(0) Obligation:

Clauses:

flatten(atom(X), .(X, [])).
flatten(cons(atom(X), U), .(X, Y)) :- flatten(U, Y).
flatten(cons(cons(U, V), W), X) :- flatten(cons(U, cons(V, W)), X).
count(atom(X), s(0)).
count(cons(atom(X), Y), s(Z)) :- count(Y, Z).
count(cons(cons(U, V), W), Z) :- ','(flatten(cons(cons(U, V), W), X), count(X, Z)).

Query: count(g,a)

(1) PrologToPiTRSViaGraphTransformerProof (SOUND transformation)

Transformed Prolog program to (Pi-)TRS.

(2) Obligation:

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

countA_in_ga(atom(T4), s(0)) → countA_out_ga(atom(T4), s(0))
countA_in_ga(cons(atom(T8), atom(T16)), s(s(0))) → countA_out_ga(cons(atom(T8), atom(T16)), s(s(0)))
countA_in_ga(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → U1_ga(T8, T29, T30, T32, countA_in_ga(T30, T32))
countA_in_ga(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → U2_ga(T8, T51, T52, T53, T55, pB_in_gggaa(T51, T52, T53, X60, T55))
pB_in_gggaa(T51, T52, T53, T56, T55) → U10_gggaa(T51, T52, T53, T56, T55, flattenF_in_ggga(T51, T52, T53, T56))
flattenF_in_ggga(T63, T64, T65, X85) → U9_ggga(T63, T64, T65, X85, flattenE_in_ggga(T63, T64, T65, X85))
flattenE_in_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → U6_ggga(T78, T89, T90, X131, flattenD_in_ga(T90, X131))
flattenD_in_ga(atom(T97), .(T97, [])) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107), .(T106, X158)) → U4_ga(T106, T107, X158, flattenD_in_ga(T107, X158))
flattenD_in_ga(cons(cons(T116, T117), T118), X175) → U5_ga(T116, T117, T118, X175, flattenE_in_ggga(T116, T117, T118, X175))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192)) → U7_ggga(T78, T125, T126, T127, X192, flattenE_in_ggga(T125, T126, T127, X192))
flattenE_in_ggga(cons(T136, T137), T138, T139, X209) → U8_ggga(T136, T137, T138, T139, X209, flattenE_in_ggga(T136, T137, cons(T138, T139), X209))
U8_ggga(T136, T137, T138, T139, X209, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
U7_ggga(T78, T125, T126, T127, X192, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
U5_ga(T116, T117, T118, X175, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)
U4_ga(T106, T107, X158, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))
U6_ggga(T78, T89, T90, X131, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U9_ggga(T63, T64, T65, X85, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U10_gggaa(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → U11_gggaa(T51, T52, T53, T56, T55, countA_in_ga(T56, T55))
countA_in_ga(cons(cons(T157, T158), T159), T150) → U3_ga(T157, T158, T159, T150, pC_in_gggaa(T157, T158, T159, X247, T150))
pC_in_gggaa(T157, T158, T159, T160, T150) → U12_gggaa(T157, T158, T159, T160, T150, flattenE_in_ggga(T157, T158, T159, T160))
U12_gggaa(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → U13_gggaa(T157, T158, T159, T160, T150, countA_in_ga(T160, T150))
U13_gggaa(T157, T158, T159, T160, T150, countA_out_ga(T160, T150)) → pC_out_gggaa(T157, T158, T159, T160, T150)
U3_ga(T157, T158, T159, T150, pC_out_gggaa(T157, T158, T159, X247, T150)) → countA_out_ga(cons(cons(T157, T158), T159), T150)
U11_gggaa(T51, T52, T53, T56, T55, countA_out_ga(T56, T55)) → pB_out_gggaa(T51, T52, T53, T56, T55)
U2_ga(T8, T51, T52, T53, T55, pB_out_gggaa(T51, T52, T53, X60, T55)) → countA_out_ga(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55))
U1_ga(T8, T29, T30, T32, countA_out_ga(T30, T32)) → countA_out_ga(cons(atom(T8), cons(atom(T29), T30)), s(s(T32)))

The argument filtering Pi contains the following mapping:
countA_in_ga(x1, x2)  =  countA_in_ga(x1)
atom(x1)  =  atom(x1)
countA_out_ga(x1, x2)  =  countA_out_ga(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x4, x6)
pB_in_gggaa(x1, x2, x3, x4, x5)  =  pB_in_gggaa(x1, x2, x3)
U10_gggaa(x1, x2, x3, x4, x5, x6)  =  U10_gggaa(x1, x2, x3, x6)
flattenF_in_ggga(x1, x2, x3, x4)  =  flattenF_in_ggga(x1, x2, x3)
U9_ggga(x1, x2, x3, x4, x5)  =  U9_ggga(x1, x2, x3, x5)
flattenE_in_ggga(x1, x2, x3, x4)  =  flattenE_in_ggga(x1, x2, x3)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
flattenD_in_ga(x1, x2)  =  flattenD_in_ga(x1)
flattenD_out_ga(x1, x2)  =  flattenD_out_ga(x1, x2)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x1, x2, x4)
U5_ga(x1, x2, x3, x4, x5)  =  U5_ga(x1, x2, x3, x5)
U7_ggga(x1, x2, x3, x4, x5, x6)  =  U7_ggga(x1, x2, x3, x4, x6)
U8_ggga(x1, x2, x3, x4, x5, x6)  =  U8_ggga(x1, x2, x3, x4, x6)
flattenE_out_ggga(x1, x2, x3, x4)  =  flattenE_out_ggga(x1, x2, x3, x4)
flattenF_out_ggga(x1, x2, x3, x4)  =  flattenF_out_ggga(x1, x2, x3, x4)
U11_gggaa(x1, x2, x3, x4, x5, x6)  =  U11_gggaa(x1, x2, x3, x4, x6)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x2, x3, x5)
pC_in_gggaa(x1, x2, x3, x4, x5)  =  pC_in_gggaa(x1, x2, x3)
U12_gggaa(x1, x2, x3, x4, x5, x6)  =  U12_gggaa(x1, x2, x3, x6)
U13_gggaa(x1, x2, x3, x4, x5, x6)  =  U13_gggaa(x1, x2, x3, x4, x6)
pC_out_gggaa(x1, x2, x3, x4, x5)  =  pC_out_gggaa(x1, x2, x3, x4, x5)
pB_out_gggaa(x1, x2, x3, x4, x5)  =  pB_out_gggaa(x1, x2, x3, x4, x5)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)

(3) DependencyPairsProof (EQUIVALENT transformation)

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

COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → U1_GA(T8, T29, T30, T32, countA_in_ga(T30, T32))
COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → COUNTA_IN_GA(T30, T32)
COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → U2_GA(T8, T51, T52, T53, T55, pB_in_gggaa(T51, T52, T53, X60, T55))
COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → PB_IN_GGGAA(T51, T52, T53, X60, T55)
PB_IN_GGGAA(T51, T52, T53, T56, T55) → U10_GGGAA(T51, T52, T53, T56, T55, flattenF_in_ggga(T51, T52, T53, T56))
PB_IN_GGGAA(T51, T52, T53, T56, T55) → FLATTENF_IN_GGGA(T51, T52, T53, T56)
FLATTENF_IN_GGGA(T63, T64, T65, X85) → U9_GGGA(T63, T64, T65, X85, flattenE_in_ggga(T63, T64, T65, X85))
FLATTENF_IN_GGGA(T63, T64, T65, X85) → FLATTENE_IN_GGGA(T63, T64, T65, X85)
FLATTENE_IN_GGGA(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → U6_GGGA(T78, T89, T90, X131, flattenD_in_ga(T90, X131))
FLATTENE_IN_GGGA(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → FLATTEND_IN_GA(T90, X131)
FLATTEND_IN_GA(cons(atom(T106), T107), .(T106, X158)) → U4_GA(T106, T107, X158, flattenD_in_ga(T107, X158))
FLATTEND_IN_GA(cons(atom(T106), T107), .(T106, X158)) → FLATTEND_IN_GA(T107, X158)
FLATTEND_IN_GA(cons(cons(T116, T117), T118), X175) → U5_GA(T116, T117, T118, X175, flattenE_in_ggga(T116, T117, T118, X175))
FLATTEND_IN_GA(cons(cons(T116, T117), T118), X175) → FLATTENE_IN_GGGA(T116, T117, T118, X175)
FLATTENE_IN_GGGA(atom(T78), cons(T125, T126), T127, .(T78, X192)) → U7_GGGA(T78, T125, T126, T127, X192, flattenE_in_ggga(T125, T126, T127, X192))
FLATTENE_IN_GGGA(atom(T78), cons(T125, T126), T127, .(T78, X192)) → FLATTENE_IN_GGGA(T125, T126, T127, X192)
FLATTENE_IN_GGGA(cons(T136, T137), T138, T139, X209) → U8_GGGA(T136, T137, T138, T139, X209, flattenE_in_ggga(T136, T137, cons(T138, T139), X209))
FLATTENE_IN_GGGA(cons(T136, T137), T138, T139, X209) → FLATTENE_IN_GGGA(T136, T137, cons(T138, T139), X209)
U10_GGGAA(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → U11_GGGAA(T51, T52, T53, T56, T55, countA_in_ga(T56, T55))
U10_GGGAA(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → COUNTA_IN_GA(T56, T55)
COUNTA_IN_GA(cons(cons(T157, T158), T159), T150) → U3_GA(T157, T158, T159, T150, pC_in_gggaa(T157, T158, T159, X247, T150))
COUNTA_IN_GA(cons(cons(T157, T158), T159), T150) → PC_IN_GGGAA(T157, T158, T159, X247, T150)
PC_IN_GGGAA(T157, T158, T159, T160, T150) → U12_GGGAA(T157, T158, T159, T160, T150, flattenE_in_ggga(T157, T158, T159, T160))
PC_IN_GGGAA(T157, T158, T159, T160, T150) → FLATTENE_IN_GGGA(T157, T158, T159, T160)
U12_GGGAA(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → U13_GGGAA(T157, T158, T159, T160, T150, countA_in_ga(T160, T150))
U12_GGGAA(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → COUNTA_IN_GA(T160, T150)

The TRS R consists of the following rules:

countA_in_ga(atom(T4), s(0)) → countA_out_ga(atom(T4), s(0))
countA_in_ga(cons(atom(T8), atom(T16)), s(s(0))) → countA_out_ga(cons(atom(T8), atom(T16)), s(s(0)))
countA_in_ga(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → U1_ga(T8, T29, T30, T32, countA_in_ga(T30, T32))
countA_in_ga(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → U2_ga(T8, T51, T52, T53, T55, pB_in_gggaa(T51, T52, T53, X60, T55))
pB_in_gggaa(T51, T52, T53, T56, T55) → U10_gggaa(T51, T52, T53, T56, T55, flattenF_in_ggga(T51, T52, T53, T56))
flattenF_in_ggga(T63, T64, T65, X85) → U9_ggga(T63, T64, T65, X85, flattenE_in_ggga(T63, T64, T65, X85))
flattenE_in_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → U6_ggga(T78, T89, T90, X131, flattenD_in_ga(T90, X131))
flattenD_in_ga(atom(T97), .(T97, [])) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107), .(T106, X158)) → U4_ga(T106, T107, X158, flattenD_in_ga(T107, X158))
flattenD_in_ga(cons(cons(T116, T117), T118), X175) → U5_ga(T116, T117, T118, X175, flattenE_in_ggga(T116, T117, T118, X175))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192)) → U7_ggga(T78, T125, T126, T127, X192, flattenE_in_ggga(T125, T126, T127, X192))
flattenE_in_ggga(cons(T136, T137), T138, T139, X209) → U8_ggga(T136, T137, T138, T139, X209, flattenE_in_ggga(T136, T137, cons(T138, T139), X209))
U8_ggga(T136, T137, T138, T139, X209, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
U7_ggga(T78, T125, T126, T127, X192, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
U5_ga(T116, T117, T118, X175, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)
U4_ga(T106, T107, X158, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))
U6_ggga(T78, T89, T90, X131, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U9_ggga(T63, T64, T65, X85, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U10_gggaa(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → U11_gggaa(T51, T52, T53, T56, T55, countA_in_ga(T56, T55))
countA_in_ga(cons(cons(T157, T158), T159), T150) → U3_ga(T157, T158, T159, T150, pC_in_gggaa(T157, T158, T159, X247, T150))
pC_in_gggaa(T157, T158, T159, T160, T150) → U12_gggaa(T157, T158, T159, T160, T150, flattenE_in_ggga(T157, T158, T159, T160))
U12_gggaa(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → U13_gggaa(T157, T158, T159, T160, T150, countA_in_ga(T160, T150))
U13_gggaa(T157, T158, T159, T160, T150, countA_out_ga(T160, T150)) → pC_out_gggaa(T157, T158, T159, T160, T150)
U3_ga(T157, T158, T159, T150, pC_out_gggaa(T157, T158, T159, X247, T150)) → countA_out_ga(cons(cons(T157, T158), T159), T150)
U11_gggaa(T51, T52, T53, T56, T55, countA_out_ga(T56, T55)) → pB_out_gggaa(T51, T52, T53, T56, T55)
U2_ga(T8, T51, T52, T53, T55, pB_out_gggaa(T51, T52, T53, X60, T55)) → countA_out_ga(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55))
U1_ga(T8, T29, T30, T32, countA_out_ga(T30, T32)) → countA_out_ga(cons(atom(T8), cons(atom(T29), T30)), s(s(T32)))

The argument filtering Pi contains the following mapping:
countA_in_ga(x1, x2)  =  countA_in_ga(x1)
atom(x1)  =  atom(x1)
countA_out_ga(x1, x2)  =  countA_out_ga(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x4, x6)
pB_in_gggaa(x1, x2, x3, x4, x5)  =  pB_in_gggaa(x1, x2, x3)
U10_gggaa(x1, x2, x3, x4, x5, x6)  =  U10_gggaa(x1, x2, x3, x6)
flattenF_in_ggga(x1, x2, x3, x4)  =  flattenF_in_ggga(x1, x2, x3)
U9_ggga(x1, x2, x3, x4, x5)  =  U9_ggga(x1, x2, x3, x5)
flattenE_in_ggga(x1, x2, x3, x4)  =  flattenE_in_ggga(x1, x2, x3)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
flattenD_in_ga(x1, x2)  =  flattenD_in_ga(x1)
flattenD_out_ga(x1, x2)  =  flattenD_out_ga(x1, x2)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x1, x2, x4)
U5_ga(x1, x2, x3, x4, x5)  =  U5_ga(x1, x2, x3, x5)
U7_ggga(x1, x2, x3, x4, x5, x6)  =  U7_ggga(x1, x2, x3, x4, x6)
U8_ggga(x1, x2, x3, x4, x5, x6)  =  U8_ggga(x1, x2, x3, x4, x6)
flattenE_out_ggga(x1, x2, x3, x4)  =  flattenE_out_ggga(x1, x2, x3, x4)
flattenF_out_ggga(x1, x2, x3, x4)  =  flattenF_out_ggga(x1, x2, x3, x4)
U11_gggaa(x1, x2, x3, x4, x5, x6)  =  U11_gggaa(x1, x2, x3, x4, x6)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x2, x3, x5)
pC_in_gggaa(x1, x2, x3, x4, x5)  =  pC_in_gggaa(x1, x2, x3)
U12_gggaa(x1, x2, x3, x4, x5, x6)  =  U12_gggaa(x1, x2, x3, x6)
U13_gggaa(x1, x2, x3, x4, x5, x6)  =  U13_gggaa(x1, x2, x3, x4, x6)
pC_out_gggaa(x1, x2, x3, x4, x5)  =  pC_out_gggaa(x1, x2, x3, x4, x5)
pB_out_gggaa(x1, x2, x3, x4, x5)  =  pB_out_gggaa(x1, x2, x3, x4, x5)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
COUNTA_IN_GA(x1, x2)  =  COUNTA_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x1, x2, x3, x4, x6)
PB_IN_GGGAA(x1, x2, x3, x4, x5)  =  PB_IN_GGGAA(x1, x2, x3)
U10_GGGAA(x1, x2, x3, x4, x5, x6)  =  U10_GGGAA(x1, x2, x3, x6)
FLATTENF_IN_GGGA(x1, x2, x3, x4)  =  FLATTENF_IN_GGGA(x1, x2, x3)
U9_GGGA(x1, x2, x3, x4, x5)  =  U9_GGGA(x1, x2, x3, x5)
FLATTENE_IN_GGGA(x1, x2, x3, x4)  =  FLATTENE_IN_GGGA(x1, x2, x3)
U6_GGGA(x1, x2, x3, x4, x5)  =  U6_GGGA(x1, x2, x3, x5)
FLATTEND_IN_GA(x1, x2)  =  FLATTEND_IN_GA(x1)
U4_GA(x1, x2, x3, x4)  =  U4_GA(x1, x2, x4)
U5_GA(x1, x2, x3, x4, x5)  =  U5_GA(x1, x2, x3, x5)
U7_GGGA(x1, x2, x3, x4, x5, x6)  =  U7_GGGA(x1, x2, x3, x4, x6)
U8_GGGA(x1, x2, x3, x4, x5, x6)  =  U8_GGGA(x1, x2, x3, x4, x6)
U11_GGGAA(x1, x2, x3, x4, x5, x6)  =  U11_GGGAA(x1, x2, x3, x4, x6)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x1, x2, x3, x5)
PC_IN_GGGAA(x1, x2, x3, x4, x5)  =  PC_IN_GGGAA(x1, x2, x3)
U12_GGGAA(x1, x2, x3, x4, x5, x6)  =  U12_GGGAA(x1, x2, x3, x6)
U13_GGGAA(x1, x2, x3, x4, x5, x6)  =  U13_GGGAA(x1, x2, x3, x4, x6)

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

(4) Obligation:

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

COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → U1_GA(T8, T29, T30, T32, countA_in_ga(T30, T32))
COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → COUNTA_IN_GA(T30, T32)
COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → U2_GA(T8, T51, T52, T53, T55, pB_in_gggaa(T51, T52, T53, X60, T55))
COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → PB_IN_GGGAA(T51, T52, T53, X60, T55)
PB_IN_GGGAA(T51, T52, T53, T56, T55) → U10_GGGAA(T51, T52, T53, T56, T55, flattenF_in_ggga(T51, T52, T53, T56))
PB_IN_GGGAA(T51, T52, T53, T56, T55) → FLATTENF_IN_GGGA(T51, T52, T53, T56)
FLATTENF_IN_GGGA(T63, T64, T65, X85) → U9_GGGA(T63, T64, T65, X85, flattenE_in_ggga(T63, T64, T65, X85))
FLATTENF_IN_GGGA(T63, T64, T65, X85) → FLATTENE_IN_GGGA(T63, T64, T65, X85)
FLATTENE_IN_GGGA(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → U6_GGGA(T78, T89, T90, X131, flattenD_in_ga(T90, X131))
FLATTENE_IN_GGGA(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → FLATTEND_IN_GA(T90, X131)
FLATTEND_IN_GA(cons(atom(T106), T107), .(T106, X158)) → U4_GA(T106, T107, X158, flattenD_in_ga(T107, X158))
FLATTEND_IN_GA(cons(atom(T106), T107), .(T106, X158)) → FLATTEND_IN_GA(T107, X158)
FLATTEND_IN_GA(cons(cons(T116, T117), T118), X175) → U5_GA(T116, T117, T118, X175, flattenE_in_ggga(T116, T117, T118, X175))
FLATTEND_IN_GA(cons(cons(T116, T117), T118), X175) → FLATTENE_IN_GGGA(T116, T117, T118, X175)
FLATTENE_IN_GGGA(atom(T78), cons(T125, T126), T127, .(T78, X192)) → U7_GGGA(T78, T125, T126, T127, X192, flattenE_in_ggga(T125, T126, T127, X192))
FLATTENE_IN_GGGA(atom(T78), cons(T125, T126), T127, .(T78, X192)) → FLATTENE_IN_GGGA(T125, T126, T127, X192)
FLATTENE_IN_GGGA(cons(T136, T137), T138, T139, X209) → U8_GGGA(T136, T137, T138, T139, X209, flattenE_in_ggga(T136, T137, cons(T138, T139), X209))
FLATTENE_IN_GGGA(cons(T136, T137), T138, T139, X209) → FLATTENE_IN_GGGA(T136, T137, cons(T138, T139), X209)
U10_GGGAA(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → U11_GGGAA(T51, T52, T53, T56, T55, countA_in_ga(T56, T55))
U10_GGGAA(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → COUNTA_IN_GA(T56, T55)
COUNTA_IN_GA(cons(cons(T157, T158), T159), T150) → U3_GA(T157, T158, T159, T150, pC_in_gggaa(T157, T158, T159, X247, T150))
COUNTA_IN_GA(cons(cons(T157, T158), T159), T150) → PC_IN_GGGAA(T157, T158, T159, X247, T150)
PC_IN_GGGAA(T157, T158, T159, T160, T150) → U12_GGGAA(T157, T158, T159, T160, T150, flattenE_in_ggga(T157, T158, T159, T160))
PC_IN_GGGAA(T157, T158, T159, T160, T150) → FLATTENE_IN_GGGA(T157, T158, T159, T160)
U12_GGGAA(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → U13_GGGAA(T157, T158, T159, T160, T150, countA_in_ga(T160, T150))
U12_GGGAA(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → COUNTA_IN_GA(T160, T150)

The TRS R consists of the following rules:

countA_in_ga(atom(T4), s(0)) → countA_out_ga(atom(T4), s(0))
countA_in_ga(cons(atom(T8), atom(T16)), s(s(0))) → countA_out_ga(cons(atom(T8), atom(T16)), s(s(0)))
countA_in_ga(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → U1_ga(T8, T29, T30, T32, countA_in_ga(T30, T32))
countA_in_ga(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → U2_ga(T8, T51, T52, T53, T55, pB_in_gggaa(T51, T52, T53, X60, T55))
pB_in_gggaa(T51, T52, T53, T56, T55) → U10_gggaa(T51, T52, T53, T56, T55, flattenF_in_ggga(T51, T52, T53, T56))
flattenF_in_ggga(T63, T64, T65, X85) → U9_ggga(T63, T64, T65, X85, flattenE_in_ggga(T63, T64, T65, X85))
flattenE_in_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → U6_ggga(T78, T89, T90, X131, flattenD_in_ga(T90, X131))
flattenD_in_ga(atom(T97), .(T97, [])) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107), .(T106, X158)) → U4_ga(T106, T107, X158, flattenD_in_ga(T107, X158))
flattenD_in_ga(cons(cons(T116, T117), T118), X175) → U5_ga(T116, T117, T118, X175, flattenE_in_ggga(T116, T117, T118, X175))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192)) → U7_ggga(T78, T125, T126, T127, X192, flattenE_in_ggga(T125, T126, T127, X192))
flattenE_in_ggga(cons(T136, T137), T138, T139, X209) → U8_ggga(T136, T137, T138, T139, X209, flattenE_in_ggga(T136, T137, cons(T138, T139), X209))
U8_ggga(T136, T137, T138, T139, X209, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
U7_ggga(T78, T125, T126, T127, X192, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
U5_ga(T116, T117, T118, X175, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)
U4_ga(T106, T107, X158, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))
U6_ggga(T78, T89, T90, X131, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U9_ggga(T63, T64, T65, X85, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U10_gggaa(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → U11_gggaa(T51, T52, T53, T56, T55, countA_in_ga(T56, T55))
countA_in_ga(cons(cons(T157, T158), T159), T150) → U3_ga(T157, T158, T159, T150, pC_in_gggaa(T157, T158, T159, X247, T150))
pC_in_gggaa(T157, T158, T159, T160, T150) → U12_gggaa(T157, T158, T159, T160, T150, flattenE_in_ggga(T157, T158, T159, T160))
U12_gggaa(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → U13_gggaa(T157, T158, T159, T160, T150, countA_in_ga(T160, T150))
U13_gggaa(T157, T158, T159, T160, T150, countA_out_ga(T160, T150)) → pC_out_gggaa(T157, T158, T159, T160, T150)
U3_ga(T157, T158, T159, T150, pC_out_gggaa(T157, T158, T159, X247, T150)) → countA_out_ga(cons(cons(T157, T158), T159), T150)
U11_gggaa(T51, T52, T53, T56, T55, countA_out_ga(T56, T55)) → pB_out_gggaa(T51, T52, T53, T56, T55)
U2_ga(T8, T51, T52, T53, T55, pB_out_gggaa(T51, T52, T53, X60, T55)) → countA_out_ga(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55))
U1_ga(T8, T29, T30, T32, countA_out_ga(T30, T32)) → countA_out_ga(cons(atom(T8), cons(atom(T29), T30)), s(s(T32)))

The argument filtering Pi contains the following mapping:
countA_in_ga(x1, x2)  =  countA_in_ga(x1)
atom(x1)  =  atom(x1)
countA_out_ga(x1, x2)  =  countA_out_ga(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x4, x6)
pB_in_gggaa(x1, x2, x3, x4, x5)  =  pB_in_gggaa(x1, x2, x3)
U10_gggaa(x1, x2, x3, x4, x5, x6)  =  U10_gggaa(x1, x2, x3, x6)
flattenF_in_ggga(x1, x2, x3, x4)  =  flattenF_in_ggga(x1, x2, x3)
U9_ggga(x1, x2, x3, x4, x5)  =  U9_ggga(x1, x2, x3, x5)
flattenE_in_ggga(x1, x2, x3, x4)  =  flattenE_in_ggga(x1, x2, x3)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
flattenD_in_ga(x1, x2)  =  flattenD_in_ga(x1)
flattenD_out_ga(x1, x2)  =  flattenD_out_ga(x1, x2)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x1, x2, x4)
U5_ga(x1, x2, x3, x4, x5)  =  U5_ga(x1, x2, x3, x5)
U7_ggga(x1, x2, x3, x4, x5, x6)  =  U7_ggga(x1, x2, x3, x4, x6)
U8_ggga(x1, x2, x3, x4, x5, x6)  =  U8_ggga(x1, x2, x3, x4, x6)
flattenE_out_ggga(x1, x2, x3, x4)  =  flattenE_out_ggga(x1, x2, x3, x4)
flattenF_out_ggga(x1, x2, x3, x4)  =  flattenF_out_ggga(x1, x2, x3, x4)
U11_gggaa(x1, x2, x3, x4, x5, x6)  =  U11_gggaa(x1, x2, x3, x4, x6)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x2, x3, x5)
pC_in_gggaa(x1, x2, x3, x4, x5)  =  pC_in_gggaa(x1, x2, x3)
U12_gggaa(x1, x2, x3, x4, x5, x6)  =  U12_gggaa(x1, x2, x3, x6)
U13_gggaa(x1, x2, x3, x4, x5, x6)  =  U13_gggaa(x1, x2, x3, x4, x6)
pC_out_gggaa(x1, x2, x3, x4, x5)  =  pC_out_gggaa(x1, x2, x3, x4, x5)
pB_out_gggaa(x1, x2, x3, x4, x5)  =  pB_out_gggaa(x1, x2, x3, x4, x5)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
COUNTA_IN_GA(x1, x2)  =  COUNTA_IN_GA(x1)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x1, x2, x3, x4, x6)
PB_IN_GGGAA(x1, x2, x3, x4, x5)  =  PB_IN_GGGAA(x1, x2, x3)
U10_GGGAA(x1, x2, x3, x4, x5, x6)  =  U10_GGGAA(x1, x2, x3, x6)
FLATTENF_IN_GGGA(x1, x2, x3, x4)  =  FLATTENF_IN_GGGA(x1, x2, x3)
U9_GGGA(x1, x2, x3, x4, x5)  =  U9_GGGA(x1, x2, x3, x5)
FLATTENE_IN_GGGA(x1, x2, x3, x4)  =  FLATTENE_IN_GGGA(x1, x2, x3)
U6_GGGA(x1, x2, x3, x4, x5)  =  U6_GGGA(x1, x2, x3, x5)
FLATTEND_IN_GA(x1, x2)  =  FLATTEND_IN_GA(x1)
U4_GA(x1, x2, x3, x4)  =  U4_GA(x1, x2, x4)
U5_GA(x1, x2, x3, x4, x5)  =  U5_GA(x1, x2, x3, x5)
U7_GGGA(x1, x2, x3, x4, x5, x6)  =  U7_GGGA(x1, x2, x3, x4, x6)
U8_GGGA(x1, x2, x3, x4, x5, x6)  =  U8_GGGA(x1, x2, x3, x4, x6)
U11_GGGAA(x1, x2, x3, x4, x5, x6)  =  U11_GGGAA(x1, x2, x3, x4, x6)
U3_GA(x1, x2, x3, x4, x5)  =  U3_GA(x1, x2, x3, x5)
PC_IN_GGGAA(x1, x2, x3, x4, x5)  =  PC_IN_GGGAA(x1, x2, x3)
U12_GGGAA(x1, x2, x3, x4, x5, x6)  =  U12_GGGAA(x1, x2, x3, x6)
U13_GGGAA(x1, x2, x3, x4, x5, x6)  =  U13_GGGAA(x1, x2, x3, x4, x6)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

FLATTENE_IN_GGGA(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → FLATTEND_IN_GA(T90, X131)
FLATTEND_IN_GA(cons(atom(T106), T107), .(T106, X158)) → FLATTEND_IN_GA(T107, X158)
FLATTEND_IN_GA(cons(cons(T116, T117), T118), X175) → FLATTENE_IN_GGGA(T116, T117, T118, X175)
FLATTENE_IN_GGGA(atom(T78), cons(T125, T126), T127, .(T78, X192)) → FLATTENE_IN_GGGA(T125, T126, T127, X192)
FLATTENE_IN_GGGA(cons(T136, T137), T138, T139, X209) → FLATTENE_IN_GGGA(T136, T137, cons(T138, T139), X209)

The TRS R consists of the following rules:

countA_in_ga(atom(T4), s(0)) → countA_out_ga(atom(T4), s(0))
countA_in_ga(cons(atom(T8), atom(T16)), s(s(0))) → countA_out_ga(cons(atom(T8), atom(T16)), s(s(0)))
countA_in_ga(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → U1_ga(T8, T29, T30, T32, countA_in_ga(T30, T32))
countA_in_ga(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → U2_ga(T8, T51, T52, T53, T55, pB_in_gggaa(T51, T52, T53, X60, T55))
pB_in_gggaa(T51, T52, T53, T56, T55) → U10_gggaa(T51, T52, T53, T56, T55, flattenF_in_ggga(T51, T52, T53, T56))
flattenF_in_ggga(T63, T64, T65, X85) → U9_ggga(T63, T64, T65, X85, flattenE_in_ggga(T63, T64, T65, X85))
flattenE_in_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → U6_ggga(T78, T89, T90, X131, flattenD_in_ga(T90, X131))
flattenD_in_ga(atom(T97), .(T97, [])) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107), .(T106, X158)) → U4_ga(T106, T107, X158, flattenD_in_ga(T107, X158))
flattenD_in_ga(cons(cons(T116, T117), T118), X175) → U5_ga(T116, T117, T118, X175, flattenE_in_ggga(T116, T117, T118, X175))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192)) → U7_ggga(T78, T125, T126, T127, X192, flattenE_in_ggga(T125, T126, T127, X192))
flattenE_in_ggga(cons(T136, T137), T138, T139, X209) → U8_ggga(T136, T137, T138, T139, X209, flattenE_in_ggga(T136, T137, cons(T138, T139), X209))
U8_ggga(T136, T137, T138, T139, X209, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
U7_ggga(T78, T125, T126, T127, X192, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
U5_ga(T116, T117, T118, X175, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)
U4_ga(T106, T107, X158, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))
U6_ggga(T78, T89, T90, X131, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U9_ggga(T63, T64, T65, X85, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U10_gggaa(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → U11_gggaa(T51, T52, T53, T56, T55, countA_in_ga(T56, T55))
countA_in_ga(cons(cons(T157, T158), T159), T150) → U3_ga(T157, T158, T159, T150, pC_in_gggaa(T157, T158, T159, X247, T150))
pC_in_gggaa(T157, T158, T159, T160, T150) → U12_gggaa(T157, T158, T159, T160, T150, flattenE_in_ggga(T157, T158, T159, T160))
U12_gggaa(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → U13_gggaa(T157, T158, T159, T160, T150, countA_in_ga(T160, T150))
U13_gggaa(T157, T158, T159, T160, T150, countA_out_ga(T160, T150)) → pC_out_gggaa(T157, T158, T159, T160, T150)
U3_ga(T157, T158, T159, T150, pC_out_gggaa(T157, T158, T159, X247, T150)) → countA_out_ga(cons(cons(T157, T158), T159), T150)
U11_gggaa(T51, T52, T53, T56, T55, countA_out_ga(T56, T55)) → pB_out_gggaa(T51, T52, T53, T56, T55)
U2_ga(T8, T51, T52, T53, T55, pB_out_gggaa(T51, T52, T53, X60, T55)) → countA_out_ga(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55))
U1_ga(T8, T29, T30, T32, countA_out_ga(T30, T32)) → countA_out_ga(cons(atom(T8), cons(atom(T29), T30)), s(s(T32)))

The argument filtering Pi contains the following mapping:
countA_in_ga(x1, x2)  =  countA_in_ga(x1)
atom(x1)  =  atom(x1)
countA_out_ga(x1, x2)  =  countA_out_ga(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x4, x6)
pB_in_gggaa(x1, x2, x3, x4, x5)  =  pB_in_gggaa(x1, x2, x3)
U10_gggaa(x1, x2, x3, x4, x5, x6)  =  U10_gggaa(x1, x2, x3, x6)
flattenF_in_ggga(x1, x2, x3, x4)  =  flattenF_in_ggga(x1, x2, x3)
U9_ggga(x1, x2, x3, x4, x5)  =  U9_ggga(x1, x2, x3, x5)
flattenE_in_ggga(x1, x2, x3, x4)  =  flattenE_in_ggga(x1, x2, x3)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
flattenD_in_ga(x1, x2)  =  flattenD_in_ga(x1)
flattenD_out_ga(x1, x2)  =  flattenD_out_ga(x1, x2)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x1, x2, x4)
U5_ga(x1, x2, x3, x4, x5)  =  U5_ga(x1, x2, x3, x5)
U7_ggga(x1, x2, x3, x4, x5, x6)  =  U7_ggga(x1, x2, x3, x4, x6)
U8_ggga(x1, x2, x3, x4, x5, x6)  =  U8_ggga(x1, x2, x3, x4, x6)
flattenE_out_ggga(x1, x2, x3, x4)  =  flattenE_out_ggga(x1, x2, x3, x4)
flattenF_out_ggga(x1, x2, x3, x4)  =  flattenF_out_ggga(x1, x2, x3, x4)
U11_gggaa(x1, x2, x3, x4, x5, x6)  =  U11_gggaa(x1, x2, x3, x4, x6)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x2, x3, x5)
pC_in_gggaa(x1, x2, x3, x4, x5)  =  pC_in_gggaa(x1, x2, x3)
U12_gggaa(x1, x2, x3, x4, x5, x6)  =  U12_gggaa(x1, x2, x3, x6)
U13_gggaa(x1, x2, x3, x4, x5, x6)  =  U13_gggaa(x1, x2, x3, x4, x6)
pC_out_gggaa(x1, x2, x3, x4, x5)  =  pC_out_gggaa(x1, x2, x3, x4, x5)
pB_out_gggaa(x1, x2, x3, x4, x5)  =  pB_out_gggaa(x1, x2, x3, x4, x5)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
FLATTENE_IN_GGGA(x1, x2, x3, x4)  =  FLATTENE_IN_GGGA(x1, x2, x3)
FLATTEND_IN_GA(x1, x2)  =  FLATTEND_IN_GA(x1)

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

(8) UsableRulesProof (EQUIVALENT transformation)

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

(9) Obligation:

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

FLATTENE_IN_GGGA(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → FLATTEND_IN_GA(T90, X131)
FLATTEND_IN_GA(cons(atom(T106), T107), .(T106, X158)) → FLATTEND_IN_GA(T107, X158)
FLATTEND_IN_GA(cons(cons(T116, T117), T118), X175) → FLATTENE_IN_GGGA(T116, T117, T118, X175)
FLATTENE_IN_GGGA(atom(T78), cons(T125, T126), T127, .(T78, X192)) → FLATTENE_IN_GGGA(T125, T126, T127, X192)
FLATTENE_IN_GGGA(cons(T136, T137), T138, T139, X209) → FLATTENE_IN_GGGA(T136, T137, cons(T138, T139), X209)

R is empty.
The argument filtering Pi contains the following mapping:
atom(x1)  =  atom(x1)
cons(x1, x2)  =  cons(x1, x2)
.(x1, x2)  =  .(x1, x2)
FLATTENE_IN_GGGA(x1, x2, x3, x4)  =  FLATTENE_IN_GGGA(x1, x2, x3)
FLATTEND_IN_GA(x1, x2)  =  FLATTEND_IN_GA(x1)

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

(10) PiDPToQDPProof (SOUND transformation)

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

(11) Obligation:

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

FLATTENE_IN_GGGA(atom(T78), atom(T89), T90) → FLATTEND_IN_GA(T90)
FLATTEND_IN_GA(cons(atom(T106), T107)) → FLATTEND_IN_GA(T107)
FLATTEND_IN_GA(cons(cons(T116, T117), T118)) → FLATTENE_IN_GGGA(T116, T117, T118)
FLATTENE_IN_GGGA(atom(T78), cons(T125, T126), T127) → FLATTENE_IN_GGGA(T125, T126, T127)
FLATTENE_IN_GGGA(cons(T136, T137), T138, T139) → FLATTENE_IN_GGGA(T136, T137, cons(T138, T139))

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

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

The following dependency pairs can be deleted:

FLATTENE_IN_GGGA(atom(T78), atom(T89), T90) → FLATTEND_IN_GA(T90)
FLATTEND_IN_GA(cons(atom(T106), T107)) → FLATTEND_IN_GA(T107)
FLATTEND_IN_GA(cons(cons(T116, T117), T118)) → FLATTENE_IN_GGGA(T116, T117, T118)
FLATTENE_IN_GGGA(atom(T78), cons(T125, T126), T127) → FLATTENE_IN_GGGA(T125, T126, T127)
No rules are removed from R.

Used ordering: POLO with Polynomial interpretation [POLO]:

POL(FLATTEND_IN_GA(x1)) = 1 + 2·x1   
POL(FLATTENE_IN_GGGA(x1, x2, x3)) = 2·x1 + 2·x2 + 2·x3   
POL(atom(x1)) = 1 + x1   
POL(cons(x1, x2)) = x1 + x2   

(13) Obligation:

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

FLATTENE_IN_GGGA(cons(T136, T137), T138, T139) → FLATTENE_IN_GGGA(T136, T137, cons(T138, T139))

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

(14) QDPSizeChangeProof (EQUIVALENT transformation)

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

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

  • FLATTENE_IN_GGGA(cons(T136, T137), T138, T139) → FLATTENE_IN_GGGA(T136, T137, cons(T138, T139))
    The graph contains the following edges 1 > 1, 1 > 2

(15) YES

(16) Obligation:

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

COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → PB_IN_GGGAA(T51, T52, T53, X60, T55)
PB_IN_GGGAA(T51, T52, T53, T56, T55) → U10_GGGAA(T51, T52, T53, T56, T55, flattenF_in_ggga(T51, T52, T53, T56))
U10_GGGAA(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → COUNTA_IN_GA(T56, T55)
COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → COUNTA_IN_GA(T30, T32)
COUNTA_IN_GA(cons(cons(T157, T158), T159), T150) → PC_IN_GGGAA(T157, T158, T159, X247, T150)
PC_IN_GGGAA(T157, T158, T159, T160, T150) → U12_GGGAA(T157, T158, T159, T160, T150, flattenE_in_ggga(T157, T158, T159, T160))
U12_GGGAA(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → COUNTA_IN_GA(T160, T150)

The TRS R consists of the following rules:

countA_in_ga(atom(T4), s(0)) → countA_out_ga(atom(T4), s(0))
countA_in_ga(cons(atom(T8), atom(T16)), s(s(0))) → countA_out_ga(cons(atom(T8), atom(T16)), s(s(0)))
countA_in_ga(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → U1_ga(T8, T29, T30, T32, countA_in_ga(T30, T32))
countA_in_ga(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → U2_ga(T8, T51, T52, T53, T55, pB_in_gggaa(T51, T52, T53, X60, T55))
pB_in_gggaa(T51, T52, T53, T56, T55) → U10_gggaa(T51, T52, T53, T56, T55, flattenF_in_ggga(T51, T52, T53, T56))
flattenF_in_ggga(T63, T64, T65, X85) → U9_ggga(T63, T64, T65, X85, flattenE_in_ggga(T63, T64, T65, X85))
flattenE_in_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → U6_ggga(T78, T89, T90, X131, flattenD_in_ga(T90, X131))
flattenD_in_ga(atom(T97), .(T97, [])) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107), .(T106, X158)) → U4_ga(T106, T107, X158, flattenD_in_ga(T107, X158))
flattenD_in_ga(cons(cons(T116, T117), T118), X175) → U5_ga(T116, T117, T118, X175, flattenE_in_ggga(T116, T117, T118, X175))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192)) → U7_ggga(T78, T125, T126, T127, X192, flattenE_in_ggga(T125, T126, T127, X192))
flattenE_in_ggga(cons(T136, T137), T138, T139, X209) → U8_ggga(T136, T137, T138, T139, X209, flattenE_in_ggga(T136, T137, cons(T138, T139), X209))
U8_ggga(T136, T137, T138, T139, X209, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
U7_ggga(T78, T125, T126, T127, X192, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
U5_ga(T116, T117, T118, X175, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)
U4_ga(T106, T107, X158, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))
U6_ggga(T78, T89, T90, X131, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U9_ggga(T63, T64, T65, X85, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U10_gggaa(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → U11_gggaa(T51, T52, T53, T56, T55, countA_in_ga(T56, T55))
countA_in_ga(cons(cons(T157, T158), T159), T150) → U3_ga(T157, T158, T159, T150, pC_in_gggaa(T157, T158, T159, X247, T150))
pC_in_gggaa(T157, T158, T159, T160, T150) → U12_gggaa(T157, T158, T159, T160, T150, flattenE_in_ggga(T157, T158, T159, T160))
U12_gggaa(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → U13_gggaa(T157, T158, T159, T160, T150, countA_in_ga(T160, T150))
U13_gggaa(T157, T158, T159, T160, T150, countA_out_ga(T160, T150)) → pC_out_gggaa(T157, T158, T159, T160, T150)
U3_ga(T157, T158, T159, T150, pC_out_gggaa(T157, T158, T159, X247, T150)) → countA_out_ga(cons(cons(T157, T158), T159), T150)
U11_gggaa(T51, T52, T53, T56, T55, countA_out_ga(T56, T55)) → pB_out_gggaa(T51, T52, T53, T56, T55)
U2_ga(T8, T51, T52, T53, T55, pB_out_gggaa(T51, T52, T53, X60, T55)) → countA_out_ga(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55))
U1_ga(T8, T29, T30, T32, countA_out_ga(T30, T32)) → countA_out_ga(cons(atom(T8), cons(atom(T29), T30)), s(s(T32)))

The argument filtering Pi contains the following mapping:
countA_in_ga(x1, x2)  =  countA_in_ga(x1)
atom(x1)  =  atom(x1)
countA_out_ga(x1, x2)  =  countA_out_ga(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x1, x2, x3, x4, x6)
pB_in_gggaa(x1, x2, x3, x4, x5)  =  pB_in_gggaa(x1, x2, x3)
U10_gggaa(x1, x2, x3, x4, x5, x6)  =  U10_gggaa(x1, x2, x3, x6)
flattenF_in_ggga(x1, x2, x3, x4)  =  flattenF_in_ggga(x1, x2, x3)
U9_ggga(x1, x2, x3, x4, x5)  =  U9_ggga(x1, x2, x3, x5)
flattenE_in_ggga(x1, x2, x3, x4)  =  flattenE_in_ggga(x1, x2, x3)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
flattenD_in_ga(x1, x2)  =  flattenD_in_ga(x1)
flattenD_out_ga(x1, x2)  =  flattenD_out_ga(x1, x2)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x1, x2, x4)
U5_ga(x1, x2, x3, x4, x5)  =  U5_ga(x1, x2, x3, x5)
U7_ggga(x1, x2, x3, x4, x5, x6)  =  U7_ggga(x1, x2, x3, x4, x6)
U8_ggga(x1, x2, x3, x4, x5, x6)  =  U8_ggga(x1, x2, x3, x4, x6)
flattenE_out_ggga(x1, x2, x3, x4)  =  flattenE_out_ggga(x1, x2, x3, x4)
flattenF_out_ggga(x1, x2, x3, x4)  =  flattenF_out_ggga(x1, x2, x3, x4)
U11_gggaa(x1, x2, x3, x4, x5, x6)  =  U11_gggaa(x1, x2, x3, x4, x6)
U3_ga(x1, x2, x3, x4, x5)  =  U3_ga(x1, x2, x3, x5)
pC_in_gggaa(x1, x2, x3, x4, x5)  =  pC_in_gggaa(x1, x2, x3)
U12_gggaa(x1, x2, x3, x4, x5, x6)  =  U12_gggaa(x1, x2, x3, x6)
U13_gggaa(x1, x2, x3, x4, x5, x6)  =  U13_gggaa(x1, x2, x3, x4, x6)
pC_out_gggaa(x1, x2, x3, x4, x5)  =  pC_out_gggaa(x1, x2, x3, x4, x5)
pB_out_gggaa(x1, x2, x3, x4, x5)  =  pB_out_gggaa(x1, x2, x3, x4, x5)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
COUNTA_IN_GA(x1, x2)  =  COUNTA_IN_GA(x1)
PB_IN_GGGAA(x1, x2, x3, x4, x5)  =  PB_IN_GGGAA(x1, x2, x3)
U10_GGGAA(x1, x2, x3, x4, x5, x6)  =  U10_GGGAA(x1, x2, x3, x6)
PC_IN_GGGAA(x1, x2, x3, x4, x5)  =  PC_IN_GGGAA(x1, x2, x3)
U12_GGGAA(x1, x2, x3, x4, x5, x6)  =  U12_GGGAA(x1, x2, x3, x6)

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

(17) UsableRulesProof (EQUIVALENT transformation)

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

(18) Obligation:

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

COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53)), s(T55)) → PB_IN_GGGAA(T51, T52, T53, X60, T55)
PB_IN_GGGAA(T51, T52, T53, T56, T55) → U10_GGGAA(T51, T52, T53, T56, T55, flattenF_in_ggga(T51, T52, T53, T56))
U10_GGGAA(T51, T52, T53, T56, T55, flattenF_out_ggga(T51, T52, T53, T56)) → COUNTA_IN_GA(T56, T55)
COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30)), s(s(T32))) → COUNTA_IN_GA(T30, T32)
COUNTA_IN_GA(cons(cons(T157, T158), T159), T150) → PC_IN_GGGAA(T157, T158, T159, X247, T150)
PC_IN_GGGAA(T157, T158, T159, T160, T150) → U12_GGGAA(T157, T158, T159, T160, T150, flattenE_in_ggga(T157, T158, T159, T160))
U12_GGGAA(T157, T158, T159, T160, T150, flattenE_out_ggga(T157, T158, T159, T160)) → COUNTA_IN_GA(T160, T150)

The TRS R consists of the following rules:

flattenF_in_ggga(T63, T64, T65, X85) → U9_ggga(T63, T64, T65, X85, flattenE_in_ggga(T63, T64, T65, X85))
flattenE_in_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131))) → U6_ggga(T78, T89, T90, X131, flattenD_in_ga(T90, X131))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192)) → U7_ggga(T78, T125, T126, T127, X192, flattenE_in_ggga(T125, T126, T127, X192))
flattenE_in_ggga(cons(T136, T137), T138, T139, X209) → U8_ggga(T136, T137, T138, T139, X209, flattenE_in_ggga(T136, T137, cons(T138, T139), X209))
U9_ggga(T63, T64, T65, X85, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U6_ggga(T78, T89, T90, X131, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U7_ggga(T78, T125, T126, T127, X192, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
U8_ggga(T136, T137, T138, T139, X209, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
flattenD_in_ga(atom(T97), .(T97, [])) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107), .(T106, X158)) → U4_ga(T106, T107, X158, flattenD_in_ga(T107, X158))
flattenD_in_ga(cons(cons(T116, T117), T118), X175) → U5_ga(T116, T117, T118, X175, flattenE_in_ggga(T116, T117, T118, X175))
U4_ga(T106, T107, X158, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))
U5_ga(T116, T117, T118, X175, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)

The argument filtering Pi contains the following mapping:
atom(x1)  =  atom(x1)
cons(x1, x2)  =  cons(x1, x2)
flattenF_in_ggga(x1, x2, x3, x4)  =  flattenF_in_ggga(x1, x2, x3)
U9_ggga(x1, x2, x3, x4, x5)  =  U9_ggga(x1, x2, x3, x5)
flattenE_in_ggga(x1, x2, x3, x4)  =  flattenE_in_ggga(x1, x2, x3)
U6_ggga(x1, x2, x3, x4, x5)  =  U6_ggga(x1, x2, x3, x5)
flattenD_in_ga(x1, x2)  =  flattenD_in_ga(x1)
flattenD_out_ga(x1, x2)  =  flattenD_out_ga(x1, x2)
U4_ga(x1, x2, x3, x4)  =  U4_ga(x1, x2, x4)
U5_ga(x1, x2, x3, x4, x5)  =  U5_ga(x1, x2, x3, x5)
U7_ggga(x1, x2, x3, x4, x5, x6)  =  U7_ggga(x1, x2, x3, x4, x6)
U8_ggga(x1, x2, x3, x4, x5, x6)  =  U8_ggga(x1, x2, x3, x4, x6)
flattenE_out_ggga(x1, x2, x3, x4)  =  flattenE_out_ggga(x1, x2, x3, x4)
flattenF_out_ggga(x1, x2, x3, x4)  =  flattenF_out_ggga(x1, x2, x3, x4)
.(x1, x2)  =  .(x1, x2)
s(x1)  =  s(x1)
COUNTA_IN_GA(x1, x2)  =  COUNTA_IN_GA(x1)
PB_IN_GGGAA(x1, x2, x3, x4, x5)  =  PB_IN_GGGAA(x1, x2, x3)
U10_GGGAA(x1, x2, x3, x4, x5, x6)  =  U10_GGGAA(x1, x2, x3, x6)
PC_IN_GGGAA(x1, x2, x3, x4, x5)  =  PC_IN_GGGAA(x1, x2, x3)
U12_GGGAA(x1, x2, x3, x4, x5, x6)  =  U12_GGGAA(x1, x2, x3, x6)

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

(19) PiDPToQDPProof (SOUND transformation)

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

(20) Obligation:

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

COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53))) → PB_IN_GGGAA(T51, T52, T53)
PB_IN_GGGAA(T51, T52, T53) → U10_GGGAA(T51, T52, T53, flattenF_in_ggga(T51, T52, T53))
U10_GGGAA(T51, T52, T53, flattenF_out_ggga(T51, T52, T53, T56)) → COUNTA_IN_GA(T56)
COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30))) → COUNTA_IN_GA(T30)
COUNTA_IN_GA(cons(cons(T157, T158), T159)) → PC_IN_GGGAA(T157, T158, T159)
PC_IN_GGGAA(T157, T158, T159) → U12_GGGAA(T157, T158, T159, flattenE_in_ggga(T157, T158, T159))
U12_GGGAA(T157, T158, T159, flattenE_out_ggga(T157, T158, T159, T160)) → COUNTA_IN_GA(T160)

