Nodes
opulse.expression.nodes ¶
Expression trees whose operators are already resolved to :class:Operator records.
Unlike :mod:opulse.definition.ast (surface syntax, symbols only), these nodes
point at concrete operators, so they can be evaluated directly. Use
:func:to_ast to embed an expression into a definition.
defined_operators ¶
defined_operators(node: Node) -> list[str]
Sorted func_ids of the defined operators applied in node, one entry per application.
map_operators ¶
map_operators(
node: Node, swap: Callable[[Operator], Operator]
) -> Node
Rebuild node with every operator replaced by swap(operator).
literal_form ¶
literal_form(node: Node, registry) -> Node
Write every negative number atom as unary minus of its magnitude (spec section 7).
Expression trees must be in this form before they are evaluated, so that the evaluator and the reference interpreter count the same negation (review finding).