(0) Obligation:

Clauses:

flatten(atom(X), Y) :- ','(!, eq(Y, .(X, []))).
flatten(L, Y) :- ','(head(L, atom(H)), ','(!, ','(eq(Y, .(H, Z)), ','(tail(L, T), flatten(T, Z))))).
flatten(L, X) :- ','(head(L, cons(U, V)), ','(tail(L, W), flatten(cons(U, cons(V, W)), X))).
head(nil, X1).
head(cons(H, X2), H).
tail(nil, nil).
tail(cons(X3, T), T).
eq(X, X).

Queries:

flatten(g,a).

(1) CutEliminatorProof (SOUND transformation)

Eliminated all cuts by simply ignoring them[PROLOG].

(2) Obligation:

Clauses:

flatten(atom(X), Y) :- eq(Y, .(X, [])).
flatten(L, Y) :- ','(head(L, atom(H)), ','(eq(Y, .(H, Z)), ','(tail(L, T), flatten(T, Z)))).
flatten(L, X) :- ','(head(L, cons(U, V)), ','(tail(L, W), flatten(cons(U, cons(V, W)), X))).
head(nil, X1).
head(cons(H, X2), H).
tail(nil, nil).
tail(cons(X3, T), T).
eq(X, X).

Queries:

flatten(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:
flatten_in: (b,f) (f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x2)
U5_ga(x1, x2, x3)  =  U5_ga(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x5)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

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

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x2)
U5_ga(x1, x2, x3)  =  U5_ga(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x5)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)

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

FLATTEN_IN_GA(atom(X), Y) → U1_GA(X, Y, eq_in_ag(Y, .(X, [])))
FLATTEN_IN_GA(atom(X), Y) → EQ_IN_AG(Y, .(X, []))
FLATTEN_IN_GA(L, Y) → U2_GA(L, Y, head_in_gg(L, atom(H)))
FLATTEN_IN_GA(L, Y) → HEAD_IN_GG(L, atom(H))
U2_GA(L, Y, head_out_gg(L, atom(H))) → U3_GA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U2_GA(L, Y, head_out_gg(L, atom(H))) → EQ_IN_AA(Y, .(H, Z))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_GA(L, Y, H, Z, tail_in_ga(L, T))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → TAIL_IN_GA(L, T)
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → U5_GA(L, Y, flatten_in_ga(T, Z))
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → FLATTEN_IN_GA(T, Z)
FLATTEN_IN_GA(L, X) → U6_GA(L, X, head_in_ga(L, cons(U, V)))
FLATTEN_IN_GA(L, X) → HEAD_IN_GA(L, cons(U, V))
U6_GA(L, X, head_out_ga(L, cons(U, V))) → U7_GA(L, X, U, V, tail_in_ga(L, W))
U6_GA(L, X, head_out_ga(L, cons(U, V))) → TAIL_IN_GA(L, W)
U7_GA(L, X, U, V, tail_out_ga(L, W)) → U8_GA(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U7_GA(L, X, U, V, tail_out_ga(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)
FLATTEN_IN_AA(atom(X), Y) → U1_AA(X, Y, eq_in_ag(Y, .(X, [])))
FLATTEN_IN_AA(atom(X), Y) → EQ_IN_AG(Y, .(X, []))
FLATTEN_IN_AA(L, Y) → U2_AA(L, Y, head_in_ag(L, atom(H)))
FLATTEN_IN_AA(L, Y) → HEAD_IN_AG(L, atom(H))
U2_AA(L, Y, head_out_ag(L, atom(H))) → U3_AA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U2_AA(L, Y, head_out_ag(L, atom(H))) → EQ_IN_AA(Y, .(H, Z))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_AA(L, Y, H, Z, tail_in_aa(L, T))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → TAIL_IN_AA(L, T)
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → U5_AA(L, Y, flatten_in_aa(T, Z))
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → FLATTEN_IN_AA(T, Z)
FLATTEN_IN_AA(L, X) → U6_AA(L, X, head_in_aa(L, cons(U, V)))
FLATTEN_IN_AA(L, X) → HEAD_IN_AA(L, cons(U, V))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → U7_AA(L, X, U, V, tail_in_aa(L, W))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → TAIL_IN_AA(L, W)
U7_AA(L, X, U, V, tail_out_aa(L, W)) → U8_AA(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U7_AA(L, X, U, V, tail_out_aa(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)

The TRS R consists of the following rules:

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x2)
U5_ga(x1, x2, x3)  =  U5_ga(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x5)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)
FLATTEN_IN_GA(x1, x2)  =  FLATTEN_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
HEAD_IN_GG(x1, x2)  =  HEAD_IN_GG(x1, x2)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
EQ_IN_AA(x1, x2)  =  EQ_IN_AA
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x5)
TAIL_IN_GA(x1, x2)  =  TAIL_IN_GA(x1)
U5_GA(x1, x2, x3)  =  U5_GA(x3)
U6_GA(x1, x2, x3)  =  U6_GA(x1, x3)
HEAD_IN_GA(x1, x2)  =  HEAD_IN_GA(x1)
U7_GA(x1, x2, x3, x4, x5)  =  U7_GA(x5)
U8_GA(x1, x2, x3)  =  U8_GA(x3)
FLATTEN_IN_AA(x1, x2)  =  FLATTEN_IN_AA
U1_AA(x1, x2, x3)  =  U1_AA(x3)
U2_AA(x1, x2, x3)  =  U2_AA(x3)
HEAD_IN_AG(x1, x2)  =  HEAD_IN_AG(x2)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4, x5)  =  U4_AA(x5)
TAIL_IN_AA(x1, x2)  =  TAIL_IN_AA
U5_AA(x1, x2, x3)  =  U5_AA(x3)
U6_AA(x1, x2, x3)  =  U6_AA(x3)
HEAD_IN_AA(x1, x2)  =  HEAD_IN_AA
U7_AA(x1, x2, x3, x4, x5)  =  U7_AA(x5)
U8_AA(x1, x2, x3)  =  U8_AA(x3)

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

(6) Obligation:

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

