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

min(0, y) → 0
min(x, 0) → 0
min(s(x), s(y)) → s(min(x, y))
max(0, y) → y
max(x, 0) → x
max(s(x), s(y)) → s(max(x, y))
+(0, y) → y
+(s(x), y) → s(+(x, y))
-(x, 0) → x
-(s(x), s(y)) → -(x, y)
*(x, 0) → 0
*(x, s(y)) → +(x, *(x, y))
p(s(x)) → x
f(s(x), s(y)) → f(-(min(s(x), s(y)), max(s(x), s(y))), *(s(x), s(y)))

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


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


min'(0', y) → 0'
min'(x, 0') → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(0', y) → y
max'(x, 0') → x
max'(s'(x), s'(y)) → s'(max'(x, y))
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
*'(x, 0') → 0'
*'(x, s'(y)) → +'(x, *'(x, y))
p'(s'(x)) → x
f'(s'(x), s'(y)) → f'(-'(min'(s'(x), s'(y)), max'(s'(x), s'(y))), *'(s'(x), s'(y)))

Rewrite Strategy: INNERMOST


Infered types.


Rules:
min'(0', y) → 0'
min'(x, 0') → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(0', y) → y
max'(x, 0') → x
max'(s'(x), s'(y)) → s'(max'(x, y))
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
*'(x, 0') → 0'
*'(x, s'(y)) → +'(x, *'(x, y))
p'(s'(x)) → x
f'(s'(x), s'(y)) → f'(-'(min'(s'(x), s'(y)), max'(s'(x), s'(y))), *'(s'(x), s'(y)))

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
*' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → f'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_gen_0':s'3 :: Nat → 0':s'


Heuristically decided to analyse the following defined symbols:
min', max', +', -', *', f'

They will be analysed ascendingly in the following order:
min' < f'
max' < f'
+' < *'
-' < f'
*' < f'


Rules:
min'(0', y) → 0'
min'(x, 0') → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(0', y) → y
max'(x, 0') → x
max'(s'(x), s'(y)) → s'(max'(x, y))
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
*'(x, 0') → 0'
*'(x, s'(y)) → +'(x, *'(x, y))
p'(s'(x)) → x
f'(s'(x), s'(y)) → f'(-'(min'(s'(x), s'(y)), max'(s'(x), s'(y))), *'(s'(x), s'(y)))

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
*' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → f'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_gen_0':s'3 :: Nat → 0':s'

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

The following defined symbols remain to be analysed:
min', max', +', -', *', f'

They will be analysed ascendingly in the following order:
min' < f'
max' < f'
+' < *'
-' < f'
*' < f'


Proved the following rewrite lemma:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)

Induction Base:
min'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
0'

Induction Step:
min'(_gen_0':s'3(+(_$n6, 1)), _gen_0':s'3(+(_$n6, 1))) →RΩ(1)
s'(min'(_gen_0':s'3(_$n6), _gen_0':s'3(_$n6))) →IH
s'(_gen_0':s'3(_$n6))

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


Rules:
min'(0', y) → 0'
min'(x, 0') → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(0', y) → y
max'(x, 0') → x
max'(s'(x), s'(y)) → s'(max'(x, y))
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
*'(x, 0') → 0'
*'(x, s'(y)) → +'(x, *'(x, y))
p'(s'(x)) → x
f'(s'(x), s'(y)) → f'(-'(min'(s'(x), s'(y)), max'(s'(x), s'(y))), *'(s'(x), s'(y)))

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
*' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → f'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

The following defined symbols remain to be analysed:
max', +', -', *', f'

They will be analysed ascendingly in the following order:
max' < f'
+' < *'
-' < f'
*' < f'


Proved the following rewrite lemma:
max'(_gen_0':s'3(_n798), _gen_0':s'3(_n798)) → _gen_0':s'3(_n798), rt ∈ Ω(1 + n798)

Induction Base:
max'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
_gen_0':s'3(0)

