Skip to content

Fix cover diagnostic messages to distinguish from assertions#413

Open
MikaelMayer wants to merge 8 commits intomainfrom
fix-cover-diagnostic-messages
Open

Fix cover diagnostic messages to distinguish from assertions#413
MikaelMayer wants to merge 8 commits intomainfrom
fix-cover-diagnostic-messages

Conversation

@MikaelMayer
Copy link
Contributor

Summary

The toDiagnosticModel function was not cover-aware - it always reported "assertion does not hold" even for cover statement failures.

Changes

  • For .fail results: report "cover property is not satisfiable" for cover statements, "assertion does not hold" for asserts
  • For .unknown results on cover statements: only report diagnostic in debug mode (verbosity > normal), since it's informational rather than an error
  • For .unknown results on asserts: always report "assertion could not be proved"

Testing

The change affects diagnostic message generation only.

@MikaelMayer MikaelMayer marked this pull request as ready for review February 12, 2026 19:33
@MikaelMayer MikaelMayer requested a review from a team as a code owner February 12, 2026 19:33
- Test that cover failures produce 'cover property is not satisfiable'
- Test that assert failures produce 'assertion does not hold'
- Test that passing statements produce no diagnostics
- Extract only messages to avoid unstable byteIdx in test expectations
Tests that same expression (x > 0) produces no diagnostic for cover (satisfiable) but produces 'assertion could not be proved' for assert (unprovable)
Tests that same expression (x > 0) produces no diagnostic for cover (satisfiable) but produces 'assertion could not be proved' for assert (unprovable)
some {
fileRange := default
message := s!"Internal error: diagnostics without position! Metadata value for fileRange key was not a fileRange. obligation label: {repr vcr.obligation.label}"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder how the line numbers in CorePrelude.lean were recorded - do they have fileRange metadata?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants