Jump to user comments
artificial intelligence, programming, language A
The programmer writes a "database" of "facts
("water is wet") and "rules
mortal(X) :- human(X).
("X is mortal is implied by X is human"). Facts and rules are
The user supplies a "goal
" which the system attempts to
involves matching the current goal against each fact or the
left hand side of each rule using "unification
". If the
goal matches a fact, the goal succeeds; if it matches a rule
then the process recurses, taking each sub-goal on the right
hand side of the rule as the current goal. If all sub-goals
succeed then the rule succeeds.
control eventually returns to the choice point and subsequent
necessary to make the fact or the left hand side of the rule
match a goal. Unification binds these variables to the
corresponding subterms of the goal. Such bindings are
chosen and are undone when backtracking reaches that choice
The user is informed of the success or failure of his first
goal and if it succeeds and contains variables he is told what
values of those variables caused it to succeed. He can then
ask for alternative solutions.