(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).

Queries:

gopher(g,a).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

gopher1(.(.(T108, T109), T110), T40) :- gopher1(cons(T108, cons(T109, T110)), T40).

Clauses:

gopherc1(nil, nil).
gopherc1([], cons(nil, [])).
gopherc1(.(nil, T31), cons(nil, T31)).
gopherc1(.(.(T108, T109), T110), T40) :- gopherc1(cons(T108, cons(T109, T110)), T40).

Afs:

gopher1(x1, x2)  =  gopher1(x1)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
gopher1_in: (b,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

GOPHER1_IN_GA(.(.(T108, T109), T110), T40) → U1_GA(T108, T109, T110, T40, gopher1_in_ga(cons(T108, cons(T109, T110)), T40))
GOPHER1_IN_GA(.(.(T108, T109), T110), T40) → GOPHER1_IN_GA(cons(T108, cons(T109, T110)), T40)

R is empty.
The argument filtering Pi contains the following mapping:
gopher1_in_ga(x1, x2)  =  gopher1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
GOPHER1_IN_GA(x1, x2)  =  GOPHER1_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GOPHER1_IN_GA(.(.(T108, T109), T110), T40) → U1_GA(T108, T109, T110, T40, gopher1_in_ga(cons(T108, cons(T109, T110)), T40))
GOPHER1_IN_GA(.(.(T108, T109), T110), T40) → GOPHER1_IN_GA(cons(T108, cons(T109, T110)), T40)

R is empty.
The argument filtering Pi contains the following mapping:
gopher1_in_ga(x1, x2)  =  gopher1_in_ga(x1)
.(x1, x2)  =  .(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
GOPHER1_IN_GA(x1, x2)  =  GOPHER1_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 0 SCCs with 2 less nodes.

(6) TRUE