Induction Step:
max'(_gen_0':s'3(+(_$n799, 1)), _gen_0':s'3(+(_$n799, 1))) →RΩ(1)
s'(max'(_gen_0':s'3(_$n799), _gen_0':s'3(_$n799))) →IH
s'(_gen_0':s'3(_$n799))

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


Rules:
min'(0', y) → 0'
min'(x, 0') → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(0', y) → y
max'(x, 0') → x
max'(s'(x), s'(y)) → s'(max'(x, y))
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
*'(x, 0') → 0'
*'(x, s'(y)) → +'(x, *'(x, y))
p'(s'(x)) → x
f'(s'(x), s'(y)) → f'(-'(min'(s'(x), s'(y)), max'(s'(x), s'(y))), *'(s'(x), s'(y)))

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
*' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → f'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
max'(_gen_0':s'3(_n798), _gen_0':s'3(_n798)) → _gen_0':s'3(_n798), rt ∈ Ω(1 + n798)

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

The following defined symbols remain to be analysed:
+', -', *', f'

They will be analysed ascendingly in the following order:
+' < *'
-' < f'
*' < f'


Proved the following rewrite lemma:
+'(_gen_0':s'3(_n1759), _gen_0':s'3(b)) → _gen_0':s'3(+(_n1759, b)), rt ∈ Ω(1 + n1759)

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

Induction Step:
+'(_gen_0':s'3(+(_$n1760, 1)), _gen_0':s'3(_b1892)) →RΩ(1)
s'(+'(_gen_0':s'3(_$n1760), _gen_0':s'3(_b1892))) →IH
s'(_gen_0':s'3(+(_$n1760, _b1892)))

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


Rules:
min'(0', y) → 0'
min'(x, 0') → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(0', y) → y
max'(x, 0') → x
max'(s'(x), s'(y)) → s'(max'(x, y))
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
*'(x, 0') → 0'
*'(x, s'(y)) → +'(x, *'(x, y))
p'(s'(x)) → x
f'(s'(x), s'(y)) → f'(-'(min'(s'(x), s'(y)), max'(s'(x), s'(y))), *'(s'(x), s'(y)))

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
*' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → f'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
max'(_gen_0':s'3(_n798), _gen_0':s'3(_n798)) → _gen_0':s'3(_n798), rt ∈ Ω(1 + n798)
+'(_gen_0':s'3(_n1759), _gen_0':s'3(b)) → _gen_0':s'3(+(_n1759, b)), rt ∈ Ω(1 + n1759)

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

The following defined symbols remain to be analysed:
-', *', f'

They will be analysed ascendingly in the following order:
-' < f'
*' < f'


Proved the following rewrite lemma:
-'(_gen_0':s'3(_n2690), _gen_0':s'3(_n2690)) → _gen_0':s'3(0), rt ∈ Ω(1 + n2690)

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

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

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


Rules:
min'(0', y) → 0'
min'(x, 0') → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(0', y) → y
max'(x, 0') → x
max'(s'(x), s'(y)) → s'(max'(x, y))
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
*'(x, 0') → 0'
*'(x, s'(y)) → +'(x, *'(x, y))
p'(s'(x)) → x
f'(s'(x), s'(y)) → f'(-'(min'(s'(x), s'(y)), max'(s'(x), s'(y))), *'(s'(x), s'(y)))

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
*' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → f'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
max'(_gen_0':s'3(_n798), _gen_0':s'3(_n798)) → _gen_0':s'3(_n798), rt ∈ Ω(1 + n798)
+'(_gen_0':s'3(_n1759), _gen_0':s'3(b)) → _gen_0':s'3(+(_n1759, b)), rt ∈ Ω(1 + n1759)
-'(_gen_0':s'3(_n2690), _gen_0':s'3(_n2690)) → _gen_0':s'3(0), rt ∈ Ω(1 + n2690)

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

The following defined symbols remain to be analysed:
*', f'

