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

times(x, plus(y, s(z))) → plus(times(x, plus(y, times(s(z), 0))), times(x, s(z)))
times(x, 0) → 0
times(x, s(y)) → plus(times(x, y), x)
plus(x, 0) → x
plus(x, s(y)) → s(plus(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:


times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))

Rewrite Strategy: INNERMOST


Infered types.


Rules:
times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))

Types:
times' :: s':0' → s':0' → s':0'
plus' :: s':0' → s':0' → s':0'
s' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'


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

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


Rules:
times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))

Types:
times' :: s':0' → s':0' → s':0'
plus' :: s':0' → s':0' → s':0'
s' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'

Generator Equations:
_gen_s':0'2(0) ⇔ 0'
_gen_s':0'2(+(x, 1)) ⇔ s'(_gen_s':0'2(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_s':0'2(a), _gen_s':0'2(_n4)) → _gen_s':0'2(+(_n4, a)), rt ∈ Ω(1 + n4)

Induction Base:
plus'(_gen_s':0'2(a), _gen_s':0'2(0)) →RΩ(1)
_gen_s':0'2(a)

Induction Step:
plus'(_gen_s':0'2(_a137), _gen_s':0'2(+(_$n5, 1))) →RΩ(1)
s'(plus'(_gen_s':0'2(_a137), _gen_s':0'2(_$n5))) →IH
s'(_gen_s':0'2(+(_$n5, _a137)))

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


Rules:
times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))

Types:
times' :: s':0' → s':0' → s':0'
plus' :: s':0' → s':0' → s':0'
s' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'

Lemmas:
plus'(_gen_s':0'2(a), _gen_s':0'2(_n4)) → _gen_s':0'2(+(_n4, a)), rt ∈ Ω(1 + n4)

Generator Equations:
_gen_s':0'2(0) ⇔ 0'
_gen_s':0'2(+(x, 1)) ⇔ s'(_gen_s':0'2(x))

The following defined symbols remain to be analysed:
times'


Proved the following rewrite lemma:
times'(_gen_s':0'2(a), _gen_s':0'2(_n464)) → _gen_s':0'2(*(_n464, a)), rt ∈ Ω(1 + a823·n464 + n464)

Induction Base:
times'(_gen_s':0'2(a), _gen_s':0'2(0)) →RΩ(1)
0'

Induction Step:
times'(_gen_s':0'2(_a823), _gen_s':0'2(+(_$n465, 1))) →RΩ(1)
plus'(times'(_gen_s':0'2(_a823), _gen_s':0'2(_$n465)), _gen_s':0'2(_a823)) →IH
plus'(_gen_s':0'2(*(_$n465, _a823)), _gen_s':0'2(_a823)) →LΩ(1 + a823)
_gen_s':0'2(+(_a823, *(_$n465, _a823)))

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


Rules:
times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))

Types:
times' :: s':0' → s':0' → s':0'
plus' :: s':0' → s':0' → s':0'
s' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'

Lemmas:
plus'(_gen_s':0'2(a), _gen_s':0'2(_n4)) → _gen_s':0'2(+(_n4, a)), rt ∈ Ω(1 + n4)
times'(_gen_s':0'2(a), _gen_s':0'2(_n464)) → _gen_s':0'2(*(_n464, a)), rt ∈ Ω(1 + a823·n464 + n464)

Generator Equations:
_gen_s':0'2(0) ⇔ 0'
_gen_s':0'2(+(x, 1)) ⇔ s'(_gen_s':0'2(x))

No more defined symbols left to analyse.


The lowerbound Ω(n2) was proven with the following lemma:
times'(_gen_s':0'2(a), _gen_s':0'2(_n464)) → _gen_s':0'2(*(_n464, a)), rt ∈ Ω(1 + a823·n464 + n464)