Skip to content

Commit 8b74fa3

Browse files
Show no state counterexample when every value fails the call
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 797608f commit 8b74fa3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker

‎liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker/TypeChecker.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,14 @@ public void throwStateRefinementError(SourcePosition position, SourcePosition de
626626
category, context, declarationNotes, counterexample(found, expected, position));
627627
}
628628

629-
/** A model of what is known where {@code expected} fails, or null if the solver gives none */
629+
/**
630+
* A model of what is known where {@code expected} fails, or null if the solver gives none or {@code expected} fails
631+
* whatever the values: then no value tells why it fails
632+
*/
630633
private Counterexample counterexample(Predicate found, Predicate expected, SourcePosition position) {
631634
try {
635+
if (verifyStateSMT(found, expected.negate(), position, true).isOk())
636+
return null;
632637
SMTResult result = verifyStateSMT(found, expected, position, true);
633638
return result.isError() ? result.getCounterexample() : null;
634639
} catch (RuntimeException e) {

0 commit comments

Comments
 (0)