(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) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph.

(2) Obligation:

Clauses:

gopher1(nil, nil).
gopher1([], cons(nil, [])).
gopher1(.(nil, T14), cons(nil, T14)).
gopher1(.(.(T31, T32), T33), T17) :- gopher1(cons(T31, cons(T32, T33)), T17).

Queries:

gopher1(g,a).

(3) PrologToPiTRSProof (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 Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

gopher1_in_ga(nil, nil) → gopher1_out_ga(nil, nil)
gopher1_in_ga([], cons(nil, [])) → gopher1_out_ga([], cons(nil, []))
gopher1_in_ga(.(nil, T14), cons(nil, T14)) → gopher1_out_ga(.(nil, T14), cons(nil, T14))
gopher1_in_ga(.(.(T31, T32), T33), T17) → U1_ga(T31, T32, T33, T17, gopher1_in_ga(cons(T31, cons(T32, T33)), T17))
U1_ga(T31, T32, T33, T17, gopher1_out_ga(cons(T31, cons(T32, T33)), T17)) → gopher1_out_ga(.(.(T31, T32), T33), T17)

The argument filtering Pi contains the following mapping:
gopher1_in_ga(x1, x2)  =  gopher1_in_ga(x1)
nil  =  nil
gopher1_out_ga(x1, x2)  =  gopher1_out_ga(x1, x2)
[]  =  []
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
cons(x1, x2)  =  cons(x1, x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

gopher1_in_ga(nil, nil) → gopher1_out_ga(nil, nil)
gopher1_in_ga([], cons(nil, [])) → gopher1_out_ga([], cons(nil, []))
gopher1_in_ga(.(nil, T14), cons(nil, T14)) → gopher1_out_ga(.(nil, T14), cons(nil, T14))
gopher1_in_ga(.(.(T31, T32), T33), T17) → U1_ga(T31, T32, T33, T17, gopher1_in_ga(cons(T31, cons(T32, T33)), T17))
U1_ga(T31, T32, T33, T17, gopher1_out_ga(cons(T31, cons(T32, T33)), T17)) → gopher1_out_ga(.(.(T31, T32), T33), T17)

The argument filtering Pi contains the following mapping:
gopher1_in_ga(x1, x2)  =  gopher1_in_ga(x1)
nil  =  nil
gopher1_out_ga(x1, x2)  =  gopher1_out_ga(x1, x2)
[]  =  []
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
cons(x1, x2)  =  cons(x1, x2)

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

GOPHER1_IN_GA(.(.(T31, T32), T33), T17) → U1_GA(T31, T32, T33, T17, gopher1_in_ga(cons(T31, cons(T32, T33)), T17))
GOPHER1_IN_GA(.(.(T31, T32), T33), T17) → GOPHER1_IN_GA(cons(T31, cons(T32, T33)), T17)

The TRS R consists of the following rules:

gopher1_in_ga(nil, nil) → gopher1_out_ga(nil, nil)
gopher1_in_ga([], cons(nil, [])) → gopher1_out_ga([], cons(nil, []))
gopher1_in_ga(.(nil, T14), cons(nil, T14)) → gopher1_out_ga(.(nil, T14), cons(nil, T14))
gopher1_in_ga(.(.(T31, T32), T33), T17) → U1_ga(T31, T32, T33, T17, gopher1_in_ga(cons(T31, cons(T32, T33)), T17))
U1_ga(T31, T32, T33, T17, gopher1_out_ga(cons(T31, cons(T32, T33)), T17)) → gopher1_out_ga(.(.(T31, T32), T33), T17)

The argument filtering Pi contains the following mapping:
gopher1_in_ga(x1, x2)  =  gopher1_in_ga(x1)
nil  =  nil
gopher1_out_ga(x1, x2)  =  gopher1_out_ga(x1, x2)
[]  =  []
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
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

(6) Obligation:

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

GOPHER1_IN_GA(.(.(T31, T32), T33), T17) → U1_GA(T31, T32, T33, T17, gopher1_in_ga(cons(T31, cons(T32, T33)), T17))
GOPHER1_IN_GA(.(.(T31, T32), T33), T17) → GOPHER1_IN_GA(cons(T31, cons(T32, T33)), T17)

The TRS R consists of the following rules:

gopher1_in_ga(nil, nil) → gopher1_out_ga(nil, nil)
gopher1_in_ga([], cons(nil, [])) → gopher1_out_ga([], cons(nil, []))
gopher1_in_ga(.(nil, T14), cons(nil, T14)) → gopher1_out_ga(.(nil, T14), cons(nil, T14))
gopher1_in_ga(.(.(T31, T32), T33), T17) → U1_ga(T31, T32, T33, T17, gopher1_in_ga(cons(T31, cons(T32, T33)), T17))
U1_ga(T31, T32, T33, T17, gopher1_out_ga(cons(T31, cons(T32, T33)), T17)) → gopher1_out_ga(.(.(T31, T32), T33), T17)

The argument filtering Pi contains the following mapping:
gopher1_in_ga(x1, x2)  =  gopher1_in_ga(x1)
nil  =  nil
gopher1_out_ga(x1, x2)  =  gopher1_out_ga(x1, x2)
[]  =  []
.(x1, x2)  =  .(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
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

(7) DependencyGraphProof (EQUIVALENT transformation)

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

(8) TRUE