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

+(X, 0) → X
+(X, s(Y)) → s(+(X, Y))
double(X) → +(X, X)
f(0, s(0), X) → f(X, double(X), X)
g(X, Y) → X
g(X, 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:


+'(X, 0') → X
+'(X, s'(Y)) → s'(+'(X, Y))
double'(X) → +'(X, X)
f'(0', s'(0'), X) → f'(X, double'(X), X)
g'(X, Y) → X
g'(X, Y) → Y

Rewrite Strategy: INNERMOST


Infered types.


Rules:
+'(X, 0') → X
+'(X, s'(Y)) → s'(+'(X, Y))
double'(X) → +'(X, X)
f'(0', s'(0'), X) → f'(X, double'(X), X)
g'(X, Y) → X
g'(X, Y) → Y

Types:
+' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
double' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → 0':s' → f'
g' :: g' → g' → g'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_hole_g'3 :: g'
_gen_0':s'4 :: Nat → 0':s'


Heuristically decided to analyse the following defined symbols:
+', f'


Rules:
+'(X, 0') → X
+'(X, s'(Y)) → s'(+'(X, Y))
double'(X) → +'(X, X)
f'(0', s'(0'), X) → f'(X, double'(X), X)
g'(X, Y) → X
g'(X, Y) → Y

Types:
+' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
double' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → 0':s' → f'
g' :: g' → g' → g'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_hole_g'3 :: g'
_gen_0':s'4 :: Nat → 0':s'

Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))

The following defined symbols remain to be analysed:
+', f'


Proved the following rewrite lemma:
+'(_gen_0':s'4(a), _gen_0':s'4(_n6)) → _gen_0':s'4(+(_n6, a)), rt ∈ Ω(1 + n6)

Induction Base:
+'(_gen_0':s'4(a), _gen_0':s'4(0)) →RΩ(1)
_gen_0':s'4(a)

Induction Step:
+'(_gen_0':s'4(_a139), _gen_0':s'4(+(_$n7, 1))) →RΩ(1)
s'(+'(_gen_0':s'4(_a139), _gen_0':s'4(_$n7))) →IH
s'(_gen_0':s'4(+(_$n7, _a139)))

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


Rules:
+'(X, 0') → X
+'(X, s'(Y)) → s'(+'(X, Y))
double'(X) → +'(X, X)
f'(0', s'(0'), X) → f'(X, double'(X), X)
g'(X, Y) → X
g'(X, Y) → Y

Types:
+' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
double' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → 0':s' → f'
g' :: g' → g' → g'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_hole_g'3 :: g'
_gen_0':s'4 :: Nat → 0':s'

Lemmas:
+'(_gen_0':s'4(a), _gen_0':s'4(_n6)) → _gen_0':s'4(+(_n6, a)), rt ∈ Ω(1 + n6)

Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))

The following defined symbols remain to be analysed:
f'


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


Rules:
+'(X, 0') → X
+'(X, s'(Y)) → s'(+'(X, Y))
double'(X) → +'(X, X)
f'(0', s'(0'), X) → f'(X, double'(X), X)
g'(X, Y) → X
g'(X, Y) → Y

Types:
+' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
double' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → 0':s' → f'
g' :: g' → g' → g'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_hole_g'3 :: g'
_gen_0':s'4 :: Nat → 0':s'

Lemmas:
+'(_gen_0':s'4(a), _gen_0':s'4(_n6)) → _gen_0':s'4(+(_n6, a)), rt ∈ Ω(1 + n6)

Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))

No more defined symbols left to analyse.


The lowerbound Ω(n) was proven with the following lemma:
+'(_gen_0':s'4(a), _gen_0':s'4(_n6)) → _gen_0':s'4(+(_n6, a)), rt ∈ Ω(1 + n6)