Determinacy
of the query pattern
f(g)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
f
(
X
) :-
g
(s(s(s(
X
)))).
f
(s(
X
)) :-
f
(
X
).
g
(s(s(s(s(
X
))))) :-
f
(
X
).
Query: f(g)
(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\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: f(T1), SCOPE: 1, CLAUSE: 0 | f(T1), SCOPE: 1, CLAUSE: 1\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: g(s(s(s(T3)))) | f(T3), SCOPE: 1, CLAUSE: 1\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: g(s(s(s(T3)))), SCOPE: 2, CLAUSE: 2 | ?_2 | f(T3), SCOPE: 1, CLAUSE: 1\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: g(s(s(s(T3)))), SCOPE: 2, CLAUSE: 2\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: ?_2 | f(T3), SCOPE: 1, CLAUSE: 1\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: f(T8)\n\nT8 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: f(T3), SCOPE: 1, CLAUSE: 1\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: f(T12)\n\nT12 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="ONLY EVAL with clause\nf(X2) :- g(s(s(s(X2)))).\nand substitutionT1 -> T3,\nX2 -> T3", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 13 [arrowhead = none ]; 13 -> 3; 14 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 3 -> 14 [arrowhead = none ]; 14 -> 4; 15 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 4 -> 15 [arrowhead = none ]; 15 -> 5; 16 [label="PARALLEL", fontsize=14, style = filled, fillcolor = violet]; 4 -> 16 [arrowhead = none ]; 16 -> 6; 17 [label="EVAL with clause\ng(s(s(s(s(X7))))) :- f(X7).\nand substitutionX7 -> T8,\nT3 -> s(T8)", fontsize=14, style = filled, fillcolor = lightblue]; 5 -> 17 [arrowhead = none ]; 17 -> 7; 18 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 5 -> 18 [arrowhead = none ]; 18 -> 8; 19 [label="FAILURE", fontsize=14, style = filled, fillcolor = lightgreen]; 6 -> 19 [arrowhead = none ]; 19 -> 9; 20 [label="INSTANCE with matching:\nT1 -> T8", fontsize=14, style = filled, fillcolor = lightgrey]; 7 -> 20 [arrowhead = none , style=dashed]; 20 -> 1[style=dashed]; 21 [label="EVAL with clause\nf(s(X11)) :- f(X11).\nand substitutionX11 -> T12,\nT3 -> s(T12)", fontsize=14, style = filled, fillcolor = lightblue]; 9 -> 21 [arrowhead = none ]; 21 -> 10; 22 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 9 -> 22 [arrowhead = none ]; 22 -> 11; 23 [label="INSTANCE with matching:\nT1 -> T12", fontsize=14, style = filled, fillcolor = lightgrey]; 10 -> 23 [arrowhead = none , style=dashed]; 23 -> 1[style=dashed]; }
(2)
YES