Dependency-directed reconsideration: an anytime algorithm for hindsight knowledge-base optimization