Determinacy
of the query pattern
p(g,g)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
p
(
X
,
Y
) :-
','
(
q
(
X
,
Y
),
r
(
X
)).
q
(a, 0).
q
(
X
, s(
Y
)) :-
q
(
X
,
Y
).
r
(b) :-
r
(b).
Query: p(g,g)
(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\nT2 is ground", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: p(T1, T2), SCOPE: 1, CLAUSE: 0\n\nT1 is ground\nT2 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: ','(q(T5, T6), r(T5))\n\nT5 is ground\nT6 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: ','(q(T5, T6), r(T5)), SCOPE: 2, CLAUSE: 1 | ','(q(T5, T6), r(T5)), SCOPE: 2, CLAUSE: 2\n\nT5 is ground\nT6 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: ','(q(T5, T6), r(T5)), SCOPE: 2, CLAUSE: 1\n\nT5 is ground\nT6 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: ','(q(T5, T6), r(T5)), SCOPE: 2, CLAUSE: 2\n\nT5 is ground\nT6 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: r(a)\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: r(a), SCOPE: 3, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: ','(q(T11, T12), r(T11))\n\nT11 is ground\nT12 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="12: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 13 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 13 [arrowhead = none ]; 13 -> 2; 14 [label="ONLY EVAL with clause\np(X3, X4) :- ','(q(X3, X4), r(X3)).\nand substitutionT1 -> T5,\nX3 -> T5,\nT2 -> T6,\nX4 -> T6", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 14 [arrowhead = none ]; 14 -> 3; 15 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 3 -> 15 [arrowhead = none ]; 15 -> 4; 16 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 4 -> 16 [arrowhead = none ]; 16 -> 5; 17 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 4 -> 17 [arrowhead = none ]; 17 -> 6; 18 [label="EVAL with clause\nq(a, 0).\nand substitutionT5 -> a,\nT6 -> 0", fontsize=14, style = filled, fillcolor = lightblue]; 5 -> 18 [arrowhead = none ]; 18 -> 7; 19 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 19 [arrowhead = none ]; 19 -> 8; 20 [label="EVAL with clause\nq(X9, s(X10)) :- q(X9, X10).\nand substitutionT5 -> T11,\nX9 -> T11,\nX10 -> T12,\nT6 -> s(T12)", fontsize=14, style = filled, fillcolor = lightblue]; 6 -> 20 [arrowhead = none ]; 20 -> 11; 21 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 6 -> 21 [arrowhead = none ]; 21 -> 12; 22 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 7 -> 22 [arrowhead = none ]; 22 -> 9; 23 [label="BACKTRACK\nfor clause: r(b) :- r(b)because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 9 -> 23 [arrowhead = none ]; 23 -> 10; 24 [label="INSTANCE with matching:\nT5 -> T11\nT6 -> T12", fontsize=14, style = filled, fillcolor = lightgrey]; 11 -> 24 [arrowhead = none , style=dashed]; 24 -> 3[style=dashed]; }
(2)
YES