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

オープン
#554 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@CatarinaGamboa がすでに取り組んでいます。

2026年11月24日 から。

  • #560 @CatarinaGamboa による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Java
スター
73
フォーク
38
平均マージ
12時間 32分
マージ済み PR(30日)
45

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

liquid-java/liquidjava のほかの issue

liquid-java/liquidjava の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。