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
(a),
!
).
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: 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), SCOPE: 3, CLAUSE: 3 | ?_3 | ','(p(T4), q(T4)), SCOPE: 2, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: ?_3 | ','(p(T4), q(T4)), SCOPE: 2, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: ','(p(T4), q(T4)), SCOPE: 2, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: ','(','(p(a), !_2), q(T9))\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: ','(','(p(a), !_2), q(T9)), SCOPE: 4, CLAUSE: 1 | ','(','(p(a), !_2), q(T9)), SCOPE: 4, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="12: ','(!_2, q(T9)) | ','(','(p(a), !_2), q(T9)), SCOPE: 4, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 13 [label="13: q(T9)\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 14 [label="14: q(T9), SCOPE: 5, CLAUSE: 3\n\n", 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: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 18 [label="18: ','(','(p(a), !_2), q(T14))\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 19 [label="19: ','(','(p(a), !_2), q(T14)), SCOPE: 6, CLAUSE: 1 | ','(','(p(a), !_2), q(T14)), SCOPE: 6, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 20 [label="20: ','(!_2, q(T14)) | ','(','(p(a), !_2), q(T14)), SCOPE: 6, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 21 [label="21: q(T14)\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 22 [label="22: q(T14), SCOPE: 7, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 23 [label="23: true\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 24 [label="24: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 25 [label="25: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 26 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 26 [arrowhead = none ]; 26 -> 2; 27 [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 -> 27 [arrowhead = none ]; 27 -> 3; 28 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 3 -> 28 [arrowhead = none ]; 28 -> 4; 29 [label="EVAL with clause\np(a).\nand substitutionT4 -> a", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 29 [arrowhead = none ]; 29 -> 5; 30 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 4 -> 30 [arrowhead = none ]; 30 -> 6; 31 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 5 -> 31 [arrowhead = none ]; 31 -> 7; 32 [label="ONLY EVAL with clause\np(X8) :- ','(p(a), !_2).\nand substitutionT4 -> T14,\nX8 -> T14,\nT13 -> T14", fontsize=14, style = filled, fillcolor = lightblue]; 6 -> 32 [arrowhead = none ]; 32 -> 18; 33 [label="BACKTRACK\nfor clause: q(b)because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 7 -> 33 [arrowhead = none ]; 33 -> 8; 34 [label="FAILURE", fontsize=14, style = filled, fillcolor = lightgreen]; 8 -> 34 [arrowhead = none ]; 34 -> 9; 35 [label="ONLY EVAL with clause\np(X5) :- ','(p(a), !_2).\nand substitutionT4 -> T9,\nX5 -> T9,\nT8 -> T9", fontsize=14, style = filled, fillcolor = lightblue]; 9 -> 35 [arrowhead = none ]; 35 -> 10; 36 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 10 -> 36 [arrowhead = none ]; 36 -> 11; 37 [label="ONLY EVAL with clause\np(a).\nand substitution", fontsize=14, style = filled, fillcolor = lightblue]; 11 -> 37 [arrowhead = none ]; 37 -> 12; 38 [label="CUT", fontsize=14, style = filled, fillcolor = lightgreen]; 12 -> 38 [arrowhead = none ]; 38 -> 13; 39 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 13 -> 39 [arrowhead = none ]; 39 -> 14; 40 [label="EVAL with clause\nq(b).\nand substitutionT9 -> b", fontsize=14, style = filled, fillcolor = lightblue]; 14 -> 40 [arrowhead = none ]; 40 -> 15; 41 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 14 -> 41 [arrowhead = none ]; 41 -> 16; 42 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 15 -> 42 [arrowhead = none ]; 42 -> 17; 43 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 18 -> 43 [arrowhead = none ]; 43 -> 19; 44 [label="ONLY EVAL with clause\np(a).\nand substitution", fontsize=14, style = filled, fillcolor = lightblue]; 19 -> 44 [arrowhead = none ]; 44 -> 20; 45 [label="CUT", fontsize=14, style = filled, fillcolor = lightgreen]; 20 -> 45 [arrowhead = none ]; 45 -> 21; 46 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 21 -> 46 [arrowhead = none ]; 46 -> 22; 47 [label="EVAL with clause\nq(b).\nand substitutionT14 -> b", fontsize=14, style = filled, fillcolor = lightblue]; 22 -> 47 [arrowhead = none ]; 47 -> 23; 48 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 22 -> 48 [arrowhead = none ]; 48 -> 24; 49 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 23 -> 49 [arrowhead = none ]; 49 -> 25; }
(2)
YES