Extract a Nat literal from an Expr (numerals and raw literals).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Interpret a coefficient leaf of ring R. For ℚ (and ℤ), a leaf that is
not structurally an integer is evaluated to a Rat and accepted only when its
denominator is 1; otherwise the dedicated non-integer-coefficient error fires.
For ℝ (not evaluable to Rat), only structurally integer leaves are accepted.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Recursive interpreter from a Polynomial R expression over
X / C / numerals (OfNat) / + / - / * / ^ (Nat) / neg, with named local defs
unfolded one delta step at a time under a fuel guard, to a Hex.ZPoly value.
isRat permits evaluating closed rational coefficients, provided they are integers.
fuel bounds successive unfolding of named definitions. onUnfold records their
names so that callers can unfold the same definitions when checking the result.