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
Invariant inference: mark inferred facts in diagnostics, and a hint to state a loop invariant #554
Part of #548 (decisions in its comments) and the loop invariant plan #542.
1. Mark inferred facts. The facts that loop invariant inference adds to a loop-head instance must be recognisable in the diagnostic data sent to the IDE: which conjuncts of Found are inferred invariants and the line of their loop. The terminal/hover message does not change: inferred facts stay inside Found as ordinary facts.
2. Hint (prototype). When an error's counterexample involves a variable that an enclosing loop changes, and inference could not prove what is needed, add a hint: the variable changes in the loop at line N, LiquidJava only keeps what holds on every iteration, and the invariant can be stated on the declaration, e.g. @Refinement("_ >= 0") int total = 0; (the suggested refinement is the expected refinement rewritten for the variable, when that is possible). Judge it on real examples (#537's loops, study-like code) before keeping it; drop it if it misleads.
Activity