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 fbfb4e2
Browse filesBrowse the repository at this point in the historyBrowse files
Treat results of methods without refinements as unconstrained in operations (#312)
When an invocation of a method with no refinements (e.g. `s.length()`,
`s.equals(..)`, `list.size()`) was an operand of a comparison or boolean
operator, `OperationsChecker` looked up the `RefinedFunction`, got
`null`, and crashed with an NPE, even in programs with no refinements at
all.
Now, in both `getOperationRefinements` (invocation branch) and
`getOperationRefinementFromExternalLib`, a missing function yields a
fresh variable of the invocation's type with refinement `true`, so the
result is treated as unconstrained instead of breaking verification.
Fixes#300
## Testing
- New `CorrectUnknownMethodInComparison`: `if (s.length() < 3)`,
`s.equals("a") || s.equals("b")`, and a `for` loop bounded by
`list.size()` (crashes without the fix).
- New `ErrorUnknownMethodInOperation`: `@Refinement("_ > 0") int x =
s.length() + 1;` is still reported as a Refinement Error (no information
is assumed about the result).
- `mvn test`: 340 tests run, 0 failures, 0 errors.
- The repro from the issue now prints `Correct! Passed Verification.`
via `./liquidjava`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker/general_checkers/OperationsChecker.java
0 commit comments