Determinacy
of the query pattern
p(a)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
p
(
.
(
A
, [])) :-
l
(
.
(
A
, [])).
r
(1).
l
([]).
l
(
.
(
H
,
T
)) :-
','
(
r
(
H
),
l
(
T
)).
Query: p(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)\n\n", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: p(T1), SCOPE: 1, CLAUSE: 0\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: l(.(T4, []))\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: l(.(T4, [])), SCOPE: 2, CLAUSE: 2 | l(.(T4, [])), SCOPE: 2, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: l(.(T4, [])), SCOPE: 2, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: ','(r(T9), l([]))\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: ','(r(T9), l([])), SCOPE: 3, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: l([])\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: l([]), SCOPE: 4, CLAUSE: 2 | l([]), SCOPE: 4, CLAUSE: 3\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="12: l([]), SCOPE: 4, CLAUSE: 2\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 13 [label="13: l([]), SCOPE: 4, CLAUSE: 3\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="16: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 17 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 17 [arrowhead = none ]; 17 -> 2; 18 [label="EVAL with clause\np(.(X2, [])) :- l(.(X2, [])).\nand substitutionX2 -> T4,\nT1 -> .(T4, []),\nT3 -> T4", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 18 [arrowhead = none ]; 18 -> 3; 19 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 2 -> 19 [arrowhead = none ]; 19 -> 4; 20 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 3 -> 20 [arrowhead = none ]; 20 -> 5; 21 [label="BACKTRACK\nfor clause: l([])because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 21 [arrowhead = none ]; 21 -> 6; 22 [label="ONLY EVAL with clause\nl(.(X7, X8)) :- ','(r(X7), l(X8)).\nand substitutionT4 -> T9,\nX7 -> T9,\nX8 -> [],\nT8 -> T9", fontsize=14, style = filled, fillcolor = lightblue]; 6 -> 22 [arrowhead = none ]; 22 -> 7; 23 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 7 -> 23 [arrowhead = none ]; 23 -> 8; 24 [label="EVAL with clause\nr(1).\nand substitutionT9 -> 1", fontsize=14, style = filled, fillcolor = lightblue]; 8 -> 24 [arrowhead = none ]; 24 -> 9; 25 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 8 -> 25 [arrowhead = none ]; 25 -> 10; 26 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 9 -> 26 [arrowhead = none ]; 26 -> 11; 27 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 11 -> 27 [arrowhead = none ]; 27 -> 12; 28 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 11 -> 28 [arrowhead = none ]; 28 -> 13; 29 [label="ONLY EVAL with clause\nl([]).\nand substitution", fontsize=14, style = filled, fillcolor = lightblue]; 12 -> 29 [arrowhead = none ]; 29 -> 14; 30 [label="BACKTRACK\nfor clause: l(.(H, T)) :- ','(r(H), l(T))because of non-unification", fontsize=14, style = filled, fillcolor = lightgreen]; 13 -> 30 [arrowhead = none ]; 30 -> 16; 31 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 14 -> 31 [arrowhead = none ]; 31 -> 15; }
(2)
YES