perf: `Expr.toPoly` in `grind`

This PR adds a version of `CommRing.Expr.toPoly` optimized for kernel
reduction. We use this function not only to implement `grind ring`,
but also to interface the ring module with `grind cutsat`.
2 files changed