fix: `grind` order solver internalizing an in-progress `Nat` cast

This PR fixes the `grind.debug` internal error "`internalize` reached an application whose arguments are still being internalized" on casts such as `((n - m : Nat) : Int)`.

The order solver translated `Nat` terms to `Int` before checking for a forbidden parent. For `n - m` under `↑(n - m)`, the translation built and internalized `↑(n - m)`, which was still being internalized. `Order.internalize` now checks `isForbiddenParent` first.

Those translations were also how the order solver mapped nodes such as `↑a + ↑b` (from `a + b ≤ c`) back to `Nat` terms such as `a + b`. `mkNode` now computes this map on demand: `toNatTerm?` inverts `natToInt`, and the candidate is used only if it is internalized and `natToInt` translates it to the node. This also maps nodes the old code missed (e.g., `2 * ↑a`), which changes the expected output of `grind_lint_1` and `grind_cutsat_toint_1`.

Closes #15621

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 files changed