FLATTEN_IN_GA(atom(X), Y) → U1_GA(X, Y, eq_in_ag(Y, .(X, [])))
FLATTEN_IN_GA(atom(X), Y) → EQ_IN_AG(Y, .(X, []))
FLATTEN_IN_GA(L, Y) → U2_GA(L, Y, head_in_gg(L, atom(H)))
FLATTEN_IN_GA(L, Y) → HEAD_IN_GG(L, atom(H))
U2_GA(L, Y, head_out_gg(L, atom(H))) → U3_GA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U2_GA(L, Y, head_out_gg(L, atom(H))) → EQ_IN_AA(Y, .(H, Z))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_GA(L, Y, H, Z, tail_in_ga(L, T))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → TAIL_IN_GA(L, T)
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → U5_GA(L, Y, flatten_in_ga(T, Z))
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → FLATTEN_IN_GA(T, Z)
FLATTEN_IN_GA(L, X) → U6_GA(L, X, head_in_ga(L, cons(U, V)))
FLATTEN_IN_GA(L, X) → HEAD_IN_GA(L, cons(U, V))
U6_GA(L, X, head_out_ga(L, cons(U, V))) → U7_GA(L, X, U, V, tail_in_ga(L, W))
U6_GA(L, X, head_out_ga(L, cons(U, V))) → TAIL_IN_GA(L, W)
U7_GA(L, X, U, V, tail_out_ga(L, W)) → U8_GA(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U7_GA(L, X, U, V, tail_out_ga(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)
FLATTEN_IN_AA(atom(X), Y) → U1_AA(X, Y, eq_in_ag(Y, .(X, [])))
FLATTEN_IN_AA(atom(X), Y) → EQ_IN_AG(Y, .(X, []))
FLATTEN_IN_AA(L, Y) → U2_AA(L, Y, head_in_ag(L, atom(H)))
FLATTEN_IN_AA(L, Y) → HEAD_IN_AG(L, atom(H))
U2_AA(L, Y, head_out_ag(L, atom(H))) → U3_AA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U2_AA(L, Y, head_out_ag(L, atom(H))) → EQ_IN_AA(Y, .(H, Z))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_AA(L, Y, H, Z, tail_in_aa(L, T))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → TAIL_IN_AA(L, T)
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → U5_AA(L, Y, flatten_in_aa(T, Z))
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → FLATTEN_IN_AA(T, Z)
FLATTEN_IN_AA(L, X) → U6_AA(L, X, head_in_aa(L, cons(U, V)))
FLATTEN_IN_AA(L, X) → HEAD_IN_AA(L, cons(U, V))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → U7_AA(L, X, U, V, tail_in_aa(L, W))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → TAIL_IN_AA(L, W)
U7_AA(L, X, U, V, tail_out_aa(L, W)) → U8_AA(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U7_AA(L, X, U, V, tail_out_aa(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)

The TRS R consists of the following rules:

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x2)
U5_ga(x1, x2, x3)  =  U5_ga(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x5)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)
FLATTEN_IN_GA(x1, x2)  =  FLATTEN_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
HEAD_IN_GG(x1, x2)  =  HEAD_IN_GG(x1, x2)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
EQ_IN_AA(x1, x2)  =  EQ_IN_AA
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x5)
TAIL_IN_GA(x1, x2)  =  TAIL_IN_GA(x1)
U5_GA(x1, x2, x3)  =  U5_GA(x3)
U6_GA(x1, x2, x3)  =  U6_GA(x1, x3)
HEAD_IN_GA(x1, x2)  =  HEAD_IN_GA(x1)
U7_GA(x1, x2, x3, x4, x5)  =  U7_GA(x5)
U8_GA(x1, x2, x3)  =  U8_GA(x3)
FLATTEN_IN_AA(x1, x2)  =  FLATTEN_IN_AA
U1_AA(x1, x2, x3)  =  U1_AA(x3)
U2_AA(x1, x2, x3)  =  U2_AA(x3)
HEAD_IN_AG(x1, x2)  =  HEAD_IN_AG(x2)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4, x5)  =  U4_AA(x5)
TAIL_IN_AA(x1, x2)  =  TAIL_IN_AA
U5_AA(x1, x2, x3)  =  U5_AA(x3)
U6_AA(x1, x2, x3)  =  U6_AA(x3)
HEAD_IN_AA(x1, x2)  =  HEAD_IN_AA
U7_AA(x1, x2, x3, x4, x5)  =  U7_AA(x5)
U8_AA(x1, x2, x3)  =  U8_AA(x3)

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

(7) DependencyGraphProof (EQUIVALENT transformation)

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

(8) Complex Obligation (AND)

(9) Obligation:

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

FLATTEN_IN_AA(L, Y) → U2_AA(L, Y, head_in_ag(L, atom(H)))
U2_AA(L, Y, head_out_ag(L, atom(H))) → U3_AA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_AA(L, Y, H, Z, tail_in_aa(L, T))
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → FLATTEN_IN_AA(T, Z)
FLATTEN_IN_AA(L, X) → U6_AA(L, X, head_in_aa(L, cons(U, V)))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → U7_AA(L, X, U, V, tail_in_aa(L, W))
U7_AA(L, X, U, V, tail_out_aa(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)

The TRS R consists of the following rules:

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x2)
U5_ga(x1, x2, x3)  =  U5_ga(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x5)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)
FLATTEN_IN_AA(x1, x2)  =  FLATTEN_IN_AA
U2_AA(x1, x2, x3)  =  U2_AA(x3)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4, x5)  =  U4_AA(x5)
U6_AA(x1, x2, x3)  =  U6_AA(x3)
U7_AA(x1, x2, x3, x4, x5)  =  U7_AA(x5)

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

(10) UsableRulesProof (EQUIVALENT transformation)

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

(11) Obligation:

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

FLATTEN_IN_AA(L, Y) → U2_AA(L, Y, head_in_ag(L, atom(H)))
U2_AA(L, Y, head_out_ag(L, atom(H))) → U3_AA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_AA(L, Y, H, Z, tail_in_aa(L, T))
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → FLATTEN_IN_AA(T, Z)
FLATTEN_IN_AA(L, X) → U6_AA(L, X, head_in_aa(L, cons(U, V)))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → U7_AA(L, X, U, V, tail_in_aa(L, W))
U7_AA(L, X, U, V, tail_out_aa(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)

The TRS R consists of the following rules:

head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
eq_in_aa(X, X) → eq_out_aa(X, X)
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)

The argument filtering Pi contains the following mapping:
atom(x1)  =  atom
.(x1, x2)  =  .(x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
FLATTEN_IN_AA(x1, x2)  =  FLATTEN_IN_AA
U2_AA(x1, x2, x3)  =  U2_AA(x3)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4, x5)  =  U4_AA(x5)
U6_AA(x1, x2, x3)  =  U6_AA(x3)
U7_AA(x1, x2, x3, x4, x5)  =  U7_AA(x5)

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

(12) PiDPToQDPProof (SOUND transformation)

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

(13) Obligation:

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

FLATTEN_IN_AAU2_AA(head_in_ag(atom))
U2_AA(head_out_ag) → U3_AA(eq_in_aa)
U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA

The TRS R consists of the following rules:

head_in_ag(X1) → head_out_ag
eq_in_aaeq_out_aa
tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

head_in_ag(x0)
eq_in_aa
tail_in_aa
head_in_aa

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

(14) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule FLATTEN_IN_AAU2_AA(head_in_ag(atom)) at position [0] we obtained the following new rules [LPAR04]:

FLATTEN_IN_AAU2_AA(head_out_ag)

(15) Obligation:

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

U2_AA(head_out_ag) → U3_AA(eq_in_aa)
U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)

The TRS R consists of the following rules:

head_in_ag(X1) → head_out_ag
eq_in_aaeq_out_aa
tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

head_in_ag(x0)
eq_in_aa
tail_in_aa
head_in_aa

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

(16) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(17) Obligation:

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

U2_AA(head_out_ag) → U3_AA(eq_in_aa)
U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa
eq_in_aaeq_out_aa

The set Q consists of the following terms:

head_in_ag(x0)
eq_in_aa
tail_in_aa
head_in_aa

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

(18) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

head_in_ag(x0)

(19) Obligation:

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

U2_AA(head_out_ag) → U3_AA(eq_in_aa)
U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa
eq_in_aaeq_out_aa

The set Q consists of the following terms:

eq_in_aa
tail_in_aa
head_in_aa

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

(20) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule U2_AA(head_out_ag) → U3_AA(eq_in_aa) at position [0] we obtained the following new rules [LPAR04]:

U2_AA(head_out_ag) → U3_AA(eq_out_aa)

(21) Obligation:

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

