(0) Obligation:

Clauses:

append(nil, Y, Y).
append(cons(U, V), Y, cons(U, Z)) :- append(V, Y, Z).
lessleaves(nil, cons(W, Z)).
lessleaves(cons(U, V), cons(W, Z)) :- ','(append(U, V, U1), ','(append(W, Z, W1), lessleaves(U1, W1))).

Queries:

lessleaves(g,g).

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph.

(2) Obligation:

Clauses:

append14(nil, T29, T29).
append14(cons(T36, T37), T38, cons(T36, X55)) :- append14(T37, T38, X55).
p12(T13, T14, X20, T19) :- append14(T13, T14, X20).
p12(T13, T14, T22, T19) :- ','(append14(T13, T14, T22), lessleaves1(T19, T22)).
lessleaves1(nil, cons(T5, T6)).
lessleaves1(cons(nil, T19), cons(T13, T14)) :- p12(T13, T14, X20, T19).
lessleaves1(cons(cons(T51, T52), T53), cons(T13, T14)) :- append14(T52, T53, X80).
lessleaves1(cons(cons(T51, T52), T53), cons(T13, T14)) :- ','(append14(T52, T53, T56), p12(T13, T14, X20, cons(T51, T56))).

Queries:

lessleaves1(g,g).

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

lessleaves1_in_gg(nil, cons(T5, T6)) → lessleaves1_out_gg(nil, cons(T5, T6))
lessleaves1_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, p12_in_ggag(T13, T14, X20, T19))
p12_in_ggag(T13, T14, X20, T19) → U2_ggag(T13, T14, X20, T19, append14_in_gga(T13, T14, X20))
append14_in_gga(nil, T29, T29) → append14_out_gga(nil, T29, T29)
append14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U1_gga(T36, T37, T38, X55, append14_in_gga(T37, T38, X55))
U1_gga(T36, T37, T38, X55, append14_out_gga(T37, T38, X55)) → append14_out_gga(cons(T36, T37), T38, cons(T36, X55))
U2_ggag(T13, T14, X20, T19, append14_out_gga(T13, T14, X20)) → p12_out_ggag(T13, T14, X20, T19)
p12_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, append14_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleaves1_in_gg(T19, T22))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, X80))
U6_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, X80)) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, p12_in_ggag(T13, T14, X20, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, p12_out_ggag(T13, T14, X20, cons(T51, T56))) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleaves1_out_gg(T19, T22)) → p12_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, p12_out_ggag(T13, T14, X20, T19)) → lessleaves1_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleaves1_in_gg(x1, x2)  =  lessleaves1_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleaves1_out_gg(x1, x2)  =  lessleaves1_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
p12_in_ggag(x1, x2, x3, x4)  =  p12_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
append14_in_gga(x1, x2, x3)  =  append14_in_gga(x1, x2)
append14_out_gga(x1, x2, x3)  =  append14_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
p12_out_ggag(x1, x2, x3, x4)  =  p12_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

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

lessleaves1_in_gg(nil, cons(T5, T6)) → lessleaves1_out_gg(nil, cons(T5, T6))
lessleaves1_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, p12_in_ggag(T13, T14, X20, T19))
p12_in_ggag(T13, T14, X20, T19) → U2_ggag(T13, T14, X20, T19, append14_in_gga(T13, T14, X20))
append14_in_gga(nil, T29, T29) → append14_out_gga(nil, T29, T29)
append14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U1_gga(T36, T37, T38, X55, append14_in_gga(T37, T38, X55))
U1_gga(T36, T37, T38, X55, append14_out_gga(T37, T38, X55)) → append14_out_gga(cons(T36, T37), T38, cons(T36, X55))
U2_ggag(T13, T14, X20, T19, append14_out_gga(T13, T14, X20)) → p12_out_ggag(T13, T14, X20, T19)
p12_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, append14_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleaves1_in_gg(T19, T22))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, X80))
U6_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, X80)) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, p12_in_ggag(T13, T14, X20, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, p12_out_ggag(T13, T14, X20, cons(T51, T56))) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleaves1_out_gg(T19, T22)) → p12_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, p12_out_ggag(T13, T14, X20, T19)) → lessleaves1_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleaves1_in_gg(x1, x2)  =  lessleaves1_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleaves1_out_gg(x1, x2)  =  lessleaves1_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
p12_in_ggag(x1, x2, x3, x4)  =  p12_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
append14_in_gga(x1, x2, x3)  =  append14_in_gga(x1, x2)
append14_out_gga(x1, x2, x3)  =  append14_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
p12_out_ggag(x1, x2, x3, x4)  =  p12_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)

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

