36
Mathematical Aspects of Logic Programming Semantics
program Tweety1/M is as follows.
penguin(tweety) ←
bird(bob) ←
bird(tweety) ← penguin(tweety)
bird(bob) ← penguin(bob)
flies(bob) ← bird(bob)
The least model for this program turns out to be M , which shows that M is
stable.
A strange feature of the supported model semantics is that the addition
of clauses of the form p ← p may change the semantics.
2.3.9 Program (Tweety2) Consider the following program Tweety2.
penguin(tweety) ←
bird(bob) ←
bird(X) ← penguin(X)
flies(X) ← bird(X), ¬penguin(X)
penguin(bob) ← penguin(bob)
Tweety2 results from Tweety1 by adding the clause penguin(bob) ←
penguin(bob). Intuitively, this addition should not change the semantics of
the program. However, in addition to the supported model M from Example
2.2.7, Tweety2 also has
'
M = {penguin(tweety), penguin(bob), bird(tweety), bird(bob)}
'
as a supported model. While M is also a stable model for Tweety2, M is not.
This can be seen by inspecting the program Tweety2/M
' , as follows, which
'
has {penguin(tweety), bird(bob), bird(tweety)} = M as its least model.
penguin(tweety) ←
bird(bob) ←
bird(tweety) ← penguin(tweety)
bird(bob) ← penguin(bob)
penguin(bob) ← penguin(bob)
We can also use the stable model semantics for modelling choice.
Précédent

- 67/305

Suivant