Runtime Complexity TRS:
The TRS R consists of the following rules:

fib(N) → sel(N, fib1(s(0), s(0)))
fib1(X, Y) → cons(X, n__fib1(Y, n__add(X, Y)))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, activate(XS))
fib1(X1, X2) → n__fib1(X1, X2)
add(X1, X2) → n__add(X1, X2)
activate(n__fib1(X1, X2)) → fib1(activate(X1), activate(X2))
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(X) → X

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


Runtime Complexity TRS:
The TRS R consists of the following rules:


fib'(N) → sel'(N, fib1'(s'(0'), s'(0')))
fib1'(X, Y) → cons'(X, n__fib1'(Y, n__add'(X, Y)))
add'(0', X) → X
add'(s'(X), Y) → s'(add'(X, Y))
sel'(0', cons'(X, XS)) → X
sel'(s'(N), cons'(X, XS)) → sel'(N, activate'(XS))
fib1'(X1, X2) → n__fib1'(X1, X2)
add'(X1, X2) → n__add'(X1, X2)
activate'(n__fib1'(X1, X2)) → fib1'(activate'(X1), activate'(X2))
activate'(n__add'(X1, X2)) → add'(activate'(X1), activate'(X2))
activate'(X) → X

Rewrite Strategy: INNERMOST


Infered types.


Rules:
fib'(N) → sel'(N, fib1'(s'(0'), s'(0')))
fib1'(X, Y) → cons'(X, n__fib1'(Y, n__add'(X, Y)))
add'(0', X) → X
add'(s'(X), Y) → s'(add'(X, Y))
sel'(0', cons'(X, XS)) → X
sel'(s'(N), cons'(X, XS)) → sel'(N, activate'(XS))
fib1'(X1, X2) → n__fib1'(X1, X2)
add'(X1, X2) → n__add'(X1, X2)
activate'(n__fib1'(X1, X2)) → fib1'(activate'(X1), activate'(X2))
activate'(n__add'(X1, X2)) → add'(activate'(X1), activate'(X2))
activate'(X) → X

Types:
fib' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
sel' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
fib1' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
s' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
0' :: 0':s':n__add':n__fib1':cons'
cons' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
n__fib1' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
n__add' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
add' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
activate' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
_hole_0':s':n__add':n__fib1':cons'1 :: 0':s':n__add':n__fib1':cons'
_gen_0':s':n__add':n__fib1':cons'2 :: Nat → 0':s':n__add':n__fib1':cons'


Heuristically decided to analyse the following defined symbols:
sel', add', activate'

They will be analysed ascendingly in the following order:
activate' < sel'
add' < activate'


Rules:
fib'(N) → sel'(N, fib1'(s'(0'), s'(0')))
fib1'(X, Y) → cons'(X, n__fib1'(Y, n__add'(X, Y)))
add'(0', X) → X
add'(s'(X), Y) → s'(add'(X, Y))
sel'(0', cons'(X, XS)) → X
sel'(s'(N), cons'(X, XS)) → sel'(N, activate'(XS))
fib1'(X1, X2) → n__fib1'(X1, X2)
add'(X1, X2) → n__add'(X1, X2)
activate'(n__fib1'(X1, X2)) → fib1'(activate'(X1), activate'(X2))
activate'(n__add'(X1, X2)) → add'(activate'(X1), activate'(X2))
activate'(X) → X

Types:
fib' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
sel' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
fib1' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
s' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
0' :: 0':s':n__add':n__fib1':cons'
cons' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
n__fib1' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
n__add' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
add' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
activate' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
_hole_0':s':n__add':n__fib1':cons'1 :: 0':s':n__add':n__fib1':cons'
_gen_0':s':n__add':n__fib1':cons'2 :: Nat → 0':s':n__add':n__fib1':cons'

Generator Equations:
_gen_0':s':n__add':n__fib1':cons'2(0) ⇔ 0'
_gen_0':s':n__add':n__fib1':cons'2(+(x, 1)) ⇔ s'(_gen_0':s':n__add':n__fib1':cons'2(x))

The following defined symbols remain to be analysed:
add', sel', activate'

They will be analysed ascendingly in the following order:
activate' < sel'
add' < activate'


Proved the following rewrite lemma:
add'(_gen_0':s':n__add':n__fib1':cons'2(_n4), _gen_0':s':n__add':n__fib1':cons'2(b)) → _gen_0':s':n__add':n__fib1':cons'2(+(_n4, b)), rt ∈ Ω(1 + n4)

Induction Base:
add'(_gen_0':s':n__add':n__fib1':cons'2(0), _gen_0':s':n__add':n__fib1':cons'2(b)) →RΩ(1)
_gen_0':s':n__add':n__fib1':cons'2(b)

Induction Step:
add'(_gen_0':s':n__add':n__fib1':cons'2(+(_$n5, 1)), _gen_0':s':n__add':n__fib1':cons'2(_b161)) →RΩ(1)
s'(add'(_gen_0':s':n__add':n__fib1':cons'2(_$n5), _gen_0':s':n__add':n__fib1':cons'2(_b161))) →IH
s'(_gen_0':s':n__add':n__fib1':cons'2(+(_$n5, _b161)))

We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).