LESSLEAVES1_IN_GG(cons(nil, T19), cons(T13, T14)) → U5_GG(T19, T13, T14, p12_in_ggag(T13, T14, X20, T19))
LESSLEAVES1_IN_GG(cons(nil, T19), cons(T13, T14)) → P12_IN_GGAG(T13, T14, X20, T19)
P12_IN_GGAG(T13, T14, X20, T19) → U2_GGAG(T13, T14, X20, T19, append14_in_gga(T13, T14, X20))
P12_IN_GGAG(T13, T14, X20, T19) → APPEND14_IN_GGA(T13, T14, X20)
APPEND14_IN_GGA(cons(T36, T37), T38, cons(T36, X55)) → U1_GGA(T36, T37, T38, X55, append14_in_gga(T37, T38, X55))
APPEND14_IN_GGA(cons(T36, T37), T38, cons(T36, X55)) → APPEND14_IN_GGA(T37, T38, X55)
P12_IN_GGAG(T13, T14, T22, T19) → U3_GGAG(T13, T14, T22, T19, append14_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → U4_GGAG(T13, T14, T22, T19, lessleaves1_in_gg(T19, T22))
U3_GGAG(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → LESSLEAVES1_IN_GG(T19, T22)
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_GG(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, X80))
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → APPEND14_IN_GGA(T52, T53, X80)
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → U8_GG(T51, T52, T53, T13, T14, p12_in_ggag(T13, T14, X20, cons(T51, T56)))
U7_GG(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → P12_IN_GGAG(T13, T14, X20, cons(T51, T56))

The TRS R consists of the following rules:

lessleaves1_in_gg(nil, cons(T5, T6)) → lessleaves1_out_gg(nil, cons(T5, T6))
lessleaves1_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, p12_in_ggag(T13, T14, X20, T19))
p12_in_ggag(T13, T14, X20, T19) → U2_ggag(T13, T14, X20, T19, append14_in_gga(T13, T14, X20))
append14_in_gga(nil, T29, T29) → append14_out_gga(nil, T29, T29)
append14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U1_gga(T36, T37, T38, X55, append14_in_gga(T37, T38, X55))
U1_gga(T36, T37, T38, X55, append14_out_gga(T37, T38, X55)) → append14_out_gga(cons(T36, T37), T38, cons(T36, X55))
U2_ggag(T13, T14, X20, T19, append14_out_gga(T13, T14, X20)) → p12_out_ggag(T13, T14, X20, T19)
p12_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, append14_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleaves1_in_gg(T19, T22))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, X80))
U6_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, X80)) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, p12_in_ggag(T13, T14, X20, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, p12_out_ggag(T13, T14, X20, cons(T51, T56))) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleaves1_out_gg(T19, T22)) → p12_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, p12_out_ggag(T13, T14, X20, T19)) → lessleaves1_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleaves1_in_gg(x1, x2)  =  lessleaves1_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleaves1_out_gg(x1, x2)  =  lessleaves1_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
p12_in_ggag(x1, x2, x3, x4)  =  p12_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
append14_in_gga(x1, x2, x3)  =  append14_in_gga(x1, x2)
append14_out_gga(x1, x2, x3)  =  append14_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
p12_out_ggag(x1, x2, x3, x4)  =  p12_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)
LESSLEAVES1_IN_GG(x1, x2)  =  LESSLEAVES1_IN_GG(x1, x2)
U5_GG(x1, x2, x3, x4)  =  U5_GG(x4)
P12_IN_GGAG(x1, x2, x3, x4)  =  P12_IN_GGAG(x1, x2, x4)
U2_GGAG(x1, x2, x3, x4, x5)  =  U2_GGAG(x5)
APPEND14_IN_GGA(x1, x2, x3)  =  APPEND14_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5)  =  U1_GGA(x1, x5)
U3_GGAG(x1, x2, x3, x4, x5)  =  U3_GGAG(x4, x5)
U4_GGAG(x1, x2, x3, x4, x5)  =  U4_GGAG(x3, x5)
U6_GG(x1, x2, x3, x4, x5, x6)  =  U6_GG(x6)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x4, x5, x6)
U8_GG(x1, x2, x3, x4, x5, x6)  =  U8_GG(x6)

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

