(0) Obligation:

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

g(c(x, s(y))) → g(c(s(x), y))
f(c(s(x), y)) → f(c(x, s(y)))
f(f(x)) → f(d(f(x)))
f(x) → x

Q is empty.