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

plus(0, x) → x
plus(s(x), y) → s(plus(p(s(x)), y))
times(0, y) → 0
times(s(x), y) → plus(y, times(p(s(x)), y))
exp(x, 0) → s(0)
exp(x, s(y)) → times(x, exp(x, y))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
tower(x, y) → towerIter(x, y, s(0))
towerIter(0, y, z) → z
towerIter(s(x), y, z) → towerIter(p(s(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'(p'(s'(x)), y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(p'(s'(x)), y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
p'(s'(0')) → 0'
p'(s'(s'(x))) → s'(p'(s'(x)))
tower'(x, y) → towerIter'(x, y, s'(0'))
towerIter'(0', y, z) → z
towerIter'(s'(x), y, z) → towerIter'(p'(s'(x)), y, exp'(y, z))

Rewrite Strategy: INNERMOST


Infered types.


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(p'(s'(x)), y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(p'(s'(x)), y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
p'(s'(0')) → 0'
p'(s'(s'(x))) → s'(p'(s'(x)))
tower'(x, y) → towerIter'(x, y, s'(0'))
towerIter'(0', y, z) → z
towerIter'(s'(x), y, z) → towerIter'(p'(s'(x)), y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 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:
plus', p', times', exp', towerIter'

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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(p'(s'(x)), y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(p'(s'(x)), y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
p'(s'(0')) → 0'
p'(s'(s'(x))) → s'(p'(s'(x)))
tower'(x, y) → towerIter'(x, y, s'(0'))
towerIter'(0', y, z) → z
towerIter'(s'(x), y, z) → towerIter'(p'(s'(x)), y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 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:
p', plus', times', exp', towerIter'

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


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

Induction Base:
p'(_gen_0':s'2(+(1, 0))) →RΩ(1)
0'

Induction Step:
p'(_gen_0':s'2(+(1, +(_$n5, 1)))) →RΩ(1)
s'(p'(s'(_gen_0':s'2(_$n5)))) →IH
s'(_gen_0':s'2(_$n5))

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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(p'(s'(x)), y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(p'(s'(x)), y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
p'(s'(0')) → 0'
p'(s'(s'(x))) → s'(p'(s'(x)))
tower'(x, y) → towerIter'(x, y, s'(0'))
towerIter'(0', y, z) → z
towerIter'(s'(x), y, z) → towerIter'(p'(s'(x)), y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
p'(_gen_0':s'2(+(1, _n4))) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)

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

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


Proved the following rewrite lemma:
plus'(_gen_0':s'2(_n518), _gen_0':s'2(b)) → _gen_0':s'2(+(_n518, b)), rt ∈ Ω(1 + n518 + n5182)

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

Induction Step:
plus'(_gen_0':s'2(+(_$n519, 1)), _gen_0':s'2(_b658)) →RΩ(1)
s'(plus'(p'(s'(_gen_0':s'2(_$n519))), _gen_0':s'2(_b658))) →LΩ(1 + $n519)
s'(plus'(_gen_0':s'2(_$n519), _gen_0':s'2(_b658))) →IH
s'(_gen_0':s'2(+(_$n519, _b658)))

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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(p'(s'(x)), y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(p'(s'(x)), y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
p'(s'(0')) → 0'
p'(s'(s'(x))) → s'(p'(s'(x)))
tower'(x, y) → towerIter'(x, y, s'(0'))
towerIter'(0', y, z) → z
towerIter'(s'(x), y, z) → towerIter'(p'(s'(x)), y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
p'(_gen_0':s'2(+(1, _n4))) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)
plus'(_gen_0':s'2(_n518), _gen_0':s'2(b)) → _gen_0':s'2(+(_n518, b)), rt ∈ Ω(1 + n518 + n5182)

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

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


Proved the following rewrite lemma:
times'(_gen_0':s'2(_n1407), _gen_0':s'2(b)) → _gen_0':s'2(*(_n1407, b)), rt ∈ Ω(1 + b1656·n1407 + b16562·n1407 + n1407 + n14072)

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

Induction Step:
times'(_gen_0':s'2(+(_$n1408, 1)), _gen_0':s'2(_b1656)) →RΩ(1)
plus'(_gen_0':s'2(_b1656), times'(p'(s'(_gen_0':s'2(_$n1408))), _gen_0':s'2(_b1656))) →LΩ(1 + $n1408)
plus'(_gen_0':s'2(_b1656), times'(_gen_0':s'2(_$n1408), _gen_0':s'2(_b1656))) →IH
plus'(_gen_0':s'2(_b1656), _gen_0':s'2(*(_$n1408, _b1656))) →LΩ(1 + b1656 + b16562)
_gen_0':s'2(+(_b1656, *(_$n1408, _b1656)))

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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(p'(s'(x)), y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(p'(s'(x)), y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
p'(s'(0')) → 0'
p'(s'(s'(x))) → s'(p'(s'(x)))
tower'(x, y) → towerIter'(x, y, s'(0'))
towerIter'(0', y, z) → z
towerIter'(s'(x), y, z) → towerIter'(p'(s'(x)), y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
p'(_gen_0':s'2(+(1, _n4))) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)
plus'(_gen_0':s'2(_n518), _gen_0':s'2(b)) → _gen_0':s'2(+(_n518, b)), rt ∈ Ω(1 + n518 + n5182)
times'(_gen_0':s'2(_n1407), _gen_0':s'2(b)) → _gen_0':s'2(*(_n1407, b)), rt ∈ Ω(1 + b1656·n1407 + b16562·n1407 + n1407 + n14072)

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

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


Proved the following rewrite lemma:
exp'(_gen_0':s'2(a), _gen_0':s'2(+(1, _n2766))) → _*3, rt ∈ Ω(n2766)

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

Induction Step:
exp'(_gen_0':s'2(_a6949), _gen_0':s'2(+(1, +(_$n2767, 1)))) →RΩ(1)
times'(_gen_0':s'2(_a6949), exp'(_gen_0':s'2(_a6949), _gen_0':s'2(+(1, _$n2767)))) →IH
times'(_gen_0':s'2(_a6949), _*3)

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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(p'(s'(x)), y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(p'(s'(x)), y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
p'(s'(0')) → 0'
p'(s'(s'(x))) → s'(p'(s'(x)))
tower'(x, y) → towerIter'(x, y, s'(0'))
towerIter'(0', y, z) → z
towerIter'(s'(x), y, z) → towerIter'(p'(s'(x)), y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
p'(_gen_0':s'2(+(1, _n4))) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)
plus'(_gen_0':s'2(_n518), _gen_0':s'2(b)) → _gen_0':s'2(+(_n518, b)), rt ∈ Ω(1 + n518 + n5182)
times'(_gen_0':s'2(_n1407), _gen_0':s'2(b)) → _gen_0':s'2(*(_n1407, b)), rt ∈ Ω(1 + b1656·n1407 + b16562·n1407 + n1407 + n14072)
exp'(_gen_0':s'2(a), _gen_0':s'2(+(1, _n2766))) → _*3, rt ∈ Ω(n2766)

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


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


Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(p'(s'(x)), y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(p'(s'(x)), y))
exp'(x, 0') → s'(0')
exp'(x, s'(y)) → times'(x, exp'(x, y))
p'(s'(0')) → 0'
p'(s'(s'(x))) → s'(p'(s'(x)))
tower'(x, y) → towerIter'(x, y, s'(0'))
towerIter'(0', y, z) → z
towerIter'(s'(x), y, z) → towerIter'(p'(s'(x)), y, exp'(y, z))

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
exp' :: 0':s' → 0':s' → 0':s'
tower' :: 0':s' → 0':s' → 0':s'
towerIter' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
p'(_gen_0':s'2(+(1, _n4))) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)
plus'(_gen_0':s'2(_n518), _gen_0':s'2(b)) → _gen_0':s'2(+(_n518, b)), rt ∈ Ω(1 + n518 + n5182)
times'(_gen_0':s'2(_n1407), _gen_0':s'2(b)) → _gen_0':s'2(*(_n1407, b)), rt ∈ Ω(1 + b1656·n1407 + b16562·n1407 + n1407 + n14072)
exp'(_gen_0':s'2(a), _gen_0':s'2(+(1, _n2766))) → _*3, rt ∈ Ω(n2766)

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 Ω(n3) was proven with the following lemma:
times'(_gen_0':s'2(_n1407), _gen_0':s'2(b)) → _gen_0':s'2(*(_n1407, b)), rt ∈ Ω(1 + b1656·n1407 + b16562·n1407 + n1407 + n14072)