🤖 AI Summary
This work addresses the tedious and inefficient manual authoring of pre- and postconditions in Move for verifying high-level program properties. It proposes a synergistic approach that integrates weakest precondition (WP) analysis with large language model coding agents—such as Claude Code—leveraging the Model Context Protocol to automatically infer specifications. Move Prover serves as a verification oracle, iteratively refining function specifications until formal verification succeeds. This is the first effort to combine formal WP reasoning with LLM-based agents for specification synthesis in Move, enabling precise augmentation of loop invariants and high-level semantic properties like monotonicity and conservation. Experimental results demonstrate that the method effectively handles representative Move codebases featuring higher-order functions, dynamic dispatch, global state, references, and complex loops, substantially reducing specification authoring effort while achieving fully automated verification.
📝 Abstract
In this paper, we describe early work on a specification inference tool for the Move Prover that combines a weakest-precondition (WP) analysis over Move bytecode with an agentic coding CLI such as Claude Code. Specification inference reduces the boilerplate of writing specifications in Move: in order to verify a high-level property such as a global state invariant, pre- and post-conditions for the supporting functions typically have to be written by hand, which is tedious. In our setting, a Model Context Protocol (MCP) service exposes the WP analysis and the prover itself to the coding agent. The WP analysis provides a sound, mechanical baseline for inference; the AI is used precisely where WP is weakest -- for loop invariants and high-level idiomatic specifications such as monotonicity, conservation, and structural invariants. The Move Prover serves as the oracle that decides whether the generated specs are valid, and the agent is equipped to generate proof hints and to refine the inferred specification until verification succeeds. The tool has been applied to a corpus of canonical Move code, including code that uses higher-order functions, dynamic dispatch, global state, references, and various forms of loops.