Skip to content

Static

opulse.solver.static

Static checks on definitions with z3 (docs/reference/semantics.md section 9, obligation 4).

Inputs range over the value domain [-B, B] (all values an operator ever receives lie there in exact mode). A conditional branch is reachable if some input passes every earlier branch without matching or aborting and then matches this branch.

reachable_branches

reachable_branches(
    operator: Operator,
    encoder: Z3Encoder,
    timeout_ms: int = 10000,
    budget: int = 600,
    check_undefined: bool = True,
) -> list[str]

Per conditional branch: "reachable", "dead", "undefined" or "unknown".

budget limits encoding nodes and gives z3 a proportional resource limit.

"undefined": the branch is reached by some input but its body is NaN on all of them (e.g. b / (a - a)), so it only ever contributes NaN.

dead_branch_reason

dead_branch_reason(
    operator: Operator,
    encoder: Z3Encoder,
    timeout_ms: int = 30000,
    budget: int = 600,
    check_undefined: bool = True,
) -> str | None

Acceptance check: reject definitions with a provably dead or always-undefined branch.