hypergraph rewriting