A rewriting calculus for cyclic higher-order term graphs