(0) Obligation:

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

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

Q is empty.

(1) Overlay + Local Confluence (EQUIVALENT transformation)

The TRS is overlay and locally confluent. By [NOC] we can switch to innermost.

(2) Obligation:

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

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)
less_leaves(x0, x1)
if1(x0, true, x1, x2)
if1(x0, false, x1, x2)
if2(true, x0, x1)
if2(false, x0, x1)

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

CONCAT(cons(u, v), y) → CONCAT(v, y)
LESS_LEAVES(u, v) → IF1(isLeaf(u), isLeaf(v), u, v)
LESS_LEAVES(u, v) → ISLEAF(u)
LESS_LEAVES(u, v) → ISLEAF(v)
IF1(b, false, u, v) → IF2(b, u, v)
IF2(false, u, v) → LESS_LEAVES(concat(left(u), right(u)), concat(left(v), right(v)))
IF2(false, u, v) → CONCAT(left(u), right(u))
IF2(false, u, v) → LEFT(u)
IF2(false, u, v) → RIGHT(u)
IF2(false, u, v) → CONCAT(left(v), right(v))
IF2(false, u, v) → LEFT(v)
IF2(false, u, v) → RIGHT(v)

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)
less_leaves(x0, x1)
if1(x0, true, x1, x2)
if1(x0, false, x1, x2)
if2(true, x0, x1)
if2(false, x0, x1)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

CONCAT(cons(u, v), y) → CONCAT(v, y)

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)
less_leaves(x0, x1)
if1(x0, true, x1, x2)
if1(x0, false, x1, x2)
if2(true, x0, x1)
if2(false, x0, x1)

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

(8) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(9) Obligation:

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

CONCAT(cons(u, v), y) → CONCAT(v, y)

R is empty.
The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)
less_leaves(x0, x1)
if1(x0, true, x1, x2)
if1(x0, false, x1, x2)
if2(true, x0, x1)
if2(false, x0, x1)

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

(10) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)
less_leaves(x0, x1)
if1(x0, true, x1, x2)
if1(x0, false, x1, x2)
if2(true, x0, x1)
if2(false, x0, x1)

(11) Obligation:

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

CONCAT(cons(u, v), y) → CONCAT(v, y)

R is empty.
Q is empty.
We have to consider all minimal (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:

  • CONCAT(cons(u, v), y) → CONCAT(v, y)
    The graph contains the following edges 1 > 1, 2 >= 2

(13) TRUE

(14) Obligation:

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

IF2(false, u, v) → LESS_LEAVES(concat(left(u), right(u)), concat(left(v), right(v)))
LESS_LEAVES(u, v) → IF1(isLeaf(u), isLeaf(v), u, v)
IF1(b, false, u, v) → IF2(b, u, v)

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)
less_leaves(x0, x1)
if1(x0, true, x1, x2)
if1(x0, false, x1, x2)
if2(true, x0, x1)
if2(false, x0, x1)

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

(15) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(16) Obligation:

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

IF2(false, u, v) → LESS_LEAVES(concat(left(u), right(u)), concat(left(v), right(v)))
LESS_LEAVES(u, v) → IF1(isLeaf(u), isLeaf(v), u, v)
IF1(b, false, u, v) → IF2(b, u, v)

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)
less_leaves(x0, x1)
if1(x0, true, x1, x2)
if1(x0, false, x1, x2)
if2(true, x0, x1)
if2(false, x0, x1)

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

(17) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

less_leaves(x0, x1)
if1(x0, true, x1, x2)
if1(x0, false, x1, x2)
if2(true, x0, x1)
if2(false, x0, x1)

(18) Obligation:

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

IF2(false, u, v) → LESS_LEAVES(concat(left(u), right(u)), concat(left(v), right(v)))
LESS_LEAVES(u, v) → IF1(isLeaf(u), isLeaf(v), u, v)
IF1(b, false, u, v) → IF2(b, u, v)

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)

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

(19) Narrowing (EQUIVALENT transformation)

By narrowing [LPAR04] the rule LESS_LEAVES(u, v) → IF1(isLeaf(u), isLeaf(v), u, v) at position [1] we obtained the following new rules [LPAR04]:

