(0) Obligation:

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

g(x, x) → g(a, b)
g(c, g(c, x)) → g(e, g(d, x))
g(d, g(d, x)) → g(c, g(e, x))
g(e, g(e, x)) → g(d, g(c, x))
f(g(x, y)) → g(y, g(f(f(x)), a))

Q is empty.