Scoring: Each part was worth 6 points. Getting the right class was worth 2 points, and getting the model(s) right was worth 4.
In this case, the second rule is in a lower module and the first (recursive) rule is in the upper module.
Once you ``evaluate'' the lower module and discover p(1) and p(2), the cyclicity that makes the instantiated rules not be locally stratified goes away. You have only p(1) :- a(1,2,3) & p(2) & NOT p(3). Since all three subgoals are true, you infer p(1) (again). The model is {p(1), p(2)}.
atom | 0 | 1 | 2 | 3 |
---|---|---|---|---|
p(1) | 0 | 1 | 1 | 1 |
p(2) | 0 | 0 | 0 | 0 |
p(3) | 0 | 0 | 1 | 0 |
Don't forget, as some did, that p(1) is true from the basis rule.
atom | 0 | 1 | 2 | 3 |
---|---|---|---|---|
p | 0 | 1 | 0 | 1 |
q | 0 | 1 | 0 | 1 |
r | 0 | 1 | 0 | 1 |
-2 no containment mapping
-2 No counterexample database given.
p(X,Y) :- a(X,A) & a(A,A) & a(A,Y)
-1 Missing one, -3 missing 2.
(X<Z & Z<Y & A=Z & B=Y & C=Y) => m1(A<B) | m2(A<B) | m3(A<B)
(X<Z & Z<Y & A=Z & B=Y & C=Y) => (X<Z) | (A<Y) | (B<C)
-2 for missing either side.