(6) Obligation:

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

LESSLEAVES1_IN_GG(cons(nil, T19), cons(T13, T14)) → U5_GG(T19, T13, T14, p12_in_ggag(T13, T14, X20, T19))
LESSLEAVES1_IN_GG(cons(nil, T19), cons(T13, T14)) → P12_IN_GGAG(T13, T14, X20, T19)
P12_IN_GGAG(T13, T14, X20, T19) → U2_GGAG(T13, T14, X20, T19, append14_in_gga(T13, T14, X20))
P12_IN_GGAG(T13, T14, X20, T19) → APPEND14_IN_GGA(T13, T14, X20)
APPEND14_IN_GGA(cons(T36, T37), T38, cons(T36, X55)) → U1_GGA(T36, T37, T38, X55, append14_in_gga(T37, T38, X55))
APPEND14_IN_GGA(cons(T36, T37), T38, cons(T36, X55)) → APPEND14_IN_GGA(T37, T38, X55)
P12_IN_GGAG(T13, T14, T22, T19) → U3_GGAG(T13, T14, T22, T19, append14_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → U4_GGAG(T13, T14, T22, T19, lessleaves1_in_gg(T19, T22))
U3_GGAG(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → LESSLEAVES1_IN_GG(T19, T22)
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_GG(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, X80))
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → APPEND14_IN_GGA(T52, T53, X80)
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → U8_GG(T51, T52, T53, T13, T14, p12_in_ggag(T13, T14, X20, cons(T51, T56)))
U7_GG(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → P12_IN_GGAG(T13, T14, X20, cons(T51, T56))

The TRS R consists of the following rules:

lessleaves1_in_gg(nil, cons(T5, T6)) → lessleaves1_out_gg(nil, cons(T5, T6))
lessleaves1_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, p12_in_ggag(T13, T14, X20, T19))
p12_in_ggag(T13, T14, X20, T19) → U2_ggag(T13, T14, X20, T19, append14_in_gga(T13, T14, X20))
append14_in_gga(nil, T29, T29) → append14_out_gga(nil, T29, T29)
append14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U1_gga(T36, T37, T38, X55, append14_in_gga(T37, T38, X55))
U1_gga(T36, T37, T38, X55, append14_out_gga(T37, T38, X55)) → append14_out_gga(cons(T36, T37), T38, cons(T36, X55))
U2_ggag(T13, T14, X20, T19, append14_out_gga(T13, T14, X20)) → p12_out_ggag(T13, T14, X20, T19)
p12_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, append14_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleaves1_in_gg(T19, T22))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, X80))
U6_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, X80)) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, p12_in_ggag(T13, T14, X20, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, p12_out_ggag(T13, T14, X20, cons(T51, T56))) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleaves1_out_gg(T19, T22)) → p12_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, p12_out_ggag(T13, T14, X20, T19)) → lessleaves1_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleaves1_in_gg(x1, x2)  =  lessleaves1_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleaves1_out_gg(x1, x2)  =  lessleaves1_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
p12_in_ggag(x1, x2, x3, x4)  =  p12_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
append14_in_gga(x1, x2, x3)  =  append14_in_gga(x1, x2)
append14_out_gga(x1, x2, x3)  =  append14_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
p12_out_ggag(x1, x2, x3, x4)  =  p12_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)
LESSLEAVES1_IN_GG(x1, x2)  =  LESSLEAVES1_IN_GG(x1, x2)
U5_GG(x1, x2, x3, x4)  =  U5_GG(x4)
P12_IN_GGAG(x1, x2, x3, x4)  =  P12_IN_GGAG(x1, x2, x4)
U2_GGAG(x1, x2, x3, x4, x5)  =  U2_GGAG(x5)
APPEND14_IN_GGA(x1, x2, x3)  =  APPEND14_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5)  =  U1_GGA(x1, x5)
U3_GGAG(x1, x2, x3, x4, x5)  =  U3_GGAG(x4, x5)
U4_GGAG(x1, x2, x3, x4, x5)  =  U4_GGAG(x3, x5)
U6_GG(x1, x2, x3, x4, x5, x6)  =  U6_GG(x6)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x4, x5, x6)
U8_GG(x1, x2, x3, x4, x5, x6)  =  U8_GG(x6)

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

