Runtime Complexity TRS:
The TRS R consists of the following rules:
fib(0) → 0
fib(s(0)) → s(0)
fib(s(s(0))) → s(0)
fib(s(s(x))) → sp(g(x))
g(0) → pair(s(0), 0)
g(s(0)) → pair(s(0), s(0))
g(s(x)) → np(g(x))
sp(pair(x, y)) → +(x, y)
np(pair(x, y)) → pair(+(x, y), x)
+(x, 0) → x
+(x, s(y)) → s(+(x, y))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
fib'(0') → 0'
fib'(s'(0')) → s'(0')
fib'(s'(s'(0'))) → s'(0')
fib'(s'(s'(x))) → sp'(g'(x))
g'(0') → pair'(s'(0'), 0')
g'(s'(0')) → pair'(s'(0'), s'(0'))
g'(s'(x)) → np'(g'(x))
sp'(pair'(x, y)) → +'(x, y)
np'(pair'(x, y)) → pair'(+'(x, y), x)
+'(x, 0') → x
+'(x, s'(y)) → s'(+'(x, y))
Infered types.
Rules:
fib'(0') → 0'
fib'(s'(0')) → s'(0')
fib'(s'(s'(0'))) → s'(0')
fib'(s'(s'(x))) → sp'(g'(x))
g'(0') → pair'(s'(0'), 0')
g'(s'(0')) → pair'(s'(0'), s'(0'))
g'(s'(x)) → np'(g'(x))
sp'(pair'(x, y)) → +'(x, y)
np'(pair'(x, y)) → pair'(+'(x, y), x)
+'(x, 0') → x
+'(x, s'(y)) → s'(+'(x, y))
Types:
fib' :: 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
sp' :: pair' → 0':s'
g' :: 0':s' → pair'
pair' :: 0':s' → 0':s' → pair'
np' :: pair' → pair'
+' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_pair'2 :: pair'
_gen_0':s'3 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
g', +'
Rules:
fib'(0') → 0'
fib'(s'(0')) → s'(0')
fib'(s'(s'(0'))) → s'(0')
fib'(s'(s'(x))) → sp'(g'(x))
g'(0') → pair'(s'(0'), 0')
g'(s'(0')) → pair'(s'(0'), s'(0'))
g'(s'(x)) → np'(g'(x))
sp'(pair'(x, y)) → +'(x, y)
np'(pair'(x, y)) → pair'(+'(x, y), x)
+'(x, 0') → x
+'(x, s'(y)) → s'(+'(x, y))
Types:
fib' :: 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
sp' :: pair' → 0':s'
g' :: 0':s' → pair'
pair' :: 0':s' → 0':s' → pair'
np' :: pair' → pair'
+' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_pair'2 :: pair'
_gen_0':s'3 :: Nat → 0':s'
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
g', +'
Proved the following rewrite lemma:
g'(_gen_0':s'3(+(1, _n5))) → _*4, rt ∈ Ω(n5)
Induction Base:
g'(_gen_0':s'3(+(1, 0)))
Induction Step:
g'(_gen_0':s'3(+(1, +(_$n6, 1)))) →RΩ(1)
np'(g'(_gen_0':s'3(+(1, _$n6)))) →IH
np'(_*4)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
fib'(0') → 0'
fib'(s'(0')) → s'(0')
fib'(s'(s'(0'))) → s'(0')
fib'(s'(s'(x))) → sp'(g'(x))
g'(0') → pair'(s'(0'), 0')
g'(s'(0')) → pair'(s'(0'), s'(0'))
g'(s'(x)) → np'(g'(x))
sp'(pair'(x, y)) → +'(x, y)
np'(pair'(x, y)) → pair'(+'(x, y), x)
+'(x, 0') → x
+'(x, s'(y)) → s'(+'(x, y))
Types:
fib' :: 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
sp' :: pair' → 0':s'
g' :: 0':s' → pair'
pair' :: 0':s' → 0':s' → pair'
np' :: pair' → pair'
+' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_pair'2 :: pair'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
g'(_gen_0':s'3(+(1, _n5))) → _*4, rt ∈ Ω(n5)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
+'
Proved the following rewrite lemma:
+'(_gen_0':s'3(a), _gen_0':s'3(_n5810)) → _gen_0':s'3(+(_n5810, a)), rt ∈ Ω(1 + n5810)
Induction Base:
+'(_gen_0':s'3(a), _gen_0':s'3(0)) →RΩ(1)
_gen_0':s'3(a)
Induction Step:
+'(_gen_0':s'3(_a5973), _gen_0':s'3(+(_$n5811, 1))) →RΩ(1)
s'(+'(_gen_0':s'3(_a5973), _gen_0':s'3(_$n5811))) →IH
s'(_gen_0':s'3(+(_$n5811, _a5973)))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
fib'(0') → 0'
fib'(s'(0')) → s'(0')
fib'(s'(s'(0'))) → s'(0')
fib'(s'(s'(x))) → sp'(g'(x))
g'(0') → pair'(s'(0'), 0')
g'(s'(0')) → pair'(s'(0'), s'(0'))
g'(s'(x)) → np'(g'(x))
sp'(pair'(x, y)) → +'(x, y)
np'(pair'(x, y)) → pair'(+'(x, y), x)
+'(x, 0') → x
+'(x, s'(y)) → s'(+'(x, y))
Types:
fib' :: 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
sp' :: pair' → 0':s'
g' :: 0':s' → pair'
pair' :: 0':s' → 0':s' → pair'
np' :: pair' → pair'
+' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_pair'2 :: pair'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
g'(_gen_0':s'3(+(1, _n5))) → _*4, rt ∈ Ω(n5)
+'(_gen_0':s'3(a), _gen_0':s'3(_n5810)) → _gen_0':s'3(+(_n5810, a)), rt ∈ Ω(1 + n5810)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
g'(_gen_0':s'3(+(1, _n5))) → _*4, rt ∈ Ω(n5)