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

dbl(S(0), S(0)) → S(S(S(S(0))))
save(S(x)) → dbl(0, save(x))
save(0) → 0
dbl(0, y) → y

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


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


dbl'(S'(0'), S'(0')) → S'(S'(S'(S'(0'))))
save'(S'(x)) → dbl'(0', save'(x))
save'(0') → 0'
dbl'(0', y) → y

Rewrite Strategy: INNERMOST


Infered types.


Rules:
dbl'(S'(0'), S'(0')) → S'(S'(S'(S'(0'))))
save'(S'(x)) → dbl'(0', save'(x))
save'(0') → 0'
dbl'(0', y) → y

Types:
dbl' :: 0':S' → 0':S' → 0':S'
S' :: 0':S' → 0':S'
0' :: 0':S'
save' :: 0':S' → 0':S'
_hole_0':S'1 :: 0':S'
_gen_0':S'2 :: Nat → 0':S'


Heuristically decided to analyse the following defined symbols:
save'


Rules:
dbl'(S'(0'), S'(0')) → S'(S'(S'(S'(0'))))
save'(S'(x)) → dbl'(0', save'(x))
save'(0') → 0'
dbl'(0', y) → y

Types:
dbl' :: 0':S' → 0':S' → 0':S'
S' :: 0':S' → 0':S'
0' :: 0':S'
save' :: 0':S' → 0':S'
_hole_0':S'1 :: 0':S'
_gen_0':S'2 :: Nat → 0':S'

Generator Equations:
_gen_0':S'2(0) ⇔ 0'
_gen_0':S'2(+(x, 1)) ⇔ S'(_gen_0':S'2(x))

The following defined symbols remain to be analysed:
save'


Proved the following rewrite lemma:
save'(_gen_0':S'2(_n4)) → _gen_0':S'2(0), rt ∈ Ω(1 + n4)

Induction Base:
save'(_gen_0':S'2(0)) →RΩ(1)
0'

Induction Step:
save'(_gen_0':S'2(+(_$n5, 1))) →RΩ(1)
dbl'(0', save'(_gen_0':S'2(_$n5))) →IH
dbl'(0', _gen_0':S'2(0)) →RΩ(1)
_gen_0':S'2(0)

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


Rules:
dbl'(S'(0'), S'(0')) → S'(S'(S'(S'(0'))))
save'(S'(x)) → dbl'(0', save'(x))
save'(0') → 0'
dbl'(0', y) → y

Types:
dbl' :: 0':S' → 0':S' → 0':S'
S' :: 0':S' → 0':S'
0' :: 0':S'
save' :: 0':S' → 0':S'
_hole_0':S'1 :: 0':S'
_gen_0':S'2 :: Nat → 0':S'

Lemmas:
save'(_gen_0':S'2(_n4)) → _gen_0':S'2(0), rt ∈ Ω(1 + n4)

Generator Equations:
_gen_0':S'2(0) ⇔ 0'
_gen_0':S'2(+(x, 1)) ⇔ S'(_gen_0':S'2(x))

No more defined symbols left to analyse.


The lowerbound Ω(n) was proven with the following lemma:
save'(_gen_0':S'2(_n4)) → _gen_0':S'2(0), rt ∈ Ω(1 + n4)