The TRS R consists of the following rules:

flattenF_in_ggga(T63, T64, T65) → U9_ggga(T63, T64, T65, flattenE_in_ggga(T63, T64, T65))
flattenE_in_ggga(atom(T78), atom(T89), T90) → U6_ggga(T78, T89, T90, flattenD_in_ga(T90))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127) → U7_ggga(T78, T125, T126, T127, flattenE_in_ggga(T125, T126, T127))
flattenE_in_ggga(cons(T136, T137), T138, T139) → U8_ggga(T136, T137, T138, T139, flattenE_in_ggga(T136, T137, cons(T138, T139)))
U9_ggga(T63, T64, T65, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U6_ggga(T78, T89, T90, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U7_ggga(T78, T125, T126, T127, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
U8_ggga(T136, T137, T138, T139, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
flattenD_in_ga(atom(T97)) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107)) → U4_ga(T106, T107, flattenD_in_ga(T107))
flattenD_in_ga(cons(cons(T116, T117), T118)) → U5_ga(T116, T117, T118, flattenE_in_ggga(T116, T117, T118))
U4_ga(T106, T107, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))
U5_ga(T116, T117, T118, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)

The set Q consists of the following terms:

flattenF_in_ggga(x0, x1, x2)
flattenE_in_ggga(x0, x1, x2)
U9_ggga(x0, x1, x2, x3)
U6_ggga(x0, x1, x2, x3)
U7_ggga(x0, x1, x2, x3, x4)
U8_ggga(x0, x1, x2, x3, x4)
flattenD_in_ga(x0)
U4_ga(x0, x1, x2)
U5_ga(x0, x1, x2, x3)

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

(21) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule PB_IN_GGGAA(T51, T52, T53) → U10_GGGAA(T51, T52, T53, flattenF_in_ggga(T51, T52, T53)) at position [3] we obtained the following new rules [LPAR04]:

PB_IN_GGGAA(T51, T52, T53) → U10_GGGAA(T51, T52, T53, U9_ggga(T51, T52, T53, flattenE_in_ggga(T51, T52, T53)))

(22) Obligation:

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

COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53))) → PB_IN_GGGAA(T51, T52, T53)
U10_GGGAA(T51, T52, T53, flattenF_out_ggga(T51, T52, T53, T56)) → COUNTA_IN_GA(T56)
COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30))) → COUNTA_IN_GA(T30)
COUNTA_IN_GA(cons(cons(T157, T158), T159)) → PC_IN_GGGAA(T157, T158, T159)
PC_IN_GGGAA(T157, T158, T159) → U12_GGGAA(T157, T158, T159, flattenE_in_ggga(T157, T158, T159))
U12_GGGAA(T157, T158, T159, flattenE_out_ggga(T157, T158, T159, T160)) → COUNTA_IN_GA(T160)
PB_IN_GGGAA(T51, T52, T53) → U10_GGGAA(T51, T52, T53, U9_ggga(T51, T52, T53, flattenE_in_ggga(T51, T52, T53)))