U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)
U2_AA(head_out_ag) → U3_AA(eq_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa
eq_in_aaeq_out_aa

The set Q consists of the following terms:

eq_in_aa
tail_in_aa
head_in_aa

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

(22) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(23) Obligation:

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

U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)
U2_AA(head_out_ag) → U3_AA(eq_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

eq_in_aa
tail_in_aa
head_in_aa

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

(24) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

eq_in_aa

(25) Obligation:

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

U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)
U2_AA(head_out_ag) → U3_AA(eq_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

tail_in_aa
head_in_aa

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

(26) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule U3_AA(eq_out_aa) → U4_AA(tail_in_aa) at position [0] we obtained the following new rules [LPAR04]:

U3_AA(eq_out_aa) → U4_AA(tail_out_aa)

(27) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)
U2_AA(head_out_ag) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

tail_in_aa
head_in_aa

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

(28) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule FLATTEN_IN_AAU6_AA(head_in_aa) at position [0] we obtained the following new rules [LPAR04]:

FLATTEN_IN_AAU6_AA(head_out_aa)

(29) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)
U2_AA(head_out_ag) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

tail_in_aa
head_in_aa

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

(30) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(31) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)
U2_AA(head_out_ag) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa

The set Q consists of the following terms:

tail_in_aa
head_in_aa

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

(32) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

head_in_aa

(33) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)
U2_AA(head_out_ag) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa

The set Q consists of the following terms:

tail_in_aa

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

(34) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule U6_AA(head_out_aa) → U7_AA(tail_in_aa) at position [0] we obtained the following new rules [LPAR04]:

U6_AA(head_out_aa) → U7_AA(tail_out_aa)

(35) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)
U2_AA(head_out_ag) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa

The set Q consists of the following terms:

tail_in_aa

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

(36) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(37) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)
U2_AA(head_out_ag) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)

R is empty.
The set Q consists of the following terms:

tail_in_aa

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

(38) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

tail_in_aa

(39) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag)
U2_AA(head_out_ag) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)

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

(40) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

s = FLATTEN_IN_AA evaluates to t =FLATTEN_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Matcher: [ ]
  • Semiunifier: [ ]




Rewriting sequence

FLATTEN_IN_AAU6_AA(head_out_aa)
with rule FLATTEN_IN_AAU6_AA(head_out_aa) at position [] and matcher [ ]

U6_AA(head_out_aa)U7_AA(tail_out_aa)
with rule U6_AA(head_out_aa) → U7_AA(tail_out_aa) at position [] and matcher [ ]

U7_AA(tail_out_aa)FLATTEN_IN_AA
with rule U7_AA(tail_out_aa) → FLATTEN_IN_AA

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.



(41) FALSE

(42) Obligation:

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

FLATTEN_IN_GA(L, Y) → U2_GA(L, Y, head_in_gg(L, atom(H)))
U2_GA(L, Y, head_out_gg(L, atom(H))) → U3_GA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_GA(L, Y, H, Z, tail_in_ga(L, T))
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → FLATTEN_IN_GA(T, Z)

The TRS R consists of the following rules:

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x2)
U5_ga(x1, x2, x3)  =  U5_ga(x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x5)
U8_ga(x1, x2, x3)  =  U8_ga(x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)
FLATTEN_IN_GA(x1, x2)  =  FLATTEN_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x5)

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

(43) UsableRulesProof (EQUIVALENT transformation)

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

(44) Obligation:

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

FLATTEN_IN_GA(L, Y) → U2_GA(L, Y, head_in_gg(L, atom(H)))
U2_GA(L, Y, head_out_gg(L, atom(H))) → U3_GA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_GA(L, Y, H, Z, tail_in_ga(L, T))
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → FLATTEN_IN_GA(T, Z)

The TRS R consists of the following rules:

head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
eq_in_aa(X, X) → eq_out_aa(X, X)
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)

The argument filtering Pi contains the following mapping:
atom(x1)  =  atom
.(x1, x2)  =  .(x2)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg
cons(x1, x2)  =  cons(x1, x2)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x2)
FLATTEN_IN_GA(x1, x2)  =  FLATTEN_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x5)

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

(45) PiDPToQDPProof (SOUND transformation)

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

(46) Obligation:

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

FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom))
U2_GA(L, head_out_gg) → U3_GA(L, eq_in_aa)
U3_GA(L, eq_out_aa) → U4_GA(tail_in_ga(L))
U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)

The TRS R consists of the following rules:

head_in_gg(nil, X1) → head_out_gg
head_in_gg(cons(H, X2), H) → head_out_gg
eq_in_aaeq_out_aa
tail_in_ga(nil) → tail_out_ga(nil)
tail_in_ga(cons(X3, T)) → tail_out_ga(T)

The set Q consists of the following terms:

head_in_gg(x0, x1)
eq_in_aa
tail_in_ga(x0)

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

(47) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

No dependency pairs are removed.

The following rules are removed from R:

tail_in_ga(cons(X3, T)) → tail_out_ga(T)
head_in_gg(cons(H, X2), H) → head_out_gg
Used ordering: POLO with Polynomial interpretation [POLO]:

POL(FLATTEN_IN_GA(x1)) = 2·x1   
POL(U2_GA(x1, x2)) = x1 + x2   
POL(U3_GA(x1, x2)) = x1 + 2·x2   
POL(U4_GA(x1)) = x1   
POL(atom) = 0   
POL(cons(x1, x2)) = 1 + x1 + 2·x2   
POL(eq_in_aa) = 0   
POL(eq_out_aa) = 0   
POL(head_in_gg(x1, x2)) = x1 + x2   
POL(head_out_gg) = 0   
POL(nil) = 0   
POL(tail_in_ga(x1)) = x1   
POL(tail_out_ga(x1)) = 2·x1   

(48) Obligation:

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

FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom))
U2_GA(L, head_out_gg) → U3_GA(L, eq_in_aa)
U3_GA(L, eq_out_aa) → U4_GA(tail_in_ga(L))
U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil)
eq_in_aaeq_out_aa
head_in_gg(nil, X1) → head_out_gg

The set Q consists of the following terms:

head_in_gg(x0, x1)
eq_in_aa
tail_in_ga(x0)

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

(49) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule U2_GA(L, head_out_gg) → U3_GA(L, eq_in_aa) at position [1] we obtained the following new rules [LPAR04]:

U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)

(50) Obligation:

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

FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom))
U3_GA(L, eq_out_aa) → U4_GA(tail_in_ga(L))
U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil)
eq_in_aaeq_out_aa
head_in_gg(nil, X1) → head_out_gg

The set Q consists of the following terms:

head_in_gg(x0, x1)
eq_in_aa
tail_in_ga(x0)

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

(51) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(52) Obligation:

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

FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom))
U3_GA(L, eq_out_aa) → U4_GA(tail_in_ga(L))
U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil)
head_in_gg(nil, X1) → head_out_gg

The set Q consists of the following terms:

head_in_gg(x0, x1)
eq_in_aa
tail_in_ga(x0)

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

(53) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

eq_in_aa

(54) Obligation:

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

FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom))
U3_GA(L, eq_out_aa) → U4_GA(tail_in_ga(L))
U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil)
head_in_gg(nil, X1) → head_out_gg

The set Q consists of the following terms:

head_in_gg(x0, x1)
tail_in_ga(x0)

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

(55) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom)) at position [1] we obtained the following new rules [LPAR04]:

FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg)

(56) Obligation:

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

U3_GA(L, eq_out_aa) → U4_GA(tail_in_ga(L))
U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg)

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil)
head_in_gg(nil, X1) → head_out_gg

The set Q consists of the following terms:

head_in_gg(x0, x1)
tail_in_ga(x0)

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

(57) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(58) Obligation:

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

U3_GA(L, eq_out_aa) → U4_GA(tail_in_ga(L))
U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg)

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil)

The set Q consists of the following terms:

head_in_gg(x0, x1)
tail_in_ga(x0)

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

(59) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

head_in_gg(x0, x1)

(60) Obligation:

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

U3_GA(L, eq_out_aa) → U4_GA(tail_in_ga(L))
U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg)

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil)

The set Q consists of the following terms:

tail_in_ga(x0)

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

(61) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule U3_GA(L, eq_out_aa) → U4_GA(tail_in_ga(L)) at position [0] we obtained the following new rules [LPAR04]:

U3_GA(nil, eq_out_aa) → U4_GA(tail_out_ga(nil))

(62) Obligation:

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

U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg)
U3_GA(nil, eq_out_aa) → U4_GA(tail_out_ga(nil))

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil)

The set Q consists of the following terms:

tail_in_ga(x0)

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

(63) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(64) Obligation:

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

U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg)
U3_GA(nil, eq_out_aa) → U4_GA(tail_out_ga(nil))

R is empty.
The set Q consists of the following terms:

tail_in_ga(x0)

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

(65) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

tail_in_ga(x0)

(66) Obligation:

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

U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg)
U3_GA(nil, eq_out_aa) → U4_GA(tail_out_ga(nil))

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

(67) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U4_GA(tail_out_ga(T)) → FLATTEN_IN_GA(T) we obtained the following new rules [LPAR04]:

U4_GA(tail_out_ga(nil)) → FLATTEN_IN_GA(nil)

(68) Obligation:

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

U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg)
U3_GA(nil, eq_out_aa) → U4_GA(tail_out_ga(nil))
U4_GA(tail_out_ga(nil)) → FLATTEN_IN_GA(nil)

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

(69) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U2_GA(L, head_out_gg) → U3_GA(L, eq_out_aa) we obtained the following new rules [LPAR04]:

U2_GA(nil, head_out_gg) → U3_GA(nil, eq_out_aa)

(70) Obligation:

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

FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg)
U3_GA(nil, eq_out_aa) → U4_GA(tail_out_ga(nil))
U4_GA(tail_out_ga(nil)) → FLATTEN_IN_GA(nil)
U2_GA(nil, head_out_gg) → U3_GA(nil, eq_out_aa)

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

(71) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

s = U2_GA(nil, head_out_gg) evaluates to t =U2_GA(nil, head_out_gg)

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Semiunifier: [ ]
  • Matcher: [ ]




Rewriting sequence

U2_GA(nil, head_out_gg)U3_GA(nil, eq_out_aa)
with rule U2_GA(nil, head_out_gg) → U3_GA(nil, eq_out_aa) at position [] and matcher [ ]

U3_GA(nil, eq_out_aa)U4_GA(tail_out_ga(nil))
with rule U3_GA(nil, eq_out_aa) → U4_GA(tail_out_ga(nil)) at position [] and matcher [ ]

U4_GA(tail_out_ga(nil))FLATTEN_IN_GA(nil)
with rule U4_GA(tail_out_ga(nil)) → FLATTEN_IN_GA(nil) at position [] and matcher [ ]

FLATTEN_IN_GA(nil)U2_GA(nil, head_out_gg)
with rule FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg)

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.



(72) FALSE

(73) PrologToPiTRSProof (SOUND transformation)

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

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x1, x2)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga(x1)
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x1, x5)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag(x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(74) Obligation:

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

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x1, x2)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga(x1)
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x1, x5)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag(x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)

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

FLATTEN_IN_GA(atom(X), Y) → U1_GA(X, Y, eq_in_ag(Y, .(X, [])))
FLATTEN_IN_GA(atom(X), Y) → EQ_IN_AG(Y, .(X, []))
FLATTEN_IN_GA(L, Y) → U2_GA(L, Y, head_in_gg(L, atom(H)))
FLATTEN_IN_GA(L, Y) → HEAD_IN_GG(L, atom(H))
U2_GA(L, Y, head_out_gg(L, atom(H))) → U3_GA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U2_GA(L, Y, head_out_gg(L, atom(H))) → EQ_IN_AA(Y, .(H, Z))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_GA(L, Y, H, Z, tail_in_ga(L, T))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → TAIL_IN_GA(L, T)
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → U5_GA(L, Y, flatten_in_ga(T, Z))
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → FLATTEN_IN_GA(T, Z)
FLATTEN_IN_GA(L, X) → U6_GA(L, X, head_in_ga(L, cons(U, V)))
FLATTEN_IN_GA(L, X) → HEAD_IN_GA(L, cons(U, V))
U6_GA(L, X, head_out_ga(L, cons(U, V))) → U7_GA(L, X, U, V, tail_in_ga(L, W))
U6_GA(L, X, head_out_ga(L, cons(U, V))) → TAIL_IN_GA(L, W)
U7_GA(L, X, U, V, tail_out_ga(L, W)) → U8_GA(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U7_GA(L, X, U, V, tail_out_ga(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)
FLATTEN_IN_AA(atom(X), Y) → U1_AA(X, Y, eq_in_ag(Y, .(X, [])))
FLATTEN_IN_AA(atom(X), Y) → EQ_IN_AG(Y, .(X, []))
FLATTEN_IN_AA(L, Y) → U2_AA(L, Y, head_in_ag(L, atom(H)))
FLATTEN_IN_AA(L, Y) → HEAD_IN_AG(L, atom(H))
U2_AA(L, Y, head_out_ag(L, atom(H))) → U3_AA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U2_AA(L, Y, head_out_ag(L, atom(H))) → EQ_IN_AA(Y, .(H, Z))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_AA(L, Y, H, Z, tail_in_aa(L, T))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → TAIL_IN_AA(L, T)
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → U5_AA(L, Y, flatten_in_aa(T, Z))
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → FLATTEN_IN_AA(T, Z)
FLATTEN_IN_AA(L, X) → U6_AA(L, X, head_in_aa(L, cons(U, V)))
FLATTEN_IN_AA(L, X) → HEAD_IN_AA(L, cons(U, V))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → U7_AA(L, X, U, V, tail_in_aa(L, W))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → TAIL_IN_AA(L, W)
U7_AA(L, X, U, V, tail_out_aa(L, W)) → U8_AA(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U7_AA(L, X, U, V, tail_out_aa(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)

The TRS R consists of the following rules:

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x1, x2)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga(x1)
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x1, x5)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag(x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)
FLATTEN_IN_GA(x1, x2)  =  FLATTEN_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
HEAD_IN_GG(x1, x2)  =  HEAD_IN_GG(x1, x2)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
EQ_IN_AA(x1, x2)  =  EQ_IN_AA
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x5)
TAIL_IN_GA(x1, x2)  =  TAIL_IN_GA(x1)
U5_GA(x1, x2, x3)  =  U5_GA(x1, x3)
U6_GA(x1, x2, x3)  =  U6_GA(x1, x3)
HEAD_IN_GA(x1, x2)  =  HEAD_IN_GA(x1)
U7_GA(x1, x2, x3, x4, x5)  =  U7_GA(x1, x5)
U8_GA(x1, x2, x3)  =  U8_GA(x1, x3)
FLATTEN_IN_AA(x1, x2)  =  FLATTEN_IN_AA
U1_AA(x1, x2, x3)  =  U1_AA(x3)
U2_AA(x1, x2, x3)  =  U2_AA(x3)
HEAD_IN_AG(x1, x2)  =  HEAD_IN_AG(x2)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4, x5)  =  U4_AA(x5)
TAIL_IN_AA(x1, x2)  =  TAIL_IN_AA
U5_AA(x1, x2, x3)  =  U5_AA(x3)
U6_AA(x1, x2, x3)  =  U6_AA(x3)
HEAD_IN_AA(x1, x2)  =  HEAD_IN_AA
U7_AA(x1, x2, x3, x4, x5)  =  U7_AA(x5)
U8_AA(x1, x2, x3)  =  U8_AA(x3)

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

(76) Obligation:

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

FLATTEN_IN_GA(atom(X), Y) → U1_GA(X, Y, eq_in_ag(Y, .(X, [])))
FLATTEN_IN_GA(atom(X), Y) → EQ_IN_AG(Y, .(X, []))
FLATTEN_IN_GA(L, Y) → U2_GA(L, Y, head_in_gg(L, atom(H)))
FLATTEN_IN_GA(L, Y) → HEAD_IN_GG(L, atom(H))
U2_GA(L, Y, head_out_gg(L, atom(H))) → U3_GA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U2_GA(L, Y, head_out_gg(L, atom(H))) → EQ_IN_AA(Y, .(H, Z))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_GA(L, Y, H, Z, tail_in_ga(L, T))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → TAIL_IN_GA(L, T)
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → U5_GA(L, Y, flatten_in_ga(T, Z))
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → FLATTEN_IN_GA(T, Z)
FLATTEN_IN_GA(L, X) → U6_GA(L, X, head_in_ga(L, cons(U, V)))
FLATTEN_IN_GA(L, X) → HEAD_IN_GA(L, cons(U, V))
U6_GA(L, X, head_out_ga(L, cons(U, V))) → U7_GA(L, X, U, V, tail_in_ga(L, W))
U6_GA(L, X, head_out_ga(L, cons(U, V))) → TAIL_IN_GA(L, W)
U7_GA(L, X, U, V, tail_out_ga(L, W)) → U8_GA(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U7_GA(L, X, U, V, tail_out_ga(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)
FLATTEN_IN_AA(atom(X), Y) → U1_AA(X, Y, eq_in_ag(Y, .(X, [])))
FLATTEN_IN_AA(atom(X), Y) → EQ_IN_AG(Y, .(X, []))
FLATTEN_IN_AA(L, Y) → U2_AA(L, Y, head_in_ag(L, atom(H)))
FLATTEN_IN_AA(L, Y) → HEAD_IN_AG(L, atom(H))
U2_AA(L, Y, head_out_ag(L, atom(H))) → U3_AA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U2_AA(L, Y, head_out_ag(L, atom(H))) → EQ_IN_AA(Y, .(H, Z))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_AA(L, Y, H, Z, tail_in_aa(L, T))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → TAIL_IN_AA(L, T)
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → U5_AA(L, Y, flatten_in_aa(T, Z))
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → FLATTEN_IN_AA(T, Z)
FLATTEN_IN_AA(L, X) → U6_AA(L, X, head_in_aa(L, cons(U, V)))
FLATTEN_IN_AA(L, X) → HEAD_IN_AA(L, cons(U, V))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → U7_AA(L, X, U, V, tail_in_aa(L, W))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → TAIL_IN_AA(L, W)
U7_AA(L, X, U, V, tail_out_aa(L, W)) → U8_AA(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U7_AA(L, X, U, V, tail_out_aa(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)

The TRS R consists of the following rules:

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x1, x2)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga(x1)
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x1, x5)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag(x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)
FLATTEN_IN_GA(x1, x2)  =  FLATTEN_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
EQ_IN_AG(x1, x2)  =  EQ_IN_AG(x2)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
HEAD_IN_GG(x1, x2)  =  HEAD_IN_GG(x1, x2)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
EQ_IN_AA(x1, x2)  =  EQ_IN_AA
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x5)
TAIL_IN_GA(x1, x2)  =  TAIL_IN_GA(x1)
U5_GA(x1, x2, x3)  =  U5_GA(x1, x3)
U6_GA(x1, x2, x3)  =  U6_GA(x1, x3)
HEAD_IN_GA(x1, x2)  =  HEAD_IN_GA(x1)
U7_GA(x1, x2, x3, x4, x5)  =  U7_GA(x1, x5)
U8_GA(x1, x2, x3)  =  U8_GA(x1, x3)
FLATTEN_IN_AA(x1, x2)  =  FLATTEN_IN_AA
U1_AA(x1, x2, x3)  =  U1_AA(x3)
U2_AA(x1, x2, x3)  =  U2_AA(x3)
HEAD_IN_AG(x1, x2)  =  HEAD_IN_AG(x2)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4, x5)  =  U4_AA(x5)
TAIL_IN_AA(x1, x2)  =  TAIL_IN_AA
U5_AA(x1, x2, x3)  =  U5_AA(x3)
U6_AA(x1, x2, x3)  =  U6_AA(x3)
HEAD_IN_AA(x1, x2)  =  HEAD_IN_AA
U7_AA(x1, x2, x3, x4, x5)  =  U7_AA(x5)
U8_AA(x1, x2, x3)  =  U8_AA(x3)

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

(77) DependencyGraphProof (EQUIVALENT transformation)

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

(78) Complex Obligation (AND)

(79) Obligation:

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

FLATTEN_IN_AA(L, Y) → U2_AA(L, Y, head_in_ag(L, atom(H)))
U2_AA(L, Y, head_out_ag(L, atom(H))) → U3_AA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_AA(L, Y, H, Z, tail_in_aa(L, T))
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → FLATTEN_IN_AA(T, Z)
FLATTEN_IN_AA(L, X) → U6_AA(L, X, head_in_aa(L, cons(U, V)))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → U7_AA(L, X, U, V, tail_in_aa(L, W))
U7_AA(L, X, U, V, tail_out_aa(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)

The TRS R consists of the following rules:

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x1, x2)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga(x1)
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x1, x5)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag(x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)
FLATTEN_IN_AA(x1, x2)  =  FLATTEN_IN_AA
U2_AA(x1, x2, x3)  =  U2_AA(x3)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4, x5)  =  U4_AA(x5)
U6_AA(x1, x2, x3)  =  U6_AA(x3)
U7_AA(x1, x2, x3, x4, x5)  =  U7_AA(x5)

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

(80) UsableRulesProof (EQUIVALENT transformation)

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

(81) Obligation:

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

FLATTEN_IN_AA(L, Y) → U2_AA(L, Y, head_in_ag(L, atom(H)))
U2_AA(L, Y, head_out_ag(L, atom(H))) → U3_AA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_AA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_AA(L, Y, H, Z, tail_in_aa(L, T))
U4_AA(L, Y, H, Z, tail_out_aa(L, T)) → FLATTEN_IN_AA(T, Z)
FLATTEN_IN_AA(L, X) → U6_AA(L, X, head_in_aa(L, cons(U, V)))
U6_AA(L, X, head_out_aa(L, cons(U, V))) → U7_AA(L, X, U, V, tail_in_aa(L, W))
U7_AA(L, X, U, V, tail_out_aa(L, W)) → FLATTEN_IN_AA(cons(U, cons(V, W)), X)

The TRS R consists of the following rules:

head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
eq_in_aa(X, X) → eq_out_aa(X, X)
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)

The argument filtering Pi contains the following mapping:
atom(x1)  =  atom
.(x1, x2)  =  .(x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag(x2)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
FLATTEN_IN_AA(x1, x2)  =  FLATTEN_IN_AA
U2_AA(x1, x2, x3)  =  U2_AA(x3)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)
U4_AA(x1, x2, x3, x4, x5)  =  U4_AA(x5)
U6_AA(x1, x2, x3)  =  U6_AA(x3)
U7_AA(x1, x2, x3, x4, x5)  =  U7_AA(x5)

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