(7) DependencyGraphProof (EQUIVALENT transformation)

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

(8) Complex Obligation (AND)

(9) Obligation:

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

APPEND14_IN_GGA(cons(T36, T37), T38, cons(T36, X55)) → APPEND14_IN_GGA(T37, T38, X55)

The TRS R consists of the following rules:

lessleaves1_in_gg(nil, cons(T5, T6)) → lessleaves1_out_gg(nil, cons(T5, T6))
lessleaves1_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, p12_in_ggag(T13, T14, X20, T19))
p12_in_ggag(T13, T14, X20, T19) → U2_ggag(T13, T14, X20, T19, append14_in_gga(T13, T14, X20))
append14_in_gga(nil, T29, T29) → append14_out_gga(nil, T29, T29)
append14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U1_gga(T36, T37, T38, X55, append14_in_gga(T37, T38, X55))
U1_gga(T36, T37, T38, X55, append14_out_gga(T37, T38, X55)) → append14_out_gga(cons(T36, T37), T38, cons(T36, X55))
U2_ggag(T13, T14, X20, T19, append14_out_gga(T13, T14, X20)) → p12_out_ggag(T13, T14, X20, T19)
p12_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, append14_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleaves1_in_gg(T19, T22))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, X80))
U6_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, X80)) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, p12_in_ggag(T13, T14, X20, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, p12_out_ggag(T13, T14, X20, cons(T51, T56))) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleaves1_out_gg(T19, T22)) → p12_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, p12_out_ggag(T13, T14, X20, T19)) → lessleaves1_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleaves1_in_gg(x1, x2)  =  lessleaves1_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleaves1_out_gg(x1, x2)  =  lessleaves1_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
p12_in_ggag(x1, x2, x3, x4)  =  p12_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
append14_in_gga(x1, x2, x3)  =  append14_in_gga(x1, x2)
append14_out_gga(x1, x2, x3)  =  append14_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
p12_out_ggag(x1, x2, x3, x4)  =  p12_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)
APPEND14_IN_GGA(x1, x2, x3)  =  APPEND14_IN_GGA(x1, x2)

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:

APPEND14_IN_GGA(cons(T36, T37), T38, cons(T36, X55)) → APPEND14_IN_GGA(T37, T38, X55)

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

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:

APPEND14_IN_GGA(cons(T36, T37), T38) → APPEND14_IN_GGA(T37, T38)

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:

  • APPEND14_IN_GGA(cons(T36, T37), T38) → APPEND14_IN_GGA(T37, T38)
    The graph contains the following edges 1 > 1, 2 >= 2

(15) YES

(16) Obligation:

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

