(0) Obligation:

Clauses:

shanoi(s(0), A, B, C, .(mv(A, C), [])).
shanoi(s(s(X)), A, B, C, M) :- ','(eq(N1, s(X)), ','(shanoi(N1, A, C, B, M1), ','(shanoi(N1, B, A, C, M2), ','(append(M1, .(mv(A, C), []), T), append(T, M2, M))))).
append([], L, L).
append(.(H, L), L1, .(H, R)) :- append(L, L1, R).
eq(X, X).

Queries:

shanoi(g,g,g,g,a).

(1) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
shanoi_in: (b,b,b,b,f)
append_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

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

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)

(3) 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:

SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → U1_GGGGA(X, A, B, C, M, eq_in_ag(N1, s(X)))
SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → EQ_IN_AG(N1, s(X))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B, M1)
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_GGGGA(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C, M2)
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_GGGGA(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → APPEND_IN_GGA(M1, .(mv(A, C), []), T)
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → U6_GGA(H, L, L1, R, append_in_gga(L, L1, R))
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_GGGGA(X, A, B, C, M, append_in_gga(T, M2, M))
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → APPEND_IN_GGA(T, M2, M)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)
SHANOI_IN_GGGGA(x1, x2, x3, x4, x5)  =  SHANOI_IN_GGGGA(x1, x2, x3, x4)
U1_GGGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGGA(x2, x3, x4, x6)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U2_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGGGA(x2, x3, x4, x6, x7)
U3_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U3_GGGGA(x2, x4, x6, x7)
U4_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U4_GGGGA(x6, x7)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x1, x5)
U5_GGGGA(x1, x2, x3, x4, x5, x6)  =  U5_GGGGA(x6)

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

(4) Obligation:

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

SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → U1_GGGGA(X, A, B, C, M, eq_in_ag(N1, s(X)))
SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → EQ_IN_AG(N1, s(X))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B, M1)
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_GGGGA(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C, M2)
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_GGGGA(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → APPEND_IN_GGA(M1, .(mv(A, C), []), T)
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → U6_GGA(H, L, L1, R, append_in_gga(L, L1, R))
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_GGGGA(X, A, B, C, M, append_in_gga(T, M2, M))
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → APPEND_IN_GGA(T, M2, M)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)
SHANOI_IN_GGGGA(x1, x2, x3, x4, x5)  =  SHANOI_IN_GGGGA(x1, x2, x3, x4)
U1_GGGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGGA(x2, x3, x4, x6)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U2_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGGGA(x2, x3, x4, x6, x7)
U3_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U3_GGGGA(x2, x4, x6, x7)
U4_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U4_GGGGA(x6, x7)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x1, x5)
U5_GGGGA(x1, x2, x3, x4, x5, x6)  =  U5_GGGGA(x6)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)

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

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

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

APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)

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

(10) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

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

APPEND_IN_GGA(.(H, L), L1) → APPEND_IN_GGA(L, L1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • APPEND_IN_GGA(.(H, L), L1) → APPEND_IN_GGA(L, L1)
    The graph contains the following edges 1 > 1, 2 >= 2

(13) TRUE

(14) Obligation:

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

U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C, M2)
SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → U1_GGGGA(X, A, B, C, M, eq_in_ag(N1, s(X)))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B, M1)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x2, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x6)
SHANOI_IN_GGGGA(x1, x2, x3, x4, x5)  =  SHANOI_IN_GGGGA(x1, x2, x3, x4)
U1_GGGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGGA(x2, x3, x4, x6)
U2_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGGGA(x2, x3, x4, x6, x7)

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

(15) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(16) Obligation:

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

