(0) Obligation:

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

le(s(x), 0) → false
le(0, y) → true
le(s(x), s(y)) → le(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
log(0) → logError
log(s(x)) → loop(s(x), s(0), 0)
loop(x, s(y), z) → if(le(x, s(y)), x, s(y), z)
if(true, x, y, z) → z
if(false, x, y, z) → loop(x, double(y), s(z))

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:

le(s(x), 0) → false
le(0, y) → true
le(s(x), s(y)) → le(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
log(0) → logError
log(s(x)) → loop(s(x), s(0), 0)
loop(x, s(y), z) → if(le(x, s(y)), x, s(y), z)
if(true, x, y, z) → z
if(false, x, y, z) → loop(x, double(y), s(z))

The set Q consists of the following terms:

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))
log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

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

LE(s(x), s(y)) → LE(x, y)
DOUBLE(s(x)) → DOUBLE(x)
LOG(s(x)) → LOOP(s(x), s(0), 0)
LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z)
LOOP(x, s(y), z) → LE(x, s(y))
IF(false, x, y, z) → LOOP(x, double(y), s(z))
IF(false, x, y, z) → DOUBLE(y)

The TRS R consists of the following rules:

le(s(x), 0) → false
le(0, y) → true
le(s(x), s(y)) → le(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
log(0) → logError
log(s(x)) → loop(s(x), s(0), 0)
loop(x, s(y), z) → if(le(x, s(y)), x, s(y), z)
if(true, x, y, z) → z
if(false, x, y, z) → loop(x, double(y), s(z))

The set Q consists of the following terms:

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))
log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

DOUBLE(s(x)) → DOUBLE(x)

The TRS R consists of the following rules:

le(s(x), 0) → false
le(0, y) → true
le(s(x), s(y)) → le(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
log(0) → logError
log(s(x)) → loop(s(x), s(0), 0)
loop(x, s(y), z) → if(le(x, s(y)), x, s(y), z)
if(true, x, y, z) → z
if(false, x, y, z) → loop(x, double(y), s(z))

The set Q consists of the following terms:

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))
log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

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:

DOUBLE(s(x)) → DOUBLE(x)

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

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))
log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

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

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))
log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

(11) Obligation:

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

DOUBLE(s(x)) → DOUBLE(x)

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:

  • DOUBLE(s(x)) → DOUBLE(x)
    The graph contains the following edges 1 > 1

(13) TRUE

(14) Obligation:

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

LE(s(x), s(y)) → LE(x, y)

The TRS R consists of the following rules:

le(s(x), 0) → false
le(0, y) → true
le(s(x), s(y)) → le(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
log(0) → logError
log(s(x)) → loop(s(x), s(0), 0)
loop(x, s(y), z) → if(le(x, s(y)), x, s(y), z)
if(true, x, y, z) → z
if(false, x, y, z) → loop(x, double(y), s(z))

The set Q consists of the following terms:

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))
log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

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:

LE(s(x), s(y)) → LE(x, y)

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

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))
log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

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

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))
log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

(18) Obligation:

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

LE(s(x), s(y)) → LE(x, y)

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

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

  • LE(s(x), s(y)) → LE(x, y)
    The graph contains the following edges 1 > 1, 2 > 2

(20) TRUE

(21) Obligation:

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

LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z)
IF(false, x, y, z) → LOOP(x, double(y), s(z))

The TRS R consists of the following rules:

le(s(x), 0) → false
le(0, y) → true
le(s(x), s(y)) → le(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
log(0) → logError
log(s(x)) → loop(s(x), s(0), 0)
loop(x, s(y), z) → if(le(x, s(y)), x, s(y), z)
if(true, x, y, z) → z
if(false, x, y, z) → loop(x, double(y), s(z))

The set Q consists of the following terms:

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))
log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

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

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

(23) Obligation:

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

LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z)
IF(false, x, y, z) → LOOP(x, double(y), s(z))

The TRS R consists of the following rules:

double(0) → 0
double(s(x)) → s(s(double(x)))
le(0, y) → true
le(s(x), s(y)) → le(x, y)
le(s(x), 0) → false

The set Q consists of the following terms:

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))
log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

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

(24) 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].

log(0)
log(s(x0))
loop(x0, s(x1), x2)
if(true, x0, x1, x2)
if(false, x0, x1, x2)

