Abductive logic programming: Difference between revisions

Content deleted Content added
No edit summary
Added the example removed from the Wikipedia page on logic programming
Line 90:
 
Once an explanation has been chosen, then this becomes part of the theory, which can be used to draw new conclusions. The explanation and more generally these new conclusions form the solution of the problem.
 
===Example 4===
The following example shows how abduction can be to interpret [[negation as failure]] as a form of abductive reasoning:<ref>Eshghi, K. and Kowalski, R.A., 1989, June. Abduction Compared with Negation by Failure. In ICLP (Vol. 89, pp. 234-255).</ref>
<syntaxhighlight lang="prolog">
canfly(X) :- bird(X), normal(X).
false :- normal(X), wounded(X).
bird(john).
bird(mary).
wounded(john).
</syntaxhighlight>
 
Here 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:
<syntaxhighlight lang="prolog">
-? canfly(X).
</syntaxhighlight>
 
==Formal semantics==