Determinacy
of the query pattern
q()
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
q
:-
p
(s(s(0))).
p
(s(
X
)) :-
p
(
X
).
p
(0).
p
(s(s(s(0)))) :-
p
(s(s(s(0)))).
Query: q()
(1) PrologDeterminacyProcessorProof (EQUIVALENT transformation)
The root node satisfies the determinacy criterion.
digraph dp_graph { node [outthreshold=100, inthreshold=100]; 1 [label="1: q\n\n", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: q, SCOPE: 1, CLAUSE: 0\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: p(s(s(0)))\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: p(s(s(0))), SCOPE: 2, CLAUSE: 1 | p(s(s(0))), SCOPE: 2, CLAUSE: 2 | p(s(s(0))), SCOPE: 2, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: p(s(s(0))), SCOPE: 2, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: p(s(s(0))), SCOPE: 2, CLAUSE: 2 | p(s(s(0))), SCOPE: 2, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: p(s(0))\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: p(s(0)), SCOPE: 3, CLAUSE: 1 | p(s(0)), SCOPE: 3, CLAUSE: 2 | p(s(0)), SCOPE: 3, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: p(s(0)), SCOPE: 3, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: p(s(0)), SCOPE: 3, CLAUSE: 2 | p(s(0)), SCOPE: 3, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: p(0)\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="12: p(0), SCOPE: 4, CLAUSE: 1 | p(0), SCOPE: 4, CLAUSE: 2 | p(0), SCOPE: 4, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 13 [label="13: p(0), SCOPE: 4, CLAUSE: 2 | p(0), SCOPE: 4, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 14 [label="14: p(0), SCOPE: 4, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 15 [label="15: p(0), SCOPE: 4, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 16 [label="16: true\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 17 [label="17: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 18 [label="18: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 19 [label="19: p(s(0)), SCOPE: 3, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 20 [label="20: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 21 [label="21: p(s(s(0))), SCOPE: 2, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 22 [label="22: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 23 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 23 [arrowhead = none ]; 23 -> 2; 24 [label="ONLY EVAL with clause\nq :- p(s(s(0))).\nand substitution", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 24 [arrowhead = none ]; 24 -> 3; 25 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 3 -> 25 [arrowhead = none ]; 25 -> 4; 26 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 4 -> 26 [arrowhead = none ]; 26 -> 5; 27 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 4 -> 27 [arrowhead = none ]; 27 -> 6; 28 [label="ONLY EVAL with clause\np(s(X7)) :- p(X7).\nand substitutionX7 -> s(0)", fontsize=14, style = filled, fillcolor = lightblue]; 5 -> 28 [arrowhead = none ]; 28 -> 7; 29 [label="BACKTRACK\nfor clause: p(0)because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 6 -> 29 [arrowhead = none ]; 29 -> 21; 30 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 7 -> 30 [arrowhead = none ]; 30 -> 8; 31 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 8 -> 31 [arrowhead = none ]; 31 -> 9; 32 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 8 -> 32 [arrowhead = none ]; 32 -> 10; 33 [label="ONLY EVAL with clause\np(s(X15)) :- p(X15).\nand substitutionX15 -> 0", fontsize=14, style = filled, fillcolor = lightblue]; 9 -> 33 [arrowhead = none ]; 33 -> 11; 34 [label="BACKTRACK\nfor clause: p(0)because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 10 -> 34 [arrowhead = none ]; 34 -> 19; 35 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 11 -> 35 [arrowhead = none ]; 35 -> 12; 36 [label="BACKTRACK\nfor clause: p(s(X)) :- p(X)because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 12 -> 36 [arrowhead = none ]; 36 -> 13; 37 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 13 -> 37 [arrowhead = none ]; 37 -> 14; 38 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 13 -> 38 [arrowhead = none ]; 38 -> 15; 39 [label="ONLY EVAL with clause\np(0).\nand substitution", fontsize=14, style = filled, fillcolor = lightblue]; 14 -> 39 [arrowhead = none ]; 39 -> 16; 40 [label="BACKTRACK\nfor clause: p(s(s(s(0)))) :- p(s(s(s(0))))because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 15 -> 40 [arrowhead = none ]; 40 -> 18; 41 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 16 -> 41 [arrowhead = none ]; 41 -> 17; 42 [label="BACKTRACK\nfor clause: p(s(s(s(0)))) :- p(s(s(s(0))))because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 19 -> 42 [arrowhead = none ]; 42 -> 20; 43 [label="BACKTRACK\nfor clause: p(s(s(s(0)))) :- p(s(s(s(0))))because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 21 -> 43 [arrowhead = none ]; 43 -> 22; }
(2)
YES