(0) Obligation:

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

f(0, 1, x) → f(x, x, x)
f(x, y, z) → 2
02
12
g(x, x, y) → y
g(x, y, y) → x

Q is empty.