(0) Obligation:

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

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

Q is empty.