Determinacy
of the query pattern
q(a)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
q
(
X
) :-
','
(
p
(
X
),
!
).
p
(0).
p
(s(
X
)) :-
p
(
X
).
Query: q(a)
(1) PrologDeterminacyProcessorProof (EQUIVALENT transformation)
The root node satisfies the determinacy criterion.
digraph dp_graph { node [outthreshold=100, inthreshold=100]; 1 [label="1: q(T1)\n\n", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: q(T1), SCOPE: 1, CLAUSE: 0\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: ','(p(T4), !_1)\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: ','(p(T4), !_1), SCOPE: 2, CLAUSE: 1 | ','(p(T4), !_1), SCOPE: 2, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: !_1 | ','(p(T4), !_1), SCOPE: 2, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: ','(p(T4), !_1), SCOPE: 2, CLAUSE: 2\n\np(T4) !=? p(0)", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: true\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: ','(p(T8), !_1)\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 11 [arrowhead = none ]; 11 -> 2; 12 [label="ONLY EVAL with clause\nq(X2) :- ','(p(X2), !_1).\nand substitutionT1 -> T4,\nX2 -> T4,\nT3 -> T4", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 12 [arrowhead = none ]; 12 -> 3; 13 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 3 -> 13 [arrowhead = none ]; 13 -> 4; 14 [label="EVAL with clause\np(0).\nand substitutionT4 -> 0", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 14 [arrowhead = none ]; 14 -> 5; 15 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 4 -> 15 [arrowhead = none ]; 15 -> 6; 16 [label="CUT", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 16 [arrowhead = none ]; 16 -> 7; 17 [label="EVAL with clause\np(s(X5)) :- p(X5).\nand substitutionX5 -> T8,\nT4 -> s(T8),\nT7 -> T8", fontsize=14, style = filled, fillcolor = lightblue]; 6 -> 17 [arrowhead = none ]; 17 -> 9; 18 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 6 -> 18 [arrowhead = none ]; 18 -> 10; 19 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 7 -> 19 [arrowhead = none ]; 19 -> 8; 20 [label="INSTANCE with matching:\nT4 -> T8", fontsize=14, style = filled, fillcolor = lightgrey]; 9 -> 20 [arrowhead = none , style=dashed]; 20 -> 3[style=dashed]; }
(2)
YES