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

f(s(x)) → s(s(f(p(s(x)))))
f(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:

f'(s'(x)) → s'(s'(f'(p'(s'(x)))))
f'(0') → 0'
p'(s'(x)) → x

Rewrite Strategy: INNERMOST

Infered types.

Rules:
f'(s'(x)) → s'(s'(f'(p'(s'(x)))))
f'(0') → 0'
p'(s'(x)) → x

Types:
f' :: s':0' → s':0'
s' :: s':0' → s':0'
p' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'

Heuristically decided to analyse the following defined symbols:
f'

Rules:
f'(s'(x)) → s'(s'(f'(p'(s'(x)))))
f'(0') → 0'
p'(s'(x)) → x

Types:
f' :: s':0' → s':0'
s' :: s':0' → s':0'
p' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'

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

The following defined symbols remain to be analysed:
f'

Proved the following rewrite lemma:
f'(_gen_s':0'2(_n4)) → _gen_s':0'2(*(2, _n4)), rt ∈ Ω(1 + n4)

Induction Base:
f'(_gen_s':0'2(0)) →RΩ(1)
0'

Induction Step:
f'(_gen_s':0'2(+(_\$n5, 1))) →RΩ(1)
s'(s'(f'(p'(s'(_gen_s':0'2(_\$n5)))))) →RΩ(1)
s'(s'(f'(_gen_s':0'2(_\$n5)))) →IH
s'(s'(_gen_s':0'2(*(2, _\$n5))))

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

Rules:
f'(s'(x)) → s'(s'(f'(p'(s'(x)))))
f'(0') → 0'
p'(s'(x)) → x

Types:
f' :: s':0' → s':0'
s' :: s':0' → s':0'
p' :: s':0' → s':0'
0' :: s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'

Lemmas:
f'(_gen_s':0'2(_n4)) → _gen_s':0'2(*(2, _n4)), rt ∈ Ω(1 + n4)

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

No more defined symbols left to analyse.

The lowerbound Ω(n) was proven with the following lemma:
f'(_gen_s':0'2(_n4)) → _gen_s':0'2(*(2, _n4)), rt ∈ Ω(1 + n4)