(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) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

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) :- ','(appendc14(T13, T14, T22), lessleaves1(T19, T22)).
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)) :- ','(appendc14(T52, T53, T56), p12(T13, T14, X20, cons(T51, T56))).

Clauses:

lessleavesc1(nil, cons(T5, T6)).
lessleavesc1(cons(nil, T19), cons(T13, T14)) :- qc12(T13, T14, X20, T19).
lessleavesc1(cons(cons(T51, T52), T53), cons(T13, T14)) :- ','(appendc14(T52, T53, T56), qc12(T13, T14, X20, cons(T51, T56))).
appendc14(nil, T29, T29).
appendc14(cons(T36, T37), T38, cons(T36, X55)) :- appendc14(T37, T38, X55).
qc12(T13, T14, T22, T19) :- ','(appendc14(T13, T14, T22), lessleavesc1(T19, T22)).

Afs:

lessleaves1(x1, x2)  =  lessleaves1(x1, x2)

(3) TriplesToPiDPProof (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)
appendc14_in: (b,b,f)
Transforming TRIPLES into the following Term Rewriting System:
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, appendc14_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, appendc14_out_gga(T13, T14, T22)) → U4_GGAG(T13, T14, T22, T19, lessleaves1_in_gg(T19, T22))
U3_GGAG(T13, T14, T22, T19, appendc14_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, appendc14_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, appendc14_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, appendc14_out_gga(T52, T53, T56)) → P12_IN_GGAG(T13, T14, X20, cons(T51, T56))

The TRS R consists of the following rules:

appendc14_in_gga(nil, T29, T29) → appendc14_out_gga(nil, T29, T29)
appendc14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U13_gga(T36, T37, T38, X55, appendc14_in_gga(T37, T38, X55))
U13_gga(T36, T37, T38, X55, appendc14_out_gga(T37, T38, X55)) → appendc14_out_gga(cons(T36, T37), T38, cons(T36, X55))

The argument filtering Pi contains the following mapping:
lessleaves1_in_gg(x1, x2)  =  lessleaves1_in_gg(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p12_in_ggag(x1, x2, x3, x4)  =  p12_in_ggag(x1, x2, x4)
append14_in_gga(x1, x2, x3)  =  append14_in_gga(x1, x2)
appendc14_in_gga(x1, x2, x3)  =  appendc14_in_gga(x1, x2)
appendc14_out_gga(x1, x2, x3)  =  appendc14_out_gga(x1, x2, x3)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x1, x2, x3, x5)
LESSLEAVES1_IN_GG(x1, x2)  =  LESSLEAVES1_IN_GG(x1, x2)
U5_GG(x1, x2, x3, x4)  =  U5_GG(x1, x2, x3, x4)
P12_IN_GGAG(x1, x2, x3, x4)  =  P12_IN_GGAG(x1, x2, x4)
U2_GGAG(x1, x2, x3, x4, x5)  =  U2_GGAG(x1, x2, x4, x5)
APPEND14_IN_GGA(x1, x2, x3)  =  APPEND14_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5)  =  U1_GGA(x1, x2, x3, x5)
U3_GGAG(x1, x2, x3, x4, x5)  =  U3_GGAG(x1, x2, x4, x5)
U4_GGAG(x1, x2, x3, x4, x5)  =  U4_GGAG(x1, x2, x3, x4, x5)
U6_GG(x1, x2, x3, x4, x5, x6)  =  U6_GG(x1, x2, x3, x4, x5, x6)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x2, x3, x4, x5, x6)
U8_GG(x1, x2, x3, x4, x5, x6)  =  U8_GG(x1, x2, x3, x4, x5, x6)

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

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) 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, appendc14_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, appendc14_out_gga(T13, T14, T22)) → U4_GGAG(T13, T14, T22, T19, lessleaves1_in_gg(T19, T22))
U3_GGAG(T13, T14, T22, T19, appendc14_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, appendc14_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, appendc14_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, appendc14_out_gga(T52, T53, T56)) → P12_IN_GGAG(T13, T14, X20, cons(T51, T56))