The TRS R consists of the following rules:

flattenF_in_ggga(T63, T64, T65) → U9_ggga(T63, T64, T65, flattenE_in_ggga(T63, T64, T65))
flattenE_in_ggga(atom(T78), atom(T89), T90) → U6_ggga(T78, T89, T90, flattenD_in_ga(T90))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127) → U7_ggga(T78, T125, T126, T127, flattenE_in_ggga(T125, T126, T127))
flattenE_in_ggga(cons(T136, T137), T138, T139) → U8_ggga(T136, T137, T138, T139, flattenE_in_ggga(T136, T137, cons(T138, T139)))
U9_ggga(T63, T64, T65, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U6_ggga(T78, T89, T90, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U7_ggga(T78, T125, T126, T127, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
U8_ggga(T136, T137, T138, T139, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
flattenD_in_ga(atom(T97)) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107)) → U4_ga(T106, T107, flattenD_in_ga(T107))
flattenD_in_ga(cons(cons(T116, T117), T118)) → U5_ga(T116, T117, T118, flattenE_in_ggga(T116, T117, T118))
U4_ga(T106, T107, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))
U5_ga(T116, T117, T118, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)

The set Q consists of the following terms:

flattenF_in_ggga(x0, x1, x2)
flattenE_in_ggga(x0, x1, x2)
U9_ggga(x0, x1, x2, x3)
U6_ggga(x0, x1, x2, x3)
U7_ggga(x0, x1, x2, x3, x4)
U8_ggga(x0, x1, x2, x3, x4)
flattenD_in_ga(x0)
U4_ga(x0, x1, x2)
U5_ga(x0, x1, x2, x3)

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

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

(24) Obligation:

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

COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53))) → PB_IN_GGGAA(T51, T52, T53)
U10_GGGAA(T51, T52, T53, flattenF_out_ggga(T51, T52, T53, T56)) → COUNTA_IN_GA(T56)
COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30))) → COUNTA_IN_GA(T30)
COUNTA_IN_GA(cons(cons(T157, T158), T159)) → PC_IN_GGGAA(T157, T158, T159)
PC_IN_GGGAA(T157, T158, T159) → U12_GGGAA(T157, T158, T159, flattenE_in_ggga(T157, T158, T159))
U12_GGGAA(T157, T158, T159, flattenE_out_ggga(T157, T158, T159, T160)) → COUNTA_IN_GA(T160)
PB_IN_GGGAA(T51, T52, T53) → U10_GGGAA(T51, T52, T53, U9_ggga(T51, T52, T53, flattenE_in_ggga(T51, T52, T53)))

The TRS R consists of the following rules:

flattenE_in_ggga(atom(T78), atom(T89), T90) → U6_ggga(T78, T89, T90, flattenD_in_ga(T90))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127) → U7_ggga(T78, T125, T126, T127, flattenE_in_ggga(T125, T126, T127))
flattenE_in_ggga(cons(T136, T137), T138, T139) → U8_ggga(T136, T137, T138, T139, flattenE_in_ggga(T136, T137, cons(T138, T139)))
U9_ggga(T63, T64, T65, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U8_ggga(T136, T137, T138, T139, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
U7_ggga(T78, T125, T126, T127, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
flattenD_in_ga(atom(T97)) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107)) → U4_ga(T106, T107, flattenD_in_ga(T107))
flattenD_in_ga(cons(cons(T116, T117), T118)) → U5_ga(T116, T117, T118, flattenE_in_ggga(T116, T117, T118))
U6_ggga(T78, T89, T90, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U5_ga(T116, T117, T118, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)
U4_ga(T106, T107, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))

The set Q consists of the following terms:

flattenF_in_ggga(x0, x1, x2)
flattenE_in_ggga(x0, x1, x2)
U9_ggga(x0, x1, x2, x3)
U6_ggga(x0, x1, x2, x3)
U7_ggga(x0, x1, x2, x3, x4)
U8_ggga(x0, x1, x2, x3, x4)
flattenD_in_ga(x0)
U4_ga(x0, x1, x2)
U5_ga(x0, x1, x2, x3)

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

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

flattenF_in_ggga(x0, x1, x2)

(26) Obligation:

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

COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53))) → PB_IN_GGGAA(T51, T52, T53)
U10_GGGAA(T51, T52, T53, flattenF_out_ggga(T51, T52, T53, T56)) → COUNTA_IN_GA(T56)
COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30))) → COUNTA_IN_GA(T30)
COUNTA_IN_GA(cons(cons(T157, T158), T159)) → PC_IN_GGGAA(T157, T158, T159)
PC_IN_GGGAA(T157, T158, T159) → U12_GGGAA(T157, T158, T159, flattenE_in_ggga(T157, T158, T159))
U12_GGGAA(T157, T158, T159, flattenE_out_ggga(T157, T158, T159, T160)) → COUNTA_IN_GA(T160)
PB_IN_GGGAA(T51, T52, T53) → U10_GGGAA(T51, T52, T53, U9_ggga(T51, T52, T53, flattenE_in_ggga(T51, T52, T53)))

