(0) Obligation:
Clauses:
gopher(nil, L) :- ','(!, eq(L, nil)).
gopher(X, Y) :- ','(head(X, nil), ','(!, ','(tail(X, T), eq(Y, cons(nil, T))))).
gopher(X, Y) :- ','(head(X, H), ','(head(H, U), ','(tail(H, V), ','(tail(X, W), gopher(cons(U, cons(V, W)), Y))))).
head([], X1).
head(.(X, X2), X).
tail([], []).
tail(.(X3, X), X).
eq(X, X).
Query: gopher(g,a)
(1) PrologToCdtProblemTransformerProof (UPPER BOUND (ID) transformation)
Built complexity over-approximating cdt problems from derivation graph.
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
f2_in(nil) → f2_out1
f2_in([]) → f2_out1
f2_in(.(nil, z0)) → f2_out1
f2_in(.([], z0)) → U1(f96_in(z0), .([], z0))
f2_in(.(.(z0, z1), z2)) → U2(f2_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2))
U1(f96_out1, .([], z0)) → f2_out1
U1(f96_out3(z0, z1), .([], z2)) → f2_out1
U1(f96_out5(z0, z1), .([], z2)) → f2_out1
U2(f2_out1, .(.(z0, z1), z2)) → f2_out1
f96_in(z0) → U3(f98_in(z0), f100_in(z0), z0)
U3(f98_out1, z0, z1) → f96_out1
U3(z0, f100_out2(z1, z2), z3) → f96_out3(z1, z2)
U3(z0, f100_out4(z1, z2), z3) → f96_out5(z1, z2)
Tuples:
F2_IN(.([], z0)) → c3(U1'(f96_in(z0), .([], z0)), F96_IN(z0))
F2_IN(.(.(z0, z1), z2)) → c4(U2'(f2_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2)), F2_IN(cons(z0, cons(z1, z2))))
F96_IN(z0) → c9(U3'(f98_in(z0), f100_in(z0), z0))
S tuples:
F2_IN(.([], z0)) → c3(U1'(f96_in(z0), .([], z0)), F96_IN(z0))
F2_IN(.(.(z0, z1), z2)) → c4(U2'(f2_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2)), F2_IN(cons(z0, cons(z1, z2))))
F96_IN(z0) → c9(U3'(f98_in(z0), f100_in(z0), z0))
K tuples:none
Defined Rule Symbols:
f2_in, U1, U2, f96_in, U3
Defined Pair Symbols:
F2_IN, F96_IN
Compound Symbols:
c3, c4, c9
(3) CdtGraphSplitRhsProof (BOTH BOUNDS(ID, ID) transformation)
Split RHS of tuples not part of any SCC
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
f2_in(nil) → f2_out1
f2_in([]) → f2_out1
f2_in(.(nil, z0)) → f2_out1
f2_in(.([], z0)) → U1(f96_in(z0), .([], z0))
f2_in(.(.(z0, z1), z2)) → U2(f2_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2))
U1(f96_out1, .([], z0)) → f2_out1
U1(f96_out3(z0, z1), .([], z2)) → f2_out1
U1(f96_out5(z0, z1), .([], z2)) → f2_out1
U2(f2_out1, .(.(z0, z1), z2)) → f2_out1
f96_in(z0) → U3(f98_in(z0), f100_in(z0), z0)
U3(f98_out1, z0, z1) → f96_out1
U3(z0, f100_out2(z1, z2), z3) → f96_out3(z1, z2)
U3(z0, f100_out4(z1, z2), z3) → f96_out5(z1, z2)
Tuples:
F96_IN(z0) → c9(U3'(f98_in(z0), f100_in(z0), z0))
F2_IN(.([], z0)) → c(U1'(f96_in(z0), .([], z0)))
F2_IN(.([], z0)) → c(F96_IN(z0))
F2_IN(.(.(z0, z1), z2)) → c(U2'(f2_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2)))
F2_IN(.(.(z0, z1), z2)) → c(F2_IN(cons(z0, cons(z1, z2))))
S tuples:
F96_IN(z0) → c9(U3'(f98_in(z0), f100_in(z0), z0))
F2_IN(.([], z0)) → c(U1'(f96_in(z0), .([], z0)))
F2_IN(.([], z0)) → c(F96_IN(z0))
F2_IN(.(.(z0, z1), z2)) → c(U2'(f2_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2)))
F2_IN(.(.(z0, z1), z2)) → c(F2_IN(cons(z0, cons(z1, z2))))
K tuples:none
Defined Rule Symbols:
f2_in, U1, U2, f96_in, U3
Defined Pair Symbols:
F96_IN, F2_IN
Compound Symbols:
c9, c
(5) CdtGraphRemoveTrailingTuplepartsProof (BOTH BOUNDS(ID, ID) transformation)
Removed 4 trailing tuple parts
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
f2_in(nil) → f2_out1
f2_in([]) → f2_out1
f2_in(.(nil, z0)) → f2_out1
f2_in(.([], z0)) → U1(f96_in(z0), .([], z0))
f2_in(.(.(z0, z1), z2)) → U2(f2_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2))
U1(f96_out1, .([], z0)) → f2_out1
U1(f96_out3(z0, z1), .([], z2)) → f2_out1
U1(f96_out5(z0, z1), .([], z2)) → f2_out1
U2(f2_out1, .(.(z0, z1), z2)) → f2_out1
f96_in(z0) → U3(f98_in(z0), f100_in(z0), z0)
U3(f98_out1, z0, z1) → f96_out1
U3(z0, f100_out2(z1, z2), z3) → f96_out3(z1, z2)
U3(z0, f100_out4(z1, z2), z3) → f96_out5(z1, z2)
Tuples:
F2_IN(.([], z0)) → c(F96_IN(z0))
F96_IN(z0) → c9
F2_IN(.([], z0)) → c
F2_IN(.(.(z0, z1), z2)) → c
S tuples:
F2_IN(.([], z0)) → c(F96_IN(z0))
F96_IN(z0) → c9
F2_IN(.([], z0)) → c
F2_IN(.(.(z0, z1), z2)) → c
K tuples:none
Defined Rule Symbols:
f2_in, U1, U2, f96_in, U3
Defined Pair Symbols:
F2_IN, F96_IN
Compound Symbols:
c, c9, c
(7) CdtKnowledgeProof (EQUIVALENT transformation)
The following tuples could be moved from S to K by knowledge propagation:
F2_IN(.([], z0)) → c(F96_IN(z0))
F96_IN(z0) → c9
F2_IN(.([], z0)) → c
F2_IN(.(.(z0, z1), z2)) → c
F2_IN(.(.(z0, z1), z2)) → c
F96_IN(z0) → c9
Now S is empty
(8) BOUNDS(O(1), O(1))
(9) PrologToCdtProblemTransformerProof (UPPER BOUND (ID) transformation)
Built complexity over-approximating cdt problems from derivation graph.
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:
f1_in(nil) → f1_out1
f1_in([]) → f1_out1
f1_in(.(nil, z0)) → f1_out1
f1_in(.([], z0)) → U1(f94_in(z0), .([], z0))
f1_in(.(.(z0, z1), z2)) → U2(f1_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2))
U1(f94_out1, .([], z0)) → f1_out1
U1(f94_out3(z0, z1), .([], z2)) → f1_out1
U1(f94_out5(z0, z1), .([], z2)) → f1_out1
U2(f1_out1, .(.(z0, z1), z2)) → f1_out1
f94_in(z0) → U3(f97_in(z0), f99_in(z0), z0)
U3(f97_out1, z0, z1) → f94_out1
U3(z0, f99_out2(z1, z2), z3) → f94_out3(z1, z2)
U3(z0, f99_out4(z1, z2), z3) → f94_out5(z1, z2)
Tuples:
F1_IN(.([], z0)) → c3(U1'(f94_in(z0), .([], z0)), F94_IN(z0))
F1_IN(.(.(z0, z1), z2)) → c4(U2'(f1_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2)), F1_IN(cons(z0, cons(z1, z2))))
F94_IN(z0) → c9(U3'(f97_in(z0), f99_in(z0), z0))
S tuples:
F1_IN(.([], z0)) → c3(U1'(f94_in(z0), .([], z0)), F94_IN(z0))
F1_IN(.(.(z0, z1), z2)) → c4(U2'(f1_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2)), F1_IN(cons(z0, cons(z1, z2))))
F94_IN(z0) → c9(U3'(f97_in(z0), f99_in(z0), z0))
K tuples:none
Defined Rule Symbols:
f1_in, U1, U2, f94_in, U3
Defined Pair Symbols:
F1_IN, F94_IN
Compound Symbols:
c3, c4, c9
(11) CdtGraphSplitRhsProof (BOTH BOUNDS(ID, ID) transformation)
Split RHS of tuples not part of any SCC
(12) Obligation:
Complexity Dependency Tuples Problem
Rules:
f1_in(nil) → f1_out1
f1_in([]) → f1_out1
f1_in(.(nil, z0)) → f1_out1
f1_in(.([], z0)) → U1(f94_in(z0), .([], z0))
f1_in(.(.(z0, z1), z2)) → U2(f1_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2))
U1(f94_out1, .([], z0)) → f1_out1
U1(f94_out3(z0, z1), .([], z2)) → f1_out1
U1(f94_out5(z0, z1), .([], z2)) → f1_out1
U2(f1_out1, .(.(z0, z1), z2)) → f1_out1
f94_in(z0) → U3(f97_in(z0), f99_in(z0), z0)
U3(f97_out1, z0, z1) → f94_out1
U3(z0, f99_out2(z1, z2), z3) → f94_out3(z1, z2)
U3(z0, f99_out4(z1, z2), z3) → f94_out5(z1, z2)
Tuples:
F94_IN(z0) → c9(U3'(f97_in(z0), f99_in(z0), z0))
F1_IN(.([], z0)) → c(U1'(f94_in(z0), .([], z0)))
F1_IN(.([], z0)) → c(F94_IN(z0))
F1_IN(.(.(z0, z1), z2)) → c(U2'(f1_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2)))
F1_IN(.(.(z0, z1), z2)) → c(F1_IN(cons(z0, cons(z1, z2))))
S tuples:
F94_IN(z0) → c9(U3'(f97_in(z0), f99_in(z0), z0))
F1_IN(.([], z0)) → c(U1'(f94_in(z0), .([], z0)))
F1_IN(.([], z0)) → c(F94_IN(z0))
F1_IN(.(.(z0, z1), z2)) → c(U2'(f1_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2)))
F1_IN(.(.(z0, z1), z2)) → c(F1_IN(cons(z0, cons(z1, z2))))
K tuples:none
Defined Rule Symbols:
f1_in, U1, U2, f94_in, U3
Defined Pair Symbols:
F94_IN, F1_IN
Compound Symbols:
c9, c
(13) CdtGraphRemoveTrailingTuplepartsProof (BOTH BOUNDS(ID, ID) transformation)
Removed 4 trailing tuple parts
(14) Obligation:
Complexity Dependency Tuples Problem
Rules:
f1_in(nil) → f1_out1
f1_in([]) → f1_out1
f1_in(.(nil, z0)) → f1_out1
f1_in(.([], z0)) → U1(f94_in(z0), .([], z0))
f1_in(.(.(z0, z1), z2)) → U2(f1_in(cons(z0, cons(z1, z2))), .(.(z0, z1), z2))
U1(f94_out1, .([], z0)) → f1_out1
U1(f94_out3(z0, z1), .([], z2)) → f1_out1
U1(f94_out5(z0, z1), .([], z2)) → f1_out1
U2(f1_out1, .(.(z0, z1), z2)) → f1_out1
f94_in(z0) → U3(f97_in(z0), f99_in(z0), z0)
U3(f97_out1, z0, z1) → f94_out1
U3(z0, f99_out2(z1, z2), z3) → f94_out3(z1, z2)
U3(z0, f99_out4(z1, z2), z3) → f94_out5(z1, z2)
Tuples:
F1_IN(.([], z0)) → c(F94_IN(z0))
F94_IN(z0) → c9
F1_IN(.([], z0)) → c
F1_IN(.(.(z0, z1), z2)) → c
S tuples:
F1_IN(.([], z0)) → c(F94_IN(z0))
F94_IN(z0) → c9
F1_IN(.([], z0)) → c
F1_IN(.(.(z0, z1), z2)) → c
K tuples:none
Defined Rule Symbols:
f1_in, U1, U2, f94_in, U3
Defined Pair Symbols:
F1_IN, F94_IN
Compound Symbols:
c, c9, c