Runtime Complexity TRS:
The TRS R consists of the following rules:
lt(0, s(x)) → true
lt(x, 0) → false
lt(s(x), s(y)) → lt(x, y)
fibo(0) → fib(0)
fibo(s(0)) → fib(s(0))
fibo(s(s(x))) → sum(fibo(s(x)), fibo(x))
fib(0) → s(0)
fib(s(0)) → s(0)
fib(s(s(x))) → if(true, 0, s(s(x)), 0, 0)
if(true, c, s(s(x)), a, b) → if(lt(s(c), s(s(x))), s(c), s(s(x)), b, c)
if(false, c, s(s(x)), a, b) → sum(fibo(a), fibo(b))
sum(x, 0) → x
sum(x, s(y)) → s(sum(x, y))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
fibo'(0') → fib'(0')
fibo'(s'(0')) → fib'(s'(0'))
fibo'(s'(s'(x))) → sum'(fibo'(s'(x)), fibo'(x))
fib'(0') → s'(0')
fib'(s'(0')) → s'(0')
fib'(s'(s'(x))) → if'(true', 0', s'(s'(x)), 0', 0')
if'(true', c, s'(s'(x)), a, b) → if'(lt'(s'(c), s'(s'(x))), s'(c), s'(s'(x)), b, c)
if'(false', c, s'(s'(x)), a, b) → sum'(fibo'(a), fibo'(b))
sum'(x, 0') → x
sum'(x, s'(y)) → s'(sum'(x, y))
Infered types.
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
fibo'(0') → fib'(0')
fibo'(s'(0')) → fib'(s'(0'))
fibo'(s'(s'(x))) → sum'(fibo'(s'(x)), fibo'(x))
fib'(0') → s'(0')
fib'(s'(0')) → s'(0')
fib'(s'(s'(x))) → if'(true', 0', s'(s'(x)), 0', 0')
if'(true', c, s'(s'(x)), a, b) → if'(lt'(s'(c), s'(s'(x))), s'(c), s'(s'(x)), b, c)
if'(false', c, s'(s'(x)), a, b) → sum'(fibo'(a), fibo'(b))
sum'(x, 0') → x
sum'(x, s'(y)) → s'(sum'(x, y))
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
fibo' :: 0':s' → 0':s'
fib' :: 0':s' → 0':s'
sum' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
lt', fibo', fib', sum', if'
They will be analysed ascendingly in the following order:
lt' < if'
fibo' = fib'
sum' < fibo'
fibo' = if'
fib' = if'
sum' < if'
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
fibo'(0') → fib'(0')
fibo'(s'(0')) → fib'(s'(0'))
fibo'(s'(s'(x))) → sum'(fibo'(s'(x)), fibo'(x))
fib'(0') → s'(0')
fib'(s'(0')) → s'(0')
fib'(s'(s'(x))) → if'(true', 0', s'(s'(x)), 0', 0')
if'(true', c, s'(s'(x)), a, b) → if'(lt'(s'(c), s'(s'(x))), s'(c), s'(s'(x)), b, c)
if'(false', c, s'(s'(x)), a, b) → sum'(fibo'(a), fibo'(b))
sum'(x, 0') → x
sum'(x, s'(y)) → s'(sum'(x, y))
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
fibo' :: 0':s' → 0':s'
fib' :: 0':s' → 0':s'
sum' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_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:
lt', fibo', fib', sum', if'
They will be analysed ascendingly in the following order:
lt' < if'
fibo' = fib'
sum' < fibo'
fibo' = if'
fib' = if'
sum' < if'
Proved the following rewrite lemma:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + n5)
Induction Base:
lt'(_gen_0':s'3(0), _gen_0':s'3(+(1, 0))) →RΩ(1)
true'
Induction Step:
lt'(_gen_0':s'3(+(_$n6, 1)), _gen_0':s'3(+(1, +(_$n6, 1)))) →RΩ(1)
lt'(_gen_0':s'3(_$n6), _gen_0':s'3(+(1, _$n6))) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
fibo'(0') → fib'(0')
fibo'(s'(0')) → fib'(s'(0'))
fibo'(s'(s'(x))) → sum'(fibo'(s'(x)), fibo'(x))
fib'(0') → s'(0')
fib'(s'(0')) → s'(0')
fib'(s'(s'(x))) → if'(true', 0', s'(s'(x)), 0', 0')
if'(true', c, s'(s'(x)), a, b) → if'(lt'(s'(c), s'(s'(x))), s'(c), s'(s'(x)), b, c)
if'(false', c, s'(s'(x)), a, b) → sum'(fibo'(a), fibo'(b))
sum'(x, 0') → x
sum'(x, s'(y)) → s'(sum'(x, y))
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
fibo' :: 0':s' → 0':s'
fib' :: 0':s' → 0':s'
sum' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + 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:
sum', fibo', fib', if'
They will be analysed ascendingly in the following order:
fibo' = fib'
sum' < fibo'
fibo' = if'
fib' = if'
sum' < if'
Proved the following rewrite lemma:
sum'(_gen_0':s'3(a), _gen_0':s'3(_n713)) → _gen_0':s'3(+(_n713, a)), rt ∈ Ω(1 + n713)
Induction Base:
sum'(_gen_0':s'3(a), _gen_0':s'3(0)) →RΩ(1)
_gen_0':s'3(a)
Induction Step:
sum'(_gen_0':s'3(_a846), _gen_0':s'3(+(_$n714, 1))) →RΩ(1)
s'(sum'(_gen_0':s'3(_a846), _gen_0':s'3(_$n714))) →IH
s'(_gen_0':s'3(+(_$n714, _a846)))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
fibo'(0') → fib'(0')
fibo'(s'(0')) → fib'(s'(0'))
fibo'(s'(s'(x))) → sum'(fibo'(s'(x)), fibo'(x))
fib'(0') → s'(0')
fib'(s'(0')) → s'(0')
fib'(s'(s'(x))) → if'(true', 0', s'(s'(x)), 0', 0')
if'(true', c, s'(s'(x)), a, b) → if'(lt'(s'(c), s'(s'(x))), s'(c), s'(s'(x)), b, c)
if'(false', c, s'(s'(x)), a, b) → sum'(fibo'(a), fibo'(b))
sum'(x, 0') → x
sum'(x, s'(y)) → s'(sum'(x, y))
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
fibo' :: 0':s' → 0':s'
fib' :: 0':s' → 0':s'
sum' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + n5)
sum'(_gen_0':s'3(a), _gen_0':s'3(_n713)) → _gen_0':s'3(+(_n713, a)), rt ∈ Ω(1 + n713)
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:
fib', fibo', if'
They will be analysed ascendingly in the following order:
fibo' = fib'
fibo' = if'
fib' = if'
Could not prove a rewrite lemma for the defined symbol fib'.
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
fibo'(0') → fib'(0')
fibo'(s'(0')) → fib'(s'(0'))
fibo'(s'(s'(x))) → sum'(fibo'(s'(x)), fibo'(x))
fib'(0') → s'(0')
fib'(s'(0')) → s'(0')
fib'(s'(s'(x))) → if'(true', 0', s'(s'(x)), 0', 0')
if'(true', c, s'(s'(x)), a, b) → if'(lt'(s'(c), s'(s'(x))), s'(c), s'(s'(x)), b, c)
if'(false', c, s'(s'(x)), a, b) → sum'(fibo'(a), fibo'(b))
sum'(x, 0') → x
sum'(x, s'(y)) → s'(sum'(x, y))
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
fibo' :: 0':s' → 0':s'
fib' :: 0':s' → 0':s'
sum' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + n5)
sum'(_gen_0':s'3(a), _gen_0':s'3(_n713)) → _gen_0':s'3(+(_n713, a)), rt ∈ Ω(1 + n713)
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:
if', fibo'
They will be analysed ascendingly in the following order:
fibo' = fib'
fibo' = if'
fib' = if'
Could not prove a rewrite lemma for the defined symbol if'.
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
fibo'(0') → fib'(0')
fibo'(s'(0')) → fib'(s'(0'))
fibo'(s'(s'(x))) → sum'(fibo'(s'(x)), fibo'(x))
fib'(0') → s'(0')
fib'(s'(0')) → s'(0')
fib'(s'(s'(x))) → if'(true', 0', s'(s'(x)), 0', 0')
if'(true', c, s'(s'(x)), a, b) → if'(lt'(s'(c), s'(s'(x))), s'(c), s'(s'(x)), b, c)
if'(false', c, s'(s'(x)), a, b) → sum'(fibo'(a), fibo'(b))
sum'(x, 0') → x
sum'(x, s'(y)) → s'(sum'(x, y))
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
fibo' :: 0':s' → 0':s'
fib' :: 0':s' → 0':s'
sum' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + n5)
sum'(_gen_0':s'3(a), _gen_0':s'3(_n713)) → _gen_0':s'3(+(_n713, a)), rt ∈ Ω(1 + n713)
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:
fibo'
They will be analysed ascendingly in the following order:
fibo' = fib'
fibo' = if'
fib' = if'
Proved the following rewrite lemma:
fibo'(_gen_0':s'3(+(2, _n5633))) → _*4, rt ∈ Ω(n5633)
Induction Base:
fibo'(_gen_0':s'3(+(2, 0)))
Induction Step:
fibo'(_gen_0':s'3(+(2, +(_$n5634, 1)))) →RΩ(1)
sum'(fibo'(s'(_gen_0':s'3(+(1, _$n5634)))), fibo'(_gen_0':s'3(+(1, _$n5634)))) →IH
sum'(_*4, fibo'(_gen_0':s'3(+(1, _$n5634))))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
fibo'(0') → fib'(0')
fibo'(s'(0')) → fib'(s'(0'))
fibo'(s'(s'(x))) → sum'(fibo'(s'(x)), fibo'(x))
fib'(0') → s'(0')
fib'(s'(0')) → s'(0')
fib'(s'(s'(x))) → if'(true', 0', s'(s'(x)), 0', 0')
if'(true', c, s'(s'(x)), a, b) → if'(lt'(s'(c), s'(s'(x))), s'(c), s'(s'(x)), b, c)
if'(false', c, s'(s'(x)), a, b) → sum'(fibo'(a), fibo'(b))
sum'(x, 0') → x
sum'(x, s'(y)) → s'(sum'(x, y))
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
fibo' :: 0':s' → 0':s'
fib' :: 0':s' → 0':s'
sum' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + n5)
sum'(_gen_0':s'3(a), _gen_0':s'3(_n713)) → _gen_0':s'3(+(_n713, a)), rt ∈ Ω(1 + n713)
fibo'(_gen_0':s'3(+(2, _n5633))) → _*4, rt ∈ Ω(n5633)
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:
fib', if'
They will be analysed ascendingly in the following order:
fibo' = fib'
fibo' = if'
fib' = if'
Could not prove a rewrite lemma for the defined symbol fib'.
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
fibo'(0') → fib'(0')
fibo'(s'(0')) → fib'(s'(0'))
fibo'(s'(s'(x))) → sum'(fibo'(s'(x)), fibo'(x))
fib'(0') → s'(0')
fib'(s'(0')) → s'(0')
fib'(s'(s'(x))) → if'(true', 0', s'(s'(x)), 0', 0')
if'(true', c, s'(s'(x)), a, b) → if'(lt'(s'(c), s'(s'(x))), s'(c), s'(s'(x)), b, c)
if'(false', c, s'(s'(x)), a, b) → sum'(fibo'(a), fibo'(b))
sum'(x, 0') → x
sum'(x, s'(y)) → s'(sum'(x, y))
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
fibo' :: 0':s' → 0':s'
fib' :: 0':s' → 0':s'
sum' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + n5)
sum'(_gen_0':s'3(a), _gen_0':s'3(_n713)) → _gen_0':s'3(+(_n713, a)), rt ∈ Ω(1 + n713)
fibo'(_gen_0':s'3(+(2, _n5633))) → _*4, rt ∈ Ω(n5633)
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:
if'
They will be analysed ascendingly in the following order:
fibo' = fib'
fibo' = if'
fib' = if'
Could not prove a rewrite lemma for the defined symbol if'.
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
fibo'(0') → fib'(0')
fibo'(s'(0')) → fib'(s'(0'))
fibo'(s'(s'(x))) → sum'(fibo'(s'(x)), fibo'(x))
fib'(0') → s'(0')
fib'(s'(0')) → s'(0')
fib'(s'(s'(x))) → if'(true', 0', s'(s'(x)), 0', 0')
if'(true', c, s'(s'(x)), a, b) → if'(lt'(s'(c), s'(s'(x))), s'(c), s'(s'(x)), b, c)
if'(false', c, s'(s'(x)), a, b) → sum'(fibo'(a), fibo'(b))
sum'(x, 0') → x
sum'(x, s'(y)) → s'(sum'(x, y))
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
fibo' :: 0':s' → 0':s'
fib' :: 0':s' → 0':s'
sum' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + n5)
sum'(_gen_0':s'3(a), _gen_0':s'3(_n713)) → _gen_0':s'3(+(_n713, a)), rt ∈ Ω(1 + n713)
fibo'(_gen_0':s'3(+(2, _n5633))) → _*4, rt ∈ Ω(n5633)
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:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + n5)