You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2a9b40d
Browse filesBrowse the repository at this point in the historyBrowse files
Show in Found only the facts about the values Expected constrains (#485)
Closes#480.
## Problem
The message's Found listed every path condition of the method, so a
guard on another variable read as the reason for the error, and nothing
was said about the variable Expected constrains.
## Change
The message keeps only the facts of Found linked to the terms of
Expected: the same `factsOf`/`linkedTerms` the counterexample already
uses, exposed as one package-private `RefinementError.linkedToExpected`
that `StateRefinementError` reuses.
- When facts remain, the frames are unchanged: `X is not a subtype of Y`
and `found X but expected Y`. When every fact is linked, Found is shown
as written (e.g. `!(x < 0 || x > 5)`, not split).
- When none remains (for a state error: none applies a ghost or state;
an alias such as `box == getBox` says nothing about the state), the
message reads `expected <refinement> but could not prove it`.
Only the message text changes. The counterexample, hints, the Found the
IDE shows and the verification query are unchanged. `TestGeneratedNames`
now reads the whole Found of refinement errors, since the message no
longer lists unrelated generated names.
## Before / after
Reproducer 1 (refinement):
```
before: Refinement Error: !(port < 0 || port > 65535) is not a subtype of timeout >= 0
after: Refinement Error: expected timeout >= 0 but could not prove it
Counterexample: timeout == -1 (unchanged)
```
Reproducer 2 (state):
```
before: State Refinement Error: found !(#isEmpty_result¹⁶ || #isEmpty_result¹⁷) && box¹⁵ == getBox¹³ but expected full(box¹⁵)
after: State Refinement Error: expected full(box¹⁵) but could not prove it
```
Study exercise (JabRef `EditCommand`, fixture
`state_hint_study_undo_manager_error`):
```
after: expected redoable(undoManager) but could not prove it
```
Facts that relate to Expected stay in the usual frame:
- `!(port < 0 || retries > t)` with Expected `t >= 0` shows `!(retries >
t) is not a subtype of t >= 0`;
- a state reaching Expected through an alias: `found empty(b1) && box ==
b1 but expected full(box)`.
## Tests
Each fails without the fix:
- `RefinementErrorCounterexampleTest`: refinement reproducer, partial
guard, Found kept as written when every fact is linked, state kept
through an alias.
- `TestStateHints`: the study's undo manager (state reproducer).
Full suite passes locally (697 tests). Size: +99 / −18 over 5 files.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments