Determinacy
of the query pattern
h(g)
w.r.t. the given
Prolog program
could successfully be
proven
:
0 Prolog
↳
1 PrologDeterminacyProcessorProof (⇔, 0 ms)
↳
2 YES
(0)
Obligation:
Clauses:
f
(c(s(
X
),
Y
)) :-
f
(c(
X
, s(
Y
))).
g
(c(
X
, s(
Y
))) :-
g
(c(s(
X
),
Y
)).
h
(
X
) :-
','
(
f
(
X
),
g
(
X
)).
Query: h(g)
(1) PrologDeterminacyProcessorProof (EQUIVALENT transformation)
The root node satisfies the determinacy criterion.
digraph dp_graph { node [outthreshold=100, inthreshold=100]; 1 [label="1: h(T1)\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow, color=red]; 2 [label="2: h(T1), SCOPE: 1, CLAUSE: 2\n\nT1 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 3 [label="3: ','(f(T3), g(T3))\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 4 [label="4: ','(f(T3), g(T3)), SCOPE: 2, CLAUSE: 0\n\nT3 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 5 [label="5: ','(f(c(T8, s(T9))), g(c(s(T8), T9)))\n\nT8 is ground\nT9 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 6 [label="6: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 7 [label="7: f(c(T8, s(T9)))\n\nT8 is ground\nT9 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 8 [label="8: g(c(s(T8), T9))\n\nT8 is ground\nT9 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 9 [label="9: f(c(T8, s(T9))), SCOPE: 3, CLAUSE: 0\n\nT8 is ground\nT9 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 10 [label="10: f(c(T18, s(s(T19))))\n\nT18 is ground\nT19 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 11 [label="11: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 12 [label="12: g(c(s(T8), T9)), SCOPE: 4, CLAUSE: 1\n\nT8 is ground\nT9 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 13 [label="13: g(c(s(s(T28)), T29))\n\nT28 is ground\nT29 is ground", fontsize=16, style=filled, fillcolor=lightyellow]; 14 [label="14: \n\n", fontsize=16, style=filled, fillcolor=lightyellow]; 15 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 1 -> 15 [arrowhead = none ]; 15 -> 2; 16 [label="ONLY EVAL with clause\nh(X2) :- ','(f(X2), g(X2)).\nand substitutionT1 -> T3,\nX2 -> T3", fontsize=14, style = filled, fillcolor = lightblue]; 2 -> 16 [arrowhead = none ]; 16 -> 3; 17 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 3 -> 17 [arrowhead = none ]; 17 -> 4; 18 [label="EVAL with clause\nf(c(s(X7), X8)) :- f(c(X7, s(X8))).\nand substitutionX7 -> T8,\nX8 -> T9,\nT3 -> c(s(T8), T9)", fontsize=14, style = filled, fillcolor = lightblue]; 4 -> 18 [arrowhead = none ]; 18 -> 5; 19 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 4 -> 19 [arrowhead = none ]; 19 -> 6; 20 [label="SPLIT 1", fontsize=14, style = filled, fillcolor = violet]; 5 -> 20 [arrowhead = none ]; 20 -> 7; 21 [label="SPLIT 2\nnew knowledge:\nT8 is ground\nT9 is ground", fontsize=14, style = filled, fillcolor = violet]; 5 -> 21 [arrowhead = none ]; 21 -> 8; 22 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 7 -> 22 [arrowhead = none ]; 22 -> 9; 23 [label="CASE", fontsize=14, style = filled, fillcolor = lightcyan]; 8 -> 23 [arrowhead = none ]; 23 -> 12; 24 [label="EVAL with clause\nf(c(s(X17), X18)) :- f(c(X17, s(X18))).\nand substitutionX17 -> T18,\nT8 -> s(T18),\nT9 -> T19,\nX18 -> s(T19)", fontsize=14, style = filled, fillcolor = lightblue]; 9 -> 24 [arrowhead = none ]; 24 -> 10; 25 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 9 -> 25 [arrowhead = none ]; 25 -> 11; 26 [label="INSTANCE with matching:\nT8 -> T18\nT9 -> s(T19)", fontsize=14, style = filled, fillcolor = lightgrey]; 10 -> 26 [arrowhead = none , style=dashed]; 26 -> 7[style=dashed]; 27 [label="EVAL with clause\ng(c(X27, s(X28))) :- g(c(s(X27), X28)).\nand substitutionT8 -> T28,\nX27 -> s(T28),\nX28 -> T29,\nT9 -> s(T29)", fontsize=14, style = filled, fillcolor = lightblue]; 12 -> 27 [arrowhead = none ]; 27 -> 13; 28 [label="EVAL-BACKTRACK", fontsize=14, style = filled, fillcolor = lightgreen]; 12 -> 28 [arrowhead = none ]; 28 -> 14; 29 [label="INSTANCE with matching:\nT8 -> s(T28)\nT9 -> T29", fontsize=14, style = filled, fillcolor = lightgrey]; 13 -> 29 [arrowhead = none , style=dashed]; 29 -> 8[style=dashed]; }
(2)
YES