(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
odd(S(x)) → even(x)
even(S(x)) → odd(x)
odd(0) → 0
even(0) → S(0)
Rewrite Strategy: INNERMOST
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
odd(S(S(x2_1))) →+ odd(x2_1)
gives rise to a decreasing loop by considering the right hand sides subterm at position [].
The pumping substitution is [x2_1 / S(S(x2_1))].
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:
odd(S(x)) → even(x)
even(S(x)) → odd(x)
odd(0') → 0'
even(0') → S(0')
S is empty.
Rewrite Strategy: INNERMOST
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
Innermost TRS:
Rules:
odd(S(x)) → even(x)
even(S(x)) → odd(x)
odd(0') → 0'
even(0') → S(0')
Types:
odd :: S:0' → S:0'
S :: S:0' → S:0'
even :: S:0' → S:0'
0' :: S:0'
hole_S:0'1_0 :: S:0'
gen_S:0'2_0 :: Nat → S:0'
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
odd,
evenThey will be analysed ascendingly in the following order:
odd = even
(8) Obligation:
Innermost TRS:
Rules:
odd(
S(
x)) →
even(
x)
even(
S(
x)) →
odd(
x)
odd(
0') →
0'even(
0') →
S(
0')
Types:
odd :: S:0' → S:0'
S :: S:0' → S:0'
even :: S:0' → S:0'
0' :: S:0'
hole_S:0'1_0 :: S:0'
gen_S:0'2_0 :: Nat → S:0'
Generator Equations:
gen_S:0'2_0(0) ⇔ 0'
gen_S:0'2_0(+(x, 1)) ⇔ S(gen_S:0'2_0(x))
The following defined symbols remain to be analysed:
even, odd
They will be analysed ascendingly in the following order:
odd = even
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
even(
gen_S:0'2_0(
*(
2,
n4_0))) →
gen_S:0'2_0(
1), rt ∈ Ω(1 + n4
0)
Induction Base:
even(gen_S:0'2_0(*(2, 0))) →RΩ(1)
S(0')
Induction Step:
even(gen_S:0'2_0(*(2, +(n4_0, 1)))) →RΩ(1)
odd(gen_S:0'2_0(+(1, *(2, n4_0)))) →RΩ(1)
even(gen_S:0'2_0(*(2, n4_0))) →IH
gen_S:0'2_0(1)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
Innermost TRS:
Rules:
odd(
S(
x)) →
even(
x)
even(
S(
x)) →
odd(
x)
odd(
0') →
0'even(
0') →
S(
0')
Types:
odd :: S:0' → S:0'
S :: S:0' → S:0'
even :: S:0' → S:0'
0' :: S:0'
hole_S:0'1_0 :: S:0'
gen_S:0'2_0 :: Nat → S:0'
Lemmas:
even(gen_S:0'2_0(*(2, n4_0))) → gen_S:0'2_0(1), rt ∈ Ω(1 + n40)
Generator Equations:
gen_S:0'2_0(0) ⇔ 0'
gen_S:0'2_0(+(x, 1)) ⇔ S(gen_S:0'2_0(x))
The following defined symbols remain to be analysed:
odd
They will be analysed ascendingly in the following order:
odd = even
(12) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol odd.
(13) Obligation:
Innermost TRS:
Rules:
odd(
S(
x)) →
even(
x)
even(
S(
x)) →
odd(
x)
odd(
0') →
0'even(
0') →
S(
0')
Types:
odd :: S:0' → S:0'
S :: S:0' → S:0'
even :: S:0' → S:0'
0' :: S:0'
hole_S:0'1_0 :: S:0'
gen_S:0'2_0 :: Nat → S:0'
Lemmas:
even(gen_S:0'2_0(*(2, n4_0))) → gen_S:0'2_0(1), rt ∈ Ω(1 + n40)
Generator Equations:
gen_S:0'2_0(0) ⇔ 0'
gen_S:0'2_0(+(x, 1)) ⇔ S(gen_S:0'2_0(x))
No more defined symbols left to analyse.
(14) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
even(gen_S:0'2_0(*(2, n4_0))) → gen_S:0'2_0(1), rt ∈ Ω(1 + n40)
(15) BOUNDS(n^1, INF)
(16) Obligation:
Innermost TRS:
Rules:
odd(
S(
x)) →
even(
x)
even(
S(
x)) →
odd(
x)
odd(
0') →
0'even(
0') →
S(
0')
Types:
odd :: S:0' → S:0'
S :: S:0' → S:0'
even :: S:0' → S:0'
0' :: S:0'
hole_S:0'1_0 :: S:0'
gen_S:0'2_0 :: Nat → S:0'
Lemmas:
even(gen_S:0'2_0(*(2, n4_0))) → gen_S:0'2_0(1), rt ∈ Ω(1 + n40)
Generator Equations:
gen_S:0'2_0(0) ⇔ 0'
gen_S:0'2_0(+(x, 1)) ⇔ S(gen_S:0'2_0(x))
No more defined symbols left to analyse.
(17) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
even(gen_S:0'2_0(*(2, n4_0))) → gen_S:0'2_0(1), rt ∈ Ω(1 + n40)
(18) BOUNDS(n^1, INF)