Determinacy
of the query pattern
p(g,a)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
p
(
X
, g(
X
)).
p
(
X
, f(
X
)) :-
p
(
X
, g(
Y
)).
Query: p(g,a)
(1) PrologDeterminacyProcessorProof (EQUIVALENT transformation)
The root node satisfies the determinacy criterion.
digraph dp_graph { node [outthreshold=100, inthreshold=100]; 1 [label="1: p(T1, T2)\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: p(T1, T2), SCOPE: 1, CLAUSE: 0 | p(T1, T2), SCOPE: 1, CLAUSE: 1\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: true | p(T4, T2), SCOPE: 1, CLAUSE: 1\n\nT4 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: p(T1, T2), SCOPE: 1, CLAUSE: 1\n\nT1 is ground\nX2 is free\np(T1, T2) !=? p(X2, g(X2))", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: p(T4, T2), SCOPE: 1, CLAUSE: 1\n\nT4 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: p(T6, g(X5))\n\nT6 is ground\nX5 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: p(T6, g(X5)), SCOPE: 2, CLAUSE: 0 | p(T6, g(X5)), SCOPE: 2, CLAUSE: 1\n\nT6 is ground\nX5 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: p(T6, g(X5)), SCOPE: 2, CLAUSE: 0\n\nT6 is ground\nX5 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: p(T6, g(X5)), SCOPE: 2, CLAUSE: 1\n\nT6 is ground\nX5 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: true\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="12: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 13 [label="13: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 14 [label="14: p(T14, g(X14))\n\nT14 is ground\nX2 is free\nX14 is free\np(T14, T2) !=? p(X2, g(X2))", fontsize=16, style=filled, fillcolor=lightyellow]; 15 [label="15: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 16 [label="16: p(T14, g(X14)), SCOPE: 3, CLAUSE: 0 | p(T14, g(X14)), SCOPE: 3, CLAUSE: 1\n\nT14 is ground\nX2 is free\nX14 is free\np(T14, T2) !=? p(X2, g(X2))", fontsize=16, style=filled, fillcolor=lightyellow]; 17 [label="17: p(T14, g(X14)), SCOPE: 3, CLAUSE: 0\n\nT14 is ground\nX2 is free\nX14 is free\np(T14, T2) !=? p(X2, g(X2))", fontsize=16, style=filled, fillcolor=lightyellow]; 18 [label="18: p(T14, g(X14)), SCOPE: 3, CLAUSE: 1\n\nT14 is ground\nX2 is free\nX14 is free\np(T14, T2) !=? p(X2, g(X2))", fontsize=16, style=filled, fillcolor=lightyellow]; 19 [label="19: true\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 20 [label="20: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 21 [label="21: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 22 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 22 [arrowhead = none ]; 22 -> 2; 23 [label="EVAL with clause\np(X2, g(X2)).\nand substitutionT1 -> T4,\nX2 -> T4,\nT2 -> g(T4)", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 23 [arrowhead = none ]; 23 -> 3; 24 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 2 -> 24 [arrowhead = none ]; 24 -> 4; 25 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 3 -> 25 [arrowhead = none ]; 25 -> 5; 26 [label="EVAL with clause\np(X13, f(X13)) :- p(X13, g(X14)).\nand substitutionT1 -> T14,\nX13 -> T14,\nT2 -> f(T14)", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 26 [arrowhead = none ]; 26 -> 14; 27 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 4 -> 27 [arrowhead = none ]; 27 -> 15; 28 [label="EVAL with clause\np(X4, f(X4)) :- p(X4, g(X5)).\nand substitutionT4 -> T6,\nX4 -> T6,\nT2 -> f(T6)", fontsize=14, style = filled, fillcolor = lightblue]; 5 -> 28 [arrowhead = none ]; 28 -> 6; 29 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 29 [arrowhead = none ]; 29 -> 7; 30 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 6 -> 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(X10, g(X10)).\nand substitutionT6 -> T11,\nX10 -> T11,\nX5 -> T11", fontsize=14, style = filled, fillcolor = lightblue]; 9 -> 33 [arrowhead = none ]; 33 -> 11; 34 [label="BACKTRACK\nfor clause: p(X, f(X)) :- p(X, g(Y))because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 10 -> 34 [arrowhead = none ]; 34 -> 13; 35 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 11 -> 35 [arrowhead = none ]; 35 -> 12; 36 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 14 -> 36 [arrowhead = none ]; 36 -> 16; 37 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 16 -> 37 [arrowhead = none ]; 37 -> 17; 38 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 16 -> 38 [arrowhead = none ]; 38 -> 18; 39 [label="ONLY EVAL with clause\np(X19, g(X19)).\nand substitutionT14 -> T19,\nX19 -> T19,\nX14 -> T19", fontsize=14, style = filled, fillcolor = lightblue]; 17 -> 39 [arrowhead = none ]; 39 -> 19; 40 [label="BACKTRACK\nfor clause: p(X, f(X)) :- p(X, g(Y))because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 18 -> 40 [arrowhead = none ]; 40 -> 21; 41 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 19 -> 41 [arrowhead = none ]; 41 -> 20; }
(2)
YES