Determinacy
of the query pattern
plus(g,a,a)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
p
(s(
X
),
X
).
plus
(0,
Y
,
Y
).
plus
(s(
X
),
Y
, s(
Z
)) :-
','
(
p
(s(
X
),
U
),
plus
(
U
,
Y
,
Z
)).
Query: plus(g,a,a)
(1) PrologDeterminacyProcessorProof (EQUIVALENT transformation)
The root node satisfies the determinacy criterion.
digraph dp_graph { node [outthreshold=100, inthreshold=100]; 1 [label="1: plus(T1, T2, T3)\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: plus(T1, T2, T3), SCOPE: 1, CLAUSE: 1 | plus(T1, T2, T3), SCOPE: 1, CLAUSE: 2\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: true | plus(0, T2, T3), SCOPE: 1, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: plus(T1, T2, T3), SCOPE: 1, CLAUSE: 2\n\nT1 is ground\nX2 is free\nplus(T1, T2, T3) !=? plus(0, X2, X2)", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: plus(0, T2, T3), SCOPE: 1, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: ','(p(s(T9), X12), plus(X12, T12, T13))\n\nT9 is ground\nX12 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: ','(p(s(T9), X12), plus(X12, T12, T13)), SCOPE: 2, CLAUSE: 0\n\nT9 is ground\nX12 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: plus(T18, T12, T13)\n\nT18 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 11 [arrowhead = none ]; 11 -> 2; 12 [label="EVAL with clause\nplus(0, X2, X2).\nand substitutionT1 -> 0,\nT2 -> T5,\nX2 -> T5,\nT3 -> T5", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 12 [arrowhead = none ]; 12 -> 3; 13 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 2 -> 13 [arrowhead = none ]; 13 -> 4; 14 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 3 -> 14 [arrowhead = none ]; 14 -> 5; 15 [label="EVAL with clause\nplus(s(X9), X10, s(X11)) :- ','(p(s(X9), X12), plus(X12, X10, X11)).\nand substitutionX9 -> T9,\nT1 -> s(T9),\nT2 -> T12,\nX10 -> T12,\nX11 -> T13,\nT3 -> s(T13),\nT10 -> T12,\nT11 -> T13", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 15 [arrowhead = none ]; 15 -> 7; 16 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 4 -> 16 [arrowhead = none ]; 16 -> 8; 17 [label="BACKTRACK\nfor clause: plus(s(X), Y, s(Z)) :- ','(p(s(X), U), plus(U, Y, Z))because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 17 [arrowhead = none ]; 17 -> 6; 18 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 7 -> 18 [arrowhead = none ]; 18 -> 9; 19 [label="ONLY EVAL with clause\np(s(X17), X17).\nand substitutionT9 -> T18,\nX17 -> T18,\nX12 -> T18", fontsize=14, style = filled, fillcolor = lightblue]; 9 -> 19 [arrowhead = none ]; 19 -> 10; 20 [label="INSTANCE with matching:\nT1 -> T18\nT2 -> T12\nT3 -> T13", fontsize=14, style = filled, fillcolor = lightgrey]; 10 -> 20 [arrowhead = none , style=dashed]; 20 -> 1[style=dashed]; }
(2)
YES