(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
cond1(true, x) → cond2(even(x), x)
cond2(true, x) → cond1(neq(x, 0), div2(x))
cond2(false, x) → cond1(neq(x, 0), p(x))
neq(0, 0) → false
neq(0, s(x)) → true
neq(s(x), 0) → true
neq(s(x), s(y)) → neq(x, y)
even(0) → true
even(s(0)) → false
even(s(s(x))) → even(x)
div2(0) → 0
div2(s(0)) → 0
div2(s(s(x))) → s(div2(x))
p(0) → 0
p(s(x)) → x
Rewrite Strategy: FULL
 
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
even(s(s(x))) →+ even(x)
gives rise to a decreasing loop by considering the right hand sides subterm at position [].
The pumping substitution is [x / s(s(x))].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
cond1(true, x) → cond2(even(x), x)
cond2(true, x) → cond1(neq(x, 0'), div2(x))
cond2(false, x) → cond1(neq(x, 0'), p(x))
neq(0', 0') → false
neq(0', s(x)) → true
neq(s(x), 0') → true
neq(s(x), s(y)) → neq(x, y)
even(0') → true
even(s(0')) → false
even(s(s(x))) → even(x)
div2(0') → 0'
div2(s(0')) → 0'
div2(s(s(x))) → s(div2(x))
p(0') → 0'
p(s(x)) → x
S is empty.
Rewrite Strategy: FULL
 
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
cond1(true, x) → cond2(even(x), x)
cond2(true, x) → cond1(neq(x, 0'), div2(x))
cond2(false, x) → cond1(neq(x, 0'), p(x))
neq(0', 0') → false
neq(0', s(x)) → true
neq(s(x), 0') → true
neq(s(x), s(y)) → neq(x, y)
even(0') → true
even(s(0')) → false
even(s(s(x))) → even(x)
div2(0') → 0'
div2(s(0')) → 0'
div2(s(s(x))) → s(div2(x))
p(0') → 0'
p(s(x)) → x
Types:
cond1 :: true:false → 0':s:y → cond1:cond2
true :: true:false
cond2 :: true:false → 0':s:y → cond1:cond2
even :: 0':s:y → true:false
neq :: 0':s:y → 0':s:y → true:false
0' :: 0':s:y
div2 :: 0':s:y → 0':s:y
false :: true:false
p :: 0':s:y → 0':s:y
s :: 0':s:y → 0':s:y
y :: 0':s:y
hole_cond1:cond21_0 :: cond1:cond2
hole_true:false2_0 :: true:false
hole_0':s:y3_0 :: 0':s:y
gen_0':s:y4_0 :: Nat → 0':s:y
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
cond1, 
cond2, 
even, 
neq, 
div2They will be analysed ascendingly in the following order:
cond1 = cond2
even < cond1
neq < cond2
div2 < cond2
 
(8) Obligation:
TRS:
Rules:
cond1(
true, 
x) → 
cond2(
even(
x), 
x)
cond2(
true, 
x) → 
cond1(
neq(
x, 
0'), 
div2(
x))
cond2(
false, 
x) → 
cond1(
neq(
x, 
0'), 
p(
x))
neq(
0', 
0') → 
falseneq(
0', 
s(
x)) → 
trueneq(
s(
x), 
0') → 
trueneq(
s(
x), 
s(
y)) → 
neq(
x, 
y)
even(
0') → 
trueeven(
s(
0')) → 
falseeven(
s(
s(
x))) → 
even(
x)
div2(
0') → 
0'div2(
s(
0')) → 
0'div2(
s(
s(
x))) → 
s(
div2(
x))
p(
0') → 
0'p(
s(
x)) → 
xTypes:
cond1 :: true:false → 0':s:y → cond1:cond2
true :: true:false
cond2 :: true:false → 0':s:y → cond1:cond2
even :: 0':s:y → true:false
neq :: 0':s:y → 0':s:y → true:false
0' :: 0':s:y
div2 :: 0':s:y → 0':s:y
false :: true:false
p :: 0':s:y → 0':s:y
s :: 0':s:y → 0':s:y
y :: 0':s:y
hole_cond1:cond21_0 :: cond1:cond2
hole_true:false2_0 :: true:false
hole_0':s:y3_0 :: 0':s:y
gen_0':s:y4_0 :: Nat → 0':s:y
Generator Equations:
gen_0':s:y4_0(0) ⇔ 0'
gen_0':s:y4_0(+(x, 1)) ⇔ s(gen_0':s:y4_0(x))
The following defined symbols remain to be analysed:
even, cond1, cond2, neq, div2
They will be analysed ascendingly in the following order:
cond1 = cond2
even < cond1
neq < cond2
div2 < cond2
 
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
even(
gen_0':s:y4_0(
*(
2, 
n6_0))) → 
true, rt ∈ Ω(1 + n6
0)
Induction Base:
even(gen_0':s:y4_0(*(2, 0))) →RΩ(1)
true
Induction Step:
even(gen_0':s:y4_0(*(2, +(n6_0, 1)))) →RΩ(1)
even(gen_0':s:y4_0(*(2, n6_0))) →IH
true
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
 
(10) Complex Obligation (BEST)
(11) Obligation:
TRS:
Rules:
cond1(
true, 
x) → 
cond2(
even(
x), 
x)
cond2(
true, 
x) → 
cond1(
neq(
x, 
0'), 
div2(
x))
cond2(
false, 
x) → 
cond1(
neq(
x, 
0'), 
p(
x))
neq(
0', 
0') → 
falseneq(
0', 
s(
x)) → 
trueneq(
s(
x), 
0') → 
trueneq(
s(
x), 
s(
y)) → 
neq(
x, 
y)
even(
0') → 
trueeven(
s(
0')) → 
falseeven(
s(
s(
x))) → 
even(
x)
div2(
0') → 
0'div2(
s(
0')) → 
0'div2(
s(
s(
x))) → 
s(
div2(
x))
p(
0') → 
0'p(
s(
x)) → 
xTypes:
cond1 :: true:false → 0':s:y → cond1:cond2
true :: true:false
cond2 :: true:false → 0':s:y → cond1:cond2
even :: 0':s:y → true:false
neq :: 0':s:y → 0':s:y → true:false
0' :: 0':s:y
div2 :: 0':s:y → 0':s:y
false :: true:false
p :: 0':s:y → 0':s:y
s :: 0':s:y → 0':s:y
y :: 0':s:y
hole_cond1:cond21_0 :: cond1:cond2
hole_true:false2_0 :: true:false
hole_0':s:y3_0 :: 0':s:y
gen_0':s:y4_0 :: Nat → 0':s:y
Lemmas:
even(gen_0':s:y4_0(*(2, n6_0))) → true, rt ∈ Ω(1 + n60)
Generator Equations:
gen_0':s:y4_0(0) ⇔ 0'
gen_0':s:y4_0(+(x, 1)) ⇔ s(gen_0':s:y4_0(x))
The following defined symbols remain to be analysed:
neq, cond1, cond2, div2
They will be analysed ascendingly in the following order:
cond1 = cond2
neq < cond2
div2 < cond2
 
(12) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol neq.
(13) Obligation:
TRS:
Rules:
cond1(
true, 
x) → 
cond2(
even(
x), 
x)
cond2(
true, 
x) → 
cond1(
neq(
x, 
0'), 
div2(
x))
cond2(
false, 
x) → 
cond1(
neq(
x, 
0'), 
p(
x))
neq(
0', 
0') → 
falseneq(
0', 
s(
x)) → 
trueneq(
s(
x), 
0') → 
trueneq(
s(
x), 
s(
y)) → 
neq(
x, 
y)
even(
0') → 
trueeven(
s(
0')) → 
falseeven(
s(
s(
x))) → 
even(
x)
div2(
0') → 
0'div2(
s(
0')) → 
0'div2(
s(
s(
x))) → 
s(
div2(
x))
p(
0') → 
0'p(
s(
x)) → 
xTypes:
cond1 :: true:false → 0':s:y → cond1:cond2
true :: true:false
cond2 :: true:false → 0':s:y → cond1:cond2
even :: 0':s:y → true:false
neq :: 0':s:y → 0':s:y → true:false
0' :: 0':s:y
div2 :: 0':s:y → 0':s:y
false :: true:false
p :: 0':s:y → 0':s:y
s :: 0':s:y → 0':s:y
y :: 0':s:y
hole_cond1:cond21_0 :: cond1:cond2
hole_true:false2_0 :: true:false
hole_0':s:y3_0 :: 0':s:y
gen_0':s:y4_0 :: Nat → 0':s:y
Lemmas:
even(gen_0':s:y4_0(*(2, n6_0))) → true, rt ∈ Ω(1 + n60)
Generator Equations:
gen_0':s:y4_0(0) ⇔ 0'
gen_0':s:y4_0(+(x, 1)) ⇔ s(gen_0':s:y4_0(x))
The following defined symbols remain to be analysed:
div2, cond1, cond2
They will be analysed ascendingly in the following order:
cond1 = cond2
div2 < cond2
 
(14) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
div2(
gen_0':s:y4_0(
*(
2, 
n198_0))) → 
gen_0':s:y4_0(
n198_0), rt ∈ Ω(1 + n198
0)
Induction Base:
div2(gen_0':s:y4_0(*(2, 0))) →RΩ(1)
0'
Induction Step:
div2(gen_0':s:y4_0(*(2, +(n198_0, 1)))) →RΩ(1)
s(div2(gen_0':s:y4_0(*(2, n198_0)))) →IH
s(gen_0':s:y4_0(c199_0))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
 
(15) Complex Obligation (BEST)
(16) Obligation:
TRS:
Rules:
cond1(
true, 
x) → 
cond2(
even(
x), 
x)
cond2(
true, 
x) → 
cond1(
neq(
x, 
0'), 
div2(
x))
cond2(
false, 
x) → 
cond1(
neq(
x, 
0'), 
p(
x))
neq(
0', 
0') → 
falseneq(
0', 
s(
x)) → 
trueneq(
s(
x), 
0') → 
trueneq(
s(
x), 
s(
y)) → 
neq(
x, 
y)
even(
0') → 
trueeven(
s(
0')) → 
falseeven(
s(
s(
x))) → 
even(
x)
div2(
0') → 
0'div2(
s(
0')) → 
0'div2(
s(
s(
x))) → 
s(
div2(
x))
p(
0') → 
0'p(
s(
x)) → 
xTypes:
cond1 :: true:false → 0':s:y → cond1:cond2
true :: true:false
cond2 :: true:false → 0':s:y → cond1:cond2
even :: 0':s:y → true:false
neq :: 0':s:y → 0':s:y → true:false
0' :: 0':s:y
div2 :: 0':s:y → 0':s:y
false :: true:false
p :: 0':s:y → 0':s:y
s :: 0':s:y → 0':s:y
y :: 0':s:y
hole_cond1:cond21_0 :: cond1:cond2
hole_true:false2_0 :: true:false
hole_0':s:y3_0 :: 0':s:y
gen_0':s:y4_0 :: Nat → 0':s:y
Lemmas:
even(gen_0':s:y4_0(*(2, n6_0))) → true, rt ∈ Ω(1 + n60)
div2(gen_0':s:y4_0(*(2, n198_0))) → gen_0':s:y4_0(n198_0), rt ∈ Ω(1 + n1980)
Generator Equations:
gen_0':s:y4_0(0) ⇔ 0'
gen_0':s:y4_0(+(x, 1)) ⇔ s(gen_0':s:y4_0(x))
The following defined symbols remain to be analysed:
cond2, cond1
They will be analysed ascendingly in the following order:
cond1 = cond2
 
(17) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol cond2.
(18) Obligation:
TRS:
Rules:
cond1(
true, 
x) → 
cond2(
even(
x), 
x)
cond2(
true, 
x) → 
cond1(
neq(
x, 
0'), 
div2(
x))
cond2(
false, 
x) → 
cond1(
neq(
x, 
0'), 
p(
x))
neq(
0', 
0') → 
falseneq(
0', 
s(
x)) → 
trueneq(
s(
x), 
0') → 
trueneq(
s(
x), 
s(
y)) → 
neq(
x, 
y)
even(
0') → 
trueeven(
s(
0')) → 
falseeven(
s(
s(
x))) → 
even(
x)
div2(
0') → 
0'div2(
s(
0')) → 
0'div2(
s(
s(
x))) → 
s(
div2(
x))
p(
0') → 
0'p(
s(
x)) → 
xTypes:
cond1 :: true:false → 0':s:y → cond1:cond2
true :: true:false
cond2 :: true:false → 0':s:y → cond1:cond2
even :: 0':s:y → true:false
neq :: 0':s:y → 0':s:y → true:false
0' :: 0':s:y
div2 :: 0':s:y → 0':s:y
false :: true:false
p :: 0':s:y → 0':s:y
s :: 0':s:y → 0':s:y
y :: 0':s:y
hole_cond1:cond21_0 :: cond1:cond2
hole_true:false2_0 :: true:false
hole_0':s:y3_0 :: 0':s:y
gen_0':s:y4_0 :: Nat → 0':s:y
Lemmas:
even(gen_0':s:y4_0(*(2, n6_0))) → true, rt ∈ Ω(1 + n60)
div2(gen_0':s:y4_0(*(2, n198_0))) → gen_0':s:y4_0(n198_0), rt ∈ Ω(1 + n1980)
Generator Equations:
gen_0':s:y4_0(0) ⇔ 0'
gen_0':s:y4_0(+(x, 1)) ⇔ s(gen_0':s:y4_0(x))
The following defined symbols remain to be analysed:
cond1
They will be analysed ascendingly in the following order:
cond1 = cond2
 
(19) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol cond1.
(20) Obligation:
TRS:
Rules:
cond1(
true, 
x) → 
cond2(
even(
x), 
x)
cond2(
true, 
x) → 
cond1(
neq(
x, 
0'), 
div2(
x))
cond2(
false, 
x) → 
cond1(
neq(
x, 
0'), 
p(
x))
neq(
0', 
0') → 
falseneq(
0', 
s(
x)) → 
trueneq(
s(
x), 
0') → 
trueneq(
s(
x), 
s(
y)) → 
neq(
x, 
y)
even(
0') → 
trueeven(
s(
0')) → 
falseeven(
s(
s(
x))) → 
even(
x)
div2(
0') → 
0'div2(
s(
0')) → 
0'div2(
s(
s(
x))) → 
s(
div2(
x))
p(
0') → 
0'p(
s(
x)) → 
xTypes:
cond1 :: true:false → 0':s:y → cond1:cond2
true :: true:false
cond2 :: true:false → 0':s:y → cond1:cond2
even :: 0':s:y → true:false
neq :: 0':s:y → 0':s:y → true:false
0' :: 0':s:y
div2 :: 0':s:y → 0':s:y
false :: true:false
p :: 0':s:y → 0':s:y
s :: 0':s:y → 0':s:y
y :: 0':s:y
hole_cond1:cond21_0 :: cond1:cond2
hole_true:false2_0 :: true:false
hole_0':s:y3_0 :: 0':s:y
gen_0':s:y4_0 :: Nat → 0':s:y
Lemmas:
even(gen_0':s:y4_0(*(2, n6_0))) → true, rt ∈ Ω(1 + n60)
div2(gen_0':s:y4_0(*(2, n198_0))) → gen_0':s:y4_0(n198_0), rt ∈ Ω(1 + n1980)
Generator Equations:
gen_0':s:y4_0(0) ⇔ 0'
gen_0':s:y4_0(+(x, 1)) ⇔ s(gen_0':s:y4_0(x))
No more defined symbols left to analyse.
 
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
even(gen_0':s:y4_0(*(2, n6_0))) → true, rt ∈ Ω(1 + n60)
(22) BOUNDS(n^1, INF)
(23) Obligation:
TRS:
Rules:
cond1(
true, 
x) → 
cond2(
even(
x), 
x)
cond2(
true, 
x) → 
cond1(
neq(
x, 
0'), 
div2(
x))
cond2(
false, 
x) → 
cond1(
neq(
x, 
0'), 
p(
x))
neq(
0', 
0') → 
falseneq(
0', 
s(
x)) → 
trueneq(
s(
x), 
0') → 
trueneq(
s(
x), 
s(
y)) → 
neq(
x, 
y)
even(
0') → 
trueeven(
s(
0')) → 
falseeven(
s(
s(
x))) → 
even(
x)
div2(
0') → 
0'div2(
s(
0')) → 
0'div2(
s(
s(
x))) → 
s(
div2(
x))
p(
0') → 
0'p(
s(
x)) → 
xTypes:
cond1 :: true:false → 0':s:y → cond1:cond2
true :: true:false
cond2 :: true:false → 0':s:y → cond1:cond2
even :: 0':s:y → true:false
neq :: 0':s:y → 0':s:y → true:false
0' :: 0':s:y
div2 :: 0':s:y → 0':s:y
false :: true:false
p :: 0':s:y → 0':s:y
s :: 0':s:y → 0':s:y
y :: 0':s:y
hole_cond1:cond21_0 :: cond1:cond2
hole_true:false2_0 :: true:false
hole_0':s:y3_0 :: 0':s:y
gen_0':s:y4_0 :: Nat → 0':s:y
Lemmas:
even(gen_0':s:y4_0(*(2, n6_0))) → true, rt ∈ Ω(1 + n60)
div2(gen_0':s:y4_0(*(2, n198_0))) → gen_0':s:y4_0(n198_0), rt ∈ Ω(1 + n1980)
Generator Equations:
gen_0':s:y4_0(0) ⇔ 0'
gen_0':s:y4_0(+(x, 1)) ⇔ s(gen_0':s:y4_0(x))
No more defined symbols left to analyse.
 
(24) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
even(gen_0':s:y4_0(*(2, n6_0))) → true, rt ∈ Ω(1 + n60)
(25) BOUNDS(n^1, INF)
(26) Obligation:
TRS:
Rules:
cond1(
true, 
x) → 
cond2(
even(
x), 
x)
cond2(
true, 
x) → 
cond1(
neq(
x, 
0'), 
div2(
x))
cond2(
false, 
x) → 
cond1(
neq(
x, 
0'), 
p(
x))
neq(
0', 
0') → 
falseneq(
0', 
s(
x)) → 
trueneq(
s(
x), 
0') → 
trueneq(
s(
x), 
s(
y)) → 
neq(
x, 
y)
even(
0') → 
trueeven(
s(
0')) → 
falseeven(
s(
s(
x))) → 
even(
x)
div2(
0') → 
0'div2(
s(
0')) → 
0'div2(
s(
s(
x))) → 
s(
div2(
x))
p(
0') → 
0'p(
s(
x)) → 
xTypes:
cond1 :: true:false → 0':s:y → cond1:cond2
true :: true:false
cond2 :: true:false → 0':s:y → cond1:cond2
even :: 0':s:y → true:false
neq :: 0':s:y → 0':s:y → true:false
0' :: 0':s:y
div2 :: 0':s:y → 0':s:y
false :: true:false
p :: 0':s:y → 0':s:y
s :: 0':s:y → 0':s:y
y :: 0':s:y
hole_cond1:cond21_0 :: cond1:cond2
hole_true:false2_0 :: true:false
hole_0':s:y3_0 :: 0':s:y
gen_0':s:y4_0 :: Nat → 0':s:y
Lemmas:
even(gen_0':s:y4_0(*(2, n6_0))) → true, rt ∈ Ω(1 + n60)
Generator Equations:
gen_0':s:y4_0(0) ⇔ 0'
gen_0':s:y4_0(+(x, 1)) ⇔ s(gen_0':s:y4_0(x))
No more defined symbols left to analyse.
 
(27) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
even(gen_0':s:y4_0(*(2, n6_0))) → true, rt ∈ Ω(1 + n60)
(28) BOUNDS(n^1, INF)