arXiv論文メモ
新着一覧
cs.PL / cs.AI / cs.SE · 査読状況未確認

LLMが仕様から実装と証明を作る言語Djinnlang

Djinnlang: Higher-Level Programming by Unambiguous Specification with an LLM in the Compiler

Simon Henniger and Stephen Chong and Nada Amin

この論文をやさしく読む

ひとことで言うと

人が曖昧さのない仕様を書き、AIがコードと正しさの証明を作り、検証器で確かめるプログラミング方式です。

何に役立つ?

コード生成の正しさをAIの説明だけに頼らず、形式的な検査へつなぐための仕組みです。人が意図した仕様を正しく記述することは引き続き重要です。

この研究の面白いところ

仕様を満たす実装なら何でもよいとせず、同じ入力に返す出力まで一意に決まることを証明させます。仕様と実装の間でAIが意味を勝手に選ぶ余地を減らす狙いです。

どこまで分かった?

要旨の実証は複数例と変換器の自己実装・検証です。任意の仕様を必ず実装できることや、人が書いた仕様そのものの妥当性を保証する結果ではありません。生成コードを読まなくてよいという記述は、この制約と検証の枠組みにおける著者らの主張です。

v1のアブストラクトに基づくAI解説。日本語訳とは別に、用途の解釈を含みます。

アブストラクトの日本語訳

プログラマーが形式仕様を書き、LLMがそれを実装し、各実装が仕様に一致することを証明する。この考えを突き詰めると、仕様言語が新しいプログラミング言語になる。本研究では、曖昧さを許さない制約が重要だと論じる。LLMは実装が仕様を満たすと証明するだけでなく、同じ仕様を満たす他の実装も、同じ入力には同じ出力を返すこと、すなわち制約が定める関係が決定的であることを証明しなければならない。 これによりプログラムの意味についてLLMに裁量がなくなる。通常のコンパイラと同様、生成コードを読む必要はなく、仕様からいつでも再生成できる。この制約と強力なLLMの下では、仕様言語とプログラミング言語の違いは本質的に意味を失い、LLMは事実上コンパイラのツールチェーンの一部となる。この構成は強いAI制御の形にもなる。信頼しないモデルがコードを書く一方、その成果は検証器によって厳密に検査されるからである。 曖昧さを許さない制約に支えられた、LLMをコンパイラへ組み込む方式の実現可能性を示すため、その将来を想定した高水準仕様言語Djinnlangを提示する。Djinnlangのプログラムは仕様だけからなり、プログラマーは実行可能コードを書かない。従来のコンパイラの代わりに、記号的な変換器が各仕様をDafnyの実装用ひな形と証明義務へ落とし込み、実行用の制御基盤がLLMを動かして実装と証明を埋め、すべてをDafny検証器で検査する。複数の例で言語と実装を評価し、セルフホスティングが可能であることを示す。LLMは仕様からDjinnlang変換器を実装でき、その再実装は自分自身を検証できる。

v1の要旨から自動生成。本文の精読・人による確認は未実施。

初稿
2026-09-21(UTC)
最新改訂
2026-09-21 · v1
査読・掲載
査読状況未確認
arXivで読むPDF

更新履歴

取得できた版を表示。版の更新は査読済みを意味しません。過去版の本文差分は未解析です。

原文の要旨

Programmers write formal specifications, and LLMs implement them, proving that each implementation matches its spec. Taken to its extreme, this makes specification languages the new programming languages. We argue that an unambiguity constraint is key: in addition to proving that its implementation satisfies the specification, the LLM must also prove that any other implementation satisfying it must produce the same outputs on the same inputs, i.e. that the relation formed by the constraints is deterministic. This leaves the LLM no leeway on program semantics: as with a conventional compiler, the generated code never needs to be read and can be regenerated from the spec at any time. Under this constraint and with a powerful LLM, the difference between a specification language and a programming language becomes essentially meaningless, and the LLM essentially becomes a part of the compiler toolchain. The arrangement doubles as a strong form of AI control: an untrusted model writes the code, yet its work is tightly checked by a verifier. To demonstrate that our LLM-in-the-compiler paradigm is feasible when supported by our unambiguity constraint, we present Djinnlang, a high-level specification language built for this future. A Djinnlang program consists only of specifications --- the programmer never writes executable code. In place of a traditional compiler, a symbolic translator lowers each spec to Dafny stubs and proof obligations, and a driver harness orchestrates an LLM that fills in implementations and proofs, all checked by the Dafny verifier. We evaluate our language and implementation on multiple examples and we show that it is self-hosting: an LLM can implement the Djinnlang translator from its specification and the reimplementation can verify itself.

arXiv ID: 2609.23954 / 要約の誤りについて