(82) PiDPToQDPProof (SOUND transformation)

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

(83) Obligation:

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

FLATTEN_IN_AAU2_AA(head_in_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_in_aa)
U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA

The TRS R consists of the following rules:

head_in_ag(X1) → head_out_ag(X1)
eq_in_aaeq_out_aa
tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

head_in_ag(x0)
eq_in_aa
tail_in_aa
head_in_aa

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

(84) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule FLATTEN_IN_AAU2_AA(head_in_ag(atom)) at position [0] we obtained the following new rules [LPAR04]:

FLATTEN_IN_AAU2_AA(head_out_ag(atom))

(85) Obligation:

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

U2_AA(head_out_ag(atom)) → U3_AA(eq_in_aa)
U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))

The TRS R consists of the following rules:

head_in_ag(X1) → head_out_ag(X1)
eq_in_aaeq_out_aa
tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

head_in_ag(x0)
eq_in_aa
tail_in_aa
head_in_aa

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

(86) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(87) Obligation:

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

U2_AA(head_out_ag(atom)) → U3_AA(eq_in_aa)
U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa
eq_in_aaeq_out_aa

The set Q consists of the following terms:

head_in_ag(x0)
eq_in_aa
tail_in_aa
head_in_aa

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

(88) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

head_in_ag(x0)

(89) Obligation:

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

U2_AA(head_out_ag(atom)) → U3_AA(eq_in_aa)
U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa
eq_in_aaeq_out_aa

The set Q consists of the following terms:

eq_in_aa
tail_in_aa
head_in_aa

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

(90) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule U2_AA(head_out_ag(atom)) → U3_AA(eq_in_aa) at position [0] we obtained the following new rules [LPAR04]:

U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)

(91) Obligation:

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

U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa
eq_in_aaeq_out_aa

The set Q consists of the following terms:

eq_in_aa
tail_in_aa
head_in_aa

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

(92) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(93) Obligation:

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

U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

eq_in_aa
tail_in_aa
head_in_aa

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

(94) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

eq_in_aa

(95) Obligation:

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

U3_AA(eq_out_aa) → U4_AA(tail_in_aa)
U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

tail_in_aa
head_in_aa

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

(96) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule U3_AA(eq_out_aa) → U4_AA(tail_in_aa) at position [0] we obtained the following new rules [LPAR04]:

U3_AA(eq_out_aa) → U4_AA(tail_out_aa)

(97) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU6_AA(head_in_aa)
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

tail_in_aa
head_in_aa

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

(98) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule FLATTEN_IN_AAU6_AA(head_in_aa) at position [0] we obtained the following new rules [LPAR04]:

FLATTEN_IN_AAU6_AA(head_out_aa)

(99) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa
head_in_aahead_out_aa

The set Q consists of the following terms:

tail_in_aa
head_in_aa

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

(100) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(101) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa

The set Q consists of the following terms:

tail_in_aa
head_in_aa

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

(102) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

head_in_aa

(103) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U6_AA(head_out_aa) → U7_AA(tail_in_aa)
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa

The set Q consists of the following terms:

tail_in_aa

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

(104) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule U6_AA(head_out_aa) → U7_AA(tail_in_aa) at position [0] we obtained the following new rules [LPAR04]:

U6_AA(head_out_aa) → U7_AA(tail_out_aa)

(105) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)

The TRS R consists of the following rules:

tail_in_aatail_out_aa

The set Q consists of the following terms:

tail_in_aa

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

(106) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(107) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)

R is empty.
The set Q consists of the following terms:

tail_in_aa

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

(108) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

tail_in_aa

(109) Obligation:

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

U4_AA(tail_out_aa) → FLATTEN_IN_AA
U7_AA(tail_out_aa) → FLATTEN_IN_AA
FLATTEN_IN_AAU2_AA(head_out_ag(atom))
U2_AA(head_out_ag(atom)) → U3_AA(eq_out_aa)
U3_AA(eq_out_aa) → U4_AA(tail_out_aa)
FLATTEN_IN_AAU6_AA(head_out_aa)
U6_AA(head_out_aa) → U7_AA(tail_out_aa)

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

(110) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

s = FLATTEN_IN_AA evaluates to t =FLATTEN_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Matcher: [ ]
  • Semiunifier: [ ]




Rewriting sequence

FLATTEN_IN_AAU6_AA(head_out_aa)
with rule FLATTEN_IN_AAU6_AA(head_out_aa) at position [] and matcher [ ]

U6_AA(head_out_aa)U7_AA(tail_out_aa)
with rule U6_AA(head_out_aa) → U7_AA(tail_out_aa) at position [] and matcher [ ]

U7_AA(tail_out_aa)FLATTEN_IN_AA
with rule U7_AA(tail_out_aa) → FLATTEN_IN_AA

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.



(111) FALSE

(112) Obligation:

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

FLATTEN_IN_GA(L, Y) → U2_GA(L, Y, head_in_gg(L, atom(H)))
U2_GA(L, Y, head_out_gg(L, atom(H))) → U3_GA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_GA(L, Y, H, Z, tail_in_ga(L, T))
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → FLATTEN_IN_GA(T, Z)

The TRS R consists of the following rules:

