Determinacy
of the query pattern
p(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
) :-
','
(
q
(f(
Y
)),
p
(
Y
)).
p
(g(
X
)) :-
p
(
X
).
q
(g(
Y
)).
Query: p(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)\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: p(T1), SCOPE: 1, CLAUSE: 0 | p(T1), SCOPE: 1, CLAUSE: 1\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: ','(q(f(X3)), p(X3)) | p(T3), SCOPE: 1, CLAUSE: 1\n\nT3 is ground\nX3 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: ','(q(f(X3)), p(X3)), SCOPE: 2, CLAUSE: 2 | ?_2 | p(T3), SCOPE: 1, CLAUSE: 1\n\nT3 is ground\nX3 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: ?_2 | p(T3), SCOPE: 1, CLAUSE: 1\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: p(T3), SCOPE: 1, CLAUSE: 1\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: p(T6)\n\nT6 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 9 [arrowhead = none ]; 9 -> 2; 10 [label="ONLY EVAL with clause\np(X2) :- ','(q(f(X3)), p(X3)).\nand substitutionT1 -> T3,\nX2 -> T3", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 10 [arrowhead = none ]; 10 -> 3; 11 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 3 -> 11 [arrowhead = none ]; 11 -> 4; 12 [label="BACKTRACK\nfor clause: q(g(Y))because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 4 -> 12 [arrowhead = none ]; 12 -> 5; 13 [label="FAILURE", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 13 [arrowhead = none ]; 13 -> 6; 14 [label="EVAL with clause\np(g(X7)) :- p(X7).\nand substitutionX7 -> T6,\nT3 -> g(T6)", fontsize=14, style = filled, fillcolor = lightblue]; 6 -> 14 [arrowhead = none ]; 14 -> 7; 15 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 6 -> 15 [arrowhead = none ]; 15 -> 8; 16 [label="INSTANCE with matching:\nT1 -> T6", fontsize=14, style = filled, fillcolor = lightgrey]; 7 -> 16 [arrowhead = none , style=dashed]; 16 -> 1[style=dashed]; }
(2)
YES