U1_GGGGA(A, B, C, eq_out_ag(N1)) → U2_GGGGA(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U2_GGGGA(A, B, C, N1, shanoi_out_gggga(M1)) → SHANOI_IN_GGGGA(N1, B, A, C)
SHANOI_IN_GGGGA(s(s(X)), A, B, C) → U1_GGGGA(A, B, C, eq_in_ag(s(X)))
U1_GGGGA(A, B, C, eq_out_ag(N1)) → SHANOI_IN_GGGGA(N1, A, C, B)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C) → shanoi_out_gggga(.(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C) → U1_gggga(A, B, C, eq_in_ag(s(X)))
eq_in_ag(X) → eq_out_ag(X)
U1_gggga(A, B, C, eq_out_ag(N1)) → U2_gggga(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U2_gggga(A, B, C, N1, shanoi_out_gggga(M1)) → U3_gggga(A, C, M1, shanoi_in_gggga(N1, B, A, C))
U3_gggga(A, C, M1, shanoi_out_gggga(M2)) → U4_gggga(M2, append_in_gga(M1, .(mv(A, C), [])))
append_in_gga([], L) → append_out_gga(L)
append_in_gga(.(H, L), L1) → U6_gga(H, append_in_gga(L, L1))
U6_gga(H, append_out_gga(R)) → append_out_gga(.(H, R))
U4_gggga(M2, append_out_gga(T)) → U5_gggga(append_in_gga(T, M2))
U5_gggga(append_out_gga(M)) → shanoi_out_gggga(M)

The set Q consists of the following terms:

shanoi_in_gggga(x0, x1, x2, x3)
eq_in_ag(x0)
U1_gggga(x0, x1, x2, x3)
U2_gggga(x0, x1, x2, x3, x4)
U3_gggga(x0, x1, x2, x3)
append_in_gga(x0, x1)
U6_gga(x0, x1)
U4_gggga(x0, x1)
U5_gggga(x0)

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

(17) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U1_GGGGA(A, B, C, eq_out_ag(N1)) → U2_GGGGA(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U1_GGGGA(A, B, C, eq_out_ag(N1)) → SHANOI_IN_GGGGA(N1, A, C, B)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = x1 + x2   
POL(0) = 0   
POL(SHANOI_IN_GGGGA(x1, x2, x3, x4)) = x1   
POL(U1_GGGGA(x1, x2, x3, x4)) = x4   
POL(U1_gggga(x1, x2, x3, x4)) = 0   
POL(U2_GGGGA(x1, x2, x3, x4, x5)) = x4   
POL(U2_gggga(x1, x2, x3, x4, x5)) = 0   
POL(U3_gggga(x1, x2, x3, x4)) = 0   
POL(U4_gggga(x1, x2)) = 0   
POL(U5_gggga(x1)) = 0   
POL(U6_gga(x1, x2)) = 0   
POL([]) = 0   
POL(append_in_gga(x1, x2)) = 1 + x1 + x2   
POL(append_out_gga(x1)) = 0   
POL(eq_in_ag(x1)) = 1 + x1   
POL(eq_out_ag(x1)) = 1 + x1   
POL(mv(x1, x2)) = 0   
POL(s(x1)) = 1 + x1   
POL(shanoi_in_gggga(x1, x2, x3, x4)) = 0   
POL(shanoi_out_gggga(x1)) = 0   

The following usable rules [FROCOS05] were oriented:

eq_in_ag(X) → eq_out_ag(X)

(18) Obligation:

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

U2_GGGGA(A, B, C, N1, shanoi_out_gggga(M1)) → SHANOI_IN_GGGGA(N1, B, A, C)
SHANOI_IN_GGGGA(s(s(X)), A, B, C) → U1_GGGGA(A, B, C, eq_in_ag(s(X)))

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C) → shanoi_out_gggga(.(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C) → U1_gggga(A, B, C, eq_in_ag(s(X)))
eq_in_ag(X) → eq_out_ag(X)
U1_gggga(A, B, C, eq_out_ag(N1)) → U2_gggga(A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U2_gggga(A, B, C, N1, shanoi_out_gggga(M1)) → U3_gggga(A, C, M1, shanoi_in_gggga(N1, B, A, C))
U3_gggga(A, C, M1, shanoi_out_gggga(M2)) → U4_gggga(M2, append_in_gga(M1, .(mv(A, C), [])))
append_in_gga([], L) → append_out_gga(L)
append_in_gga(.(H, L), L1) → U6_gga(H, append_in_gga(L, L1))
U6_gga(H, append_out_gga(R)) → append_out_gga(.(H, R))
U4_gggga(M2, append_out_gga(T)) → U5_gggga(append_in_gga(T, M2))
U5_gggga(append_out_gga(M)) → shanoi_out_gggga(M)

The set Q consists of the following terms:

shanoi_in_gggga(x0, x1, x2, x3)
eq_in_ag(x0)
U1_gggga(x0, x1, x2, x3)
U2_gggga(x0, x1, x2, x3, x4)
U3_gggga(x0, x1, x2, x3)
append_in_gga(x0, x1)
U6_gga(x0, x1)
U4_gggga(x0, x1)
U5_gggga(x0)

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

(19) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
shanoi_in: (b,b,b,b,f)
append_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x1, x2, x3, x4, x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x1, x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x1, x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x1, x2, x3, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x1, x2, x3, x4, x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x2, x3, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x1, x2, x3, x4, x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(20) Obligation:

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

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x1, x2, x3, x4, x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x1, x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x1, x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x1, x2, x3, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x1, x2, x3, x4, x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x2, x3, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x1, x2, x3, x4, x6)

(21) 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:

SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → U1_GGGGA(X, A, B, C, M, eq_in_ag(N1, s(X)))
SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → EQ_IN_AG(N1, s(X))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B, M1)
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_GGGGA(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C, M2)
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_GGGGA(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → APPEND_IN_GGA(M1, .(mv(A, C), []), T)
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → U6_GGA(H, L, L1, R, append_in_gga(L, L1, R))
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_GGGGA(X, A, B, C, M, append_in_gga(T, M2, M))
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → APPEND_IN_GGA(T, M2, M)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x1, x2, x3, x4, x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x1, x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x1, x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x1, x2, x3, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x1, x2, x3, x4, x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x2, x3, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x1, x2, x3, x4, x6)
SHANOI_IN_GGGGA(x1, x2, x3, x4, x5)  =  SHANOI_IN_GGGGA(x1, x2, x3, x4)
U1_GGGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGGA(x1, x2, x3, x4, x6)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U2_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGGGA(x1, x2, x3, x4, x6, x7)
U3_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U3_GGGGA(x1, x2, x3, x4, x6, x7)
U4_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U4_GGGGA(x1, x2, x3, x4, x6, x7)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x1, x2, x3, x5)
U5_GGGGA(x1, x2, x3, x4, x5, x6)  =  U5_GGGGA(x1, x2, x3, x4, x6)

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

(22) Obligation:

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

SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → U1_GGGGA(X, A, B, C, M, eq_in_ag(N1, s(X)))
SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → EQ_IN_AG(N1, s(X))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B, M1)
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_GGGGA(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C, M2)
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_GGGGA(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
U3_GGGGA(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → APPEND_IN_GGA(M1, .(mv(A, C), []), T)
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → U6_GGA(H, L, L1, R, append_in_gga(L, L1, R))
APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_GGGGA(X, A, B, C, M, append_in_gga(T, M2, M))
U4_GGGGA(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → APPEND_IN_GGA(T, M2, M)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x1, x2, x3, x4, x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x1, x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x1, x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x1, x2, x3, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x1, x2, x3, x4, x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x2, x3, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x1, x2, x3, x4, x6)
SHANOI_IN_GGGGA(x1, x2, x3, x4, x5)  =  SHANOI_IN_GGGGA(x1, x2, x3, x4)
U1_GGGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGGA(x1, x2, x3, x4, x6)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U2_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGGGA(x1, x2, x3, x4, x6, x7)
U3_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U3_GGGGA(x1, x2, x3, x4, x6, x7)
U4_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U4_GGGGA(x1, x2, x3, x4, x6, x7)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5)  =  U6_GGA(x1, x2, x3, x5)
U5_GGGGA(x1, x2, x3, x4, x5, x6)  =  U5_GGGGA(x1, x2, x3, x4, x6)

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

(23) DependencyGraphProof (EQUIVALENT transformation)

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

(24) Complex Obligation (AND)

(25) Obligation:

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

APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x1, x2, x3, x4, x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x1, x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x1, x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x1, x2, x3, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x1, x2, x3, x4, x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x2, x3, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x1, x2, x3, x4, x6)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)

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

