0 Prolog
↳1 CutEliminatorProof (⇐)
↳2 Prolog
↳3 PrologToPiTRSProof (⇐)
↳4 PiTRS
↳5 DependencyPairsProof (⇔)
↳6 PiDP
↳7 DependencyGraphProof (⇔)
↳8 PiDP
↳9 UsableRulesProof (⇔)
↳10 PiDP
↳11 PiDPToQDPProof (⇐)
↳12 QDP
↳13 Rewriting (⇔)
↳14 QDP
↳15 Rewriting (⇔)
↳16 QDP
↳17 UsableRulesProof (⇔)
↳18 QDP
↳19 QReductionProof (⇔)
↳20 QDP
↳21 Rewriting (⇔)
↳22 QDP
↳23 Rewriting (⇔)
↳24 QDP
↳25 UsableRulesProof (⇔)
↳26 QDP
↳27 QReductionProof (⇔)
↳28 QDP
↳29 NonTerminationProof (⇔)
↳30 FALSE
↳31 PrologToPiTRSProof (⇐)
↳32 PiTRS
↳33 DependencyPairsProof (⇔)
↳34 PiDP
↳35 DependencyGraphProof (⇔)
↳36 PiDP
↳37 UsableRulesProof (⇔)
↳38 PiDP
↳39 PiDPToQDPProof (⇐)
↳40 QDP
↳41 Rewriting (⇔)
↳42 QDP
↳43 Rewriting (⇔)
↳44 QDP
↳45 UsableRulesProof (⇔)
↳46 QDP
↳47 QReductionProof (⇔)
↳48 QDP
↳49 Rewriting (⇔)
↳50 QDP
↳51 Rewriting (⇔)
↳52 QDP
↳53 UsableRulesProof (⇔)
↳54 QDP
↳55 QReductionProof (⇔)
↳56 QDP
↳57 NonTerminationProof (⇔)
↳58 FALSE
gopher_in_ga(nil, L) → U1_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, nil)) → gopher_out_ga(nil, L)
gopher_in_ga(X, Y) → U2_ga(X, Y, head_in_gg(X, nil))
head_in_gg([], X1) → head_out_gg([], X1)
head_in_gg(.(X, X2), X) → head_out_gg(.(X, X2), X)
U2_ga(X, Y, head_out_gg(X, nil)) → U3_ga(X, Y, tail_in_ga(X, T))
tail_in_ga([], []) → tail_out_ga([], [])
tail_in_ga(.(X3, X), X) → tail_out_ga(.(X3, X), X)
U3_ga(X, Y, tail_out_ga(X, T)) → U4_ga(X, Y, eq_in_ag(Y, cons(nil, T)))
U4_ga(X, Y, eq_out_ag(Y, cons(nil, T))) → gopher_out_ga(X, Y)
gopher_in_ga(X, Y) → U5_ga(X, Y, head_in_ga(X, H))
head_in_ga([], X1) → head_out_ga([], X1)
head_in_ga(.(X, X2), X) → head_out_ga(.(X, X2), X)
U5_ga(X, Y, head_out_ga(X, H)) → U6_ga(X, Y, H, head_in_aa(H, U))
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
U6_ga(X, Y, H, head_out_aa(H, U)) → U7_ga(X, Y, H, U, tail_in_aa(H, V))
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
U7_ga(X, Y, H, U, tail_out_aa(H, V)) → U8_ga(X, Y, H, U, V, tail_in_ga(X, W))
U8_ga(X, Y, H, U, V, tail_out_ga(X, W)) → U9_ga(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
gopher_in_aa(nil, L) → U1_aa(L, eq_in_ag(L, nil))
U1_aa(L, eq_out_ag(L, nil)) → gopher_out_aa(nil, L)
gopher_in_aa(X, Y) → U2_aa(X, Y, head_in_ag(X, nil))
head_in_ag([], X1) → head_out_ag([], X1)
head_in_ag(.(X, X2), X) → head_out_ag(.(X, X2), X)
U2_aa(X, Y, head_out_ag(X, nil)) → U3_aa(X, Y, tail_in_aa(X, T))
U3_aa(X, Y, tail_out_aa(X, T)) → U4_aa(X, Y, eq_in_aa(Y, cons(nil, T)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U4_aa(X, Y, eq_out_aa(Y, cons(nil, T))) → gopher_out_aa(X, Y)
gopher_in_aa(X, Y) → U5_aa(X, Y, head_in_aa(X, H))
U5_aa(X, Y, head_out_aa(X, H)) → U6_aa(X, Y, H, head_in_aa(H, U))
U6_aa(X, Y, H, head_out_aa(H, U)) → U7_aa(X, Y, H, U, tail_in_aa(H, V))
U7_aa(X, Y, H, U, tail_out_aa(H, V)) → U8_aa(X, Y, H, U, V, tail_in_aa(X, W))
U8_aa(X, Y, H, U, V, tail_out_aa(X, W)) → U9_aa(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U9_aa(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_aa(X, Y)
U9_ga(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_ga(X, Y)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
gopher_in_ga(nil, L) → U1_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, nil)) → gopher_out_ga(nil, L)
gopher_in_ga(X, Y) → U2_ga(X, Y, head_in_gg(X, nil))
head_in_gg([], X1) → head_out_gg([], X1)
head_in_gg(.(X, X2), X) → head_out_gg(.(X, X2), X)
U2_ga(X, Y, head_out_gg(X, nil)) → U3_ga(X, Y, tail_in_ga(X, T))
tail_in_ga([], []) → tail_out_ga([], [])
tail_in_ga(.(X3, X), X) → tail_out_ga(.(X3, X), X)
U3_ga(X, Y, tail_out_ga(X, T)) → U4_ga(X, Y, eq_in_ag(Y, cons(nil, T)))
U4_ga(X, Y, eq_out_ag(Y, cons(nil, T))) → gopher_out_ga(X, Y)
gopher_in_ga(X, Y) → U5_ga(X, Y, head_in_ga(X, H))
head_in_ga([], X1) → head_out_ga([], X1)
head_in_ga(.(X, X2), X) → head_out_ga(.(X, X2), X)
U5_ga(X, Y, head_out_ga(X, H)) → U6_ga(X, Y, H, head_in_aa(H, U))
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
U6_ga(X, Y, H, head_out_aa(H, U)) → U7_ga(X, Y, H, U, tail_in_aa(H, V))
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
U7_ga(X, Y, H, U, tail_out_aa(H, V)) → U8_ga(X, Y, H, U, V, tail_in_ga(X, W))
U8_ga(X, Y, H, U, V, tail_out_ga(X, W)) → U9_ga(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
gopher_in_aa(nil, L) → U1_aa(L, eq_in_ag(L, nil))
U1_aa(L, eq_out_ag(L, nil)) → gopher_out_aa(nil, L)
gopher_in_aa(X, Y) → U2_aa(X, Y, head_in_ag(X, nil))
head_in_ag([], X1) → head_out_ag([], X1)
head_in_ag(.(X, X2), X) → head_out_ag(.(X, X2), X)
U2_aa(X, Y, head_out_ag(X, nil)) → U3_aa(X, Y, tail_in_aa(X, T))
U3_aa(X, Y, tail_out_aa(X, T)) → U4_aa(X, Y, eq_in_aa(Y, cons(nil, T)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U4_aa(X, Y, eq_out_aa(Y, cons(nil, T))) → gopher_out_aa(X, Y)
gopher_in_aa(X, Y) → U5_aa(X, Y, head_in_aa(X, H))
U5_aa(X, Y, head_out_aa(X, H)) → U6_aa(X, Y, H, head_in_aa(H, U))
U6_aa(X, Y, H, head_out_aa(H, U)) → U7_aa(X, Y, H, U, tail_in_aa(H, V))
U7_aa(X, Y, H, U, tail_out_aa(H, V)) → U8_aa(X, Y, H, U, V, tail_in_aa(X, W))
U8_aa(X, Y, H, U, V, tail_out_aa(X, W)) → U9_aa(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U9_aa(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_aa(X, Y)
U9_ga(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_ga(X, Y)
GOPHER_IN_GA(nil, L) → U1_GA(L, eq_in_ag(L, nil))
GOPHER_IN_GA(nil, L) → EQ_IN_AG(L, nil)
GOPHER_IN_GA(X, Y) → U2_GA(X, Y, head_in_gg(X, nil))
GOPHER_IN_GA(X, Y) → HEAD_IN_GG(X, nil)
U2_GA(X, Y, head_out_gg(X, nil)) → U3_GA(X, Y, tail_in_ga(X, T))
U2_GA(X, Y, head_out_gg(X, nil)) → TAIL_IN_GA(X, T)
U3_GA(X, Y, tail_out_ga(X, T)) → U4_GA(X, Y, eq_in_ag(Y, cons(nil, T)))
U3_GA(X, Y, tail_out_ga(X, T)) → EQ_IN_AG(Y, cons(nil, T))
GOPHER_IN_GA(X, Y) → U5_GA(X, Y, head_in_ga(X, H))
GOPHER_IN_GA(X, Y) → HEAD_IN_GA(X, H)
U5_GA(X, Y, head_out_ga(X, H)) → U6_GA(X, Y, H, head_in_aa(H, U))
U5_GA(X, Y, head_out_ga(X, H)) → HEAD_IN_AA(H, U)
U6_GA(X, Y, H, head_out_aa(H, U)) → U7_GA(X, Y, H, U, tail_in_aa(H, V))
U6_GA(X, Y, H, head_out_aa(H, U)) → TAIL_IN_AA(H, V)
U7_GA(X, Y, H, U, tail_out_aa(H, V)) → U8_GA(X, Y, H, U, V, tail_in_ga(X, W))
U7_GA(X, Y, H, U, tail_out_aa(H, V)) → TAIL_IN_GA(X, W)
U8_GA(X, Y, H, U, V, tail_out_ga(X, W)) → U9_GA(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U8_GA(X, Y, H, U, V, tail_out_ga(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
GOPHER_IN_AA(nil, L) → U1_AA(L, eq_in_ag(L, nil))
GOPHER_IN_AA(nil, L) → EQ_IN_AG(L, nil)
GOPHER_IN_AA(X, Y) → U2_AA(X, Y, head_in_ag(X, nil))
GOPHER_IN_AA(X, Y) → HEAD_IN_AG(X, nil)
U2_AA(X, Y, head_out_ag(X, nil)) → U3_AA(X, Y, tail_in_aa(X, T))
U2_AA(X, Y, head_out_ag(X, nil)) → TAIL_IN_AA(X, T)
U3_AA(X, Y, tail_out_aa(X, T)) → U4_AA(X, Y, eq_in_aa(Y, cons(nil, T)))
U3_AA(X, Y, tail_out_aa(X, T)) → EQ_IN_AA(Y, cons(nil, T))
GOPHER_IN_AA(X, Y) → U5_AA(X, Y, head_in_aa(X, H))
GOPHER_IN_AA(X, Y) → HEAD_IN_AA(X, H)
U5_AA(X, Y, head_out_aa(X, H)) → U6_AA(X, Y, H, head_in_aa(H, U))
U5_AA(X, Y, head_out_aa(X, H)) → HEAD_IN_AA(H, U)
U6_AA(X, Y, H, head_out_aa(H, U)) → U7_AA(X, Y, H, U, tail_in_aa(H, V))
U6_AA(X, Y, H, head_out_aa(H, U)) → TAIL_IN_AA(H, V)
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → U8_AA(X, Y, H, U, V, tail_in_aa(X, W))
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → TAIL_IN_AA(X, W)
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → U9_AA(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
gopher_in_ga(nil, L) → U1_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, nil)) → gopher_out_ga(nil, L)
gopher_in_ga(X, Y) → U2_ga(X, Y, head_in_gg(X, nil))
head_in_gg([], X1) → head_out_gg([], X1)
head_in_gg(.(X, X2), X) → head_out_gg(.(X, X2), X)
U2_ga(X, Y, head_out_gg(X, nil)) → U3_ga(X, Y, tail_in_ga(X, T))
tail_in_ga([], []) → tail_out_ga([], [])
tail_in_ga(.(X3, X), X) → tail_out_ga(.(X3, X), X)
U3_ga(X, Y, tail_out_ga(X, T)) → U4_ga(X, Y, eq_in_ag(Y, cons(nil, T)))
U4_ga(X, Y, eq_out_ag(Y, cons(nil, T))) → gopher_out_ga(X, Y)
gopher_in_ga(X, Y) → U5_ga(X, Y, head_in_ga(X, H))
head_in_ga([], X1) → head_out_ga([], X1)
head_in_ga(.(X, X2), X) → head_out_ga(.(X, X2), X)
U5_ga(X, Y, head_out_ga(X, H)) → U6_ga(X, Y, H, head_in_aa(H, U))
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
U6_ga(X, Y, H, head_out_aa(H, U)) → U7_ga(X, Y, H, U, tail_in_aa(H, V))
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
U7_ga(X, Y, H, U, tail_out_aa(H, V)) → U8_ga(X, Y, H, U, V, tail_in_ga(X, W))
U8_ga(X, Y, H, U, V, tail_out_ga(X, W)) → U9_ga(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
gopher_in_aa(nil, L) → U1_aa(L, eq_in_ag(L, nil))
U1_aa(L, eq_out_ag(L, nil)) → gopher_out_aa(nil, L)
gopher_in_aa(X, Y) → U2_aa(X, Y, head_in_ag(X, nil))
head_in_ag([], X1) → head_out_ag([], X1)
head_in_ag(.(X, X2), X) → head_out_ag(.(X, X2), X)
U2_aa(X, Y, head_out_ag(X, nil)) → U3_aa(X, Y, tail_in_aa(X, T))
U3_aa(X, Y, tail_out_aa(X, T)) → U4_aa(X, Y, eq_in_aa(Y, cons(nil, T)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U4_aa(X, Y, eq_out_aa(Y, cons(nil, T))) → gopher_out_aa(X, Y)
gopher_in_aa(X, Y) → U5_aa(X, Y, head_in_aa(X, H))
U5_aa(X, Y, head_out_aa(X, H)) → U6_aa(X, Y, H, head_in_aa(H, U))
U6_aa(X, Y, H, head_out_aa(H, U)) → U7_aa(X, Y, H, U, tail_in_aa(H, V))
U7_aa(X, Y, H, U, tail_out_aa(H, V)) → U8_aa(X, Y, H, U, V, tail_in_aa(X, W))
U8_aa(X, Y, H, U, V, tail_out_aa(X, W)) → U9_aa(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U9_aa(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_aa(X, Y)
U9_ga(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_ga(X, Y)
GOPHER_IN_GA(nil, L) → U1_GA(L, eq_in_ag(L, nil))
GOPHER_IN_GA(nil, L) → EQ_IN_AG(L, nil)
GOPHER_IN_GA(X, Y) → U2_GA(X, Y, head_in_gg(X, nil))
GOPHER_IN_GA(X, Y) → HEAD_IN_GG(X, nil)
U2_GA(X, Y, head_out_gg(X, nil)) → U3_GA(X, Y, tail_in_ga(X, T))
U2_GA(X, Y, head_out_gg(X, nil)) → TAIL_IN_GA(X, T)
U3_GA(X, Y, tail_out_ga(X, T)) → U4_GA(X, Y, eq_in_ag(Y, cons(nil, T)))
U3_GA(X, Y, tail_out_ga(X, T)) → EQ_IN_AG(Y, cons(nil, T))
GOPHER_IN_GA(X, Y) → U5_GA(X, Y, head_in_ga(X, H))
GOPHER_IN_GA(X, Y) → HEAD_IN_GA(X, H)
U5_GA(X, Y, head_out_ga(X, H)) → U6_GA(X, Y, H, head_in_aa(H, U))
U5_GA(X, Y, head_out_ga(X, H)) → HEAD_IN_AA(H, U)
U6_GA(X, Y, H, head_out_aa(H, U)) → U7_GA(X, Y, H, U, tail_in_aa(H, V))
U6_GA(X, Y, H, head_out_aa(H, U)) → TAIL_IN_AA(H, V)
U7_GA(X, Y, H, U, tail_out_aa(H, V)) → U8_GA(X, Y, H, U, V, tail_in_ga(X, W))
U7_GA(X, Y, H, U, tail_out_aa(H, V)) → TAIL_IN_GA(X, W)
U8_GA(X, Y, H, U, V, tail_out_ga(X, W)) → U9_GA(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U8_GA(X, Y, H, U, V, tail_out_ga(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
GOPHER_IN_AA(nil, L) → U1_AA(L, eq_in_ag(L, nil))
GOPHER_IN_AA(nil, L) → EQ_IN_AG(L, nil)
GOPHER_IN_AA(X, Y) → U2_AA(X, Y, head_in_ag(X, nil))
GOPHER_IN_AA(X, Y) → HEAD_IN_AG(X, nil)
U2_AA(X, Y, head_out_ag(X, nil)) → U3_AA(X, Y, tail_in_aa(X, T))
U2_AA(X, Y, head_out_ag(X, nil)) → TAIL_IN_AA(X, T)
U3_AA(X, Y, tail_out_aa(X, T)) → U4_AA(X, Y, eq_in_aa(Y, cons(nil, T)))
U3_AA(X, Y, tail_out_aa(X, T)) → EQ_IN_AA(Y, cons(nil, T))
GOPHER_IN_AA(X, Y) → U5_AA(X, Y, head_in_aa(X, H))
GOPHER_IN_AA(X, Y) → HEAD_IN_AA(X, H)
U5_AA(X, Y, head_out_aa(X, H)) → U6_AA(X, Y, H, head_in_aa(H, U))
U5_AA(X, Y, head_out_aa(X, H)) → HEAD_IN_AA(H, U)
U6_AA(X, Y, H, head_out_aa(H, U)) → U7_AA(X, Y, H, U, tail_in_aa(H, V))
U6_AA(X, Y, H, head_out_aa(H, U)) → TAIL_IN_AA(H, V)
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → U8_AA(X, Y, H, U, V, tail_in_aa(X, W))
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → TAIL_IN_AA(X, W)
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → U9_AA(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
gopher_in_ga(nil, L) → U1_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, nil)) → gopher_out_ga(nil, L)
gopher_in_ga(X, Y) → U2_ga(X, Y, head_in_gg(X, nil))
head_in_gg([], X1) → head_out_gg([], X1)
head_in_gg(.(X, X2), X) → head_out_gg(.(X, X2), X)
U2_ga(X, Y, head_out_gg(X, nil)) → U3_ga(X, Y, tail_in_ga(X, T))
tail_in_ga([], []) → tail_out_ga([], [])
tail_in_ga(.(X3, X), X) → tail_out_ga(.(X3, X), X)
U3_ga(X, Y, tail_out_ga(X, T)) → U4_ga(X, Y, eq_in_ag(Y, cons(nil, T)))
U4_ga(X, Y, eq_out_ag(Y, cons(nil, T))) → gopher_out_ga(X, Y)
gopher_in_ga(X, Y) → U5_ga(X, Y, head_in_ga(X, H))
head_in_ga([], X1) → head_out_ga([], X1)
head_in_ga(.(X, X2), X) → head_out_ga(.(X, X2), X)
U5_ga(X, Y, head_out_ga(X, H)) → U6_ga(X, Y, H, head_in_aa(H, U))
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
U6_ga(X, Y, H, head_out_aa(H, U)) → U7_ga(X, Y, H, U, tail_in_aa(H, V))
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
U7_ga(X, Y, H, U, tail_out_aa(H, V)) → U8_ga(X, Y, H, U, V, tail_in_ga(X, W))
U8_ga(X, Y, H, U, V, tail_out_ga(X, W)) → U9_ga(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
gopher_in_aa(nil, L) → U1_aa(L, eq_in_ag(L, nil))
U1_aa(L, eq_out_ag(L, nil)) → gopher_out_aa(nil, L)
gopher_in_aa(X, Y) → U2_aa(X, Y, head_in_ag(X, nil))
head_in_ag([], X1) → head_out_ag([], X1)
head_in_ag(.(X, X2), X) → head_out_ag(.(X, X2), X)
U2_aa(X, Y, head_out_ag(X, nil)) → U3_aa(X, Y, tail_in_aa(X, T))
U3_aa(X, Y, tail_out_aa(X, T)) → U4_aa(X, Y, eq_in_aa(Y, cons(nil, T)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U4_aa(X, Y, eq_out_aa(Y, cons(nil, T))) → gopher_out_aa(X, Y)
gopher_in_aa(X, Y) → U5_aa(X, Y, head_in_aa(X, H))
U5_aa(X, Y, head_out_aa(X, H)) → U6_aa(X, Y, H, head_in_aa(H, U))
U6_aa(X, Y, H, head_out_aa(H, U)) → U7_aa(X, Y, H, U, tail_in_aa(H, V))
U7_aa(X, Y, H, U, tail_out_aa(H, V)) → U8_aa(X, Y, H, U, V, tail_in_aa(X, W))
U8_aa(X, Y, H, U, V, tail_out_aa(X, W)) → U9_aa(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U9_aa(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_aa(X, Y)
U9_ga(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_ga(X, Y)
GOPHER_IN_AA(X, Y) → U5_AA(X, Y, head_in_aa(X, H))
U5_AA(X, Y, head_out_aa(X, H)) → U6_AA(X, Y, H, head_in_aa(H, U))
U6_AA(X, Y, H, head_out_aa(H, U)) → U7_AA(X, Y, H, U, tail_in_aa(H, V))
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → U8_AA(X, Y, H, U, V, tail_in_aa(X, W))
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
gopher_in_ga(nil, L) → U1_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, nil)) → gopher_out_ga(nil, L)
gopher_in_ga(X, Y) → U2_ga(X, Y, head_in_gg(X, nil))
head_in_gg([], X1) → head_out_gg([], X1)
head_in_gg(.(X, X2), X) → head_out_gg(.(X, X2), X)
U2_ga(X, Y, head_out_gg(X, nil)) → U3_ga(X, Y, tail_in_ga(X, T))
tail_in_ga([], []) → tail_out_ga([], [])
tail_in_ga(.(X3, X), X) → tail_out_ga(.(X3, X), X)
U3_ga(X, Y, tail_out_ga(X, T)) → U4_ga(X, Y, eq_in_ag(Y, cons(nil, T)))
U4_ga(X, Y, eq_out_ag(Y, cons(nil, T))) → gopher_out_ga(X, Y)
gopher_in_ga(X, Y) → U5_ga(X, Y, head_in_ga(X, H))
head_in_ga([], X1) → head_out_ga([], X1)
head_in_ga(.(X, X2), X) → head_out_ga(.(X, X2), X)
U5_ga(X, Y, head_out_ga(X, H)) → U6_ga(X, Y, H, head_in_aa(H, U))
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
U6_ga(X, Y, H, head_out_aa(H, U)) → U7_ga(X, Y, H, U, tail_in_aa(H, V))
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
U7_ga(X, Y, H, U, tail_out_aa(H, V)) → U8_ga(X, Y, H, U, V, tail_in_ga(X, W))
U8_ga(X, Y, H, U, V, tail_out_ga(X, W)) → U9_ga(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
gopher_in_aa(nil, L) → U1_aa(L, eq_in_ag(L, nil))
U1_aa(L, eq_out_ag(L, nil)) → gopher_out_aa(nil, L)
gopher_in_aa(X, Y) → U2_aa(X, Y, head_in_ag(X, nil))
head_in_ag([], X1) → head_out_ag([], X1)
head_in_ag(.(X, X2), X) → head_out_ag(.(X, X2), X)
U2_aa(X, Y, head_out_ag(X, nil)) → U3_aa(X, Y, tail_in_aa(X, T))
U3_aa(X, Y, tail_out_aa(X, T)) → U4_aa(X, Y, eq_in_aa(Y, cons(nil, T)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U4_aa(X, Y, eq_out_aa(Y, cons(nil, T))) → gopher_out_aa(X, Y)
gopher_in_aa(X, Y) → U5_aa(X, Y, head_in_aa(X, H))
U5_aa(X, Y, head_out_aa(X, H)) → U6_aa(X, Y, H, head_in_aa(H, U))
U6_aa(X, Y, H, head_out_aa(H, U)) → U7_aa(X, Y, H, U, tail_in_aa(H, V))
U7_aa(X, Y, H, U, tail_out_aa(H, V)) → U8_aa(X, Y, H, U, V, tail_in_aa(X, W))
U8_aa(X, Y, H, U, V, tail_out_aa(X, W)) → U9_aa(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U9_aa(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_aa(X, Y)
U9_ga(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_ga(X, Y)
GOPHER_IN_AA(X, Y) → U5_AA(X, Y, head_in_aa(X, H))
U5_AA(X, Y, head_out_aa(X, H)) → U6_AA(X, Y, H, head_in_aa(H, U))
U6_AA(X, Y, H, head_out_aa(H, U)) → U7_AA(X, Y, H, U, tail_in_aa(H, V))
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → U8_AA(X, Y, H, U, V, tail_in_aa(X, W))
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
GOPHER_IN_AA → U5_AA(head_in_aa)
U5_AA(head_out_aa) → U6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
head_in_aa → head_out_aa
tail_in_aa → tail_out_aa
head_in_aa
tail_in_aa
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
head_in_aa → head_out_aa
tail_in_aa → tail_out_aa
head_in_aa
tail_in_aa
U5_AA(head_out_aa) → U6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
head_in_aa → head_out_aa
tail_in_aa → tail_out_aa
head_in_aa
tail_in_aa
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
tail_in_aa → tail_out_aa
head_in_aa
tail_in_aa
head_in_aa
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
tail_in_aa → tail_out_aa
tail_in_aa
U6_AA(head_out_aa) → U7_AA(tail_out_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)
tail_in_aa → tail_out_aa
tail_in_aa
U7_AA(tail_out_aa) → U8_AA(tail_out_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)
U7_AA(tail_out_aa) → U8_AA(tail_out_aa)
tail_in_aa → tail_out_aa
tail_in_aa
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)
U7_AA(tail_out_aa) → U8_AA(tail_out_aa)
tail_in_aa
tail_in_aa
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)
U7_AA(tail_out_aa) → U8_AA(tail_out_aa)
gopher_in_ga(nil, L) → U1_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, nil)) → gopher_out_ga(nil, L)
gopher_in_ga(X, Y) → U2_ga(X, Y, head_in_gg(X, nil))
head_in_gg([], X1) → head_out_gg([], X1)
head_in_gg(.(X, X2), X) → head_out_gg(.(X, X2), X)
U2_ga(X, Y, head_out_gg(X, nil)) → U3_ga(X, Y, tail_in_ga(X, T))
tail_in_ga([], []) → tail_out_ga([], [])
tail_in_ga(.(X3, X), X) → tail_out_ga(.(X3, X), X)
U3_ga(X, Y, tail_out_ga(X, T)) → U4_ga(X, Y, eq_in_ag(Y, cons(nil, T)))
U4_ga(X, Y, eq_out_ag(Y, cons(nil, T))) → gopher_out_ga(X, Y)
gopher_in_ga(X, Y) → U5_ga(X, Y, head_in_ga(X, H))
head_in_ga([], X1) → head_out_ga([], X1)
head_in_ga(.(X, X2), X) → head_out_ga(.(X, X2), X)
U5_ga(X, Y, head_out_ga(X, H)) → U6_ga(X, Y, H, head_in_aa(H, U))
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
U6_ga(X, Y, H, head_out_aa(H, U)) → U7_ga(X, Y, H, U, tail_in_aa(H, V))
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
U7_ga(X, Y, H, U, tail_out_aa(H, V)) → U8_ga(X, Y, H, U, V, tail_in_ga(X, W))
U8_ga(X, Y, H, U, V, tail_out_ga(X, W)) → U9_ga(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
gopher_in_aa(nil, L) → U1_aa(L, eq_in_ag(L, nil))
U1_aa(L, eq_out_ag(L, nil)) → gopher_out_aa(nil, L)
gopher_in_aa(X, Y) → U2_aa(X, Y, head_in_ag(X, nil))
head_in_ag([], X1) → head_out_ag([], X1)
head_in_ag(.(X, X2), X) → head_out_ag(.(X, X2), X)
U2_aa(X, Y, head_out_ag(X, nil)) → U3_aa(X, Y, tail_in_aa(X, T))
U3_aa(X, Y, tail_out_aa(X, T)) → U4_aa(X, Y, eq_in_aa(Y, cons(nil, T)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U4_aa(X, Y, eq_out_aa(Y, cons(nil, T))) → gopher_out_aa(X, Y)
gopher_in_aa(X, Y) → U5_aa(X, Y, head_in_aa(X, H))
U5_aa(X, Y, head_out_aa(X, H)) → U6_aa(X, Y, H, head_in_aa(H, U))
U6_aa(X, Y, H, head_out_aa(H, U)) → U7_aa(X, Y, H, U, tail_in_aa(H, V))
U7_aa(X, Y, H, U, tail_out_aa(H, V)) → U8_aa(X, Y, H, U, V, tail_in_aa(X, W))
U8_aa(X, Y, H, U, V, tail_out_aa(X, W)) → U9_aa(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U9_aa(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_aa(X, Y)
U9_ga(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_ga(X, Y)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
gopher_in_ga(nil, L) → U1_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, nil)) → gopher_out_ga(nil, L)
gopher_in_ga(X, Y) → U2_ga(X, Y, head_in_gg(X, nil))
head_in_gg([], X1) → head_out_gg([], X1)
head_in_gg(.(X, X2), X) → head_out_gg(.(X, X2), X)
U2_ga(X, Y, head_out_gg(X, nil)) → U3_ga(X, Y, tail_in_ga(X, T))
tail_in_ga([], []) → tail_out_ga([], [])
tail_in_ga(.(X3, X), X) → tail_out_ga(.(X3, X), X)
U3_ga(X, Y, tail_out_ga(X, T)) → U4_ga(X, Y, eq_in_ag(Y, cons(nil, T)))
U4_ga(X, Y, eq_out_ag(Y, cons(nil, T))) → gopher_out_ga(X, Y)
gopher_in_ga(X, Y) → U5_ga(X, Y, head_in_ga(X, H))
head_in_ga([], X1) → head_out_ga([], X1)
head_in_ga(.(X, X2), X) → head_out_ga(.(X, X2), X)
U5_ga(X, Y, head_out_ga(X, H)) → U6_ga(X, Y, H, head_in_aa(H, U))
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
U6_ga(X, Y, H, head_out_aa(H, U)) → U7_ga(X, Y, H, U, tail_in_aa(H, V))
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
U7_ga(X, Y, H, U, tail_out_aa(H, V)) → U8_ga(X, Y, H, U, V, tail_in_ga(X, W))
U8_ga(X, Y, H, U, V, tail_out_ga(X, W)) → U9_ga(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
gopher_in_aa(nil, L) → U1_aa(L, eq_in_ag(L, nil))
U1_aa(L, eq_out_ag(L, nil)) → gopher_out_aa(nil, L)
gopher_in_aa(X, Y) → U2_aa(X, Y, head_in_ag(X, nil))
head_in_ag([], X1) → head_out_ag([], X1)
head_in_ag(.(X, X2), X) → head_out_ag(.(X, X2), X)
U2_aa(X, Y, head_out_ag(X, nil)) → U3_aa(X, Y, tail_in_aa(X, T))
U3_aa(X, Y, tail_out_aa(X, T)) → U4_aa(X, Y, eq_in_aa(Y, cons(nil, T)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U4_aa(X, Y, eq_out_aa(Y, cons(nil, T))) → gopher_out_aa(X, Y)
gopher_in_aa(X, Y) → U5_aa(X, Y, head_in_aa(X, H))
U5_aa(X, Y, head_out_aa(X, H)) → U6_aa(X, Y, H, head_in_aa(H, U))
U6_aa(X, Y, H, head_out_aa(H, U)) → U7_aa(X, Y, H, U, tail_in_aa(H, V))
U7_aa(X, Y, H, U, tail_out_aa(H, V)) → U8_aa(X, Y, H, U, V, tail_in_aa(X, W))
U8_aa(X, Y, H, U, V, tail_out_aa(X, W)) → U9_aa(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U9_aa(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_aa(X, Y)
U9_ga(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_ga(X, Y)
GOPHER_IN_GA(nil, L) → U1_GA(L, eq_in_ag(L, nil))
GOPHER_IN_GA(nil, L) → EQ_IN_AG(L, nil)
GOPHER_IN_GA(X, Y) → U2_GA(X, Y, head_in_gg(X, nil))
GOPHER_IN_GA(X, Y) → HEAD_IN_GG(X, nil)
U2_GA(X, Y, head_out_gg(X, nil)) → U3_GA(X, Y, tail_in_ga(X, T))
U2_GA(X, Y, head_out_gg(X, nil)) → TAIL_IN_GA(X, T)
U3_GA(X, Y, tail_out_ga(X, T)) → U4_GA(X, Y, eq_in_ag(Y, cons(nil, T)))
U3_GA(X, Y, tail_out_ga(X, T)) → EQ_IN_AG(Y, cons(nil, T))
GOPHER_IN_GA(X, Y) → U5_GA(X, Y, head_in_ga(X, H))
GOPHER_IN_GA(X, Y) → HEAD_IN_GA(X, H)
U5_GA(X, Y, head_out_ga(X, H)) → U6_GA(X, Y, H, head_in_aa(H, U))
U5_GA(X, Y, head_out_ga(X, H)) → HEAD_IN_AA(H, U)
U6_GA(X, Y, H, head_out_aa(H, U)) → U7_GA(X, Y, H, U, tail_in_aa(H, V))
U6_GA(X, Y, H, head_out_aa(H, U)) → TAIL_IN_AA(H, V)
U7_GA(X, Y, H, U, tail_out_aa(H, V)) → U8_GA(X, Y, H, U, V, tail_in_ga(X, W))
U7_GA(X, Y, H, U, tail_out_aa(H, V)) → TAIL_IN_GA(X, W)
U8_GA(X, Y, H, U, V, tail_out_ga(X, W)) → U9_GA(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U8_GA(X, Y, H, U, V, tail_out_ga(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
GOPHER_IN_AA(nil, L) → U1_AA(L, eq_in_ag(L, nil))
GOPHER_IN_AA(nil, L) → EQ_IN_AG(L, nil)
GOPHER_IN_AA(X, Y) → U2_AA(X, Y, head_in_ag(X, nil))
GOPHER_IN_AA(X, Y) → HEAD_IN_AG(X, nil)
U2_AA(X, Y, head_out_ag(X, nil)) → U3_AA(X, Y, tail_in_aa(X, T))
U2_AA(X, Y, head_out_ag(X, nil)) → TAIL_IN_AA(X, T)
U3_AA(X, Y, tail_out_aa(X, T)) → U4_AA(X, Y, eq_in_aa(Y, cons(nil, T)))
U3_AA(X, Y, tail_out_aa(X, T)) → EQ_IN_AA(Y, cons(nil, T))
GOPHER_IN_AA(X, Y) → U5_AA(X, Y, head_in_aa(X, H))
GOPHER_IN_AA(X, Y) → HEAD_IN_AA(X, H)
U5_AA(X, Y, head_out_aa(X, H)) → U6_AA(X, Y, H, head_in_aa(H, U))
U5_AA(X, Y, head_out_aa(X, H)) → HEAD_IN_AA(H, U)
U6_AA(X, Y, H, head_out_aa(H, U)) → U7_AA(X, Y, H, U, tail_in_aa(H, V))
U6_AA(X, Y, H, head_out_aa(H, U)) → TAIL_IN_AA(H, V)
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → U8_AA(X, Y, H, U, V, tail_in_aa(X, W))
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → TAIL_IN_AA(X, W)
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → U9_AA(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
gopher_in_ga(nil, L) → U1_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, nil)) → gopher_out_ga(nil, L)
gopher_in_ga(X, Y) → U2_ga(X, Y, head_in_gg(X, nil))
head_in_gg([], X1) → head_out_gg([], X1)
head_in_gg(.(X, X2), X) → head_out_gg(.(X, X2), X)
U2_ga(X, Y, head_out_gg(X, nil)) → U3_ga(X, Y, tail_in_ga(X, T))
tail_in_ga([], []) → tail_out_ga([], [])
tail_in_ga(.(X3, X), X) → tail_out_ga(.(X3, X), X)
U3_ga(X, Y, tail_out_ga(X, T)) → U4_ga(X, Y, eq_in_ag(Y, cons(nil, T)))
U4_ga(X, Y, eq_out_ag(Y, cons(nil, T))) → gopher_out_ga(X, Y)
gopher_in_ga(X, Y) → U5_ga(X, Y, head_in_ga(X, H))
head_in_ga([], X1) → head_out_ga([], X1)
head_in_ga(.(X, X2), X) → head_out_ga(.(X, X2), X)
U5_ga(X, Y, head_out_ga(X, H)) → U6_ga(X, Y, H, head_in_aa(H, U))
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
U6_ga(X, Y, H, head_out_aa(H, U)) → U7_ga(X, Y, H, U, tail_in_aa(H, V))
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
U7_ga(X, Y, H, U, tail_out_aa(H, V)) → U8_ga(X, Y, H, U, V, tail_in_ga(X, W))
U8_ga(X, Y, H, U, V, tail_out_ga(X, W)) → U9_ga(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
gopher_in_aa(nil, L) → U1_aa(L, eq_in_ag(L, nil))
U1_aa(L, eq_out_ag(L, nil)) → gopher_out_aa(nil, L)
gopher_in_aa(X, Y) → U2_aa(X, Y, head_in_ag(X, nil))
head_in_ag([], X1) → head_out_ag([], X1)
head_in_ag(.(X, X2), X) → head_out_ag(.(X, X2), X)
U2_aa(X, Y, head_out_ag(X, nil)) → U3_aa(X, Y, tail_in_aa(X, T))
U3_aa(X, Y, tail_out_aa(X, T)) → U4_aa(X, Y, eq_in_aa(Y, cons(nil, T)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U4_aa(X, Y, eq_out_aa(Y, cons(nil, T))) → gopher_out_aa(X, Y)
gopher_in_aa(X, Y) → U5_aa(X, Y, head_in_aa(X, H))
U5_aa(X, Y, head_out_aa(X, H)) → U6_aa(X, Y, H, head_in_aa(H, U))
U6_aa(X, Y, H, head_out_aa(H, U)) → U7_aa(X, Y, H, U, tail_in_aa(H, V))
U7_aa(X, Y, H, U, tail_out_aa(H, V)) → U8_aa(X, Y, H, U, V, tail_in_aa(X, W))
U8_aa(X, Y, H, U, V, tail_out_aa(X, W)) → U9_aa(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U9_aa(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_aa(X, Y)
U9_ga(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_ga(X, Y)
GOPHER_IN_GA(nil, L) → U1_GA(L, eq_in_ag(L, nil))
GOPHER_IN_GA(nil, L) → EQ_IN_AG(L, nil)
GOPHER_IN_GA(X, Y) → U2_GA(X, Y, head_in_gg(X, nil))
GOPHER_IN_GA(X, Y) → HEAD_IN_GG(X, nil)
U2_GA(X, Y, head_out_gg(X, nil)) → U3_GA(X, Y, tail_in_ga(X, T))
U2_GA(X, Y, head_out_gg(X, nil)) → TAIL_IN_GA(X, T)
U3_GA(X, Y, tail_out_ga(X, T)) → U4_GA(X, Y, eq_in_ag(Y, cons(nil, T)))
U3_GA(X, Y, tail_out_ga(X, T)) → EQ_IN_AG(Y, cons(nil, T))
GOPHER_IN_GA(X, Y) → U5_GA(X, Y, head_in_ga(X, H))
GOPHER_IN_GA(X, Y) → HEAD_IN_GA(X, H)
U5_GA(X, Y, head_out_ga(X, H)) → U6_GA(X, Y, H, head_in_aa(H, U))
U5_GA(X, Y, head_out_ga(X, H)) → HEAD_IN_AA(H, U)
U6_GA(X, Y, H, head_out_aa(H, U)) → U7_GA(X, Y, H, U, tail_in_aa(H, V))
U6_GA(X, Y, H, head_out_aa(H, U)) → TAIL_IN_AA(H, V)
U7_GA(X, Y, H, U, tail_out_aa(H, V)) → U8_GA(X, Y, H, U, V, tail_in_ga(X, W))
U7_GA(X, Y, H, U, tail_out_aa(H, V)) → TAIL_IN_GA(X, W)
U8_GA(X, Y, H, U, V, tail_out_ga(X, W)) → U9_GA(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U8_GA(X, Y, H, U, V, tail_out_ga(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
GOPHER_IN_AA(nil, L) → U1_AA(L, eq_in_ag(L, nil))
GOPHER_IN_AA(nil, L) → EQ_IN_AG(L, nil)
GOPHER_IN_AA(X, Y) → U2_AA(X, Y, head_in_ag(X, nil))
GOPHER_IN_AA(X, Y) → HEAD_IN_AG(X, nil)
U2_AA(X, Y, head_out_ag(X, nil)) → U3_AA(X, Y, tail_in_aa(X, T))
U2_AA(X, Y, head_out_ag(X, nil)) → TAIL_IN_AA(X, T)
U3_AA(X, Y, tail_out_aa(X, T)) → U4_AA(X, Y, eq_in_aa(Y, cons(nil, T)))
U3_AA(X, Y, tail_out_aa(X, T)) → EQ_IN_AA(Y, cons(nil, T))
GOPHER_IN_AA(X, Y) → U5_AA(X, Y, head_in_aa(X, H))
GOPHER_IN_AA(X, Y) → HEAD_IN_AA(X, H)
U5_AA(X, Y, head_out_aa(X, H)) → U6_AA(X, Y, H, head_in_aa(H, U))
U5_AA(X, Y, head_out_aa(X, H)) → HEAD_IN_AA(H, U)
U6_AA(X, Y, H, head_out_aa(H, U)) → U7_AA(X, Y, H, U, tail_in_aa(H, V))
U6_AA(X, Y, H, head_out_aa(H, U)) → TAIL_IN_AA(H, V)
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → U8_AA(X, Y, H, U, V, tail_in_aa(X, W))
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → TAIL_IN_AA(X, W)
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → U9_AA(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
gopher_in_ga(nil, L) → U1_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, nil)) → gopher_out_ga(nil, L)
gopher_in_ga(X, Y) → U2_ga(X, Y, head_in_gg(X, nil))
head_in_gg([], X1) → head_out_gg([], X1)
head_in_gg(.(X, X2), X) → head_out_gg(.(X, X2), X)
U2_ga(X, Y, head_out_gg(X, nil)) → U3_ga(X, Y, tail_in_ga(X, T))
tail_in_ga([], []) → tail_out_ga([], [])
tail_in_ga(.(X3, X), X) → tail_out_ga(.(X3, X), X)
U3_ga(X, Y, tail_out_ga(X, T)) → U4_ga(X, Y, eq_in_ag(Y, cons(nil, T)))
U4_ga(X, Y, eq_out_ag(Y, cons(nil, T))) → gopher_out_ga(X, Y)
gopher_in_ga(X, Y) → U5_ga(X, Y, head_in_ga(X, H))
head_in_ga([], X1) → head_out_ga([], X1)
head_in_ga(.(X, X2), X) → head_out_ga(.(X, X2), X)
U5_ga(X, Y, head_out_ga(X, H)) → U6_ga(X, Y, H, head_in_aa(H, U))
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
U6_ga(X, Y, H, head_out_aa(H, U)) → U7_ga(X, Y, H, U, tail_in_aa(H, V))
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
U7_ga(X, Y, H, U, tail_out_aa(H, V)) → U8_ga(X, Y, H, U, V, tail_in_ga(X, W))
U8_ga(X, Y, H, U, V, tail_out_ga(X, W)) → U9_ga(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
gopher_in_aa(nil, L) → U1_aa(L, eq_in_ag(L, nil))
U1_aa(L, eq_out_ag(L, nil)) → gopher_out_aa(nil, L)
gopher_in_aa(X, Y) → U2_aa(X, Y, head_in_ag(X, nil))
head_in_ag([], X1) → head_out_ag([], X1)
head_in_ag(.(X, X2), X) → head_out_ag(.(X, X2), X)
U2_aa(X, Y, head_out_ag(X, nil)) → U3_aa(X, Y, tail_in_aa(X, T))
U3_aa(X, Y, tail_out_aa(X, T)) → U4_aa(X, Y, eq_in_aa(Y, cons(nil, T)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U4_aa(X, Y, eq_out_aa(Y, cons(nil, T))) → gopher_out_aa(X, Y)
gopher_in_aa(X, Y) → U5_aa(X, Y, head_in_aa(X, H))
U5_aa(X, Y, head_out_aa(X, H)) → U6_aa(X, Y, H, head_in_aa(H, U))
U6_aa(X, Y, H, head_out_aa(H, U)) → U7_aa(X, Y, H, U, tail_in_aa(H, V))
U7_aa(X, Y, H, U, tail_out_aa(H, V)) → U8_aa(X, Y, H, U, V, tail_in_aa(X, W))
U8_aa(X, Y, H, U, V, tail_out_aa(X, W)) → U9_aa(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U9_aa(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_aa(X, Y)
U9_ga(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_ga(X, Y)
GOPHER_IN_AA(X, Y) → U5_AA(X, Y, head_in_aa(X, H))
U5_AA(X, Y, head_out_aa(X, H)) → U6_AA(X, Y, H, head_in_aa(H, U))
U6_AA(X, Y, H, head_out_aa(H, U)) → U7_AA(X, Y, H, U, tail_in_aa(H, V))
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → U8_AA(X, Y, H, U, V, tail_in_aa(X, W))
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
gopher_in_ga(nil, L) → U1_ga(L, eq_in_ag(L, nil))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, nil)) → gopher_out_ga(nil, L)
gopher_in_ga(X, Y) → U2_ga(X, Y, head_in_gg(X, nil))
head_in_gg([], X1) → head_out_gg([], X1)
head_in_gg(.(X, X2), X) → head_out_gg(.(X, X2), X)
U2_ga(X, Y, head_out_gg(X, nil)) → U3_ga(X, Y, tail_in_ga(X, T))
tail_in_ga([], []) → tail_out_ga([], [])
tail_in_ga(.(X3, X), X) → tail_out_ga(.(X3, X), X)
U3_ga(X, Y, tail_out_ga(X, T)) → U4_ga(X, Y, eq_in_ag(Y, cons(nil, T)))
U4_ga(X, Y, eq_out_ag(Y, cons(nil, T))) → gopher_out_ga(X, Y)
gopher_in_ga(X, Y) → U5_ga(X, Y, head_in_ga(X, H))
head_in_ga([], X1) → head_out_ga([], X1)
head_in_ga(.(X, X2), X) → head_out_ga(.(X, X2), X)
U5_ga(X, Y, head_out_ga(X, H)) → U6_ga(X, Y, H, head_in_aa(H, U))
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
U6_ga(X, Y, H, head_out_aa(H, U)) → U7_ga(X, Y, H, U, tail_in_aa(H, V))
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
U7_ga(X, Y, H, U, tail_out_aa(H, V)) → U8_ga(X, Y, H, U, V, tail_in_ga(X, W))
U8_ga(X, Y, H, U, V, tail_out_ga(X, W)) → U9_ga(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
gopher_in_aa(nil, L) → U1_aa(L, eq_in_ag(L, nil))
U1_aa(L, eq_out_ag(L, nil)) → gopher_out_aa(nil, L)
gopher_in_aa(X, Y) → U2_aa(X, Y, head_in_ag(X, nil))
head_in_ag([], X1) → head_out_ag([], X1)
head_in_ag(.(X, X2), X) → head_out_ag(.(X, X2), X)
U2_aa(X, Y, head_out_ag(X, nil)) → U3_aa(X, Y, tail_in_aa(X, T))
U3_aa(X, Y, tail_out_aa(X, T)) → U4_aa(X, Y, eq_in_aa(Y, cons(nil, T)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U4_aa(X, Y, eq_out_aa(Y, cons(nil, T))) → gopher_out_aa(X, Y)
gopher_in_aa(X, Y) → U5_aa(X, Y, head_in_aa(X, H))
U5_aa(X, Y, head_out_aa(X, H)) → U6_aa(X, Y, H, head_in_aa(H, U))
U6_aa(X, Y, H, head_out_aa(H, U)) → U7_aa(X, Y, H, U, tail_in_aa(H, V))
U7_aa(X, Y, H, U, tail_out_aa(H, V)) → U8_aa(X, Y, H, U, V, tail_in_aa(X, W))
U8_aa(X, Y, H, U, V, tail_out_aa(X, W)) → U9_aa(X, Y, gopher_in_aa(cons(U, cons(V, W)), Y))
U9_aa(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_aa(X, Y)
U9_ga(X, Y, gopher_out_aa(cons(U, cons(V, W)), Y)) → gopher_out_ga(X, Y)
GOPHER_IN_AA(X, Y) → U5_AA(X, Y, head_in_aa(X, H))
U5_AA(X, Y, head_out_aa(X, H)) → U6_AA(X, Y, H, head_in_aa(H, U))
U6_AA(X, Y, H, head_out_aa(H, U)) → U7_AA(X, Y, H, U, tail_in_aa(H, V))
U7_AA(X, Y, H, U, tail_out_aa(H, V)) → U8_AA(X, Y, H, U, V, tail_in_aa(X, W))
U8_AA(X, Y, H, U, V, tail_out_aa(X, W)) → GOPHER_IN_AA(cons(U, cons(V, W)), Y)
head_in_aa([], X1) → head_out_aa([], X1)
head_in_aa(.(X, X2), X) → head_out_aa(.(X, X2), X)
tail_in_aa([], []) → tail_out_aa([], [])
tail_in_aa(.(X3, X), X) → tail_out_aa(.(X3, X), X)
GOPHER_IN_AA → U5_AA(head_in_aa)
U5_AA(head_out_aa) → U6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
head_in_aa → head_out_aa
tail_in_aa → tail_out_aa
head_in_aa
tail_in_aa
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
head_in_aa → head_out_aa
tail_in_aa → tail_out_aa
head_in_aa
tail_in_aa
U5_AA(head_out_aa) → U6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
head_in_aa → head_out_aa
tail_in_aa → tail_out_aa
head_in_aa
tail_in_aa
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
tail_in_aa → tail_out_aa
head_in_aa
tail_in_aa
head_in_aa
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
tail_in_aa → tail_out_aa
tail_in_aa
U6_AA(head_out_aa) → U7_AA(tail_out_aa)
U7_AA(tail_out_aa) → U8_AA(tail_in_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)
tail_in_aa → tail_out_aa
tail_in_aa
U7_AA(tail_out_aa) → U8_AA(tail_out_aa)
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)
U7_AA(tail_out_aa) → U8_AA(tail_out_aa)
tail_in_aa → tail_out_aa
tail_in_aa
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)
U7_AA(tail_out_aa) → U8_AA(tail_out_aa)
tail_in_aa
tail_in_aa
U8_AA(tail_out_aa) → GOPHER_IN_AA
GOPHER_IN_AA → U5_AA(head_out_aa)
U5_AA(head_out_aa) → U6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)
U7_AA(tail_out_aa) → U8_AA(tail_out_aa)