(0) Obligation:

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

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

Q is empty.