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

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


+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(0', y) → 0'
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)

Rewrite Strategy: INNERMOST


Infered types.


Rules:
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(0', y) → 0'
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)

Types:
+' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 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:
+', -'


Rules:
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(0', y) → 0'
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)

Types:
+' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 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:
+', -'


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

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

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

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


Rules:
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(0', y) → 0'
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)

Types:
+' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
+'(_gen_0':s'2(_n4), _gen_0':s'2(b)) → _gen_0':s'2(+(_n4, b)), 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:
-'


Proved the following rewrite lemma:
-'(_gen_0':s'2(_n420), _gen_0':s'2(_n420)) → _gen_0':s'2(0), rt ∈ Ω(1 + n420)

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

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

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


Rules:
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(0', y) → 0'
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)

Types:
+' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
+'(_gen_0':s'2(_n4), _gen_0':s'2(b)) → _gen_0':s'2(+(_n4, b)), rt ∈ Ω(1 + n4)
-'(_gen_0':s'2(_n420), _gen_0':s'2(_n420)) → _gen_0':s'2(0), rt ∈ Ω(1 + n420)

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