LESSLEAVES1_IN_GG(cons(nil, T19), cons(T13, T14)) → P12_IN_GGAG(T13, T14, X20, T19)
P12_IN_GGAG(T13, T14, T22, T19) → U3_GGAG(T13, T14, T22, T19, append14_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → LESSLEAVES1_IN_GG(T19, T22)
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → P12_IN_GGAG(T13, T14, X20, cons(T51, T56))

The TRS R consists of the following rules:

lessleaves1_in_gg(nil, cons(T5, T6)) → lessleaves1_out_gg(nil, cons(T5, T6))
lessleaves1_in_gg(cons(nil, T19), cons(T13, T14)) → U5_gg(T19, T13, T14, p12_in_ggag(T13, T14, X20, T19))
p12_in_ggag(T13, T14, X20, T19) → U2_ggag(T13, T14, X20, T19, append14_in_gga(T13, T14, X20))
append14_in_gga(nil, T29, T29) → append14_out_gga(nil, T29, T29)
append14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U1_gga(T36, T37, T38, X55, append14_in_gga(T37, T38, X55))
U1_gga(T36, T37, T38, X55, append14_out_gga(T37, T38, X55)) → append14_out_gga(cons(T36, T37), T38, cons(T36, X55))
U2_ggag(T13, T14, X20, T19, append14_out_gga(T13, T14, X20)) → p12_out_ggag(T13, T14, X20, T19)
p12_in_ggag(T13, T14, T22, T19) → U3_ggag(T13, T14, T22, T19, append14_in_gga(T13, T14, T22))
U3_ggag(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → U4_ggag(T13, T14, T22, T19, lessleaves1_in_gg(T19, T22))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U6_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, X80))
U6_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, X80)) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
lessleaves1_in_gg(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_gg(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, T56))
U7_gg(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → U8_gg(T51, T52, T53, T13, T14, p12_in_ggag(T13, T14, X20, cons(T51, T56)))
U8_gg(T51, T52, T53, T13, T14, p12_out_ggag(T13, T14, X20, cons(T51, T56))) → lessleaves1_out_gg(cons(cons(T51, T52), T53), cons(T13, T14))
U4_ggag(T13, T14, T22, T19, lessleaves1_out_gg(T19, T22)) → p12_out_ggag(T13, T14, T22, T19)
U5_gg(T19, T13, T14, p12_out_ggag(T13, T14, X20, T19)) → lessleaves1_out_gg(cons(nil, T19), cons(T13, T14))

The argument filtering Pi contains the following mapping:
lessleaves1_in_gg(x1, x2)  =  lessleaves1_in_gg(x1, x2)
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
lessleaves1_out_gg(x1, x2)  =  lessleaves1_out_gg
U5_gg(x1, x2, x3, x4)  =  U5_gg(x4)
p12_in_ggag(x1, x2, x3, x4)  =  p12_in_ggag(x1, x2, x4)
U2_ggag(x1, x2, x3, x4, x5)  =  U2_ggag(x5)
append14_in_gga(x1, x2, x3)  =  append14_in_gga(x1, x2)
append14_out_gga(x1, x2, x3)  =  append14_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
p12_out_ggag(x1, x2, x3, x4)  =  p12_out_ggag(x3)
U3_ggag(x1, x2, x3, x4, x5)  =  U3_ggag(x4, x5)
U4_ggag(x1, x2, x3, x4, x5)  =  U4_ggag(x3, x5)
U6_gg(x1, x2, x3, x4, x5, x6)  =  U6_gg(x6)
U7_gg(x1, x2, x3, x4, x5, x6)  =  U7_gg(x1, x4, x5, x6)
U8_gg(x1, x2, x3, x4, x5, x6)  =  U8_gg(x6)
LESSLEAVES1_IN_GG(x1, x2)  =  LESSLEAVES1_IN_GG(x1, x2)
P12_IN_GGAG(x1, x2, x3, x4)  =  P12_IN_GGAG(x1, x2, x4)
U3_GGAG(x1, x2, x3, x4, x5)  =  U3_GGAG(x4, x5)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x4, x5, 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:

LESSLEAVES1_IN_GG(cons(nil, T19), cons(T13, T14)) → P12_IN_GGAG(T13, T14, X20, T19)
P12_IN_GGAG(T13, T14, T22, T19) → U3_GGAG(T13, T14, T22, T19, append14_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, append14_out_gga(T13, T14, T22)) → LESSLEAVES1_IN_GG(T19, T22)
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T52, T53, T13, T14, append14_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, append14_out_gga(T52, T53, T56)) → P12_IN_GGAG(T13, T14, X20, cons(T51, T56))

The TRS R consists of the following rules:

append14_in_gga(nil, T29, T29) → append14_out_gga(nil, T29, T29)
append14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U1_gga(T36, T37, T38, X55, append14_in_gga(T37, T38, X55))
U1_gga(T36, T37, T38, X55, append14_out_gga(T37, T38, X55)) → append14_out_gga(cons(T36, T37), T38, cons(T36, X55))

The argument filtering Pi contains the following mapping:
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
append14_in_gga(x1, x2, x3)  =  append14_in_gga(x1, x2)
append14_out_gga(x1, x2, x3)  =  append14_out_gga(x3)
U1_gga(x1, x2, x3, x4, x5)  =  U1_gga(x1, x5)
LESSLEAVES1_IN_GG(x1, x2)  =  LESSLEAVES1_IN_GG(x1, x2)
P12_IN_GGAG(x1, x2, x3, x4)  =  P12_IN_GGAG(x1, x2, x4)
U3_GGAG(x1, x2, x3, x4, x5)  =  U3_GGAG(x4, x5)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x4, x5, 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:

