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