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

double(0) → 0
double(s(x)) → s(s(double(x)))
half(0) → 0
half(s(0)) → 0
half(s(s(x))) → s(half(x))
-(x, 0) → x
-(s(x), s(y)) → -(x, y)
if(0, y, z) → y
if(s(x), y, z) → z
half(double(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:


double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
if'(0', y, z) → y
if'(s'(x), y, z) → z
half'(double'(x)) → x

Rewrite Strategy: INNERMOST


Infered types.


Rules:
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
if'(0', y, z) → y
if'(s'(x), y, z) → z
half'(double'(x)) → x

Types:
double' :: 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
half' :: 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
if' :: 0':s' → if' → if' → if'
_hole_0':s'1 :: 0':s'
_hole_if'2 :: if'
_gen_0':s'3 :: Nat → 0':s'


Heuristically decided to analyse the following defined symbols:
double', half', -'


Rules:
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
if'(0', y, z) → y
if'(s'(x), y, z) → z
half'(double'(x)) → x

Types:
double' :: 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
half' :: 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
if' :: 0':s' → if' → if' → if'
_hole_0':s'1 :: 0':s'
_hole_if'2 :: if'
_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:
double', half', -'


Proved the following rewrite lemma:
double'(_gen_0':s'3(_n5)) → _gen_0':s'3(*(2, _n5)), rt ∈ Ω(1 + n5)

Induction Base:
double'(_gen_0':s'3(0)) →RΩ(1)
0'

Induction Step:
double'(_gen_0':s'3(+(_$n6, 1))) →RΩ(1)
s'(s'(double'(_gen_0':s'3(_$n6)))) →IH
s'(s'(_gen_0':s'3(*(2, _$n6))))

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


Rules:
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
if'(0', y, z) → y
if'(s'(x), y, z) → z
half'(double'(x)) → x

Types:
double' :: 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
half' :: 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
if' :: 0':s' → if' → if' → if'
_hole_0':s'1 :: 0':s'
_hole_if'2 :: if'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
double'(_gen_0':s'3(_n5)) → _gen_0':s'3(*(2, _n5)), 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:
half', -'


Proved the following rewrite lemma:
half'(_gen_0':s'3(*(2, _n371))) → _gen_0':s'3(_n371), rt ∈ Ω(1 + n371)

Induction Base:
half'(_gen_0':s'3(*(2, 0))) →RΩ(1)
0'

Induction Step:
half'(_gen_0':s'3(*(2, +(_$n372, 1)))) →RΩ(1)
s'(half'(_gen_0':s'3(*(2, _$n372)))) →IH
s'(_gen_0':s'3(_$n372))

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


Rules:
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
if'(0', y, z) → y
if'(s'(x), y, z) → z
half'(double'(x)) → x

Types:
double' :: 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
half' :: 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
if' :: 0':s' → if' → if' → if'
_hole_0':s'1 :: 0':s'
_hole_if'2 :: if'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
double'(_gen_0':s'3(_n5)) → _gen_0':s'3(*(2, _n5)), rt ∈ Ω(1 + n5)
half'(_gen_0':s'3(*(2, _n371))) → _gen_0':s'3(_n371), rt ∈ Ω(1 + n371)

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:
-'


Proved the following rewrite lemma:
-'(_gen_0':s'3(_n935), _gen_0':s'3(_n935)) → _gen_0':s'3(0), rt ∈ Ω(1 + n935)

Induction Base:
-'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
_gen_0':s'3(0)

Induction Step:
-'(_gen_0':s'3(+(_$n936, 1)), _gen_0':s'3(+(_$n936, 1))) →RΩ(1)
-'(_gen_0':s'3(_$n936), _gen_0':s'3(_$n936)) →IH
_gen_0':s'3(0)

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


Rules:
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
if'(0', y, z) → y
if'(s'(x), y, z) → z
half'(double'(x)) → x

Types:
double' :: 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
half' :: 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
if' :: 0':s' → if' → if' → if'
_hole_0':s'1 :: 0':s'
_hole_if'2 :: if'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
double'(_gen_0':s'3(_n5)) → _gen_0':s'3(*(2, _n5)), rt ∈ Ω(1 + n5)
half'(_gen_0':s'3(*(2, _n371))) → _gen_0':s'3(_n371), rt ∈ Ω(1 + n371)
-'(_gen_0':s'3(_n935), _gen_0':s'3(_n935)) → _gen_0':s'3(0), rt ∈ Ω(1 + n935)

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:
double'(_gen_0':s'3(_n5)) → _gen_0':s'3(*(2, _n5)), rt ∈ Ω(1 + n5)