Termination of a set of rules modulo a set of equations