(25) Obligation:

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

LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z)
IF(false, x, y, z) → LOOP(x, double(y), s(z))

The TRS R consists of the following rules:

double(0) → 0
double(s(x)) → s(s(double(x)))
le(0, y) → true
le(s(x), s(y)) → le(x, y)
le(s(x), 0) → false

The set Q consists of the following terms:

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))

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

(26) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z) we obtained the following new rules [LPAR04]:

LOOP(z0, s(x1), s(z2)) → IF(le(z0, s(x1)), z0, s(x1), s(z2))

(27) Obligation:

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

IF(false, x, y, z) → LOOP(x, double(y), s(z))
LOOP(z0, s(x1), s(z2)) → IF(le(z0, s(x1)), z0, s(x1), s(z2))

The TRS R consists of the following rules:

double(0) → 0
double(s(x)) → s(s(double(x)))
le(0, y) → true
le(s(x), s(y)) → le(x, y)
le(s(x), 0) → false

The set Q consists of the following terms:

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))

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

(28) NonInfProof (EQUIVALENT transformation)

The DP Problem is simplified using the Induction Calculus [NONINF] with the following steps:
Note that final constraints are written in bold face.


For Pair LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z) the following chains were created:
  • We consider the chain LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z), IF(false, x, y, z) → LOOP(x, double(y), s(z)) which results in the following constraint:

    (1)    (IF(le(x3, s(x4)), x3, s(x4), x5)=IF(false, x6, x7, x8) ⇒ LOOP(x3, s(x4), x5)≥IF(le(x3, s(x4)), x3, s(x4), x5))



    We simplified constraint (1) using rules (I), (II), (IV), (VII) which results in the following new constraint:

    (2)    (s(x4)=x18le(x3, x18)=falseLOOP(x3, s(x4), x5)≥IF(le(x3, s(x4)), x3, s(x4), x5))



    We simplified constraint (2) using rule (V) (with possible (I) afterwards) using induction on le(x3, x18)=false which results in the following new constraints:

    (3)    (le(x21, x20)=falses(x4)=s(x20)∧(∀x22,x23:le(x21, x20)=falses(x22)=x20LOOP(x21, s(x22), x23)≥IF(le(x21, s(x22)), x21, s(x22), x23)) ⇒ LOOP(s(x21), s(x4), x5)≥IF(le(s(x21), s(x4)), s(x21), s(x4), x5))


    (4)    (false=falses(x4)=0LOOP(s(x24), s(x4), x5)≥IF(le(s(x24), s(x4)), s(x24), s(x4), x5))



    We simplified constraint (3) using rules (I), (II), (III), (IV) which results in the following new constraint:

    (5)    (le(x21, x20)=falseLOOP(s(x21), s(x20), x5)≥IF(le(s(x21), s(x20)), s(x21), s(x20), x5))



    We solved constraint (4) using rules (I), (II).We simplified constraint (5) using rule (V) (with possible (I) afterwards) using induction on le(x21, x20)=false which results in the following new constraints:

    (6)    (le(x27, x26)=false∧(∀x28:le(x27, x26)=falseLOOP(s(x27), s(x26), x28)≥IF(le(s(x27), s(x26)), s(x27), s(x26), x28)) ⇒ LOOP(s(s(x27)), s(s(x26)), x5)≥IF(le(s(s(x27)), s(s(x26))), s(s(x27)), s(s(x26)), x5))


    (7)    (false=falseLOOP(s(s(x29)), s(0), x5)≥IF(le(s(s(x29)), s(0)), s(s(x29)), s(0), x5))



    We simplified constraint (6) using rule (VI) where we applied the induction hypothesis (∀x28:le(x27, x26)=falseLOOP(s(x27), s(x26), x28)≥IF(le(s(x27), s(x26)), s(x27), s(x26), x28)) with σ = [x28 / x5] which results in the following new constraint:

    (8)    (LOOP(s(x27), s(x26), x5)≥IF(le(s(x27), s(x26)), s(x27), s(x26), x5) ⇒ LOOP(s(s(x27)), s(s(x26)), x5)≥IF(le(s(s(x27)), s(s(x26))), s(s(x27)), s(s(x26)), x5))



    We simplified constraint (7) using rules (I), (II) which results in the following new constraint:

    (9)    (LOOP(s(s(x29)), s(0), x5)≥IF(le(s(s(x29)), s(0)), s(s(x29)), s(0), x5))