The TRS R consists of the following rules:

flattenE_in_ggga(atom(T78), atom(T89), T90) → U6_ggga(T78, T89, T90, flattenD_in_ga(T90))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127) → U7_ggga(T78, T125, T126, T127, flattenE_in_ggga(T125, T126, T127))
flattenE_in_ggga(cons(T136, T137), T138, T139) → U8_ggga(T136, T137, T138, T139, flattenE_in_ggga(T136, T137, cons(T138, T139)))
U9_ggga(T63, T64, T65, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U8_ggga(T136, T137, T138, T139, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
U7_ggga(T78, T125, T126, T127, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
flattenD_in_ga(atom(T97)) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107)) → U4_ga(T106, T107, flattenD_in_ga(T107))
flattenD_in_ga(cons(cons(T116, T117), T118)) → U5_ga(T116, T117, T118, flattenE_in_ggga(T116, T117, T118))
U6_ggga(T78, T89, T90, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U5_ga(T116, T117, T118, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)
U4_ga(T106, T107, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))

The set Q consists of the following terms:

flattenE_in_ggga(x0, x1, x2)
U9_ggga(x0, x1, x2, x3)
U6_ggga(x0, x1, x2, x3)
U7_ggga(x0, x1, x2, x3, x4)
U8_ggga(x0, x1, x2, x3, x4)
flattenD_in_ga(x0)
U4_ga(x0, x1, x2)
U5_ga(x0, x1, x2, x3)

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

(27) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


COUNTA_IN_GA(cons(atom(T8), cons(cons(T51, T52), T53))) → PB_IN_GGGAA(T51, T52, T53)
COUNTA_IN_GA(cons(atom(T8), cons(atom(T29), T30))) → COUNTA_IN_GA(T30)
COUNTA_IN_GA(cons(cons(T157, T158), T159)) → PC_IN_GGGAA(T157, T158, T159)
PC_IN_GGGAA(T157, T158, T159) → U12_GGGAA(T157, T158, T159, flattenE_in_ggga(T157, T158, T159))
PB_IN_GGGAA(T51, T52, T53) → U10_GGGAA(T51, T52, T53, U9_ggga(T51, T52, T53, flattenE_in_ggga(T51, T52, T53)))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 0   
POL(COUNTA_IN_GA(x1)) = x1   
POL(PB_IN_GGGAA(x1, x2, x3)) = 1 + x1 + x3   
POL(PC_IN_GGGAA(x1, x2, x3)) = 1 + x1 + x2 + x3   
POL(U10_GGGAA(x1, x2, x3, x4)) = x4   
POL(U12_GGGAA(x1, x2, x3, x4)) = x4   
POL(U4_ga(x1, x2, x3)) = 1 + x1   
POL(U5_ga(x1, x2, x3, x4)) = 1 + x3 + x4   
POL(U6_ggga(x1, x2, x3, x4)) = 0   
POL(U7_ggga(x1, x2, x3, x4, x5)) = 0   
POL(U8_ggga(x1, x2, x3, x4, x5)) = 1 + x2 + x5   
POL(U9_ggga(x1, x2, x3, x4)) = x4   
POL([]) = 0   
POL(atom(x1)) = 1 + x1   
POL(cons(x1, x2)) = 1 + x1 + x2   
POL(flattenD_in_ga(x1)) = x1   
POL(flattenD_out_ga(x1, x2)) = 0   
POL(flattenE_in_ggga(x1, x2, x3)) = x1   
POL(flattenE_out_ggga(x1, x2, x3, x4)) = x4   
POL(flattenF_out_ggga(x1, x2, x3, x4)) = x4   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

flattenE_in_ggga(atom(T78), atom(T89), T90) → U6_ggga(T78, T89, T90, flattenD_in_ga(T90))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127) → U7_ggga(T78, T125, T126, T127, flattenE_in_ggga(T125, T126, T127))
flattenE_in_ggga(cons(T136, T137), T138, T139) → U8_ggga(T136, T137, T138, T139, flattenE_in_ggga(T136, T137, cons(T138, T139)))
U9_ggga(T63, T64, T65, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
flattenD_in_ga(cons(atom(T106), T107)) → U4_ga(T106, T107, flattenD_in_ga(T107))
U4_ga(T106, T107, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))
flattenD_in_ga(cons(cons(T116, T117), T118)) → U5_ga(T116, T117, T118, flattenE_in_ggga(T116, T117, T118))
U5_ga(T116, T117, T118, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)
U6_ggga(T78, T89, T90, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U7_ggga(T78, T125, T126, T127, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
U8_ggga(T136, T137, T138, T139, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)

(28) Obligation:

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

U10_GGGAA(T51, T52, T53, flattenF_out_ggga(T51, T52, T53, T56)) → COUNTA_IN_GA(T56)
U12_GGGAA(T157, T158, T159, flattenE_out_ggga(T157, T158, T159, T160)) → COUNTA_IN_GA(T160)

The TRS R consists of the following rules:

flattenE_in_ggga(atom(T78), atom(T89), T90) → U6_ggga(T78, T89, T90, flattenD_in_ga(T90))
flattenE_in_ggga(atom(T78), cons(T125, T126), T127) → U7_ggga(T78, T125, T126, T127, flattenE_in_ggga(T125, T126, T127))
flattenE_in_ggga(cons(T136, T137), T138, T139) → U8_ggga(T136, T137, T138, T139, flattenE_in_ggga(T136, T137, cons(T138, T139)))
U9_ggga(T63, T64, T65, flattenE_out_ggga(T63, T64, T65, X85)) → flattenF_out_ggga(T63, T64, T65, X85)
U8_ggga(T136, T137, T138, T139, flattenE_out_ggga(T136, T137, cons(T138, T139), X209)) → flattenE_out_ggga(cons(T136, T137), T138, T139, X209)
U7_ggga(T78, T125, T126, T127, flattenE_out_ggga(T125, T126, T127, X192)) → flattenE_out_ggga(atom(T78), cons(T125, T126), T127, .(T78, X192))
flattenD_in_ga(atom(T97)) → flattenD_out_ga(atom(T97), .(T97, []))
flattenD_in_ga(cons(atom(T106), T107)) → U4_ga(T106, T107, flattenD_in_ga(T107))
flattenD_in_ga(cons(cons(T116, T117), T118)) → U5_ga(T116, T117, T118, flattenE_in_ggga(T116, T117, T118))
U6_ggga(T78, T89, T90, flattenD_out_ga(T90, X131)) → flattenE_out_ggga(atom(T78), atom(T89), T90, .(T78, .(T89, X131)))
U5_ga(T116, T117, T118, flattenE_out_ggga(T116, T117, T118, X175)) → flattenD_out_ga(cons(cons(T116, T117), T118), X175)
U4_ga(T106, T107, flattenD_out_ga(T107, X158)) → flattenD_out_ga(cons(atom(T106), T107), .(T106, X158))

The set Q consists of the following terms:

flattenE_in_ggga(x0, x1, x2)
U9_ggga(x0, x1, x2, x3)
U6_ggga(x0, x1, x2, x3)
U7_ggga(x0, x1, x2, x3, x4)
U8_ggga(x0, x1, x2, x3, x4)
flattenD_in_ga(x0)
U4_ga(x0, x1, x2)
U5_ga(x0, x1, x2, x3)

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

(29) DependencyGraphProof (EQUIVALENT transformation)

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

(30) TRUE