LESS_LEAVES(y0, leaf) → IF1(isLeaf(y0), true, y0, leaf)
LESS_LEAVES(y0, cons(x0, x1)) → IF1(isLeaf(y0), false, y0, cons(x0, x1))

(20) Obligation:

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

IF2(false, u, v) → LESS_LEAVES(concat(left(u), right(u)), concat(left(v), right(v)))
IF1(b, false, u, v) → IF2(b, u, v)
LESS_LEAVES(y0, leaf) → IF1(isLeaf(y0), true, y0, leaf)
LESS_LEAVES(y0, cons(x0, x1)) → IF1(isLeaf(y0), false, y0, cons(x0, x1))

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)

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

(21) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.

(22) Obligation:

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

LESS_LEAVES(y0, cons(x0, x1)) → IF1(isLeaf(y0), false, y0, cons(x0, x1))
IF1(b, false, u, v) → IF2(b, u, v)
IF2(false, u, v) → LESS_LEAVES(concat(left(u), right(u)), concat(left(v), right(v)))

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)

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

(23) Narrowing (EQUIVALENT transformation)

By narrowing [LPAR04] the rule IF2(false, u, v) → LESS_LEAVES(concat(left(u), right(u)), concat(left(v), right(v))) at position [1] we obtained the following new rules [LPAR04]:

IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(x0, right(cons(x0, x1))))
IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(left(cons(x0, x1)), x1))

(24) Obligation:

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

LESS_LEAVES(y0, cons(x0, x1)) → IF1(isLeaf(y0), false, y0, cons(x0, x1))
IF1(b, false, u, v) → IF2(b, u, v)
IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(x0, right(cons(x0, x1))))
IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(left(cons(x0, x1)), x1))

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)

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

(25) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(x0, right(cons(x0, x1)))) at position [1,1] we obtained the following new rules [LPAR04]:

IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(x0, x1))

(26) Obligation:

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

LESS_LEAVES(y0, cons(x0, x1)) → IF1(isLeaf(y0), false, y0, cons(x0, x1))
IF1(b, false, u, v) → IF2(b, u, v)
IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(left(cons(x0, x1)), x1))
IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(x0, x1))

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)

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

(27) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(left(cons(x0, x1)), x1)) at position [1,0] we obtained the following new rules [LPAR04]:

IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(x0, x1))

(28) Obligation:

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

LESS_LEAVES(y0, cons(x0, x1)) → IF1(isLeaf(y0), false, y0, cons(x0, x1))
IF1(b, false, u, v) → IF2(b, u, v)
IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(x0, x1))

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)

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

(29) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


IF2(false, y0, cons(x0, x1)) → LESS_LEAVES(concat(left(y0), right(y0)), concat(x0, x1))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(IF1(x1, x2, x3, x4)) = x1 + x4   
POL(IF2(x1, x2, x3)) = x1 + x3   
POL(LESS_LEAVES(x1, x2)) = 1 + x2   
POL(concat(x1, x2)) = x1 + x2   
POL(cons(x1, x2)) = 1 + x1 + x2   
POL(false) = 1   
POL(isLeaf(x1)) = 1   
POL(leaf) = 0   
POL(left(x1)) = 0   
POL(right(x1)) = 0   
POL(true) = 0   

The following usable rules [FROCOS05] were oriented:

isLeaf(cons(u, v)) → false
isLeaf(leaf) → true
concat(cons(u, v), y) → cons(u, concat(v, y))
concat(leaf, y) → y

(30) Obligation:

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

LESS_LEAVES(y0, cons(x0, x1)) → IF1(isLeaf(y0), false, y0, cons(x0, x1))
IF1(b, false, u, v) → IF2(b, u, v)

The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))

The set Q consists of the following terms:

isLeaf(leaf)
isLeaf(cons(x0, x1))
left(cons(x0, x1))
right(cons(x0, x1))
concat(leaf, x0)
concat(cons(x0, x1), x2)

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

(31) DependencyGraphProof (EQUIVALENT transformation)

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

(32) TRUE