(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

ap(f, x) → x
ap(ap(ap(g, x), y), ap(s, z)) → ap(ap(ap(g, x), y), ap(ap(x, y), 0))

Q is empty.