Formal Verification of Imperative First-Class Functions in Move
Wolfgang Grieskamp 1 and Teng Zhang and Vineeth Kashyap and Jake Silverman · 2026
Read Formal Verification of Imperative First-Class Functions in Move by Wolfgang Grieskamp 1 and Teng Zhang and Vineeth Kashyap and Jake Silverman (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-10007.txt.
Introduction
Grieskamp, Zhang, Kashyap and Silverman extend the Move Prover to imperative first-class functions. This recent Aptos addition lets functions be passed around, stored in structs and held in persistent storage, allowing dynamic dispatch. The paper describes how function values are represented in Move's specification language and implemented in the prover. Behavioural predicates capture each function by single-state or two-state conditions on aborts and pre- and post-conditions.
State labels name intermediate memory states so predicates can compose across sequences of transitions. At the solver level, function values are encoded by sorting among the functions able to reach a call site. Known functions are handled directly, unknown ones through their predicates. The approach goes beyond Dafny by supporting state-changing functions with Rust-style references and globals, and it yields leaner solver encodings than separation logic thanks to Move's static memory separation.
Catalog record
| CREATOR | Wolfgang Grieskamp 1 and Teng Zhang and Vineeth Kashyap and Jake Silverman |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 42 KB |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.10007
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Formal Verification of Imperative First-Class Functions in Move Wolfgang Grieskamp 1 and Teng Zhang and Vineeth Kashyap and Jake Silverman Abstract The Move Prover ( MVP ) is a formal verifier for smart contracts written in the Move programming language. Recently, Move on Aptos was extended with higher-order functions : imperative functions as first-class values that can be passed around, stored in data structs, and kept in persistent storage, enabling dynamic dispatch . This paper describes the representation of function values in the Move specification language and their implementation in MVP . We introduce behavioral predicates which characterize Move functions (aborts and pre/post conditions) by single-state or two-state predicates. We also introduce state labels for naming intermediate memory states in which expressions are evaluated and which allow to compose behavioral predicates to describe sequences of state transitions. On SMT level, function values are encoded by discriminating over the possible function values reaching a call site: when the concrete function is known, its effect is accounted for directly; when it is unknown (for example, a function parameter, or a closure loaded from storage), its behavioral predicates describe the effect. Our approach goes beyond, for example, Dafny, by supporting imperative first-class functions which can modify state via Rust-style references and global variables, and leads to more efficient SMT encodings than separation logic because of the static separation of memory enabled by Move. We further extend MVP ’s specification inference tool to work with function values: given arbitrary higher-order Move code, weakest-precondition analysis semi-automatically derives behavioral-predicate-based specifications, reducing the annotation burden and providing a validation pipeline for the new specification constructs. I Introduction The Move Prover ( MVP ) [ DillGPQXZ22 ] is a formal verification tool for Move smart contracts [ blackshear2020resources , MoveOnAptosBook ] , designed for routine use during development with response times comparable to type checkers and linters. MVP is deployed at Aptos to verify core protocol logic — staking, metering, code deployment, and supporting data structures [ ParkZGXGCLC24 , AptosFrameworkBook ] — and was originally developed for the Libra/Diem blockchain at Meta. Recently, Move was extended with higher-order functions [ grieskamp2025movehigherorder ] : functions are now first-class values that can be passed, returned, stored in struct fields, and persisted in global storage. Combined with Move’s resource model, persisted function values give a principled account of dynamic dispatch . Typical Aptos use cases include callback-based asset flows, extensible asset managers, dispatchable permissions and metering, and generic data-structure operations parameterized by a caller-provided function (e.g. fold, map, filter, custom comparators). Higher-order functions are a known challenge for verification: they break the modular, static-dispatch specification style on which MVP was built. When a call is dispatched dynamically, its pre- and post-conditions cannot in general be looked up at the call site; the caller’s specification must instead refer abstractly to the behavior of its function-value arguments, and the verifier must reconcile this with whichever concrete function reaches the call site. For a production-oriented prover, this reconciliation must be fast, complete in the relevant cases, and free of the trigger instability (‘butterfly’ effect) that SMT encodings easily introduce [ BUTTERFLY ] . Contributions. This paper describes the extension of MVP to support higher-order Move, and the underlying extension of the Move specification language: – We extend Move specifications with behavioral predicates \mathop{\mathstrut{\mathsf{requires\_of}}}\nolimits\langle f\rangle(\bar{x}) , \mathop{\mathstrut{\mathsf{aborts\_of}}}\nolimits\langle f\rangle(\bar{x}) , and \mathop{\mathstrut{\mathsf{ensures\_of}}}\nolimits\langle f\rangle(\bar{x},\bar{y}) , which characterize the pre-/abort-/post-behavior of a function value f on arguments \bar{x} and results \bar{y} , making function specifications first-class. They implicitly track read and read/write state dependencies. – We introduce state labels , which name intermediate memory states along a function’s execution and connect them via two-state predicates, as in S1..S2\mathrel{{\scriptstyle}\mkern-1.0mu{\scriptstyle\sim}}\phi , enabling reasoning about sequential evolution of state. – We describe how MVP implements invocation of function values on top of SMT [ SMTLib2010 , z3 ] by discriminating over the function-value variants flowing into the call site: if f is known, the invocation is replaced by the effect of the concrete function; otherwise (e.g., a function-typed parameter or a closure loaded from storage), the behavioral predicates of f describe its effect. – We extend MVP ’s specification inference tool [ GrieskampEtAl26Inf ] to function-valued code. The tool computes weakest preconditions over Move bytecode with closures and dynamic dispatch, automatically producing behavioral-predicate-based specifications. This both reduces the annotation burden and yields a validation pipeline confirming the encoding is internally consistent. While these aspects have similarities to features and solutions in Dafny, F* , or Verus , they are novel in the details. For example, Dafny has state labels but does not support higher-order functions with side effects, nor quantification over state labels. See Sec. for a more thorough discussion of related work. II Using Function Values in Move Specifications This section recalls the aspects of Move on Aptos [ MoveOnAptosBook ] that matter for the verification of higher-order programs, introduces an automated market maker (AMM) as a running example, and illustrates the common specification patterns our extension supports. All examples can be also found at [ PaperExamples ] . II-A Move on Aptos Move is a bytecode-verifiable programming language designed from the outset to coexist with formal verification. For the purposes of this paper, the relevant properties are: – Strong static typing with generics. Every expression has a statically known explicit type; generic functions and structs are monomorphized for verification [ DillGPQXZ22 ] . – Type-indexed global storage. Global state is a map keyed by (resource type, address) pairs: a struct can be moved to, borrowed, and moved from the location T [ address ] , with linear ownership enforced statically. Specifications quantify over this memory directly, and modifies clauses name the footprint a function may touch, providing a frame condition. – Reference semantics. References are borrowed from local variables or from global storage; this yields an alias-free memory model that makes verification tractable [ DillGPQXZ22 ] . – Strongly-typed bytecode. Move source is compiled to bytecode whose type- and memory-safety are checked before execution. MVP verifies this bytecode against specifications in the source. – Integrated specification language. Move lets developers write pre-/post-conditions, abort conditions, data invariants, and global memory invariants in the same source file as the code they describe, or optionally, into separate files. The Move Prover. MVP is an automated formal verifier built into the Move toolchain; the version discussed here and described in [ DillGPQXZ22 ] is a complete rewrite of the earlier version in [ MOVE_PROVER ] . Developers annotate Move source with specifications — preconditions, postconditions, abort conditions, data invariants, and loop invariants — using a first-order specification language that shares Move’s type system. MVP translates the annotated program to Boogie [ boogie , thisisboogie2 ] , an intermediate verification language, which Z3 [ z3 ] then discharges as SMT queries. The tool targets routine use during development: verification is designed to complete within seconds per function through careful SMT encoding and monomorphized, modular function summaries; it is used in CI (continuous integration testing) in the workflows at Aptos. Abort conditions deserve special note: multiple aborts_if clauses form a biconditional — the function aborts if and only if at least one clause holds — rather than the one-directional “if it aborts, then …” familiar