SKEDSOFT

Artificial Intelligence

Introduction: Backward chaining (a la Prolog) is more like finding what initial conditions form a path to your goal. At a very basic level it is a backward search from your goal to find conditions that will fulfil it.

Backward chaining is used for interrogative applications (finding items that fulfil certain criteria) - one commercial example of a backward chaining application might be finding which insurance policies are covered by a particular reinsurance contract.

CONCLUSIONS (HYPOTHESES) ) ASSERTIONS: The pseudocode that follows is for a naive implementation of backward chaining.

Backward-Chaining(H)
if H matches an assertion in working memory then
return true
end if
if there is no rule with a consequent that matches H then
ASK USER or ASSUME false
end if
for every rule R with a consequent that matches H do
if for all antecedents A of rule R, we have Backward-Chaining(A) = true then
return true
end if
end for
return false

Note the recursive nature of backward chaining. Note also that the for-loop creates the or-nodes of the goal (and/or) tree, while the if-statement inside that for-loop creates the and-nodes. Other more efficient implementations are possible. For instance, we might add assertion to the working memory for later reuse as we find them to be true during the backward chaining process. Also, many variants resulting from different implementation decisions are possible. For example, the system can ask the user even after all rules with a consequent that match the hypothesis fail. Another option is to use conflict resolution to decide the order in which the system will consider the rules with consequents that match the hypothesis (in the for-loop).