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

-(0, y) → 0
-(x, 0) → x
-(x, s(y)) → if(greater(x, s(y)), s(-(x, p(s(y)))), 0)
p(0) → 0
p(s(x)) → x

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) → 0'
-'(x, 0') → x
-'(x, s'(y)) → if'(greater'(x, s'(y)), s'(-'(x, p'(s'(y)))), 0')
p'(0') → 0'
p'(s'(x)) → x

Rewrite Strategy: INNERMOST

Sliced the following arguments:
if'/0
if'/2
greater'/0
greater'/1

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

-'(0', y) → 0'
-'(x, 0') → x
-'(x, s'(y)) → if'(s'(-'(x, p'(s'(y)))))
p'(0') → 0'
p'(s'(x)) → x

Rewrite Strategy: INNERMOST

Infered types.

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

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

Heuristically decided to analyse the following defined symbols:
-'

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

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

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

The following defined symbols remain to be analysed:
-'

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

Induction Base:
-'(_gen_0':s':if'2(a), _gen_0':s':if'2(0))

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

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

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

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

Lemmas:
-'(_gen_0':s':if'2(a), _gen_0':s':if'2(_n4)) → _*3, rt ∈ Ω(n4)

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

No more defined symbols left to analyse.

The lowerbound Ω(n) was proven with the following lemma:
-'(_gen_0':s':if'2(a), _gen_0':s':if'2(_n4)) → _*3, rt ∈ Ω(n4)