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(
Y
)) :-
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(T7, g(T9))\n\nT7 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: p(T7, g(T9)), SCOPE: 2, CLAUSE: 0 | p(T7, g(T9)), SCOPE: 2, CLAUSE: 1\n\nT7 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: p(T7, g(T9)), SCOPE: 2, CLAUSE: 0\n\nT7 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: p(T7, g(T9)), SCOPE: 2, CLAUSE: 1\n\nT7 is ground", 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: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 15 [label="15: p(T18, g(T20))\n\nT18 is ground\nX2 is free\np(T18, T2) !=? p(X2, g(X2))", fontsize=16, style=filled, fillcolor=lightyellow]; 16 [label="16: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 17 [label="17: p(T18, g(T20)), SCOPE: 3, CLAUSE: 0 | p(T18, g(T20)), SCOPE: 3, CLAUSE: 1\n\nT18 is ground\nX2 is free\np(T18, T2) !=? p(X2, g(X2))", fontsize=16, style=filled, fillcolor=lightyellow]; 18 [label="18: p(T18, g(T20)), SCOPE: 3, CLAUSE: 0\n\nT18 is ground\nX2 is free\np(T18, T2) !=? p(X2, g(X2))", fontsize=16, style=filled, fillcolor=lightyellow]; 19 [label="19: p(T18, g(T20)), SCOPE: 3, CLAUSE: 1\n\nT18 is ground\nX2 is free\np(T18, T2) !=? p(X2, g(X2))", fontsize=16, style=filled, fillcolor=lightyellow]; 20 [label="20: true\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 21 [label="21: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 22 [label="22: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 23 [label="23: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 24 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 24 [arrowhead = none ]; 24 -> 2; 25 [label="EVAL with clause\np(X2, g(X2)).\nand substitutionT1 -> T4,\nX2 -> T4,\nT2 -> g(T4)", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 25 [arrowhead = none ]; 25 -> 3; 26 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 2 -> 26 [arrowhead = none ]; 26 -> 4; 27 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 3 -> 27 [arrowhead = none ]; 27 -> 5; 28 [label="EVAL with clause\np(X16, f(X17)) :- p(X16, g(X17)).\nand substitutionT1 -> T18,\nX16 -> T18,\nX17 -> T20,\nT2 -> f(T20),\nT19 -> T20", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 28 [arrowhead = none ]; 28 -> 15; 29 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 4 -> 29 [arrowhead = none ]; 29 -> 16; 30 [label="EVAL with clause\np(X5, f(X6)) :- p(X5, g(X6)).\nand substitutionT4 -> T7,\nX5 -> T7,\nX6 -> T9,\nT2 -> f(T9),\nT8 -> T9", fontsize=14, style = filled, fillcolor = lightblue]; 5 -> 30 [arrowhead = none ]; 30 -> 6; 31 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 31 [arrowhead = none ]; 31 -> 7; 32 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 6 -> 32 [arrowhead = none ]; 32 -> 8; 33 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 8 -> 33 [arrowhead = none ]; 33 -> 9; 34 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 8 -> 34 [arrowhead = none ]; 34 -> 10; 35 [label="EVAL with clause\np(X11, g(X11)).\nand substitutionT7 -> T14,\nX11 -> T14,\nT9 -> T14", fontsize=14, style = filled, fillcolor = lightblue]; 9 -> 35 [arrowhead = none ]; 35 -> 11; 36 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 9 -> 36 [arrowhead = none ]; 36 -> 12; 37 [label="BACKTRACK\nfor clause: p(X, f(Y)) :- p(X, g(Y))because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 10 -> 37 [arrowhead = none ]; 37 -> 14; 38 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 11 -> 38 [arrowhead = none ]; 38 -> 13; 39 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 15 -> 39 [arrowhead = none ]; 39 -> 17; 40 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 17 -> 40 [arrowhead = none ]; 40 -> 18; 41 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 17 -> 41 [arrowhead = none ]; 41 -> 19; 42 [label="EVAL with clause\np(X22, g(X22)).\nand substitutionT18 -> T25,\nX22 -> T25,\nT20 -> T25", fontsize=14, style = filled, fillcolor = lightblue]; 18 -> 42 [arrowhead = none ]; 42 -> 20; 43 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 18 -> 43 [arrowhead = none ]; 43 -> 21; 44 [label="BACKTRACK\nfor clause: p(X, f(Y)) :- p(X, g(Y))because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 19 -> 44 [arrowhead = none ]; 44 -> 23; 45 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 20 -> 45 [arrowhead = none ]; 45 -> 22; }
(2)
YES