Determinacy
of the query pattern
even(g)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
even
(0).
even
(s(
X
)) :-
odd
(
X
).
odd
(s(
X
)) :-
even
(
X
).
Query: even(g)
(1) PrologDeterminacyProcessorProof (EQUIVALENT transformation)
The root node satisfies the determinacy criterion.
digraph dp_graph { node [outthreshold=100, inthreshold=100]; 1 [label="1: even(T1)\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: even(T1), SCOPE: 1, CLAUSE: 0 | even(T1), SCOPE: 1, CLAUSE: 1\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: true | even(0), SCOPE: 1, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: even(T1), SCOPE: 1, CLAUSE: 1\n\nT1 is ground\neven(T1) !=? even(0)", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: even(0), SCOPE: 1, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: odd(T3)\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: odd(T3), SCOPE: 2, CLAUSE: 2\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: even(T6)\n\nT6 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 12 [arrowhead = none ]; 12 -> 2; 13 [label="EVAL with clause\neven(0).\nand substitutionT1 -> 0", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 13 [arrowhead = none ]; 13 -> 3; 14 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 2 -> 14 [arrowhead = none ]; 14 -> 4; 15 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 3 -> 15 [arrowhead = none ]; 15 -> 5; 16 [label="EVAL with clause\neven(s(X3)) :- odd(X3).\nand substitutionX3 -> T3,\nT1 -> s(T3)", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 16 [arrowhead = none ]; 16 -> 7; 17 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 4 -> 17 [arrowhead = none ]; 17 -> 8; 18 [label="BACKTRACK\nfor clause: even(s(X)) :- odd(X)because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 18 [arrowhead = none ]; 18 -> 6; 19 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 7 -> 19 [arrowhead = none ]; 19 -> 9; 20 [label="EVAL with clause\nodd(s(X6)) :- even(X6).\nand substitutionX6 -> T6,\nT3 -> s(T6)", fontsize=14, style = filled, fillcolor = lightblue]; 9 -> 20 [arrowhead = none ]; 20 -> 10; 21 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 9 -> 21 [arrowhead = none ]; 21 -> 11; 22 [label="INSTANCE with matching:\nT1 -> T6", fontsize=14, style = filled, fillcolor = lightgrey]; 10 -> 22 [arrowhead = none , style=dashed]; 22 -> 1[style=dashed]; }
(2)
YES