Determinacy
of the query pattern
f(a)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
f
(
X
) :-
','
(
p
(
X
),
q
(
X
)).
p
(a) :-
!
.
p
(
X
) :-
p
(
Y
).
q
(b).
Query: f(a)
(1) PrologDeterminacyProcessorProof (EQUIVALENT transformation)
The root node satisfies the determinacy criterion.
digraph dp_graph { node [outthreshold=100, inthreshold=100]; 1 [label="1: f(T1)\n\n", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: f(T1), SCOPE: 1, CLAUSE: 0\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: ','(p(T4), q(T4))\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: ','(p(T4), q(T4)), SCOPE: 2, CLAUSE: 1 | ','(p(T4), q(T4)), SCOPE: 2, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: ','(!_2, q(a)) | ','(p(T4), q(T4)), SCOPE: 2, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: ','(p(T4), q(T4)), SCOPE: 2, CLAUSE: 2\n\np(T4) !=? p(a)", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: q(a)\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: q(a), SCOPE: 3, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: ','(p(X7), q(T9))\n\nX7 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: p(X7)\n\nX7 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="12: q(T9)\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 13 [label="13: p(X7), SCOPE: 4, CLAUSE: 1 | p(X7), SCOPE: 4, CLAUSE: 2\n\nX7 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 14 [label="14: !_4 | p(X7), SCOPE: 4, CLAUSE: 2\n\nX7 is free", fontsize=16, style=filled, fillcolor=lightyellow]; 15 [label="15: true\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 16 [label="16: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 17 [label="17: q(T9), SCOPE: 5, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 18 [label="18: true\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 19 [label="19: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 20 [label="20: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 21 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 21 [arrowhead = none ]; 21 -> 2; 22 [label="ONLY EVAL with clause\nf(X2) :- ','(p(X2), q(X2)).\nand substitutionT1 -> T4,\nX2 -> T4,\nT3 -> T4", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 22 [arrowhead = none ]; 22 -> 3; 23 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 3 -> 23 [arrowhead = none ]; 23 -> 4; 24 [label="EVAL with clause\np(a) :- !_2.\nand substitutionT4 -> a", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 24 [arrowhead = none ]; 24 -> 5; 25 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 4 -> 25 [arrowhead = none ]; 25 -> 6; 26 [label="CUT", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 26 [arrowhead = none ]; 26 -> 7; 27 [label="ONLY EVAL with clause\np(X6) :- p(X7).\nand substitutionT4 -> T9,\nX6 -> T9,\nT8 -> T9", fontsize=14, style = filled, fillcolor = lightblue]; 6 -> 27 [arrowhead = none ]; 27 -> 10; 28 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 7 -> 28 [arrowhead = none ]; 28 -> 8; 29 [label="BACKTRACK\nfor clause: q(b)because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 8 -> 29 [arrowhead = none ]; 29 -> 9; 30 [label="SPLIT 1", fontsize=14, style = filled, fillcolor = violet]; 10 -> 30 [arrowhead = none ]; 30 -> 11; 31 [label="SPLIT 2\nreplacements:X7 -> T10", fontsize=14, style = filled, fillcolor = violet]; 10 -> 31 [arrowhead = none ]; 31 -> 12; 32 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 11 -> 32 [arrowhead = none ]; 32 -> 13; 33 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 12 -> 33 [arrowhead = none ]; 33 -> 17; 34 [label="ONLY EVAL with clause\np(a) :- !_4.\nand substitutionX7 -> a", fontsize=14, style = filled, fillcolor = lightblue]; 13 -> 34 [arrowhead = none ]; 34 -> 14; 35 [label="CUT", fontsize=14, style = filled, fillcolor = lightgreen]; 14 -> 35 [arrowhead = none ]; 35 -> 15; 36 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 15 -> 36 [arrowhead = none ]; 36 -> 16; 37 [label="EVAL with clause\nq(b).\nand substitutionT9 -> b", fontsize=14, style = filled, fillcolor = lightblue]; 17 -> 37 [arrowhead = none ]; 37 -> 18; 38 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 17 -> 38 [arrowhead = none ]; 38 -> 19; 39 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 18 -> 39 [arrowhead = none ]; 39 -> 20; }
(2)
YES