(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

Q is empty.

(1) AAECC Innermost (EQUIVALENT transformation)

We have applied [NOC,AAECCNOC] to switch to innermost. The TRS R 1 is

if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)

The TRS R 2 is

ac
ad

The signature Sigma is {a, c, d}

(2) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(4) Obligation:

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

LESSELEMENTS(l, t) → LESSE(l, t, 0)
LESSE(l, t, n) → IF(le(length(l), n), le(length(toList(t)), n), l, t, n)
LESSE(l, t, n) → LE(length(l), n)
LESSE(l, t, n) → LENGTH(l)
LESSE(l, t, n) → LE(length(toList(t)), n)
LESSE(l, t, n) → LENGTH(toList(t))
LESSE(l, t, n) → TOLIST(t)
IF(false, false, l, t, n) → LESSE(l, t, s(n))
LENGTH(cons(n, l)) → LENGTH(l)
TOLIST(node(t1, n, t2)) → APPEND(toList(t1), cons(n, toList(t2)))
TOLIST(node(t1, n, t2)) → TOLIST(t1)
TOLIST(node(t1, n, t2)) → TOLIST(t2)
APPEND(cons(n, l1), l2) → APPEND(l1, l2)
LE(s(n), s(m)) → LE(n, m)

The TRS R consists of the following rules:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

LE(s(n), s(m)) → LE(n, m)

The TRS R consists of the following rules:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

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

(8) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


LE(s(n), s(m)) → LE(n, m)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
LE(x1, x2)  =  x2
s(x1)  =  s(x1)
lessElements(x1, x2)  =  lessElements(x1, x2)
lessE(x1, x2, x3)  =  lessE(x1, x2)
0  =  0
if(x1, x2, x3, x4, x5)  =  if(x3, x4)
le(x1, x2)  =  le(x1, x2)
length(x1)  =  x1
toList(x1)  =  toList(x1)
true  =  true
false  =  false
nil  =  nil
cons(x1, x2)  =  cons(x1, x2)
leaf  =  leaf
node(x1, x2, x3)  =  node(x1, x2, x3)
append(x1, x2)  =  append(x1, x2)
a  =  a
c  =  c
d  =  d

Recursive path order with status [RPO].
Quasi-Precedence:
lessElements2 > [lessE2, if2] > s1
[0, toList1, nil, node3] > true > s1
[0, toList1, nil, node3] > false > s1
[0, toList1, nil, node3] > [cons2, append2] > s1
le2 > true > s1
le2 > false > s1
leaf > s1
[a, c, d] > s1

Status:
s1: multiset
lessElements2: [2,1]
lessE2: multiset
0: multiset
if2: multiset
le2: multiset
toList1: multiset
true: multiset
false: multiset
nil: multiset
cons2: [1,2]
leaf: multiset
node3: multiset
append2: [1,2]
a: multiset
c: multiset
d: multiset


The following usable rules [FROCOS05] were oriented:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

(9) Obligation:

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

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

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

(10) PisEmptyProof (EQUIVALENT transformation)

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

(11) TRUE

(12) Obligation:

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

APPEND(cons(n, l1), l2) → APPEND(l1, l2)

The TRS R consists of the following rules:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

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

(13) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


