Invariant inference: mark inferred facts in diagnostics, and a hint to state a loop invariant

Aperta
#554 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@CatarinaGamboa ci sta già lavorando.

Dal 24/11/2026.

  • #560 di @CatarinaGamboa — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

Start by reading the decisions in #548 and the loop-invariant plan in #542; the payload names no files, so locate where loop-head instances receive inferred conjuncts in Found and where diagnostic data is assembled for the IDE. Then trace the counterexample/error path that would carry the new hint, and use the loops from #537 as the real-example check. Done means inferred facts are identifiable with their loop line in diagnostics while the terminal/hover message stays unchanged, and the hint is validated or dropped after review.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement error messages

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.

Lingua principale
Java
Stelle
73
Fork
38
Merge medio
12h 32m
PR unite (30g)
45

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di liquid-java/liquidjava

Tutte le issue di liquid-java/liquidjava

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.