SKEDSOFT

Artificial Intelligence

Figure 5.7: An algorithm for debugging missing answers

1: procedure DebugMissing(g, KB)
2: Inputs
3: KB a knowledge base
4: g an atom: KB  g and g is true in the intended interpretation
5: Output
6: atom for which there is a clause missing
7: if there is a definite clause g ← a1 ∧ . . . ∧ ak ∈ KB such that all ai are
true in the intended interpretation then
8: select ai that cannot be proved
9: DebugMissing(ai, KB)
10: else
11: return g