(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 {c, a, 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)

Lexicographic Path Order [LPO].
Precedence:
trivial


The following usable rules [FROCOS05] were oriented: none

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

Lexicographic Path Order [LPO].
Precedence:
trivial


The following usable rules [FROCOS05] were oriented: none

(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, x3)

Lexicographic Path Order [LPO].
Precedence:
trivial


The following usable rules [FROCOS05] were oriented: none

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

Lexicographic Path Order [LPO].
Precedence:
trivial


The following usable rules [FROCOS05] were oriented: none

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