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

minus(x, 0) → x
minus(s(x), s(y)) → minus(x, y)
f(0) → s(0)
f(s(x)) → minus(s(x), g(f(x)))
g(0) → 0
g(s(x)) → minus(s(x), f(g(x)))

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'(s'(x), s'(y)) → minus'(x, y)
f'(0') → s'(0')
f'(s'(x)) → minus'(s'(x), g'(f'(x)))
g'(0') → 0'
g'(s'(x)) → minus'(s'(x), f'(g'(x)))

Rewrite Strategy: INNERMOST


Infered types.


Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
f'(0') → s'(0')
f'(s'(x)) → minus'(s'(x), g'(f'(x)))
g'(0') → 0'
g'(s'(x)) → minus'(s'(x), f'(g'(x)))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 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', f', g'

They will be analysed ascendingly in the following order:
minus' < f'
minus' < g'
f' = g'


Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
f'(0') → s'(0')
f'(s'(x)) → minus'(s'(x), g'(f'(x)))
g'(0') → 0'
g'(s'(x)) → minus'(s'(x), f'(g'(x)))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 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:
minus', f', g'

They will be analysed ascendingly in the following order:
minus' < f'
minus' < g'
f' = g'


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

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

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

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


Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
f'(0') → s'(0')
f'(s'(x)) → minus'(s'(x), g'(f'(x)))
g'(0') → 0'
g'(s'(x)) → minus'(s'(x), f'(g'(x)))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
minus'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), 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:
g', f'

They will be analysed ascendingly in the following order:
f' = g'


Proved the following rewrite lemma:
g'(_gen_0':s'2(+(1, _n326))) → _*3, rt ∈ Ω(n326)

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

Induction Step:
g'(_gen_0':s'2(+(1, +(_$n327, 1)))) →RΩ(1)
minus'(s'(_gen_0':s'2(+(1, _$n327))), f'(g'(_gen_0':s'2(+(1, _$n327))))) →IH
minus'(s'(_gen_0':s'2(+(1, _$n327))), f'(_*3))

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


Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
f'(0') → s'(0')
f'(s'(x)) → minus'(s'(x), g'(f'(x)))
g'(0') → 0'
g'(s'(x)) → minus'(s'(x), f'(g'(x)))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
minus'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
g'(_gen_0':s'2(+(1, _n326))) → _*3, rt ∈ Ω(n326)

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

They will be analysed ascendingly in the following order:
f' = g'


Proved the following rewrite lemma:
f'(_gen_0':s'2(+(1, _n5692))) → _*3, rt ∈ Ω(n5692)

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

Induction Step:
f'(_gen_0':s'2(+(1, +(_$n5693, 1)))) →RΩ(1)
minus'(s'(_gen_0':s'2(+(1, _$n5693))), g'(f'(_gen_0':s'2(+(1, _$n5693))))) →IH
minus'(s'(_gen_0':s'2(+(1, _$n5693))), g'(_*3))

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


Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
f'(0') → s'(0')
f'(s'(x)) → minus'(s'(x), g'(f'(x)))
g'(0') → 0'
g'(s'(x)) → minus'(s'(x), f'(g'(x)))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
minus'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
g'(_gen_0':s'2(+(1, _n326))) → _*3, rt ∈ Ω(n326)
f'(_gen_0':s'2(+(1, _n5692))) → _*3, rt ∈ Ω(n5692)

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

They will be analysed ascendingly in the following order:
f' = g'


Proved the following rewrite lemma:
g'(_gen_0':s'2(+(1, _n93399))) → _*3, rt ∈ Ω(n93399)

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

Induction Step:
g'(_gen_0':s'2(+(1, +(_$n93400, 1)))) →RΩ(1)
minus'(s'(_gen_0':s'2(+(1, _$n93400))), f'(g'(_gen_0':s'2(+(1, _$n93400))))) →IH
minus'(s'(_gen_0':s'2(+(1, _$n93400))), f'(_*3))

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


Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
f'(0') → s'(0')
f'(s'(x)) → minus'(s'(x), g'(f'(x)))
g'(0') → 0'
g'(s'(x)) → minus'(s'(x), f'(g'(x)))

Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
minus'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
g'(_gen_0':s'2(+(1, _n93399))) → _*3, rt ∈ Ω(n93399)
f'(_gen_0':s'2(+(1, _n5692))) → _*3, rt ∈ Ω(n5692)

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:
minus'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)