Multiset rewriting by multiset constraint solving