(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)  =  LE(x1)
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)
length(x1)  =  length(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

Lexicographic path order with status [LPO].
Quasi-Precedence:
[lessElements2, lessE2, if2] > [le1, true, false] > [LE1, s1]
[lessElements2, lessE2, if2] > length1 > [LE1, s1]
[lessElements2, lessE2, if2] > length1 > 0
toList1 > nil
toList1 > append2 > cons2 > [LE1, s1]
leaf > nil
node3 > cons2 > [LE1, s1]
[a, d] > c

Status:
LE1: [1]
s1: [1]
lessElements2: [1,2]
lessE2: [1,2]
0: []
if2: [1,2]
le1: [1]
length1: [1]
toList1: [1]
true: []
false: []
nil: []
cons2: [1,2]
leaf: []
node3: [1,3,2]
append2: [1,2]
a: []
c: []
d: []


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)  =  APPEND(x1)
cons(x1, x2)  =  cons(x2)
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
length(x1)  =  x1
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

Lexicographic path order with status [LPO].
Quasi-Precedence:
APPEND1 > s
[lessElements2, lessE2, if2] > 0 > [le, true, false] > s
toList1 > [nil, leaf] > 0 > [le, true, false] > s
toList1 > append2 > cons1 > s
node2 > append2 > cons1 > s
a > c > s
a > d > s

Status:
APPEND1: [1]
cons1: [1]
lessElements2: [2,1]
lessE2: [2,1]
0: []
if2: [2,1]
le: []
toList1: [1]
true: []
false: []
s: []
nil: []
leaf: []
node2: [2,1]
append2: [1,2]
a: []
c: []
d: []


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)  =  TOLIST(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(x1, x2)
length(x1)  =  length(x1)
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

Lexicographic path order with status [LPO].
Quasi-Precedence:
TOLIST1 > [toList1, nil, leaf]
node3 > append2 > [toList1, nil, leaf]
lessElements2 > [lessE2, if2] > [toList1, nil, leaf]
lessElements2 > 0 > [toList1, nil, leaf]
le2 > true > [toList1, nil, leaf]
le2 > false > [lessE2, if2] > [toList1, nil, leaf]
length1 > 0 > [toList1, nil, leaf]
a > c > [toList1, nil, leaf]
a > d > [toList1, nil, leaf]

Status:
TOLIST1: [1]
node3: [2,3,1]
lessElements2: [2,1]
lessE2: [2,1]
0: []
if2: [2,1]
le2: [1,2]
length1: [1]
toList1: [1]
true: []
false: []
nil: []
leaf: []
append2: [1,2]
a: []
c: []
d: []


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(x3, x4, x5)
le(x1, x2)  =  le
length(x1)  =  length(x1)
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

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

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


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.