Rules:
fib'(N) → sel'(N, fib1'(s'(0'), s'(0')))
fib1'(X, Y) → cons'(X, n__fib1'(Y, n__add'(X, Y)))
add'(0', X) → X
add'(s'(X), Y) → s'(add'(X, Y))
sel'(0', cons'(X, XS)) → X
sel'(s'(N), cons'(X, XS)) → sel'(N, activate'(XS))
fib1'(X1, X2) → n__fib1'(X1, X2)
add'(X1, X2) → n__add'(X1, X2)
activate'(n__fib1'(X1, X2)) → fib1'(activate'(X1), activate'(X2))
activate'(n__add'(X1, X2)) → add'(activate'(X1), activate'(X2))
activate'(X) → X

Types:
fib' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
sel' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
fib1' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
s' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
0' :: 0':s':n__add':n__fib1':cons'
cons' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
n__fib1' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
n__add' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
add' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
activate' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
_hole_0':s':n__add':n__fib1':cons'1 :: 0':s':n__add':n__fib1':cons'
_gen_0':s':n__add':n__fib1':cons'2 :: Nat → 0':s':n__add':n__fib1':cons'

Lemmas:
add'(_gen_0':s':n__add':n__fib1':cons'2(_n4), _gen_0':s':n__add':n__fib1':cons'2(b)) → _gen_0':s':n__add':n__fib1':cons'2(+(_n4, b)), rt ∈ Ω(1 + n4)

Generator Equations:
_gen_0':s':n__add':n__fib1':cons'2(0) ⇔ 0'
_gen_0':s':n__add':n__fib1':cons'2(+(x, 1)) ⇔ s'(_gen_0':s':n__add':n__fib1':cons'2(x))

The following defined symbols remain to be analysed:
activate', sel'

They will be analysed ascendingly in the following order:
activate' < sel'


Could not prove a rewrite lemma for the defined symbol activate'.


Rules:
fib'(N) → sel'(N, fib1'(s'(0'), s'(0')))
fib1'(X, Y) → cons'(X, n__fib1'(Y, n__add'(X, Y)))
add'(0', X) → X
add'(s'(X), Y) → s'(add'(X, Y))
sel'(0', cons'(X, XS)) → X
sel'(s'(N), cons'(X, XS)) → sel'(N, activate'(XS))
fib1'(X1, X2) → n__fib1'(X1, X2)
add'(X1, X2) → n__add'(X1, X2)
activate'(n__fib1'(X1, X2)) → fib1'(activate'(X1), activate'(X2))
activate'(n__add'(X1, X2)) → add'(activate'(X1), activate'(X2))
activate'(X) → X

Types:
fib' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
sel' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
fib1' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
s' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
0' :: 0':s':n__add':n__fib1':cons'
cons' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
n__fib1' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
n__add' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
add' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
activate' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
_hole_0':s':n__add':n__fib1':cons'1 :: 0':s':n__add':n__fib1':cons'
_gen_0':s':n__add':n__fib1':cons'2 :: Nat → 0':s':n__add':n__fib1':cons'

Lemmas:
add'(_gen_0':s':n__add':n__fib1':cons'2(_n4), _gen_0':s':n__add':n__fib1':cons'2(b)) → _gen_0':s':n__add':n__fib1':cons'2(+(_n4, b)), rt ∈ Ω(1 + n4)

Generator Equations:
_gen_0':s':n__add':n__fib1':cons'2(0) ⇔ 0'
_gen_0':s':n__add':n__fib1':cons'2(+(x, 1)) ⇔ s'(_gen_0':s':n__add':n__fib1':cons'2(x))

The following defined symbols remain to be analysed:
sel'


Could not prove a rewrite lemma for the defined symbol sel'.


Rules:
fib'(N) → sel'(N, fib1'(s'(0'), s'(0')))
fib1'(X, Y) → cons'(X, n__fib1'(Y, n__add'(X, Y)))
add'(0', X) → X
add'(s'(X), Y) → s'(add'(X, Y))
sel'(0', cons'(X, XS)) → X
sel'(s'(N), cons'(X, XS)) → sel'(N, activate'(XS))
fib1'(X1, X2) → n__fib1'(X1, X2)
add'(X1, X2) → n__add'(X1, X2)
activate'(n__fib1'(X1, X2)) → fib1'(activate'(X1), activate'(X2))
activate'(n__add'(X1, X2)) → add'(activate'(X1), activate'(X2))
activate'(X) → X

Types:
fib' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
sel' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
fib1' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
s' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
0' :: 0':s':n__add':n__fib1':cons'
cons' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
n__fib1' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
n__add' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
add' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
activate' :: 0':s':n__add':n__fib1':cons' → 0':s':n__add':n__fib1':cons'
_hole_0':s':n__add':n__fib1':cons'1 :: 0':s':n__add':n__fib1':cons'
_gen_0':s':n__add':n__fib1':cons'2 :: Nat → 0':s':n__add':n__fib1':cons'

Lemmas:
add'(_gen_0':s':n__add':n__fib1':cons'2(_n4), _gen_0':s':n__add':n__fib1':cons'2(b)) → _gen_0':s':n__add':n__fib1':cons'2(+(_n4, b)), rt ∈ Ω(1 + n4)

Generator Equations:
_gen_0':s':n__add':n__fib1':cons'2(0) ⇔ 0'
_gen_0':s':n__add':n__fib1':cons'2(+(x, 1)) ⇔ s'(_gen_0':s':n__add':n__fib1':cons'2(x))

No more defined symbols left to analyse.


The lowerbound Ω(n) was proven with the following lemma:
add'(_gen_0':s':n__add':n__fib1':cons'2(_n4), _gen_0':s':n__add':n__fib1':cons'2(b)) → _gen_0':s':n__add':n__fib1':cons'2(+(_n4, b)), rt ∈ Ω(1 + n4)