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

even(0) → true
even(s(0)) → false
even(s(s(x))) → even(x)
half(0) → 0
half(s(s(x))) → s(half(x))
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
times(0, y) → 0
times(s(x), y) → if_times(even(s(x)), s(x), y)
if_times(true, s(x), y) → plus(times(half(s(x)), y), times(half(s(x)), y))
if_times(false, s(x), y) → plus(y, times(x, y))

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


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


even'(0') → true'
even'(s'(0')) → false'
even'(s'(s'(x))) → even'(x)
half'(0') → 0'
half'(s'(s'(x))) → s'(half'(x))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → if_times'(even'(s'(x)), s'(x), y)
if_times'(true', s'(x), y) → plus'(times'(half'(s'(x)), y), times'(half'(s'(x)), y))
if_times'(false', s'(x), y) → plus'(y, times'(x, y))

Rewrite Strategy: INNERMOST


Infered types.


Rules:
even'(0') → true'
even'(s'(0')) → false'
even'(s'(s'(x))) → even'(x)
half'(0') → 0'
half'(s'(s'(x))) → s'(half'(x))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → if_times'(even'(s'(x)), s'(x), y)
if_times'(true', s'(x), y) → plus'(times'(half'(s'(x)), y), times'(half'(s'(x)), y))
if_times'(false', s'(x), y) → plus'(y, times'(x, y))

Types:
even' :: 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
half' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
if_times' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'


Heuristically decided to analyse the following defined symbols:
even', half', plus', times'

They will be analysed ascendingly in the following order:
even' < times'
half' < times'
plus' < times'


Rules:
even'(0') → true'
even'(s'(0')) → false'
even'(s'(s'(x))) → even'(x)
half'(0') → 0'
half'(s'(s'(x))) → s'(half'(x))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → if_times'(even'(s'(x)), s'(x), y)
if_times'(true', s'(x), y) → plus'(times'(half'(s'(x)), y), times'(half'(s'(x)), y))
if_times'(false', s'(x), y) → plus'(y, times'(x, y))

Types:
even' :: 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
half' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
if_times' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_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:
even', half', plus', times'

They will be analysed ascendingly in the following order:
even' < times'
half' < times'
plus' < times'


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

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

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

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


Rules:
even'(0') → true'
even'(s'(0')) → false'
even'(s'(s'(x))) → even'(x)
half'(0') → 0'
half'(s'(s'(x))) → s'(half'(x))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → if_times'(even'(s'(x)), s'(x), y)
if_times'(true', s'(x), y) → plus'(times'(half'(s'(x)), y), times'(half'(s'(x)), y))
if_times'(false', s'(x), y) → plus'(y, times'(x, y))

Types:
even' :: 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
half' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
if_times' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
even'(_gen_0':s'3(*(2, _n5))) → true', 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', plus', times'

They will be analysed ascendingly in the following order:
half' < times'
plus' < times'


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

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

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

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


Rules:
even'(0') → true'
even'(s'(0')) → false'
even'(s'(s'(x))) → even'(x)
half'(0') → 0'
half'(s'(s'(x))) → s'(half'(x))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → if_times'(even'(s'(x)), s'(x), y)
if_times'(true', s'(x), y) → plus'(times'(half'(s'(x)), y), times'(half'(s'(x)), y))
if_times'(false', s'(x), y) → plus'(y, times'(x, y))

Types:
even' :: 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
half' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
if_times' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
even'(_gen_0':s'3(*(2, _n5))) → true', rt ∈ Ω(1 + n5)
half'(_gen_0':s'3(*(2, _n351))) → _gen_0':s'3(_n351), rt ∈ Ω(1 + n351)

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:
plus', times'

They will be analysed ascendingly in the following order:
plus' < times'


Proved the following rewrite lemma:
plus'(_gen_0':s'3(_n790), _gen_0':s'3(b)) → _gen_0':s'3(+(_n790, b)), rt ∈ Ω(1 + n790)

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

Induction Step:
plus'(_gen_0':s'3(+(_$n791, 1)), _gen_0':s'3(_b923)) →RΩ(1)
s'(plus'(_gen_0':s'3(_$n791), _gen_0':s'3(_b923))) →IH
s'(_gen_0':s'3(+(_$n791, _b923)))

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


Rules:
even'(0') → true'
even'(s'(0')) → false'
even'(s'(s'(x))) → even'(x)
half'(0') → 0'
half'(s'(s'(x))) → s'(half'(x))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → if_times'(even'(s'(x)), s'(x), y)
if_times'(true', s'(x), y) → plus'(times'(half'(s'(x)), y), times'(half'(s'(x)), y))
if_times'(false', s'(x), y) → plus'(y, times'(x, y))

Types:
even' :: 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
half' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
if_times' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
even'(_gen_0':s'3(*(2, _n5))) → true', rt ∈ Ω(1 + n5)
half'(_gen_0':s'3(*(2, _n351))) → _gen_0':s'3(_n351), rt ∈ Ω(1 + n351)
plus'(_gen_0':s'3(_n790), _gen_0':s'3(b)) → _gen_0':s'3(+(_n790, b)), rt ∈ Ω(1 + n790)

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


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


Rules:
even'(0') → true'
even'(s'(0')) → false'
even'(s'(s'(x))) → even'(x)
half'(0') → 0'
half'(s'(s'(x))) → s'(half'(x))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → if_times'(even'(s'(x)), s'(x), y)
if_times'(true', s'(x), y) → plus'(times'(half'(s'(x)), y), times'(half'(s'(x)), y))
if_times'(false', s'(x), y) → plus'(y, times'(x, y))

Types:
even' :: 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
half' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
if_times' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
even'(_gen_0':s'3(*(2, _n5))) → true', rt ∈ Ω(1 + n5)
half'(_gen_0':s'3(*(2, _n351))) → _gen_0':s'3(_n351), rt ∈ Ω(1 + n351)
plus'(_gen_0':s'3(_n790), _gen_0':s'3(b)) → _gen_0':s'3(+(_n790, b)), rt ∈ Ω(1 + n790)

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