They will be analysed ascendingly in the following order:
*' < f'


Proved the following rewrite lemma:
*'(_gen_0':s'3(a), _gen_0':s'3(_n3593)) → _gen_0':s'3(*(_n3593, a)), rt ∈ Ω(1 + a3853·n3593 + n3593)

Induction Base:
*'(_gen_0':s'3(a), _gen_0':s'3(0)) →RΩ(1)
0'

Induction Step:
*'(_gen_0':s'3(_a3853), _gen_0':s'3(+(_$n3594, 1))) →RΩ(1)
+'(_gen_0':s'3(_a3853), *'(_gen_0':s'3(_a3853), _gen_0':s'3(_$n3594))) →IH
+'(_gen_0':s'3(_a3853), _gen_0':s'3(*(_$n3594, _a3853))) →LΩ(1 + a3853)
_gen_0':s'3(+(_a3853, *(_$n3594, _a3853)))

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


Rules:
min'(0', y) → 0'
min'(x, 0') → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(0', y) → y
max'(x, 0') → x
max'(s'(x), s'(y)) → s'(max'(x, y))
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
*'(x, 0') → 0'
*'(x, s'(y)) → +'(x, *'(x, y))
p'(s'(x)) → x
f'(s'(x), s'(y)) → f'(-'(min'(s'(x), s'(y)), max'(s'(x), s'(y))), *'(s'(x), s'(y)))

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
*' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → f'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
max'(_gen_0':s'3(_n798), _gen_0':s'3(_n798)) → _gen_0':s'3(_n798), rt ∈ Ω(1 + n798)
+'(_gen_0':s'3(_n1759), _gen_0':s'3(b)) → _gen_0':s'3(+(_n1759, b)), rt ∈ Ω(1 + n1759)
-'(_gen_0':s'3(_n2690), _gen_0':s'3(_n2690)) → _gen_0':s'3(0), rt ∈ Ω(1 + n2690)
*'(_gen_0':s'3(a), _gen_0':s'3(_n3593)) → _gen_0':s'3(*(_n3593, a)), rt ∈ Ω(1 + a3853·n3593 + n3593)

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

The following defined symbols remain to be analysed:
f'


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


Rules:
min'(0', y) → 0'
min'(x, 0') → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(0', y) → y
max'(x, 0') → x
max'(s'(x), s'(y)) → s'(max'(x, y))
+'(0', y) → y
+'(s'(x), y) → s'(+'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
*'(x, 0') → 0'
*'(x, s'(y)) → +'(x, *'(x, y))
p'(s'(x)) → x
f'(s'(x), s'(y)) → f'(-'(min'(s'(x), s'(y)), max'(s'(x), s'(y))), *'(s'(x), s'(y)))

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
*' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
f' :: 0':s' → 0':s' → f'
_hole_0':s'1 :: 0':s'
_hole_f'2 :: f'
_gen_0':s'3 :: Nat → 0':s'

Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
max'(_gen_0':s'3(_n798), _gen_0':s'3(_n798)) → _gen_0':s'3(_n798), rt ∈ Ω(1 + n798)
+'(_gen_0':s'3(_n1759), _gen_0':s'3(b)) → _gen_0':s'3(+(_n1759, b)), rt ∈ Ω(1 + n1759)
-'(_gen_0':s'3(_n2690), _gen_0':s'3(_n2690)) → _gen_0':s'3(0), rt ∈ Ω(1 + n2690)
*'(_gen_0':s'3(a), _gen_0':s'3(_n3593)) → _gen_0':s'3(*(_n3593, a)), rt ∈ Ω(1 + a3853·n3593 + n3593)

Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))

No more defined symbols left to analyse.


The lowerbound Ω(n2) was proven with the following lemma:
*'(_gen_0':s'3(a), _gen_0':s'3(_n3593)) → _gen_0':s'3(*(_n3593, a)), rt ∈ Ω(1 + a3853·n3593 + n3593)