final case class RewritingSystem(monoid: FiniteMonoid, normalForms: IndexedSeq[Vector[Int]], levels: Map[Int, Int])
A complete rewriting system for a finite monoid, given by the normal form of every element: normalForms(x) is a word in the letters (element indices, the keys of levels), the empty word for the identity. The rules are the minimal words that are not normal forms, each rewritten to the normal form of its value.
levels orders the letters for termination: a rule must decrease in the wreath product of shortlex orders by level (the collection order of polycyclic presentations), which validate() checks along with the rest. Build one by hand, or with RewritingSystem.refining from a chain of subgroups.
Empty when every element of every subgroup in chain has a normal form using only that subgroup's letters -- the condition under which Brown's collapse (CollapsedNerve) never matches cells of two filtration levels.
Empty when every element of every subgroup in chain has a normal form using only that subgroup's letters -- the condition under which Brown's collapse (CollapsedNerve) never matches cells of two filtration levels.
Empty when this is a complete rewriting system: one normal form per element, evaluating to it, the identity's empty; every letter its own normal form; normal forms closed under taking factors; every rule decreasing in the collection order (so rewriting terminates, and with unique normal forms it is confluent).
Empty when this is a complete rewriting system: one normal form per element, evaluating to it, the identity's empty; every letter its own normal form; normal forms closed under taking factors; every rule decreasing in the collection order (so rewriting terminates, and with unique normal forms it is confluent).