Determinacy
of the query pattern
p(a,a,a)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
p
(
X
,
X
, a) :-
!
.
p
(
X
,
Y
,
Z
) :-
','
(
=
(
Z
, a),
','
(
=
(
X
,
Y
),
p
(
X
,
Y
,
Z
))).
Query: p(a,a,a)
(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, T3)\n\n", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: p(T1, T2, T3), SCOPE: 1, CLAUSE: 0 | p(T1, T2, T3), SCOPE: 1, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: !_1 | p(T1, T2, T3), SCOPE: 1, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: p(T1, T2, T3), SCOPE: 1, CLAUSE: 1\n\nX2 is free\np(T1, T2, T3) !=? p(X2, X2, a)", 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: ','(=(T12, a), ','(=(T13, T14), p(T13, T14, T12)))\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: ','(=(T15, T16), p(T15, T16, a))\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: p(T19, T19, a)\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="12: p(T19, T19, a), SCOPE: 2, CLAUSE: 0 | p(T19, T19, a), SCOPE: 2, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 13 [label="13: !_2 | p(T19, T19, a), SCOPE: 2, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 14 [label="14: true\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 15 [label="15: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 16 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 16 [arrowhead = none ]; 16 -> 2; 17 [label="EVAL with clause\np(X2, X2, a) :- !_1.\nand substitutionT1 -> T5,\nX2 -> T5,\nT2 -> T5,\nT3 -> a", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 17 [arrowhead = none ]; 17 -> 3; 18 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 2 -> 18 [arrowhead = none ]; 18 -> 4; 19 [label="CUT", fontsize=14, style = filled, fillcolor = lightgreen]; 3 -> 19 [arrowhead = none ]; 19 -> 5; 20 [label="ONLY EVAL with clause\np(X6, X7, X8) :- ','(=(X8, a), ','(=(X6, X7), p(X6, X7, X8))).\nand substitutionT1 -> T13,\nX6 -> T13,\nT2 -> T14,\nX7 -> T14,\nT3 -> T12,\nX8 -> T12,\nT11 -> T12,\nT9 -> T13,\nT10 -> T14", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 20 [arrowhead = none ]; 20 -> 7; 21 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 21 [arrowhead = none ]; 21 -> 6; 22 [label="UNIFY CASE with substitutionT12 -> a,\nT13 -> T15,\nT14 -> T16", fontsize=14, style = filled, fillcolor = lightblue]; 7 -> 22 [arrowhead = none ]; 22 -> 8; 23 [label="UNIFY-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 7 -> 23 [arrowhead = none ]; 23 -> 9; 24 [label="UNIFY CASE with substitutionT15 -> T19,\nT16 -> T19,\nT18 -> T19", fontsize=14, style = filled, fillcolor = lightblue]; 8 -> 24 [arrowhead = none ]; 24 -> 10; 25 [label="UNIFY-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 8 -> 25 [arrowhead = none ]; 25 -> 11; 26 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 10 -> 26 [arrowhead = none ]; 26 -> 12; 27 [label="ONLY EVAL with clause\np(X11, X11, a) :- !_2.\nand substitutionT19 -> T22,\nX11 -> T22", fontsize=14, style = filled, fillcolor = lightblue]; 12 -> 27 [arrowhead = none ]; 27 -> 13; 28 [label="CUT", fontsize=14, style = filled, fillcolor = lightgreen]; 13 -> 28 [arrowhead = none ]; 28 -> 14; 29 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 14 -> 29 [arrowhead = none ]; 29 -> 15; }
(2)
YES