tools.py 356 B

1234567891011
  1. from .core import exhaust, multiplex
  2. from .traverse import top_down
  3. def canon(*rules):
  4. """ Strategy for canonicalization
  5. Apply each branching rule in a top-down fashion through the tree.
  6. Multiplex through all branching rule traversals
  7. Keep doing this until there is no change.
  8. """
  9. return exhaust(multiplex(*map(top_down, rules)))