The TRS R consists of the following rules:

appendc14_in_gga(nil, T29, T29) → appendc14_out_gga(nil, T29, T29)
appendc14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U13_gga(T36, T37, T38, X55, appendc14_in_gga(T37, T38, X55))
U13_gga(T36, T37, T38, X55, appendc14_out_gga(T37, T38, X55)) → appendc14_out_gga(cons(T36, T37), T38, cons(T36, X55))

The argument filtering Pi contains the following mapping:
lessleaves1_in_gg(x1, x2)  =  lessleaves1_in_gg(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
p12_in_ggag(x1, x2, x3, x4)  =  p12_in_ggag(x1, x2, x4)
append14_in_gga(x1, x2, x3)  =  append14_in_gga(x1, x2)
appendc14_in_gga(x1, x2, x3)  =  appendc14_in_gga(x1, x2)
appendc14_out_gga(x1, x2, x3)  =  appendc14_out_gga(x1, x2, x3)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x1, x2, x3, x5)
LESSLEAVES1_IN_GG(x1, x2)  =  LESSLEAVES1_IN_GG(x1, x2)
U5_GG(x1, x2, x3, x4)  =  U5_GG(x1, x2, x3, x4)
P12_IN_GGAG(x1, x2, x3, x4)  =  P12_IN_GGAG(x1, x2, x4)
U2_GGAG(x1, x2, x3, x4, x5)  =  U2_GGAG(x1, x2, x4, x5)
APPEND14_IN_GGA(x1, x2, x3)  =  APPEND14_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4, x5)  =  U1_GGA(x1, x2, x3, x5)
U3_GGAG(x1, x2, x3, x4, x5)  =  U3_GGAG(x1, x2, x4, x5)
U4_GGAG(x1, x2, x3, x4, x5)  =  U4_GGAG(x1, x2, x3, x4, x5)
U6_GG(x1, x2, x3, x4, x5, x6)  =  U6_GG(x1, x2, x3, x4, x5, x6)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x2, x3, x4, x5, x6)
U8_GG(x1, x2, x3, x4, x5, x6)  =  U8_GG(x1, x2, x3, x4, x5, 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 8 less nodes.

(6) Complex Obligation (AND)

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

appendc14_in_gga(nil, T29, T29) → appendc14_out_gga(nil, T29, T29)
appendc14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U13_gga(T36, T37, T38, X55, appendc14_in_gga(T37, T38, X55))
U13_gga(T36, T37, T38, X55, appendc14_out_gga(T37, T38, X55)) → appendc14_out_gga(cons(T36, T37), T38, cons(T36, X55))

The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
appendc14_in_gga(x1, x2, x3)  =  appendc14_in_gga(x1, x2)
appendc14_out_gga(x1, x2, x3)  =  appendc14_out_gga(x1, x2, x3)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x1, x2, x3, x5)
APPEND14_IN_GGA(x1, x2, x3)  =  APPEND14_IN_GGA(x1, x2)

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

(8) UsableRulesProof (EQUIVALENT transformation)

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

(9) Obligation:

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

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

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

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.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

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

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

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

(13) YES

(14) 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, appendc14_in_gga(T13, T14, T22))
U3_GGAG(T13, T14, T22, T19, appendc14_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, appendc14_in_gga(T52, T53, T56))
U7_GG(T51, T52, T53, T13, T14, appendc14_out_gga(T52, T53, T56)) → P12_IN_GGAG(T13, T14, X20, cons(T51, T56))

The TRS R consists of the following rules:

appendc14_in_gga(nil, T29, T29) → appendc14_out_gga(nil, T29, T29)
appendc14_in_gga(cons(T36, T37), T38, cons(T36, X55)) → U13_gga(T36, T37, T38, X55, appendc14_in_gga(T37, T38, X55))
U13_gga(T36, T37, T38, X55, appendc14_out_gga(T37, T38, X55)) → appendc14_out_gga(cons(T36, T37), T38, cons(T36, X55))

