Skip to content

feat: parametric ResultClassifier for pyAnalyzeLaurel success/failure#666

Merged
shigoel merged 4 commits intomainfrom
shilpi/vc-result-classifier
Mar 26, 2026
Merged

feat: parametric ResultClassifier for pyAnalyzeLaurel success/failure#666
shigoel merged 4 commits intomainfrom
shilpi/vc-result-classifier

Conversation

@shigoel
Copy link
Copy Markdown
Contributor

@shigoel shigoel commented Mar 26, 2026

Summary

  • Add ResultClassifier structure with pluggable isSuccess/isFailure predicates (defaults preserve existing behavior) so callers can control what counts as a failure without touching printPyAnalyzeSummary.
  • In bug-finding mode, narrow isFailure to alwaysFalseAndReachable only — the outcome where validity confirms the property is always false on a reachable path. Other failure modes become inconclusive.
  • Apply the classifier consistently: both the per-VC "Assertion failed" prefix and the summary counts/exit-code now use the same classifier.isFailure.
  • nInconclusive is now the remainder (total minus success, failure, unreachable, impl-error), so narrowing isFailure automatically widens inconclusive.
  • Add VCOutcome.hasSMTError / VCResult.hasSMTError to Verifier.lean alongside the other nine-case predicates, and use them to simplify nImplError in printPyAnalyzeSummary.

🤖 Generated with Claude Code

Add a `ResultClassifier` structure to `StrataMain` holding pluggable
`isSuccess` and `isFailure` predicates (defaulting to the existing
`VCResult` methods).  Pass it through `printPyAnalyzeSummary` and the
per-VC display loop so that both the summary counts/exit-code and the
"Assertion failed" location prefix are driven by the same definition.

`nInconclusive` is now computed as the remainder after subtracting
success, failure, unreachable, and implementation-error counts, so
narrowing `isFailure` automatically widens inconclusive without further
changes.

In bug-finding mode (`bugFinding` / `bugFindingAssumingCompleteSpec`)
the classifier narrows `isFailure` to `alwaysFalseAndReachable` only
— the outcome where the validity check confirms the property is always
false on a reachable path.

Also add `VCOutcome.hasSMTError` and `VCResult.hasSMTError` to
`Verifier.lean` alongside the other nine-case predicates, and use them
to simplify the `nImplError` filter in `printPyAnalyzeSummary`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shigoel shigoel requested a review from a team March 26, 2026 01:21
Copy link
Copy Markdown
Contributor

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean PR — the ResultClassifier abstraction is well-scoped and the remainder-based nInconclusive is a nice simplification. The hasSMTError extraction into Verifier.lean is a good cleanup. One observations below which is worth discussing before merge.

shigoel and others added 2 commits March 26, 2026 10:28
Replace independent counting + Nat-subtraction remainder with successive
list partitioning (implError → success → failure → inconclusive), which
guarantees disjointness by construction and eliminates the Nat underflow
risk. Unreachable is now an informational overlay rather than a separate
partition, so it flows through the classifier — correctly handling future
cover obligations where unreachable is a failure, not a success.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shigoel shigoel added this pull request to the merge queue Mar 26, 2026
Merged via the queue into main with commit 55cbb58 Mar 26, 2026
15 checks passed
@shigoel shigoel deleted the shilpi/vc-result-classifier branch March 26, 2026 16:09
olivier-aws pushed a commit that referenced this pull request Mar 30, 2026
…#666)

## Summary

- Add `ResultClassifier` structure with pluggable
`isSuccess`/`isFailure` predicates (defaults preserve existing behavior)
so callers can control what counts as a failure without touching
`printPyAnalyzeSummary`.
- In bug-finding mode, narrow `isFailure` to `alwaysFalseAndReachable`
only — the outcome where validity confirms the property is always false
on a reachable path. Other failure modes become inconclusive.
- Apply the classifier consistently: both the per-VC `"Assertion
failed"` prefix and the summary counts/exit-code now use the same
`classifier.isFailure`.
- `nInconclusive` is now the remainder (total minus success, failure,
unreachable, impl-error), so narrowing `isFailure` automatically widens
inconclusive.
- Add `VCOutcome.hasSMTError` / `VCResult.hasSMTError` to
`Verifier.lean` alongside the other nine-case predicates, and use them
to simplify `nImplError` in `printPyAnalyzeSummary`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants