Skip to main content

Module collapse

Module collapse 

Source
Expand description

Foundation for explicit symbolic → numeric collapse (spec §9).

Numeric evaluation only lowers determinate nodes to Number: built-in constants (\e/\pi), exact nodes, unary numeric operators, and the four arithmetic operations plus powers. It returns None for unresolved symbols or unsupported operators; the caller (the collapse function family, spec §9.2) decides whether to raise an error or keep the symbolic form.

Functions§

collapse_value
Collapse a Value to a number (spec §9): Number is returned as-is, Expr is evaluated numerically, everything else (including Undefined/Indeterminate/arrays) yields None.
numeric_value
ExprDAG → number (spec §9).