Skip to content

Operator

opulse.core.operator

The operator record and its JSONL representation.

An :class:Operator is plain data. It knows how to describe itself (arity, position, how to render its left-hand side) but not how to find other operators; that is the job of :class:opulse.core.registry.OperatorRegistry.

The JSON field names match the legacy operator_*.jsonl files so that old datasets load unchanged and downstream tools (CoT expansion, NL description) can read new output.

Operator dataclass

is_primitive property

is_primitive: bool

True for hand-written initial operators that have no definition string.

apply_str

apply_str(*operands: str, symbols=None) -> str

Render this operator applied to already-rendered operand strings.

symbols (:class:opulse.config.Symbols) supplies the brackets and the argument separator of the call form; only operators with three or more arguments use them.

is_call_form

is_call_form(n_ary: int) -> bool

Applications with three or more arguments are written symbol(arg, arg, arg).