Determinacy
of the query pattern
num(g)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
num
(0) :-
!
.
num
(
X
) :-
','
(
p
(
X
,
Y
),
num
(
Y
)).
p
(0, 0).
p
(s(
X
),
X
).
Query: num(g)
(1) PrologDeterminacyProcessorProof (EQUIVALENT transformation)
The root node satisfies the determinacy criterion.
digraph dp_graph { node [outthreshold=100, inthreshold=100]; 1 [label="1: num(T1)\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: num(T1), SCOPE: 1, CLAUSE: 0 | num(T1), SCOPE: 1, CLAUSE: 1\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: !_1 | num(0), SCOPE: 1, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: num(T1), SCOPE: 1, CLAUSE: 1\n\nT1 is ground\nnum(T1) !=? num(0)", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: true\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: ','(p(T3, X3), num(X3))\n\nT3 is ground\nX3 is free\nnum(T3) !=? num(0)", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: ','(p(T3, X3), num(X3)), SCOPE: 2, CLAUSE: 2 | ','(p(T3, X3), num(X3)), SCOPE: 2, CLAUSE: 3\n\nT3 is ground\nX3 is free\nnum(T3) !=? num(0)", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: ','(p(T3, X3), num(X3)), SCOPE: 2, CLAUSE: 3\n\nT3 is ground\nX3 is free\nnum(T3) !=? num(0)", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: num(T6)\n\nT6 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 12 [arrowhead = none ]; 12 -> 2; 13 [label="EVAL with clause\nnum(0) :- !_1.\nand substitutionT1 -> 0", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 13 [arrowhead = none ]; 13 -> 3; 14 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 2 -> 14 [arrowhead = none ]; 14 -> 4; 15 [label="CUT", fontsize=14, style = filled, fillcolor = lightgreen]; 3 -> 15 [arrowhead = none ]; 15 -> 5; 16 [label="ONLY EVAL with clause\nnum(X2) :- ','(p(X2, X3), num(X3)).\nand substitutionT1 -> T3,\nX2 -> T3", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 16 [arrowhead = none ]; 16 -> 7; 17 [label="SUCCESS", 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 -> 8; 19 [label="BACKTRACK\nfor clause: p(0, 0)\nwith clash: (num(T3), num(0))", fontsize=14, style = filled, fillcolor = lightgreen]; 8 -> 19 [arrowhead = none ]; 19 -> 9; 20 [label="EVAL with clause\np(s(X6), X6).\nand substitutionX6 -> T6,\nT3 -> s(T6),\nX3 -> T6", fontsize=14, style = filled, fillcolor = lightblue]; 9 -> 20 [arrowhead = none ]; 20 -> 10; 21 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 9 -> 21 [arrowhead = none ]; 21 -> 11; 22 [label="INSTANCE with matching:\nT1 -> T6", fontsize=14, style = filled, fillcolor = lightgrey]; 10 -> 22 [arrowhead = none , style=dashed]; 22 -> 1[style=dashed]; }
(2)
YES