(26) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(27) Obligation:

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

APPEND_IN_GGA(.(H, L), L1, .(H, R)) → APPEND_IN_GGA(L, L1, R)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
APPEND_IN_GGA(x1, x2, x3)  =  APPEND_IN_GGA(x1, x2)

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

(28) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(29) Obligation:

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

APPEND_IN_GGA(.(H, L), L1) → APPEND_IN_GGA(L, L1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(30) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • APPEND_IN_GGA(.(H, L), L1) → APPEND_IN_GGA(L, L1)
    The graph contains the following edges 1 > 1, 2 >= 2

(31) TRUE

(32) Obligation:

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

U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_GGGGA(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C, M2)
SHANOI_IN_GGGGA(s(s(X)), A, B, C, M) → U1_GGGGA(X, A, B, C, M, eq_in_ag(N1, s(X)))
U1_GGGGA(X, A, B, C, M, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B, M1)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C, M) → U1_gggga(X, A, B, C, M, eq_in_ag(N1, s(X)))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, M, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, M, N1, shanoi_in_gggga(N1, A, C, B, M1))
U2_gggga(X, A, B, C, M, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M, M1, shanoi_in_gggga(N1, B, A, C, M2))
U3_gggga(X, A, B, C, M, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M, M2, append_in_gga(M1, .(mv(A, C), []), T))
append_in_gga([], L, L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1, .(H, R)) → U6_gga(H, L, L1, R, append_in_gga(L, L1, R))
U6_gga(H, L, L1, R, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, M, append_in_gga(T, M2, M))
U5_gggga(X, A, B, C, M, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in_gggga(x1, x2, x3, x4, x5)  =  shanoi_in_gggga(x1, x2, x3, x4)
s(x1)  =  s(x1)
0  =  0
shanoi_out_gggga(x1, x2, x3, x4, x5)  =  shanoi_out_gggga(x1, x2, x3, x4, x5)
U1_gggga(x1, x2, x3, x4, x5, x6)  =  U1_gggga(x1, x2, x3, x4, x6)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
U2_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U2_gggga(x1, x2, x3, x4, x6, x7)
U3_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U3_gggga(x1, x2, x3, x4, x6, x7)
U4_gggga(x1, x2, x3, x4, x5, x6, x7)  =  U4_gggga(x1, x2, x3, x4, x6, x7)
append_in_gga(x1, x2, x3)  =  append_in_gga(x1, x2)
[]  =  []
append_out_gga(x1, x2, x3)  =  append_out_gga(x1, x2, x3)
.(x1, x2)  =  .(x1, x2)
U6_gga(x1, x2, x3, x4, x5)  =  U6_gga(x1, x2, x3, x5)
mv(x1, x2)  =  mv(x1, x2)
U5_gggga(x1, x2, x3, x4, x5, x6)  =  U5_gggga(x1, x2, x3, x4, x6)
SHANOI_IN_GGGGA(x1, x2, x3, x4, x5)  =  SHANOI_IN_GGGGA(x1, x2, x3, x4)
U1_GGGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGGA(x1, x2, x3, x4, x6)
U2_GGGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGGGA(x1, x2, x3, x4, x6, x7)

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

(33) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(34) Obligation:

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

U1_GGGGA(X, A, B, C, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U2_GGGGA(X, A, B, C, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C)
SHANOI_IN_GGGGA(s(s(X)), A, B, C) → U1_GGGGA(X, A, B, C, eq_in_ag(s(X)))
U1_GGGGA(X, A, B, C, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B)

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C) → U1_gggga(X, A, B, C, eq_in_ag(s(X)))
eq_in_ag(X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U2_gggga(X, A, B, C, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M1, shanoi_in_gggga(N1, B, A, C))
U3_gggga(X, A, B, C, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M2, append_in_gga(M1, .(mv(A, C), [])))
append_in_gga([], L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1) → U6_gga(H, L, L1, append_in_gga(L, L1))
U6_gga(H, L, L1, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, append_in_gga(T, M2))
U5_gggga(X, A, B, C, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The set Q consists of the following terms:

shanoi_in_gggga(x0, x1, x2, x3)
eq_in_ag(x0)
U1_gggga(x0, x1, x2, x3, x4)
U2_gggga(x0, x1, x2, x3, x4, x5)
U3_gggga(x0, x1, x2, x3, x4, x5)
append_in_gga(x0, x1)
U6_gga(x0, x1, x2, x3)
U4_gggga(x0, x1, x2, x3, x4, x5)
U5_gggga(x0, x1, x2, x3, x4)

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

(35) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U1_GGGGA(X, A, B, C, eq_out_ag(N1, s(X))) → U2_GGGGA(X, A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U1_GGGGA(X, A, B, C, eq_out_ag(N1, s(X))) → SHANOI_IN_GGGGA(N1, A, C, B)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 0   
POL(0) = 0   
POL(SHANOI_IN_GGGGA(x1, x2, x3, x4)) = x1   
POL(U1_GGGGA(x1, x2, x3, x4, x5)) = 1 + x5   
POL(U1_gggga(x1, x2, x3, x4, x5)) = 0   
POL(U2_GGGGA(x1, x2, x3, x4, x5, x6)) = x5   
POL(U2_gggga(x1, x2, x3, x4, x5, x6)) = 0   
POL(U3_gggga(x1, x2, x3, x4, x5, x6)) = 0   
POL(U4_gggga(x1, x2, x3, x4, x5, x6)) = 0   
POL(U5_gggga(x1, x2, x3, x4, x5)) = 0   
POL(U6_gga(x1, x2, x3, x4)) = 0   
POL([]) = 0   
POL(append_in_gga(x1, x2)) = 0   
POL(append_out_gga(x1, x2, x3)) = 0   
POL(eq_in_ag(x1)) = x1   
POL(eq_out_ag(x1, x2)) = x1   
POL(mv(x1, x2)) = 0   
POL(s(x1)) = 1 + x1   
POL(shanoi_in_gggga(x1, x2, x3, x4)) = 0   
POL(shanoi_out_gggga(x1, x2, x3, x4, x5)) = 0   

The following usable rules [FROCOS05] were oriented:

eq_in_ag(X) → eq_out_ag(X, X)

(36) Obligation:

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

U2_GGGGA(X, A, B, C, N1, shanoi_out_gggga(N1, A, C, B, M1)) → SHANOI_IN_GGGGA(N1, B, A, C)
SHANOI_IN_GGGGA(s(s(X)), A, B, C) → U1_GGGGA(X, A, B, C, eq_in_ag(s(X)))

The TRS R consists of the following rules:

shanoi_in_gggga(s(0), A, B, C) → shanoi_out_gggga(s(0), A, B, C, .(mv(A, C), []))
shanoi_in_gggga(s(s(X)), A, B, C) → U1_gggga(X, A, B, C, eq_in_ag(s(X)))
eq_in_ag(X) → eq_out_ag(X, X)
U1_gggga(X, A, B, C, eq_out_ag(N1, s(X))) → U2_gggga(X, A, B, C, N1, shanoi_in_gggga(N1, A, C, B))
U2_gggga(X, A, B, C, N1, shanoi_out_gggga(N1, A, C, B, M1)) → U3_gggga(X, A, B, C, M1, shanoi_in_gggga(N1, B, A, C))
U3_gggga(X, A, B, C, M1, shanoi_out_gggga(N1, B, A, C, M2)) → U4_gggga(X, A, B, C, M2, append_in_gga(M1, .(mv(A, C), [])))
append_in_gga([], L) → append_out_gga([], L, L)
append_in_gga(.(H, L), L1) → U6_gga(H, L, L1, append_in_gga(L, L1))
U6_gga(H, L, L1, append_out_gga(L, L1, R)) → append_out_gga(.(H, L), L1, .(H, R))
U4_gggga(X, A, B, C, M2, append_out_gga(M1, .(mv(A, C), []), T)) → U5_gggga(X, A, B, C, append_in_gga(T, M2))
U5_gggga(X, A, B, C, append_out_gga(T, M2, M)) → shanoi_out_gggga(s(s(X)), A, B, C, M)

The set Q consists of the following terms:

shanoi_in_gggga(x0, x1, x2, x3)
eq_in_ag(x0)
U1_gggga(x0, x1, x2, x3, x4)
U2_gggga(x0, x1, x2, x3, x4, x5)
U3_gggga(x0, x1, x2, x3, x4, x5)
append_in_gga(x0, x1)
U6_gga(x0, x1, x2, x3)
U4_gggga(x0, x1, x2, x3, x4, x5)
U5_gggga(x0, x1, x2, x3, x4)

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

(37) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 2 less nodes.

(38) TRUE