The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x1, x2)
nil  =  nil
appendc14_in_gga(x1, x2, x3)  =  appendc14_in_gga(x1, x2)
appendc14_out_gga(x1, x2, x3)  =  appendc14_out_gga(x1, x2, x3)
U13_gga(x1, x2, x3, x4, x5)  =  U13_gga(x1, x2, x3, 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(x1, x2, x4, x5)
U7_GG(x1, x2, x3, x4, x5, x6)  =  U7_GG(x1, x2, x3, x4, x5, x6)

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

(15) PiDPToQDPProof (SOUND transformation)

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

(16) Obligation:

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

LESSLEAVES1_IN_GG(cons(nil, T19), cons(T13, T14)) → P12_IN_GGAG(T13, T14, T19)
P12_IN_GGAG(T13, T14, T19) → U3_GGAG(T13, T14, T19, appendc14_in_gga(T13, T14))
U3_GGAG(T13, T14, T19, appendc14_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, appendc14_in_gga(T52, T53))
U7_GG(T51, T52, T53, T13, T14, appendc14_out_gga(T52, T53, T56)) → P12_IN_GGAG(T13, T14, cons(T51, T56))

The TRS R consists of the following rules:

appendc14_in_gga(nil, T29) → appendc14_out_gga(nil, T29, T29)
appendc14_in_gga(cons(T36, T37), T38) → U13_gga(T36, T37, T38, appendc14_in_gga(T37, T38))
U13_gga(T36, T37, T38, appendc14_out_gga(T37, T38, X55)) → appendc14_out_gga(cons(T36, T37), T38, cons(T36, X55))

The set Q consists of the following terms:

appendc14_in_gga(x0, x1)
U13_gga(x0, x1, x2, x3)

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

(17) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


LESSLEAVES1_IN_GG(cons(nil, T19), cons(T13, T14)) → P12_IN_GGAG(T13, T14, T19)
LESSLEAVES1_IN_GG(cons(cons(T51, T52), T53), cons(T13, T14)) → U7_GG(T51, T52, T53, T13, T14, appendc14_in_gga(T52, T53))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(LESSLEAVES1_IN_GG(x1, x2)) = 1 + x2   
POL(P12_IN_GGAG(x1, x2, x3)) = x1 + x2   
POL(U13_gga(x1, x2, x3, x4)) = x1 + x4   
POL(U3_GGAG(x1, x2, x3, x4)) = x4   
POL(U7_GG(x1, x2, x3, x4, x5, x6)) = x4 + x5   
POL(appendc14_in_gga(x1, x2)) = x1 + x2   
POL(appendc14_out_gga(x1, x2, x3)) = 1 + x3   
POL(cons(x1, x2)) = x1 + x2   
POL(nil) = 1   

The following usable rules [FROCOS05] were oriented:

appendc14_in_gga(nil, T29) → appendc14_out_gga(nil, T29, T29)
appendc14_in_gga(cons(T36, T37), T38) → U13_gga(T36, T37, T38, appendc14_in_gga(T37, T38))
U13_gga(T36, T37, T38, appendc14_out_gga(T37, T38, X55)) → appendc14_out_gga(cons(T36, T37), T38, cons(T36, X55))

(18) Obligation:

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

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

The TRS R consists of the following rules:

appendc14_in_gga(nil, T29) → appendc14_out_gga(nil, T29, T29)
appendc14_in_gga(cons(T36, T37), T38) → U13_gga(T36, T37, T38, appendc14_in_gga(T37, T38))
U13_gga(T36, T37, T38, appendc14_out_gga(T37, T38, X55)) → appendc14_out_gga(cons(T36, T37), T38, cons(T36, X55))

The set Q consists of the following terms:

appendc14_in_gga(x0, x1)
U13_gga(x0, x1, x2, x3)

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

(19) DependencyGraphProof (EQUIVALENT transformation)

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

(20) TRUE