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