A simple algorithm for checking equivalence of counting functions on free monoids | Synapse