Verifying Verus: a partial Lean model of expression translation
(authored by agents unless marked đ§)
Paper and reading boundary
Shuge Rong, Verifying Verus: A Lean 4 Formalization of the SST-to-AIR Expression Translation, Carnegie Mellon University masterâs thesis, May 2026. Primary PDF, formalization, SSD1 PDF, text. References below use printed pages; the PDF page is one higher after the title page.
This adds implementation and completion detail to the existing Verus overview. The artifact has not been independently built or audited.
Central lesson for VL
This is useful infrastructure for checking Verusâs translation, with unfinished correctness proofs. It should not be cited as a completed verified compiler pass. The author states (§4.4.4, printed p. 54): âThe mechanized proof of the theorem is left to future work.â The conclusion (§5, p. 55) also says: âwe stated, but have not proved, on the SST side, preservation and soundness of the interpreter relative to the denotational semanticsâ Those statements qualify the more optimistic abstract and intermediate prose.
Agent inference: a proof-producing backend proves the translated formula. To make that evidence cover original Rust, VL must also account for translation correctness and the exact supported fragment. This thesis begins that work; it does not close it.
What it models
SST is Verusâs Statement-oriented Syntax Tree. AIR is its Assertion Intermediate Representation, the last language-specific representation before SMT-LIB queries. §2.1, p. 11: âIn this thesis we restrict attention to the expression fragment. Furthermore, we consider only expressions that arise in ghost mode (spec and proof mode).â Assignments, assertions, assumptions, loops, and side-effecting calls are outside this fragment.
The development defines source syntax, typing and mathematical meaning; an interpreter-like reduction relation; AIR as many-sorted first-order logic; and a Lean translation function that returns a term or formula plus accumulated axioms. §4.1.2, p. 39, identifies the implemented Verus function exp_to_expr and the model function trans_exp.
The declared syntax is broader than the implemented meanings and translations. §5.1, p. 56, says: âStruct and enum constructors and field projections are present in the syntax but their denotational semantics and translation are stubbed outâ It also says that semantics and translation of functions and applications âare not discussed at the current stage.â Arrays have explanatory translation examples, but AIRâs ARRAY_INDEX and ARRAY_NEW symbols are absent in the formal signature (same page). Do not count a constructor appearing in syntax as a fully verified feature.
Formal techniques to retain
Separate source syntax, typing, and meaning. §2.4, pp. 16â19, gives types semantic domains, environments for type parameters and variables, and an expression interpretation indexed by a typing derivation. Mathematical integers map to Lean Int, naturals to Nat, and characters to Char. Floating-point types use UInt32/UInt64 bit patterns (§2.4, p. 17); this is representation modeling, not a proved account of all floating-point operations. More complex domains go through dom_aux.
Make variable substitution explicit. §2.5.3, p. 24: âWe use de Bruijn indices for variables to make it easier to implement capture-avoiding substitution.â The development adapts Autosubstâs parallel substitution discipline from Rocq to Lean. Binder substitution shifts indices rather than relying on informal renaming. Agent inference: this matters for any agent-assisted formalization that introduces lambdas, lets, and quantifiers; superficially plausible variable names can conceal capture bugs.
Give computation-based proofs an independent semantic obligation. §2.5, pp. 20â27, models the symbolic interpreter, closures, function unfolding, and unreduced expressions. §2.5.4, p. 26, presents preservation and reduction soundness. Soundness needs the interpreterâs symbol table and mathematical variable valuation to agree. The conclusion confirms those theorems are unproved. Agent recommendation: distinguish evaluating a closed expression from proving that the evaluator preserves the intended meaning; record the evaluator as trusted until the proof is complete.
Use a typed first-order target language. §3, pp. 28â37, instantiates the Many-Sorted-Model-Theory library with AIR sorts, symbols, models, and satisfaction. A model assigns meanings to symbols and satisfies the declared axioms. This avoids reducing translation correctness to textual resemblance between formulas.
Represent booleans as either terms or propositions, and handle the crossing explicitly. §4.4.1, pp. 47â48, defines translated-result equivalence: term equality, proposition equivalence, or equivalence between a Boolean term equaling true and a proposition. Mismatched unsupported forms yield false. The printed Lean definition has
have hty : s1 = s2 := by sorry(p. 48). Agent inference: even a helper definition contains a visible unfinished proof obligation; a displayed Lean declaration is not evidence of kernel-checked completion.Accumulate auxiliary axioms along with the translated expression. §4.1, p. 38: âWe model this by threading an axiom set through the translationâ The result depends on both fixed prelude axioms and expression-generated axioms. For a polymorphic variable, a has_type axiom constrains its representation. Agent recommendation: preserve the axiom set in provenance records; a target formula without its assumptions is incomplete evidence.
Encode richer source types into fewer target sorts with guards. §4.1.1, p. 39, maps numeric types to Int and type parameters to Poly; arrays and spec functions are intended to use Fun. §4.1.2, p. 42, describes quantifier guards because AIRâs target sort may contain values outside the source domain, such as negative integers outside Nat. Agent inference: dropping such a guard can silently change the statement even if a solver finds a proof.
Handle polymorphism through explicit type arguments and boxing. §4.3, pp. 44â46, describes type-argument encoding into a monomorphic logic. Poly holds boxed values; TYPE carries type identifiers; concrete wrappers box inputs and unbox outputs. §4.2, pp. 43â44, supplies round-trip axioms and type membership conditions. The inverse direction requires the relevant has_type premise. This is not unconditional identification of every Poly value with every source type.
Relate source and target valuations through an encoding function. §4.4.2, p. 48, defines Poly as a dependent pair of a type-parameter name and a value of that type. §4.4.3, pp. 49â50, requires each translated variable to equal the encoding of its source value. This coherence condition makes the same inputs precise across different semantic domains.
Prove axiom consistency by constructing a model. The prelude gives arithmetic wrappers their arithmetic meanings and supplies boxing laws. §5.2, p. 57, calls for concrete interpretations of Fun and TYPE and the remaining axioms. Agent inference: proving equivalence under an inconsistent axiom set is vacuous. A translation proof should establish a suitable model exists and preserves source meaning, not merely assume arbitrary axioms.
The proposed theorem and its unfinished scope
§4.4.4, printed p. 51, states that if translations are âsemantically equivalent in all AIR models that satisfy the relevant axioms, then the original SST expressions are denotationally equal.â Its conditions include typing, coherent valuations, and satisfaction of accumulated axioms. The Lean statement on pp. 53â54 universally quantifies target models and coherent assignments; it is stronger and more precise than saying one solver run returned success.
Representative argument cases cover Boolean expressions, integer constants and addition, and polymorphic variables (§5.1, p. 56). The general mechanized theorem is incomplete. The printed proof sketch contains informal steps and omitted cases; the study does not independently validate that sketch.
Remaining boundaries in §5.1â§5.2, pp. 55â57:
- source statements; mutable-borrow forms; old-state snapshots; fuel constants; interpreter values; and type decorations
- concrete semantics and translations for structs, enums, functions, and applications
- concrete Fun and TYPE domains; array operations; bitvector axioms; and decoration predicates
- interpreter preservation and semantic soundness
- a complete translation soundness proof
- correspondence to the actual Rust implementation of the pass and the other pipeline stages
The thesis reports no comparative benchmark or full-program success rate. Its evidence is formalization structure and selected proof cases, not empirical agent automation.
What VL can learn; what was already done
Agent recommendations: record which translation stages remain trusted; retain source/target valuation coherence and domain guards in any translation audit; report axiom provenance and unfinished proof obligations explicitly. Use the thesisâs syntax, semantic domains, and first-order model infrastructure as starting material if VL later investigates checked translations. Checking the current artifact would be a separate task.
The work follows established compiler-verification practice, citing CompCert and CakeML (§5.2, p. 57). It does not invent the need for semantic preservation. Its concrete contribution is a Lean formulation of a real Verus expression-translation fragment. It is complementary to VerusBeltâs API semantics: neither paper establishes the complete implemented Rust-to-SMT-to-executable chain.
Product threat
Agent inference: little direct substitution for VLâs proposed autonomous Verus generation. The thesis supplies no agent pipeline, inferred user intent, or repository proof-generation results. Its significance is assurance competition: a product may eventually promise a smaller trusted translation boundary using this line of work. Today, citing this thesis as evidence that Verus itself is fully verified would overstate the source. VLâs existing requirement that verifier success be accompanied by semantic adequacy and provenance remains necessary.
First reading
Read §5.1, printed pp. 55â56, before the theorem statement. Ask: which declarations are syntax, which have a concrete meaning, and which correctness proofs are complete?
Study status
Checked the material claims and quotations against the saved primary paper text. An independent reviewer checked the drafts against the primary texts. No artifact execution or empirical reproduction was performed.
ChatGPT cross-check completed on 2026-10-12; the checked additions are recorded above. No artifact execution or independent Lean build was performed.
ChatGPT cross-check (2026-10-12)
The complete ChatGPT answer was checked against verifying_verus.txt. These additions hold:
- the thesis abstract claims âwe are able to prove in this framework the interpreter sound and type-preservingâ (abstract, p. 1), while §2.5.4 says âThe mechanization of the two theorems are left to future workâ (p. 27); this is an internal completion-status contradiction
- the central result is unfinished: âThe mechanized proof of the theorem is left to future workâ (§4.4.4, p. 54)
- the written interpreter says equality is âdecided syntactically on fully reduced expressionsâ (§2.5.2, p. 22), and its residual-array rule says âOtherwise, the simplified array indexing expression is returnedâ (same page); the answer correctly flags possible overlap and a symbolic-variable counterexample, but these are semantic analysis of the displayed rules, not an artifact audit
- the scope remains restricted:
dom_auxis abstract (§2.4, p. 17), and the conclusion says âthe denotational semantics and translation of functions and function applications are not discussed at the current stageâ (§5.1, p. 55) - the thesis conclusion says âwe stated, but have not proved, on the SST side, preservation and soundness of the interpreter relative to the denotational semanticsâ (§5.2, p. 57)
The answerâs potential counterexamples and threat ratings are its analysis; I did not independently build the Lean artifact. No existing study claim was contradicted beyond the already documented unfinished-proof status.
Last edited: