Skip to content

Commit e705514

Browse files
small cleanup
1 parent f77ef6b commit e705514

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker/RefinementTypeChecker.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,10 @@ public void visitCtIf(CtIf ifElement) {
343343

344344
String pathVarName = String.format(Formats.FRESH, context.getCounter());
345345
RefinedVariable freshRV;
346-
// The condition's predicate may use Keys.WILDCARD as a stand-in for the boolean value of the condition
347-
// (e.g. invocation post-conditions of the form `_ == true --> state(this)`, or variable reads `_ == k`).
348-
// When that's the case the fresh path variable IS that boolean value, so we assert it true in the then
349-
// branch and false in the else branch — instead of negating the whole predicate, which is unsound for
350-
// implications and equality forms.
346+
347+
// When the condition's predicate uses Keys.WILDCARD as a stand-in for its boolean value (e.g. _ == true -->
348+
// state(this) or _ == k), the fresh path variable IS that value — assert it true in the then branch and false
349+
// in the else, since negating the whole predicate is unsound for implications and equality forms.
351350
boolean valueIsCondition = false;
352351
Predicate thenRefs;
353352
Predicate elseRefs;
@@ -379,10 +378,9 @@ public void visitCtIf(CtIf ifElement) {
379378
Predicate.createLit("false", Types.BOOLEAN));
380379
thenRefs = Predicate.createConjunction(expRefs, freshIsTrue);
381380
elseRefs = Predicate.createConjunction(expRefs, freshIsFalse);
382-
freshRV = context.addInstanceToContext(pathVarName, factory.Type().BOOLEAN_PRIMITIVE, thenRefs, exp);
383-
} else {
384-
freshRV = context.addInstanceToContext(pathVarName, factory.Type().INTEGER_PRIMITIVE, expRefs, exp);
385381
}
382+
383+
freshRV = context.addInstanceToContext(pathVarName, factory.Type().BOOLEAN_PRIMITIVE, thenRefs, exp);
386384
}
387385
vcChecker.addPathVariable(freshRV);
388386

0 commit comments

Comments
 (0)