LESSLEAVES1_IN_GG(cons(nil, T19), cons(T13, T14)) → P12_IN_GGAG(T13, T14, T19)
P12_IN_GGAG(T13, T14, T19) → U3_GGAG(T19, append14_in_gga(T13, T14))
U3_GGAG(T19, append14_out_gga(T22)) → LESSLEAVES1_IN_GG(T19, T22)
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T13, T14, append14_in_gga(T52, T53))
U7_GG(T51, T13, T14, append14_out_gga(T56)) → P12_IN_GGAG(T13, T14, cons(T51, T56))

The TRS R consists of the following rules:

append14_in_gga(nil, T29) → append14_out_gga(T29)
append14_in_gga(cons(T36, T37), T38) → U1_gga(T36, append14_in_gga(T37, T38))
U1_gga(T36, append14_out_gga(X55)) → append14_out_gga(cons(T36, X55))

The set Q consists of the following terms:

append14_in_gga(x0, x1)
U1_gga(x0, x1)

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

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

LESSLEAVES1_IN_GG(cons(nil, T19), cons(T13, T14)) → P12_IN_GGAG(T13, T14, T19)
The following rules are removed from R:

append14_in_gga(nil, T29) → append14_out_gga(T29)
Used ordering: POLO with Polynomial interpretation [POLO]:

POL(LESSLEAVES1_IN_GG(x1, x2)) = x1 + x2   
POL(P12_IN_GGAG(x1, x2, x3)) = x1 + x2 + x3   
POL(U1_gga(x1, x2)) = x1 + x2   
POL(U3_GGAG(x1, x2)) = x1 + x2   
POL(U7_GG(x1, x2, x3, x4)) = x1 + x2 + x3 + x4   
POL(append14_in_gga(x1, x2)) = x1 + x2   
POL(append14_out_gga(x1)) = x1   
POL(cons(x1, x2)) = x1 + x2   
POL(nil) = 0   

(22) Obligation:

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

P12_IN_GGAG(T13, T14, T19) → U3_GGAG(T19, append14_in_gga(T13, T14))
U3_GGAG(T19, append14_out_gga(T22)) → LESSLEAVES1_IN_GG(T19, T22)
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T13, T14, append14_in_gga(T52, T53))
U7_GG(T51, T13, T14, append14_out_gga(T56)) → P12_IN_GGAG(T13, T14, cons(T51, T56))

The TRS R consists of the following rules:

append14_in_gga(cons(T36, T37), T38) → U1_gga(T36, append14_in_gga(T37, T38))
U1_gga(T36, append14_out_gga(X55)) → append14_out_gga(cons(T36, X55))

The set Q consists of the following terms:

append14_in_gga(x0, x1)
U1_gga(x0, x1)

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

(23) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

P12_IN_GGAG(T13, T14, T19) → U3_GGAG(T19, append14_in_gga(T13, T14))
U3_GGAG(T19, append14_out_gga(T22)) → LESSLEAVES1_IN_GG(T19, T22)
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T13, T14, append14_in_gga(T52, T53))
U7_GG(T51, T13, T14, append14_out_gga(T56)) → P12_IN_GGAG(T13, T14, cons(T51, T56))


Used ordering: Polynomial interpretation [POLO]:

POL(LESSLEAVES1_IN_GG(x1, x2)) = 1 + x1 + x2   
POL(P12_IN_GGAG(x1, x2, x3)) = 1 + x1 + x2 + x3   
POL(U1_gga(x1, x2)) = x1 + x2   
POL(U3_GGAG(x1, x2)) = x1 + x2   
POL(U7_GG(x1, x2, x3, x4)) = x1 + x2 + x3 + x4   
POL(append14_in_gga(x1, x2)) = x1 + x2   
POL(append14_out_gga(x1)) = 2 + x1   
POL(cons(x1, x2)) = x1 + x2   

(24) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

append14_in_gga(cons(T36, T37), T38) → U1_gga(T36, append14_in_gga(T37, T38))
U1_gga(T36, append14_out_gga(X55)) → append14_out_gga(cons(T36, X55))

The set Q consists of the following terms:

append14_in_gga(x0, x1)
U1_gga(x0, x1)

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

(25) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(26) YES