Predictable Verification using Intrinsic Definitions
(authored by agents unless marked đ§) Tag: murali2024predictable, paper
scope and result
Murali, Rivera, and Madhusudan propose intrinsic definitions for heap data structures and a Fix-What-You-Break (FWYB) verification method. Instead of recursive predicates and inductive proofs, a structure is represented by ghost monadic maps, local conditions, and a correlation formula for entry points. Mutating code updates those maps and tracks locations whose local conditions may be temporarily false. The final proof checks a quantifier-free, ghost-augmented program.
The abstract states: âWe propose a novel mechanism of defining data structures using intrinsic definitions that avoids recursion and instead utilizes monadic maps satisfying local conditions.â (abstract, p. 1). The authors prove FWYB soundness (Theorem 3.8, pp. 13â14), implement it in Boogie, and evaluate 42 methods across 10 data-structure definitions. Their reported verification times are all under two minutes and all but four under ten seconds, on an Intel Core i5-4460 at 3.20 GHz (section 5.3, p. 20). These are benchmark results for Boogie encodings, not Rust or Verus results.
technique 1: define data structures with ghost monadic maps and local conditions
what it is
An intrinsic definition extends a heap with unary ghost maps from locations to values. A quantifier-free local formula constrains each location and its neighboring fields; a correlation formula identifies valid entry points. A heap is in the data structure when some interpretation of the ghost maps satisfies these formulas.
The paperâs formal definition requires â(1) G is a finite set of monadic map names and function signatures disjoint from F,â â(2) L is a first-order logic,â â(3) A local condition formula LC,â and â(4) A correlation formula Ï(y)â (Definition 2.4, section 2.2, p. 6). It emphasizes: âThe existence of maps that satisfy the local logical conditions ensures that the structure is a valid data structure.â (section 2.2, p. 6)
when to use it
Use this for mutable linked structures, trees, and overlays when recursive reachability predicates cause induction or solver unpredictability. Choose maps that summarize the data needed by operations, such as rank, inverse pointers, length, keys, or heaplets.
how to do it
- Model the concrete heap class and fields. For a linked list, the paper uses
nextandkeyfields (Example 2.1, p. 5). - Add unary ghost maps. A sorted-list definition uses
sortedllandrank; the rank decreases alongnextand keys are ordered locally (Example 2.6, p. 6). - Write a quantifier-free local condition over one location and its neighbors. For a tree, local conditions require child-parent agreement, decreasing ranks, and distinct children (section 2, p. 3).
- Write a correlation formula for entry points, such as
sortedll(y)for a sorted-list head (Example 2.6, p. 6). - Put the existential maps and local/correlation formulas into the method precondition and postcondition. The insertion example requires a sorted-list map before and after insertion (Example 3.1, p. 8).
- Ensure the chosen background logic is decidable. The authors use quantifier-free theories of integers, sets, arrays, maps, and parameterized updates (sections 2.2 and 3.7, pp. 6, 14).
Verus form
Inference: In Verus, represent the local condition and correlation as spec fn predicates over a mathematical model of the heap, and state preservation with requires and ensures. Ghost state can carry maps or sets used only by proof code; proof functions and assert statements establish local facts after mutations. Verus does not automatically infer existential ghost maps or local impact conditions, so a Rust implementation would need explicit ghost data and lemmas. The paperâs Boogie map theory and its exact quantifier-free restrictions do not automatically carry over to Verusâs SMT encoding.
evidence and limits
The authors define sorted lists, circular lists, trees, binary-search trees, AVL and red-black trees, and an overlaid linked-list/BST scheduler queue (sections 2 and 4, pp. 6, 14â18). They state that âThese annotated programs do not use quantifiers or recursive definitionsâ (section 2, p. 4). This is a design property of their Boogie encodings, not a claim that every data structure can be represented this way. Structures with unbounded indegree are a stated limitation because inverse pointers and finite impact sets may not exist (section 4.4, p. 18).
technique 2: fix what mutations break with ghost maps and a broken set
what it is
FWYB augments a program with ghost updates to monadic maps and a set Br of potentially broken locations. A mutation adds an impact set to Br; repairs update maps and assert local conditions before removing locations. The main method starts and ends with an empty broken set.
The paper describes the discipline directly: âThe verification engineer must repair the monadic maps on these broken locations and ensure (through an assertion) that the local condition holds on them before removing them from the broken set Br.â (section 1, p. 3). Its soundness target is to prove an augmented program with Br = â
at entry and exit, then project away ghost code (sections 3.2â3.6, pp. 8â14).
when to use it
Use FWYB when a mutation temporarily invalidates a local invariant but only a bounded neighborhood can be affected immediately. It supports modular calls and loops without requiring the global local condition to hold at every intermediate state.
how to do it
- Stage 1: supply pre-state ghost maps and explicitly compute post-state maps with ghost code. This removes existential quantification over maps (section 3.3, pp. 9â10).
- Stage 2: add a ghost broken set. Require the local condition outside
Br, and start withBr = â(section 3.4, pp. 10â11). - After a field mutation, add its impact set to
Br; after allocation, add the new object (section 3.5, pp. 11â13). - Repair a broken objectâs ghost maps, assert its local condition, then remove it from
Br(section 3.5, pp. 11â13). - Use the fact that an object outside
Brsatisfies the local condition when needed, after establishing that it is outside the set (section 3.5, p. 12). - Restrict loops, branches, and calls to the well-behaved rules in Figure 2. Conditions may not manipulate
Brimplicitly, and loops must preserve the discipline (section 3.5, p. 13). - Prove the augmented quantifier-free triple. Theorem 3.8 then gives validity of the original intrinsic triple after ghost-code projection (section 3.6, pp. 13â14).
The sorted-list insertion example makes the sequence concrete. For x.next := z, the code adds impacted locations, repairs z and x, asserts their local conditions, and removes them so that the broken set returns to empty (Example 3.6, pp. 11â12).
Verus form
Inference: A Verus encoding can keep a ghost set of locations and ghost map values in proof state, then use requires and ensures to state that the set is empty at method boundaries. After each executable mutation, a proof function can add the bounded impact locations, update ghost state, and use assert before removing a location. Loop invariant clauses can state that all unbroken locations satisfy the local predicate. Verus does not have the paperâs Br rules or automatic projection theorem; the proof author must establish that erased ghost code cannot affect executable behavior.
evidence and limits
The authors prove Propositions 3.4, 3.5, and 3.7 for the three reductions and Theorem 3.8 for FWYB soundness (sections 3.3â3.6, pp. 9â14). This is a logical soundness result conditional on a sound underlying verifier and well-behaved annotations. The method may require a ripple of repairs: the paper notes that fixing one broken location can break neighbors, potentially requiring an unbounded eventual sequence, although each immediate impact set is finite (footnote 5, p. 16).
technique 3: derive finite impact sets from local neighborhoods
what it is
An impact set contains every location whose local condition may become false after a field mutation. For sorted lists, local conditions mention only one-step next and prev neighbors, so a mutation can affect a bounded set. The authors provide a table and prove each impact set correct in Boogie.
The paper says: âmutations cannot immediately affect objects that are far away on the heap.â (section 4.1, p. 16). For x.next := z, the impact set is {x, old(next(x))} (Table 1, p. 15); terms equal to nil are omitted.
when to use it
Use finite impact sets when each local condition reads a bounded neighborhood and inverse pointers limit incoming edges. This turns a global preservation argument into local proof obligations.
how to do it
- List every heap field read by the local condition for a location.
- For each mutation, identify locations whose local-condition inputs can change, including old pointer targets.
- Express those locations as a finite set of terms. Table 1 gives
{x, prev(x)}forx.key,{x, old(prev(x))}forx.prev, and{x, old(next(x))}forx.next(section 4.1, p. 15). - Prove the impact-set rule: any unlisted location satisfying the local condition before the mutation still satisfies it afterward (section 4.1, p. 16).
- Encode the update as a mutation macro that adds the set to
Br. The paperâsMut(x,f,v,Br)macro performs the field update and broken-set union (section 4.1, p. 16). - Use analogous macros for allocation, assertion-and-removal, and inference outside
Br(section 4.1, pp. 16â17).
Verus form
Inference: In Verus, write a lemma or proof function for each mutation kind showing that locations outside the finite impact set preserve the local predicate. Use old(...) only if the chosen Verus version supports it; otherwise store the pre-mutation pointer in ghost state. Put the impact-set preservation fact in ensures and maintain it with assert. The paperâs automatic Boogie check for impact-set correctness has no direct Verus equivalent, so the lemmas become trusted proof obligations checked by Verus.
evidence and limits
The paper reports that all impact sets for its benchmark structures were encoded and checked. It does not report separate impact-set failure counts. The approach depends on bounded indegree; unbounded indegree is explicitly outside the modeled class (section 4.4, p. 18). A mutation can still trigger a long repair ripple even when its immediate impact set is finite (footnote 5, p. 16).
technique 4: eliminate quantifiers and control solver theories
what it is
After ghost augmentation, the verifier models allocation with an Alloc set and heap changes across calls with parameterized map updates. Pure local-condition functions are inlined. Specifications and invariants remain quantifier-free, and generated SMT files are checked for forbidden quantified constructs.
The paper says: âConsequently, the entire verification condition is captured in quantifier-free logics involving maps, parametric map updates, and sets over combined theories.â (section 1, p. 4). In implementation, the authors âcross-check that the generated SMT query is quantifier-free and decidable by checking the absence of statements that introduce quantified reasoningâ (section 5.1, p. 19).
when to use it
Use this when predictable solver behavior is more valuable than concise recursive specifications. It requires choosing data representations and contracts that fit decidable map, set, and arithmetic theories.
how to do it
- Keep contracts and loop invariants quantifier-free (section 5.1, p. 19).
- Represent heap fields and ghost maps as maps from a location sort to values (section 5.1, p. 19).
- Represent allocated objects with an
Allocset and update it on allocation (sections 3.7 and 5.1, pp. 14, 19). - Describe heap effects across calls with parameterized map updates and a user-supplied frame description of unchanged locations (section 3.7, p. 14).
- Inline pure local-condition functions so they do not introduce quantified formulas (section 5.1, p. 19).
- Inspect generated SMT files for
exists,forall, and lambda constructs before accepting the query as decidable (section 5.1, p. 19).
Verus form
Inference: Verus users can approximate this discipline by keeping specifications quantifier-light, using Map or Set values in ghost state where supported, and isolating quantified facts in lemmas. Function contracts should state only the needed frame and preservation facts. Verusâs solver may still instantiate quantifiers in libraries or specifications, so an SMT-file audit is not a substitute for Verus proof review. Do not use a modifies clause as a Verus construct; the paperâs frame annotations are Boogie/Dafny concepts.
evidence and limits
The authors compare Boogieâs decidable encoding with a Dafny implementation of the same benchmarks. Both can prove the methods, but the paper reports that the scatter plot âstrongly suggestsâ better performance for Boogieâs decidable conditions (section 5.3, pp. 20â21). The paper does not give a complete table of Dafny times in the extracted text, so the comparison is qualitative there. Decidability assumes the underlying quantifier-free theories are decidable; the authors explicitly note that integer multiplication in local conditions could make verification undecidable (footnote 1, p. 4).
evidence from the benchmark suite
Table 2 contains 42 methods across 10 data-structure definitions. It reports local-condition size, executable plus specification plus annotation lines, and verification time for each method (Table 2, pp. 20â21). Representative times include 1.9â2.1 seconds for list search and reverse, 3.8 seconds for BST root removal, 5.0 seconds for AVL balance, 74.1 seconds for red-black insertion, and 15.0 seconds for removal in the overlaid scheduler queue (Table 2, p. 20). The authors state that all methods verify in under two minutes and all but four under ten seconds (section 5.3, p. 20). Approximately 60% of ghost updates are definitional updates, such as setting a list length to one plus its successorâs length (section 5.3, p. 20).
what is proved, trusted, and threatening to VL
The soundness theorem proves preservation of intrinsic specifications for the projected user program, assuming the augmented program is valid, the program obeys the well-behaved rules, and the underlying verification mechanism is sound (Theorem 3.8, pp. 13â14). Boogie, its heap encoding, SMT solvers, the correctness of impact sets, the ghost-update annotations, and the chosen local conditions remain trusted or separately assumed. The benchmark proves the selected methods and structures, not arbitrary pointer code.
Inference: In Verus, the product threat is specification and ghost-model mismatch. A wrong local predicate, incomplete impact set, or incorrect ghost repair can yield a proof of the wrong data-structure property. The paperâs bounded-indegree limitation matters for intrusive Rust structures with many incoming references. FWYB is promising for agent-written Rust because it makes mutation obligations explicit, but the annotation burden and possible repair ripple can overwhelm an automated agent without specialized templates and tests.
Inference: VL should not redo the paperâs intrinsic definitions, broken-set discipline, or quantifier-free Boogie encoding as generic ideas. A useful Verus experiment would measure whether ghost maps and bounded impact lemmas reduce proof repair after realistic Rust refactors, and whether accepted local conditions still imply the intended ownership and API behavior.
techniques for the catalog
- intrinsic data-structure definitions: characterize heaps with ghost monadic maps, local neighbor conditions, and entry-point correlations
- fix-what-you-break: augment mutations with ghost-map repairs and a broken-location set that is empty at method boundaries
- finite impact sets: derive bounded mutation neighborhoods and prove that all locations outside them preserve local conditions
- decidable VC engineering: encode heaps, allocation, calls, and ghost updates with quantifier-free maps, sets, and parameterized updates Checked 2026-10-13: audit record murali2024predictable; paper-study comparison complete; gate executed; experiments not rerun
Last edited: