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

minus(x, 0) → x
minus(0, y) → 0
minus(s(x), s(y)) → minus(p(s(x)), p(s(y)))
minus(x, plus(y, z)) → minus(minus(x, y), z)
p(s(s(x))) → s(p(s(x)))
p(0) → s(s(0))
div(s(x), s(y)) → s(div(minus(x, y), s(y)))
div(plus(x, y), z) → plus(div(x, z), div(y, z))
plus(0, y) → y
plus(s(x), y) → s(plus(y, minus(s(x), s(0))))

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


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


minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(p'(s'(x)), p'(s'(y)))
minus'(x, plus'(y, z)) → minus'(minus'(x, y), z)
p'(s'(s'(x))) → s'(p'(s'(x)))
p'(0') → s'(s'(0'))
div'(s'(x), s'(y)) → s'(div'(minus'(x, y), s'(y)))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(y, minus'(s'(x), s'(0'))))

Rewrite Strategy: INNERMOST


Infered types.


Rules:
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(p'(s'(x)), p'(s'(y)))
minus'(x, plus'(y, z)) → minus'(minus'(x, y), z)
p'(s'(s'(x))) → s'(p'(s'(x)))
p'(0') → s'(s'(0'))
div'(s'(x), s'(y)) → s'(div'(minus'(x, y), s'(y)))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(y, minus'(s'(x), s'(0'))))

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

They will be analysed ascendingly in the following order:
p' < minus'
minus' < div'
minus' < plus'
plus' < div'


Rules:
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(p'(s'(x)), p'(s'(y)))
minus'(x, plus'(y, z)) → minus'(minus'(x, y), z)
p'(s'(s'(x))) → s'(p'(s'(x)))
p'(0') → s'(s'(0'))
div'(s'(x), s'(y)) → s'(div'(minus'(x, y), s'(y)))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(y, minus'(s'(x), s'(0'))))

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

They will be analysed ascendingly in the following order:
p' < minus'
minus' < div'
minus' < plus'
plus' < div'


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

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

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

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


Rules:
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(p'(s'(x)), p'(s'(y)))
minus'(x, plus'(y, z)) → minus'(minus'(x, y), z)
p'(s'(s'(x))) → s'(p'(s'(x)))
p'(0') → s'(s'(0'))
div'(s'(x), s'(y)) → s'(div'(minus'(x, y), s'(y)))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(y, minus'(s'(x), s'(0'))))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
div' :: 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(+(2, _n4))) → _*3, rt ∈ Ω(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:
minus', div', plus'

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


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


Rules:
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(p'(s'(x)), p'(s'(y)))
minus'(x, plus'(y, z)) → minus'(minus'(x, y), z)
p'(s'(s'(x))) → s'(p'(s'(x)))
p'(0') → s'(s'(0'))
div'(s'(x), s'(y)) → s'(div'(minus'(x, y), s'(y)))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(y, minus'(s'(x), s'(0'))))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
div' :: 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(+(2, _n4))) → _*3, rt ∈ Ω(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', div'

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


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


Rules:
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(p'(s'(x)), p'(s'(y)))
minus'(x, plus'(y, z)) → minus'(minus'(x, y), z)
p'(s'(s'(x))) → s'(p'(s'(x)))
p'(0') → s'(s'(0'))
div'(s'(x), s'(y)) → s'(div'(minus'(x, y), s'(y)))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(y, minus'(s'(x), s'(0'))))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
div' :: 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(+(2, _n4))) → _*3, rt ∈ Ω(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:
div'


Proved the following rewrite lemma:
div'(_gen_0':s'2(+(1, _n1996)), _gen_0':s'2(1)) → _*3, rt ∈ Ω(n1996)

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

Induction Step:
div'(_gen_0':s'2(+(1, +(_$n1997, 1))), _gen_0':s'2(1)) →RΩ(1)
s'(div'(minus'(_gen_0':s'2(+(1, _$n1997)), _gen_0':s'2(0)), s'(_gen_0':s'2(0)))) →RΩ(1)
s'(div'(_gen_0':s'2(+(1, _$n1997)), s'(_gen_0':s'2(0)))) →IH
s'(_*3)

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


Rules:
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(p'(s'(x)), p'(s'(y)))
minus'(x, plus'(y, z)) → minus'(minus'(x, y), z)
p'(s'(s'(x))) → s'(p'(s'(x)))
p'(0') → s'(s'(0'))
div'(s'(x), s'(y)) → s'(div'(minus'(x, y), s'(y)))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(y, minus'(s'(x), s'(0'))))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
p' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
div' :: 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(+(2, _n4))) → _*3, rt ∈ Ω(n4)
div'(_gen_0':s'2(+(1, _n1996)), _gen_0':s'2(1)) → _*3, rt ∈ Ω(n1996)

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 Ω(n) was proven with the following lemma:
p'(_gen_0':s'2(+(2, _n4))) → _*3, rt ∈ Ω(n4)