flatten_in_ga(atom(X), Y) → U1_ga(X, Y, eq_in_ag(Y, .(X, [])))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_ga(atom(X), Y)
flatten_in_ga(L, Y) → U2_ga(L, Y, head_in_gg(L, atom(H)))
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
U2_ga(L, Y, head_out_gg(L, atom(H))) → U3_ga(L, Y, H, eq_in_aa(Y, .(H, Z)))
eq_in_aa(X, X) → eq_out_aa(X, X)
U3_ga(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_ga(L, Y, H, Z, tail_in_ga(L, T))
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)
U4_ga(L, Y, H, Z, tail_out_ga(L, T)) → U5_ga(L, Y, flatten_in_ga(T, Z))
flatten_in_ga(L, X) → U6_ga(L, X, head_in_ga(L, cons(U, V)))
head_in_ga(nil, X1) → head_out_ga(nil, X1)
head_in_ga(cons(H, X2), H) → head_out_ga(cons(H, X2), H)
U6_ga(L, X, head_out_ga(L, cons(U, V))) → U7_ga(L, X, U, V, tail_in_ga(L, W))
U7_ga(L, X, U, V, tail_out_ga(L, W)) → U8_ga(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
flatten_in_aa(atom(X), Y) → U1_aa(X, Y, eq_in_ag(Y, .(X, [])))
U1_aa(X, Y, eq_out_ag(Y, .(X, []))) → flatten_out_aa(atom(X), Y)
flatten_in_aa(L, Y) → U2_aa(L, Y, head_in_ag(L, atom(H)))
head_in_ag(nil, X1) → head_out_ag(nil, X1)
head_in_ag(cons(H, X2), H) → head_out_ag(cons(H, X2), H)
U2_aa(L, Y, head_out_ag(L, atom(H))) → U3_aa(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_aa(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_aa(L, Y, H, Z, tail_in_aa(L, T))
tail_in_aa(nil, nil) → tail_out_aa(nil, nil)
tail_in_aa(cons(X3, T), T) → tail_out_aa(cons(X3, T), T)
U4_aa(L, Y, H, Z, tail_out_aa(L, T)) → U5_aa(L, Y, flatten_in_aa(T, Z))
flatten_in_aa(L, X) → U6_aa(L, X, head_in_aa(L, cons(U, V)))
head_in_aa(nil, X1) → head_out_aa(nil, X1)
head_in_aa(cons(H, X2), H) → head_out_aa(cons(H, X2), H)
U6_aa(L, X, head_out_aa(L, cons(U, V))) → U7_aa(L, X, U, V, tail_in_aa(L, W))
U7_aa(L, X, U, V, tail_out_aa(L, W)) → U8_aa(L, X, flatten_in_aa(cons(U, cons(V, W)), X))
U8_aa(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_aa(L, X)
U5_aa(L, Y, flatten_out_aa(T, Z)) → flatten_out_aa(L, Y)
U8_ga(L, X, flatten_out_aa(cons(U, cons(V, W)), X)) → flatten_out_ga(L, X)
U5_ga(L, Y, flatten_out_ga(T, Z)) → flatten_out_ga(L, Y)

The argument filtering Pi contains the following mapping:
flatten_in_ga(x1, x2)  =  flatten_in_ga(x1)
atom(x1)  =  atom
U1_ga(x1, x2, x3)  =  U1_ga(x3)
eq_in_ag(x1, x2)  =  eq_in_ag(x2)
eq_out_ag(x1, x2)  =  eq_out_ag(x1, x2)
.(x1, x2)  =  .(x2)
[]  =  []
flatten_out_ga(x1, x2)  =  flatten_out_ga(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x5)
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x1, x2)
U5_ga(x1, x2, x3)  =  U5_ga(x1, x3)
U6_ga(x1, x2, x3)  =  U6_ga(x1, x3)
head_in_ga(x1, x2)  =  head_in_ga(x1)
head_out_ga(x1, x2)  =  head_out_ga(x1)
U7_ga(x1, x2, x3, x4, x5)  =  U7_ga(x1, x5)
U8_ga(x1, x2, x3)  =  U8_ga(x1, x3)
flatten_in_aa(x1, x2)  =  flatten_in_aa
U1_aa(x1, x2, x3)  =  U1_aa(x3)
flatten_out_aa(x1, x2)  =  flatten_out_aa
U2_aa(x1, x2, x3)  =  U2_aa(x3)
head_in_ag(x1, x2)  =  head_in_ag(x2)
head_out_ag(x1, x2)  =  head_out_ag(x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5)  =  U4_aa(x5)
tail_in_aa(x1, x2)  =  tail_in_aa
tail_out_aa(x1, x2)  =  tail_out_aa
U5_aa(x1, x2, x3)  =  U5_aa(x3)
U6_aa(x1, x2, x3)  =  U6_aa(x3)
head_in_aa(x1, x2)  =  head_in_aa
head_out_aa(x1, x2)  =  head_out_aa
U7_aa(x1, x2, x3, x4, x5)  =  U7_aa(x5)
U8_aa(x1, x2, x3)  =  U8_aa(x3)
FLATTEN_IN_GA(x1, x2)  =  FLATTEN_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x5)

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

(113) UsableRulesProof (EQUIVALENT transformation)

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

(114) Obligation:

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

FLATTEN_IN_GA(L, Y) → U2_GA(L, Y, head_in_gg(L, atom(H)))
U2_GA(L, Y, head_out_gg(L, atom(H))) → U3_GA(L, Y, H, eq_in_aa(Y, .(H, Z)))
U3_GA(L, Y, H, eq_out_aa(Y, .(H, Z))) → U4_GA(L, Y, H, Z, tail_in_ga(L, T))
U4_GA(L, Y, H, Z, tail_out_ga(L, T)) → FLATTEN_IN_GA(T, Z)

The TRS R consists of the following rules:

head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
eq_in_aa(X, X) → eq_out_aa(X, X)
tail_in_ga(nil, nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T), T) → tail_out_ga(cons(X3, T), T)

The argument filtering Pi contains the following mapping:
atom(x1)  =  atom
.(x1, x2)  =  .(x2)
head_in_gg(x1, x2)  =  head_in_gg(x1, x2)
nil  =  nil
head_out_gg(x1, x2)  =  head_out_gg(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
eq_in_aa(x1, x2)  =  eq_in_aa
eq_out_aa(x1, x2)  =  eq_out_aa
tail_in_ga(x1, x2)  =  tail_in_ga(x1)
tail_out_ga(x1, x2)  =  tail_out_ga(x1, x2)
FLATTEN_IN_GA(x1, x2)  =  FLATTEN_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x5)

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

(115) PiDPToQDPProof (SOUND transformation)

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

(116) Obligation:

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

FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom))
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_in_aa)
U3_GA(L, eq_out_aa) → U4_GA(L, tail_in_ga(L))
U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)

The TRS R consists of the following rules:

head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
eq_in_aaeq_out_aa
tail_in_ga(nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T)) → tail_out_ga(cons(X3, T), T)

The set Q consists of the following terms:

head_in_gg(x0, x1)
eq_in_aa
tail_in_ga(x0)

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

(117) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_in_aa) at position [1] we obtained the following new rules [LPAR04]:

U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)

(118) Obligation:

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

FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom))
U3_GA(L, eq_out_aa) → U4_GA(L, tail_in_ga(L))
U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)

The TRS R consists of the following rules:

head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)
eq_in_aaeq_out_aa
tail_in_ga(nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T)) → tail_out_ga(cons(X3, T), T)

The set Q consists of the following terms:

head_in_gg(x0, x1)
eq_in_aa
tail_in_ga(x0)

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

(119) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(120) Obligation:

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

FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom))
U3_GA(L, eq_out_aa) → U4_GA(L, tail_in_ga(L))
U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T)) → tail_out_ga(cons(X3, T), T)
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)

The set Q consists of the following terms:

head_in_gg(x0, x1)
eq_in_aa
tail_in_ga(x0)

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

(121) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

eq_in_aa

(122) Obligation:

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

FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom))
U3_GA(L, eq_out_aa) → U4_GA(L, tail_in_ga(L))
U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T)) → tail_out_ga(cons(X3, T), T)
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)

The set Q consists of the following terms:

head_in_gg(x0, x1)
tail_in_ga(x0)

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

(123) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule FLATTEN_IN_GA(L) → U2_GA(L, head_in_gg(L, atom)) at position [1] we obtained the following new rules [LPAR04]:

FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
FLATTEN_IN_GA(cons(atom, x1)) → U2_GA(cons(atom, x1), head_out_gg(cons(atom, x1), atom))

(124) Obligation:

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

U3_GA(L, eq_out_aa) → U4_GA(L, tail_in_ga(L))
U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
FLATTEN_IN_GA(cons(atom, x1)) → U2_GA(cons(atom, x1), head_out_gg(cons(atom, x1), atom))

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T)) → tail_out_ga(cons(X3, T), T)
head_in_gg(nil, X1) → head_out_gg(nil, X1)
head_in_gg(cons(H, X2), H) → head_out_gg(cons(H, X2), H)

The set Q consists of the following terms:

head_in_gg(x0, x1)
tail_in_ga(x0)

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

(125) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(126) Obligation:

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

U3_GA(L, eq_out_aa) → U4_GA(L, tail_in_ga(L))
U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
FLATTEN_IN_GA(cons(atom, x1)) → U2_GA(cons(atom, x1), head_out_gg(cons(atom, x1), atom))

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T)) → tail_out_ga(cons(X3, T), T)

The set Q consists of the following terms:

head_in_gg(x0, x1)
tail_in_ga(x0)

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

(127) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

head_in_gg(x0, x1)

