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

plus(x, 0) → x
plus(x, s(y)) → s(plus(x, y))
times(0, y) → 0
times(x, 0) → 0
times(s(x), y) → plus(times(x, y), y)
p(s(s(x))) → s(p(s(x)))
p(s(0)) → 0
fac(s(x)) → times(fac(p(s(x))), s(x))

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


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


plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))
times'(0', y) → 0'
times'(x, 0') → 0'
times'(s'(x), y) → plus'(times'(x, y), y)
p'(s'(s'(x))) → s'(p'(s'(x)))
p'(s'(0')) → 0'
fac'(s'(x)) → times'(fac'(p'(s'(x))), s'(x))

Rewrite Strategy: INNERMOST


Infered types.


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

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

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


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

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

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


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

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

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

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


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

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
fac' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
plus'(_gen_0':s'2(a), _gen_0':s'2(_n4)) → _gen_0':s'2(+(_n4, a)), 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:
times', p', fac'

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


Proved the following rewrite lemma:
times'(_gen_0':s'2(_n521), _gen_0':s'2(b)) → _gen_0':s'2(*(_n521, b)), rt ∈ Ω(1 + b808·n521 + n521)

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

Induction Step:
times'(_gen_0':s'2(+(_$n522, 1)), _gen_0':s'2(_b808)) →RΩ(1)
plus'(times'(_gen_0':s'2(_$n522), _gen_0':s'2(_b808)), _gen_0':s'2(_b808)) →IH
plus'(_gen_0':s'2(*(_$n522, _b808)), _gen_0':s'2(_b808)) →LΩ(1 + b808)
_gen_0':s'2(+(_b808, *(_$n522, _b808)))

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


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

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
fac' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
plus'(_gen_0':s'2(a), _gen_0':s'2(_n4)) → _gen_0':s'2(+(_n4, a)), rt ∈ Ω(1 + n4)
times'(_gen_0':s'2(_n521), _gen_0':s'2(b)) → _gen_0':s'2(*(_n521, b)), rt ∈ Ω(1 + b808·n521 + n521)

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', fac'

They will be analysed ascendingly in the following order:
p' < fac'


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

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

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

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


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

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
fac' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
plus'(_gen_0':s'2(a), _gen_0':s'2(_n4)) → _gen_0':s'2(+(_n4, a)), rt ∈ Ω(1 + n4)
times'(_gen_0':s'2(_n521), _gen_0':s'2(b)) → _gen_0':s'2(*(_n521, b)), rt ∈ Ω(1 + b808·n521 + n521)
p'(_gen_0':s'2(+(1, _n1342))) → _gen_0':s'2(_n1342), rt ∈ Ω(1 + n1342)

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


Proved the following rewrite lemma:
fac'(_gen_0':s'2(+(1, _n1759))) → _*3, rt ∈ Ω(n1759 + n17592)

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

Induction Step:
fac'(_gen_0':s'2(+(1, +(_$n1760, 1)))) →RΩ(1)
times'(fac'(p'(s'(_gen_0':s'2(+(1, _$n1760))))), s'(_gen_0':s'2(+(1, _$n1760)))) →LΩ(2 + $n1760)
times'(fac'(_gen_0':s'2(+(1, _$n1760))), s'(_gen_0':s'2(+(1, _$n1760)))) →IH
times'(_*3, s'(_gen_0':s'2(+(1, _$n1760))))

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


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

Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
fac' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
plus'(_gen_0':s'2(a), _gen_0':s'2(_n4)) → _gen_0':s'2(+(_n4, a)), rt ∈ Ω(1 + n4)
times'(_gen_0':s'2(_n521), _gen_0':s'2(b)) → _gen_0':s'2(*(_n521, b)), rt ∈ Ω(1 + b808·n521 + n521)
p'(_gen_0':s'2(+(1, _n1342))) → _gen_0':s'2(_n1342), rt ∈ Ω(1 + n1342)
fac'(_gen_0':s'2(+(1, _n1759))) → _*3, rt ∈ Ω(n1759 + n17592)

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