APPEND(cons(n, l1), l2) → APPEND(l1, l2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
APPEND(x1, x2)  =  x1
cons(x1, x2)  =  cons(x2)
lessElements(x1, x2)  =  lessElements(x1, x2)
lessE(x1, x2, x3)  =  lessE(x1, x2, x3)
0  =  0
if(x1, x2, x3, x4, x5)  =  if(x1, x3, x4)
le(x1, x2)  =  le
length(x1)  =  length
toList(x1)  =  toList(x1)
true  =  true
false  =  false
s(x1)  =  s
nil  =  nil
leaf  =  leaf
node(x1, x2, x3)  =  node(x1, x2, x3)
append(x1, x2)  =  append(x1, x2)
a  =  a
c  =  c
d  =  d

Recursive path order with status [RPO].
Quasi-Precedence:
lessElements2 > [0, length] > [cons1, lessE3, if3, le, true, false, s]
[toList1, node3] > nil > [cons1, lessE3, if3, le, true, false, s]
[toList1, node3] > append2 > [cons1, lessE3, if3, le, true, false, s]
leaf > [cons1, lessE3, if3, le, true, false, s]
[a, d] > c > [cons1, lessE3, if3, le, true, false, s]

Status:
cons1: multiset
lessElements2: [2,1]
lessE3: [1,3,2]
0: multiset
if3: [2,1,3]
le: multiset
length: multiset
toList1: multiset
true: multiset
false: multiset
s: multiset
nil: multiset
leaf: multiset
node3: multiset
append2: [2,1]
a: multiset
c: multiset
d: multiset


The following usable rules [FROCOS05] were oriented:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

(14) Obligation:

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

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

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

(15) PisEmptyProof (EQUIVALENT transformation)

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

(16) TRUE

(17) Obligation:

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

TOLIST(node(t1, n, t2)) → TOLIST(t2)
TOLIST(node(t1, n, t2)) → TOLIST(t1)

The TRS R consists of the following rules:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

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

(18) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


TOLIST(node(t1, n, t2)) → TOLIST(t2)
TOLIST(node(t1, n, t2)) → TOLIST(t1)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
TOLIST(x1)  =  x1
node(x1, x2, x3)  =  node(x1, x2, x3)
lessElements(x1, x2)  =  lessElements(x1, x2)
lessE(x1, x2, x3)  =  lessE(x1, x2)
0  =  0
if(x1, x2, x3, x4, x5)  =  if(x3, x4)
le(x1, x2)  =  le(x2)
length(x1)  =  length
toList(x1)  =  toList(x1)
true  =  true
false  =  false
s(x1)  =  x1
nil  =  nil
cons(x1, x2)  =  x2
leaf  =  leaf
append(x1, x2)  =  append(x1, x2)
a  =  a
c  =  c
d  =  d

Recursive path order with status [RPO].
Quasi-Precedence:
lessElements2 > [0, false] > [lessE2, if2]
lessElements2 > [0, false] > true
le1 > [0, false] > [lessE2, if2]
le1 > [0, false] > true
length > [0, false] > [lessE2, if2]
length > [0, false] > true
toList1 > nil
toList1 > append2
leaf > nil
[a, c, d]

Status:
node3: multiset
lessElements2: [2,1]
lessE2: multiset
0: multiset
if2: multiset
le1: multiset
length: multiset
toList1: [1]
true: multiset
false: multiset
nil: multiset
leaf: multiset
append2: multiset
a: multiset
c: multiset
d: multiset


The following usable rules [FROCOS05] were oriented:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

(19) Obligation:

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

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

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

(20) PisEmptyProof (EQUIVALENT transformation)

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

(21) TRUE

(22) Obligation:

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

LENGTH(cons(n, l)) → LENGTH(l)

The TRS R consists of the following rules:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

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

(23) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


LENGTH(cons(n, l)) → LENGTH(l)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
LENGTH(x1)  =  LENGTH(x1)
cons(x1, x2)  =  cons(x2)
lessElements(x1, x2)  =  lessElements(x1, x2)
lessE(x1, x2, x3)  =  lessE(x1, x2, x3)
0  =  0
if(x1, x2, x3, x4, x5)  =  if(x1, x3, x4)
le(x1, x2)  =  le
length(x1)  =  length
toList(x1)  =  toList(x1)
true  =  true
false  =  false
s(x1)  =  s
nil  =  nil
leaf  =  leaf
node(x1, x2, x3)  =  node(x1, x3)
append(x1, x2)  =  append(x1, x2)
a  =  a
c  =  c
d  =  d

Recursive path order with status [RPO].
Quasi-Precedence:
LENGTH1 > [lessE3, 0, if3, le, length, true, false, s]
lessElements2 > [lessE3, 0, if3, le, length, true, false, s]
leaf > nil > [lessE3, 0, if3, le, length, true, false, s]
node2 > toList1 > cons1 > [lessE3, 0, if3, le, length, true, false, s]
node2 > append2 > cons1 > [lessE3, 0, if3, le, length, true, false, s]
[a, d] > c > [lessE3, 0, if3, le, length, true, false, s]

Status:
LENGTH1: [1]
cons1: [1]
lessElements2: [2,1]
lessE3: multiset
0: multiset
if3: multiset
le: multiset
length: multiset
toList1: [1]
true: multiset
false: multiset
s: multiset
nil: multiset
leaf: multiset
node2: multiset
append2: [1,2]
a: multiset
c: multiset
d: multiset


The following usable rules [FROCOS05] were oriented:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

(24) Obligation:

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

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

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

(25) PisEmptyProof (EQUIVALENT transformation)

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

(26) TRUE

(27) Obligation:

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

IF(false, false, l, t, n) → LESSE(l, t, s(n))
LESSE(l, t, n) → IF(le(length(l), n), le(length(toList(t)), n), l, t, n)

The TRS R consists of the following rules:

lessElements(l, t) → lessE(l, t, 0)
lessE(l, t, n) → if(le(length(l), n), le(length(toList(t)), n), l, t, n)
if(true, b, l, t, n) → l
if(false, true, l, t, n) → t
if(false, false, l, t, n) → lessE(l, t, s(n))
length(nil) → 0
length(cons(n, l)) → s(length(l))
toList(leaf) → nil
toList(node(t1, n, t2)) → append(toList(t1), cons(n, toList(t2)))
append(nil, l2) → l2
append(cons(n, l1), l2) → cons(n, append(l1, l2))
le(s(n), 0) → false
le(0, m) → true
le(s(n), s(m)) → le(n, m)
ac
ad

The set Q consists of the following terms:

lessElements(x0, x1)
lessE(x0, x1, x2)
if(true, x0, x1, x2, x3)
if(false, true, x0, x1, x2)
if(false, false, x0, x1, x2)
length(nil)
length(cons(x0, x1))
toList(leaf)
toList(node(x0, x1, x2))
append(nil, x0)
append(cons(x0, x1), x2)
le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
a

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