(128) Obligation:

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

U3_GA(L, eq_out_aa) → U4_GA(L, tail_in_ga(L))
U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
FLATTEN_IN_GA(cons(atom, x1)) → U2_GA(cons(atom, x1), head_out_gg(cons(atom, x1), atom))

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T)) → tail_out_ga(cons(X3, T), T)

The set Q consists of the following terms:

tail_in_ga(x0)

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

(129) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule U3_GA(L, eq_out_aa) → U4_GA(L, tail_in_ga(L)) at position [1] we obtained the following new rules [LPAR04]:

U3_GA(nil, eq_out_aa) → U4_GA(nil, tail_out_ga(nil, nil))
U3_GA(cons(x0, x1), eq_out_aa) → U4_GA(cons(x0, x1), tail_out_ga(cons(x0, x1), x1))

(130) Obligation:

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

U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
FLATTEN_IN_GA(cons(atom, x1)) → U2_GA(cons(atom, x1), head_out_gg(cons(atom, x1), atom))
U3_GA(nil, eq_out_aa) → U4_GA(nil, tail_out_ga(nil, nil))
U3_GA(cons(x0, x1), eq_out_aa) → U4_GA(cons(x0, x1), tail_out_ga(cons(x0, x1), x1))

The TRS R consists of the following rules:

tail_in_ga(nil) → tail_out_ga(nil, nil)
tail_in_ga(cons(X3, T)) → tail_out_ga(cons(X3, T), T)

The set Q consists of the following terms:

tail_in_ga(x0)

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

(131) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(132) Obligation:

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

U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
FLATTEN_IN_GA(cons(atom, x1)) → U2_GA(cons(atom, x1), head_out_gg(cons(atom, x1), atom))
U3_GA(nil, eq_out_aa) → U4_GA(nil, tail_out_ga(nil, nil))
U3_GA(cons(x0, x1), eq_out_aa) → U4_GA(cons(x0, x1), tail_out_ga(cons(x0, x1), x1))

R is empty.
The set Q consists of the following terms:

tail_in_ga(x0)

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

(133) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

tail_in_ga(x0)

(134) Obligation:

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

U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
FLATTEN_IN_GA(cons(atom, x1)) → U2_GA(cons(atom, x1), head_out_gg(cons(atom, x1), atom))
U3_GA(nil, eq_out_aa) → U4_GA(nil, tail_out_ga(nil, nil))
U3_GA(cons(x0, x1), eq_out_aa) → U4_GA(cons(x0, x1), tail_out_ga(cons(x0, x1), x1))

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

(135) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


U3_GA(cons(x0, x1), eq_out_aa) → U4_GA(cons(x0, x1), tail_out_ga(cons(x0, x1), x1))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(FLATTEN_IN_GA(x1)) = x1   
POL(U2_GA(x1, x2)) = x1   
POL(U3_GA(x1, x2)) = x1   
POL(U4_GA(x1, x2)) = x2   
POL(atom) = 1   
POL(cons(x1, x2)) = 1 + x1 + x2   
POL(eq_out_aa) = 0   
POL(head_out_gg(x1, x2)) = 0   
POL(nil) = 0   
POL(tail_out_ga(x1, x2)) = x2   

The following usable rules [FROCOS05] were oriented: none

(136) Obligation:

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

U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
FLATTEN_IN_GA(cons(atom, x1)) → U2_GA(cons(atom, x1), head_out_gg(cons(atom, x1), atom))
U3_GA(nil, eq_out_aa) → U4_GA(nil, tail_out_ga(nil, nil))

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

(137) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FLATTEN_IN_GA(cons(atom, x1)) → U2_GA(cons(atom, x1), head_out_gg(cons(atom, x1), atom))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:

POL(U4_GA(x1, x2)) = 0 +
[1,0]
·x1 +
[0,1]
·x2

POL(tail_out_ga(x1, x2)) =
/0\
\0/
+
/00\
\00/
·x1 +
/00\
\10/
·x2

POL(FLATTEN_IN_GA(x1)) = 0 +
[1,0]
·x1

POL(U2_GA(x1, x2)) = 0 +
[0,0]
·x1 +
[0,0]
·x2

POL(head_out_gg(x1, x2)) =
/0\
\0/
+
/00\
\00/
·x1 +
/00\
\00/
·x2

POL(atom) =
/0\
\0/

POL(U3_GA(x1, x2)) = 0 +
[0,0]
·x1 +
[0,0]
·x2

POL(eq_out_aa) =
/0\
\0/

POL(nil) =
/0\
\0/

POL(cons(x1, x2)) =
/1\
\0/
+
/00\
\00/
·x1 +
/00\
\00/
·x2

The following usable rules [FROCOS05] were oriented: none

(138) Obligation:

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

U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T)
U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
U3_GA(nil, eq_out_aa) → U4_GA(nil, tail_out_ga(nil, nil))

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

(139) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T) we obtained the following new rules [LPAR04]:

U4_GA(nil, tail_out_ga(nil, nil)) → FLATTEN_IN_GA(nil)

(140) Obligation:

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

U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
U3_GA(nil, eq_out_aa) → U4_GA(nil, tail_out_ga(nil, nil))
U4_GA(nil, tail_out_ga(nil, nil)) → FLATTEN_IN_GA(nil)

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

(141) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U4_GA(L, tail_out_ga(L, T)) → FLATTEN_IN_GA(T) we obtained the following new rules [LPAR04]:

U4_GA(nil, tail_out_ga(nil, nil)) → FLATTEN_IN_GA(nil)

(142) Obligation:

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

U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa)
FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
U3_GA(nil, eq_out_aa) → U4_GA(nil, tail_out_ga(nil, nil))
U4_GA(nil, tail_out_ga(nil, nil)) → FLATTEN_IN_GA(nil)

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

(143) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U2_GA(L, head_out_gg(L, atom)) → U3_GA(L, eq_out_aa) we obtained the following new rules [LPAR04]:

U2_GA(nil, head_out_gg(nil, atom)) → U3_GA(nil, eq_out_aa)

(144) Obligation:

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

FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))
U3_GA(nil, eq_out_aa) → U4_GA(nil, tail_out_ga(nil, nil))
U4_GA(nil, tail_out_ga(nil, nil)) → FLATTEN_IN_GA(nil)
U2_GA(nil, head_out_gg(nil, atom)) → U3_GA(nil, eq_out_aa)

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

(145) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

s = U2_GA(nil, head_out_gg(nil, atom)) evaluates to t =U2_GA(nil, head_out_gg(nil, atom))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Matcher: [ ]
  • Semiunifier: [ ]




Rewriting sequence

U2_GA(nil, head_out_gg(nil, atom))U3_GA(nil, eq_out_aa)
with rule U2_GA(nil, head_out_gg(nil, atom)) → U3_GA(nil, eq_out_aa) at position [] and matcher [ ]

U3_GA(nil, eq_out_aa)U4_GA(nil, tail_out_ga(nil, nil))
with rule U3_GA(nil, eq_out_aa) → U4_GA(nil, tail_out_ga(nil, nil)) at position [] and matcher [ ]

U4_GA(nil, tail_out_ga(nil, nil))FLATTEN_IN_GA(nil)
with rule U4_GA(nil, tail_out_ga(nil, nil)) → FLATTEN_IN_GA(nil) at position [] and matcher [ ]

FLATTEN_IN_GA(nil)U2_GA(nil, head_out_gg(nil, atom))
with rule FLATTEN_IN_GA(nil) → U2_GA(nil, head_out_gg(nil, atom))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.



(146) FALSE