Skip to content

Coverage

opulse.analysis.coverage

Find and check top-level definition branches for empirical measurements.

The witness constraints mirror the reachability check: an input must pass all earlier conditions without matching or aborting before it can enter a branch. The reference oracle checks actual branch selection, including short circuiting.

branch_witnesses

branch_witnesses(
    operator: Operator,
    encoder: Z3Encoder,
    timeout_ms: int = 10000,
    rlimit: int = 5000000,
) -> list[tuple[int, ...] | None]

Return one model per top-level branch, or None when none is found.

This includes a terminal else or bare branch. A None can mean unsatisfiable or a resource limit; coverage is checked independently against the oracle.

selected_branch

selected_branch(
    operator: Operator, args: Sequence[int], oracle: Oracle
) -> int | None

Index of the entered top-level branch; None if selection aborts or misses.