For Pair IF(false, x, y, z) → LOOP(x, double(y), s(z)) the following chains were created:
  • We consider the chain IF(false, x, y, z) → LOOP(x, double(y), s(z)), LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z) which results in the following constraint:

    (10)    (LOOP(x9, double(x10), s(x11))=LOOP(x12, s(x13), x14) ⇒ IF(false, x9, x10, x11)≥LOOP(x9, double(x10), s(x11)))



    We simplified constraint (10) using rules (I), (II), (IV) which results in the following new constraint:

    (11)    (double(x10)=s(x13) ⇒ IF(false, x9, x10, x11)≥LOOP(x9, double(x10), s(x11)))



    We simplified constraint (11) using rule (V) (with possible (I) afterwards) using induction on double(x10)=s(x13) which results in the following new constraint:

    (12)    (s(s(double(x30)))=s(x13)∧(∀x31,x32,x33:double(x30)=s(x31) ⇒ IF(false, x32, x30, x33)≥LOOP(x32, double(x30), s(x33))) ⇒ IF(false, x9, s(x30), x11)≥LOOP(x9, double(s(x30)), s(x11)))



    We simplified constraint (12) using rules (I), (II), (IV) which results in the following new constraint:

    (13)    (IF(false, x9, s(x30), x11)≥LOOP(x9, double(s(x30)), s(x11)))







To summarize, we get the following constraints P for the following pairs.
  • LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z)
    • (LOOP(s(x27), s(x26), x5)≥IF(le(s(x27), s(x26)), s(x27), s(x26), x5) ⇒ LOOP(s(s(x27)), s(s(x26)), x5)≥IF(le(s(s(x27)), s(s(x26))), s(s(x27)), s(s(x26)), x5))
    • (LOOP(s(s(x29)), s(0), x5)≥IF(le(s(s(x29)), s(0)), s(s(x29)), s(0), x5))

  • IF(false, x, y, z) → LOOP(x, double(y), s(z))
    • (IF(false, x9, s(x30), x11)≥LOOP(x9, double(s(x30)), s(x11)))




The constraints for P> respective Pbound are constructed from P where we just replace every occurence of "t ≥ s" in P by "t > s" respective "t ≥ c". Here c stands for the fresh constant used for Pbound.
Using the following integer polynomial ordering the resulting constraints can be solved
Polynomial interpretation [NONINF]:

POL(0) = 0   
POL(IF(x1, x2, x3, x4)) = -1 - x1 + x2 - x3   
POL(LOOP(x1, x2, x3)) = -1 + x1 - x2   
POL(c) = -2   
POL(double(x1)) = 2·x1   
POL(false) = 0   
POL(le(x1, x2)) = 0   
POL(s(x1)) = 1 + x1   
POL(true) = 2   

The following pairs are in P>:

IF(false, x, y, z) → LOOP(x, double(y), s(z))
The following pairs are in Pbound:

LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z)
The following rules are usable:

0double(0)
s(s(double(x))) → double(s(x))
truele(0, y)
le(x, y) → le(s(x), s(y))
falsele(s(x), 0)

(29) Complex Obligation (AND)

(30) Obligation:

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

LOOP(x, s(y), z) → IF(le(x, s(y)), x, s(y), z)

The TRS R consists of the following rules:

double(0) → 0
double(s(x)) → s(s(double(x)))
le(0, y) → true
le(s(x), s(y)) → le(x, y)
le(s(x), 0) → false

The set Q consists of the following terms:

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))

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 1 less node.

(32) TRUE

(33) Obligation:

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

IF(false, x, y, z) → LOOP(x, double(y), s(z))

The TRS R consists of the following rules:

double(0) → 0
double(s(x)) → s(s(double(x)))
le(0, y) → true
le(s(x), s(y)) → le(x, y)
le(s(x), 0) → false

The set Q consists of the following terms:

le(s(x0), 0)
le(0, x0)
le(s(x0), s(x1))
double(0)
double(s(x0))

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

(34) DependencyGraphProof (EQUIVALENT transformation)

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

(35) TRUE