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

dbl(S(0), S(0)) → S(S(S(S(0))))
unsafe(S(x)) → dbl(unsafe(x), 0)
unsafe(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'))))
unsafe'(S'(x)) → dbl'(unsafe'(x), 0')
unsafe'(0') → 0'
dbl'(0', y) → y

Rewrite Strategy: INNERMOST


Infered types.


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

Types:
dbl' :: 0':S' → 0':S' → 0':S'
S' :: 0':S' → 0':S'
0' :: 0':S'
unsafe' :: 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:
unsafe'


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

Types:
dbl' :: 0':S' → 0':S' → 0':S'
S' :: 0':S' → 0':S'
0' :: 0':S'
unsafe' :: 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:
unsafe'


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

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

Induction Step:
unsafe'(_gen_0':S'2(+(_$n5, 1))) →RΩ(1)
dbl'(unsafe'(_gen_0':S'2(_$n5)), 0') →IH
dbl'(_gen_0':S'2(0), 0') →RΩ(1)
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'))))
unsafe'(S'(x)) → dbl'(unsafe'(x), 0')
unsafe'(0') → 0'
dbl'(0', y) → y

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

Lemmas:
unsafe'(_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:
unsafe'(_gen_0':S'2(_n4)) → _gen_0':S'2(0), rt ∈ Ω(1 + n4)