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

plus(0, x) → x
plus(s(x), y) → s(plus(x, y))
times(0, y) → 0
times(s(x), y) → plus(y, times(x, y))
exp(x, 0) → s(0)
exp(x, s(y)) → times(x, exp(x, y))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
tower(x, y) → towerIter(0, x, y, s(0))
towerIter(c, x, y, z) → help(ge(c, x), c, x, y, z)
help(true, c, x, y, z) → z
help(false, c, x, y, z) → towerIter(s(c), x, y, exp(y, z))

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


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


plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
tower'(x, y) → towerIter'(0', x, y, s'(0'))
towerIter'(c, x, y, z) → help'(ge'(c, x), c, x, y, z)
help'(true', c, x, y, z) → z
help'(false', c, x, y, z) → towerIter'(s'(c), x, y, exp'(y, z))

Rewrite Strategy: INNERMOST


Infered types.


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
tower'(x, y) → towerIter'(0', x, y, s'(0'))
towerIter'(c, x, y, z) → help'(ge'(c, x), c, x, y, z)
help'(true', c, x, y, z) → z
help'(false', c, x, y, z) → towerIter'(s'(c), x, y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'


Heuristically decided to analyse the following defined symbols:
plus', times', exp', ge', towerIter'

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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
tower'(x, y) → towerIter'(0', x, y, s'(0'))
towerIter'(c, x, y, z) → help'(ge'(c, x), c, x, y, z)
help'(true', c, x, y, z) → z
help'(false', c, x, y, z) → towerIter'(s'(c), x, y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_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:
plus', times', exp', ge', towerIter'

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


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

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(+(_$n6, 1)), _gen_0':s'3(_b138)) →RΩ(1)
s'(plus'(_gen_0':s'3(_$n6), _gen_0':s'3(_b138))) →IH
s'(_gen_0':s'3(+(_$n6, _b138)))

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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
tower'(x, y) → towerIter'(0', x, y, s'(0'))
towerIter'(c, x, y, z) → help'(ge'(c, x), c, x, y, z)
help'(true', c, x, y, z) → z
help'(false', c, x, y, z) → towerIter'(s'(c), x, y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
plus'(_gen_0':s'3(_n5), _gen_0':s'3(b)) → _gen_0':s'3(+(_n5, b)), 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:
times', exp', ge', towerIter'

They will be analysed ascendingly in the following order:
times' < exp'
exp' < towerIter'
ge' < towerIter'


Proved the following rewrite lemma:
times'(_gen_0':s'3(_n989), _gen_0':s'3(b)) → _gen_0':s'3(*(_n989, b)), rt ∈ Ω(1 + b1249·n989 + n989)

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

Induction Step:
times'(_gen_0':s'3(+(_$n990, 1)), _gen_0':s'3(_b1249)) →RΩ(1)
plus'(_gen_0':s'3(_b1249), times'(_gen_0':s'3(_$n990), _gen_0':s'3(_b1249))) →IH
plus'(_gen_0':s'3(_b1249), _gen_0':s'3(*(_$n990, _b1249))) →LΩ(1 + b1249)
_gen_0':s'3(+(_b1249, *(_$n990, _b1249)))

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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
tower'(x, y) → towerIter'(0', x, y, s'(0'))
towerIter'(c, x, y, z) → help'(ge'(c, x), c, x, y, z)
help'(true', c, x, y, z) → z
help'(false', c, x, y, z) → towerIter'(s'(c), x, y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
plus'(_gen_0':s'3(_n5), _gen_0':s'3(b)) → _gen_0':s'3(+(_n5, b)), rt ∈ Ω(1 + n5)
times'(_gen_0':s'3(_n989), _gen_0':s'3(b)) → _gen_0':s'3(*(_n989, b)), rt ∈ Ω(1 + b1249·n989 + n989)

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:
exp', ge', towerIter'

They will be analysed ascendingly in the following order:
exp' < towerIter'
ge' < towerIter'


Proved the following rewrite lemma:
exp'(_gen_0':s'3(a), _gen_0':s'3(+(1, _n2476))) → _*4, rt ∈ Ω(n2476)

Induction Base:
exp'(_gen_0':s'3(a), _gen_0':s'3(+(1, 0)))

Induction Step:
exp'(_gen_0':s'3(_a6659), _gen_0':s'3(+(1, +(_$n2477, 1)))) →RΩ(1)
times'(_gen_0':s'3(_a6659), exp'(_gen_0':s'3(_a6659), _gen_0':s'3(+(1, _$n2477)))) →IH
times'(_gen_0':s'3(_a6659), _*4)

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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
tower'(x, y) → towerIter'(0', x, y, s'(0'))
towerIter'(c, x, y, z) → help'(ge'(c, x), c, x, y, z)
help'(true', c, x, y, z) → z
help'(false', c, x, y, z) → towerIter'(s'(c), x, y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
plus'(_gen_0':s'3(_n5), _gen_0':s'3(b)) → _gen_0':s'3(+(_n5, b)), rt ∈ Ω(1 + n5)
times'(_gen_0':s'3(_n989), _gen_0':s'3(b)) → _gen_0':s'3(*(_n989, b)), rt ∈ Ω(1 + b1249·n989 + n989)
exp'(_gen_0':s'3(a), _gen_0':s'3(+(1, _n2476))) → _*4, rt ∈ Ω(n2476)

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:
ge', towerIter'

They will be analysed ascendingly in the following order:
ge' < towerIter'


Proved the following rewrite lemma:
ge'(_gen_0':s'3(_n7825), _gen_0':s'3(_n7825)) → true', rt ∈ Ω(1 + n7825)

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

Induction Step:
ge'(_gen_0':s'3(+(_$n7826, 1)), _gen_0':s'3(+(_$n7826, 1))) →RΩ(1)
ge'(_gen_0':s'3(_$n7826), _gen_0':s'3(_$n7826)) →IH
true'

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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
tower'(x, y) → towerIter'(0', x, y, s'(0'))
towerIter'(c, x, y, z) → help'(ge'(c, x), c, x, y, z)
help'(true', c, x, y, z) → z
help'(false', c, x, y, z) → towerIter'(s'(c), x, y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
plus'(_gen_0':s'3(_n5), _gen_0':s'3(b)) → _gen_0':s'3(+(_n5, b)), rt ∈ Ω(1 + n5)
times'(_gen_0':s'3(_n989), _gen_0':s'3(b)) → _gen_0':s'3(*(_n989, b)), rt ∈ Ω(1 + b1249·n989 + n989)
exp'(_gen_0':s'3(a), _gen_0':s'3(+(1, _n2476))) → _*4, rt ∈ Ω(n2476)
ge'(_gen_0':s'3(_n7825), _gen_0':s'3(_n7825)) → true', rt ∈ Ω(1 + n7825)

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


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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
tower'(x, y) → towerIter'(0', x, y, s'(0'))
towerIter'(c, x, y, z) → help'(ge'(c, x), c, x, y, z)
help'(true', c, x, y, z) → z
help'(false', c, x, y, z) → towerIter'(s'(c), x, y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
plus'(_gen_0':s'3(_n5), _gen_0':s'3(b)) → _gen_0':s'3(+(_n5, b)), rt ∈ Ω(1 + n5)
times'(_gen_0':s'3(_n989), _gen_0':s'3(b)) → _gen_0':s'3(*(_n989, b)), rt ∈ Ω(1 + b1249·n989 + n989)
exp'(_gen_0':s'3(a), _gen_0':s'3(+(1, _n2476))) → _*4, rt ∈ Ω(n2476)
ge'(_gen_0':s'3(_n7825), _gen_0':s'3(_n7825)) → true', rt ∈ Ω(1 + n7825)

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 Ω(n2) was proven with the following lemma:
times'(_gen_0':s'3(_n989), _gen_0':s'3(b)) → _gen_0':s'3(*(_n989, b)), rt ∈ Ω(1 + b1249·n989 + n989)