Content deleted Content added
Added the example removed from the Wikipedia page on logic programming |
|||
Line 92:
===Example 4===
The following example shows how abduction can be to
<syntaxhighlight lang="prolog">
canfly(X) :- bird(X), normal(X).
Line 101:
</syntaxhighlight>
Here the predicate <kbd>normal</kbd> is abducible, and the abducible condition <kbd>normal(X)</kbd> corresponds to the negative literal <kbd>not(abnormal(X))</kbd> in normal logic programming. The constraint <kbd>false :- normal(X), wounded(X)</kbd> ensures that the abducible condition is not assumed when the condition <kbd>wounded(X)</kbd> also holds. This is like ensuring that <kbd>not(abnormal(X))</kbd> succeeds when <kbd>wounded(X)</kbd> fails.
The goal of explaining the observation <kbd>canfly(mary)</kbd> has the solution <kbd>normal(mary)</kbd>. The same solution justifies the answer <kbd>X = mary</kbd> for the goal:
|