(0) Obligation:

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

f(a, x) → f(b, f(c, x))
f(a, f(b, x)) → f(b, f(a, x))
f(d, f(c, x)) → f(d, f(a, x))
f(a, f(c, x)) → f(c, f(a, x))

Q is empty.