Determinacy
of the query pattern
list(g)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
list
([]) :-
!
.
list
(
X
) :-
','
(
tail
(
X
,
T
),
list
(
T
)).
tail
([], []).
tail
(
.
(
X
,
Xs
),
Xs
).
Query: list(g)
(1) PrologDeterminacyProcessorProof (EQUIVALENT transformation)
The root node satisfies the determinacy criterion.
digraph dp_graph { node [outthreshold=100, inthreshold=100]; 1 [label="1: list(T1)\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: list(T1), SCOPE: 1, CLAUSE: 0 | list(T1), SCOPE: 1, CLAUSE: 1\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: !_1 | list([]), SCOPE: 1, CLAUSE: 1\n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: list(T1), SCOPE: 1, CLAUSE: 1\n\nT1 is ground\nlist(T1) !=? list([])", 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: ','(tail(T3, X3), list(X3))\n\nT3 is ground\nX3 is free\nlist(T3) !=? list([])", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: ','(tail(T3, X3), list(X3)), SCOPE: 2, CLAUSE: 2 | ','(tail(T3, X3), list(X3)), SCOPE: 2, CLAUSE: 3\n\nT3 is ground\nX3 is free\nlist(T3) !=? list([])", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: ','(tail(T3, X3), list(X3)), SCOPE: 2, CLAUSE: 3\n\nT3 is ground\nX3 is free\nlist(T3) !=? list([])", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: list(T9)\n\nT9 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 12 [arrowhead = none ]; 12 -> 2; 13 [label="EVAL with clause\nlist([]) :- !_1.\nand substitutionT1 -> []", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 13 [arrowhead = none ]; 13 -> 3; 14 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 2 -> 14 [arrowhead = none ]; 14 -> 4; 15 [label="CUT", fontsize=14, style = filled, fillcolor = lightgreen]; 3 -> 15 [arrowhead = none ]; 15 -> 5; 16 [label="ONLY EVAL with clause\nlist(X2) :- ','(tail(X2, X3), list(X3)).\nand substitutionT1 -> T3,\nX2 -> T3", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 16 [arrowhead = none ]; 16 -> 7; 17 [label="SUCCESS", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 17 [arrowhead = none ]; 17 -> 6; 18 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 7 -> 18 [arrowhead = none ]; 18 -> 8; 19 [label="BACKTRACK\nfor clause: tail([], [])\nwith clash: (list(T3), list([]))", fontsize=14, style = filled, fillcolor = lightgreen]; 8 -> 19 [arrowhead = none ]; 19 -> 9; 20 [label="EVAL with clause\ntail(.(X8, X9), X9).\nand substitutionX8 -> T8,\nX9 -> T9,\nT3 -> .(T8, T9),\nX3 -> T9", fontsize=14, style = filled, fillcolor = lightblue]; 9 -> 20 [arrowhead = none ]; 20 -> 10; 21 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 9 -> 21 [arrowhead = none ]; 21 -> 11; 22 [label="INSTANCE with matching:\nT1 -> T9", fontsize=14, style = filled, fillcolor = lightgrey]; 10 -> 22 [arrowhead = none , style=dashed]; 22 -> 1[style=dashed]; }
(2)
YES