jacopy.ProofFailure

exception jacopy.ProofFailure(message, *, report=None, residual=None)

Bases: Exception

Raised when a strategy cannot close the gap between two expressions.

The exception message includes the surviving residual, which is usually enough to diagnose whether the mismatch is genuine or whether a missing grading declaration / definition prevented the strategy from closing.

When the raising strategy has a residual on hand, it may attach a DiagnosticReport as the report kwarg, callers can read exc.report to get structural hints about which rewrite stalled. A report is optional; legacy call sites still raise with a bare message and report defaults to None.

Parameters:
  • message (str)

  • report (Optional[Any])

  • residual (Optional[Expr])

Return type:

None

residual

The surviving obstruction as an Expr (when the raising strategy has it) — machine-readable, so repair loops can inspect the exact shape instead of parsing the message.