Runtime Complexity TRS:
The TRS R consists of the following rules:
g(s(x)) → f(x)
f(0) → s(0)
f(s(x)) → s(s(g(x)))
g(0) → 0
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
g'(s'(x)) → f'(x)
f'(0') → s'(0')
f'(s'(x)) → s'(s'(g'(x)))
g'(0') → 0'
Infered types.
Rules:
g'(s'(x)) → f'(x)
f'(0') → s'(0')
f'(s'(x)) → s'(s'(g'(x)))
g'(0') → 0'
Types:
g' :: s':0' → s':0'
s' :: s':0' → s':0'
f' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'
Heuristically decided to analyse the following defined symbols:
g', f'
They will be analysed ascendingly in the following order:
g' = f'
Rules:
g'(s'(x)) → f'(x)
f'(0') → s'(0')
f'(s'(x)) → s'(s'(g'(x)))
g'(0') → 0'
Types:
g' :: s':0' → s':0'
s' :: s':0' → s':0'
f' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'
Generator Equations:
_gen_s':0'2(0) ⇔ 0'
_gen_s':0'2(+(x, 1)) ⇔ s'(_gen_s':0'2(x))
The following defined symbols remain to be analysed:
f', g'
They will be analysed ascendingly in the following order:
g' = f'
Proved the following rewrite lemma:
f'(_gen_s':0'2(*(2, _n4))) → _gen_s':0'2(+(1, *(2, _n4))), rt ∈ Ω(1 + n4)
Induction Base:
f'(_gen_s':0'2(*(2, 0))) →RΩ(1)
s'(0')
Induction Step:
f'(_gen_s':0'2(*(2, +(_$n5, 1)))) →RΩ(1)
s'(s'(g'(_gen_s':0'2(+(1, *(2, _$n5)))))) →RΩ(1)
s'(s'(f'(_gen_s':0'2(*(2, _$n5))))) →IH
s'(s'(_gen_s':0'2(+(1, *(2, _$n5)))))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
g'(s'(x)) → f'(x)
f'(0') → s'(0')
f'(s'(x)) → s'(s'(g'(x)))
g'(0') → 0'
Types:
g' :: s':0' → s':0'
s' :: s':0' → s':0'
f' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'
Lemmas:
f'(_gen_s':0'2(*(2, _n4))) → _gen_s':0'2(+(1, *(2, _n4))), rt ∈ Ω(1 + n4)
Generator Equations:
_gen_s':0'2(0) ⇔ 0'
_gen_s':0'2(+(x, 1)) ⇔ s'(_gen_s':0'2(x))
The following defined symbols remain to be analysed:
g'
They will be analysed ascendingly in the following order:
g' = f'
Could not prove a rewrite lemma for the defined symbol g'.
Rules:
g'(s'(x)) → f'(x)
f'(0') → s'(0')
f'(s'(x)) → s'(s'(g'(x)))
g'(0') → 0'
Types:
g' :: s':0' → s':0'
s' :: s':0' → s':0'
f' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'
Lemmas:
f'(_gen_s':0'2(*(2, _n4))) → _gen_s':0'2(+(1, *(2, _n4))), rt ∈ Ω(1 + n4)
Generator Equations:
_gen_s':0'2(0) ⇔ 0'
_gen_s':0'2(+(x, 1)) ⇔ s'(_gen_s':0'2(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
f'(_gen_s':0'2(*(2, _n4))) → _gen_s':0'2(+(1, *(2, _n4))), rt ∈ Ω(1 + n4)