# Hybrid Mechanical and Agentic Specification Inference

DevFeed: [Hybrid Mechanical and Agentic Specification Inference](<https://devfeed.tech/articles/hybrid-mechanical-and-agentic-specification-inference-134981.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2605.10005>)

Author: Wolfgang Grieskamp, Teng Zhang, Vineeth Kashyap

Published: 2026-11-16T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>), [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [agentic-coding](<https://devfeed.tech/topics/agentic-coding.md>), [Automated reasoning](<https://devfeed.tech/topics/automated-reasoning.md>), [smart contract](<https://devfeed.tech/topics/smart-contract.md>)

Tags: [agentic](<https://devfeed.tech/tags/agentic.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-lo](<https://devfeed.tech/tags/cs-lo.md>), [cs-pl](<https://devfeed.tech/tags/cs-pl.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [formal-verification](<https://devfeed.tech/tags/formal-verification.md>), [hybrid](<https://devfeed.tech/tags/hybrid.md>), [inference](<https://devfeed.tech/tags/inference.md>), [specification](<https://devfeed.tech/tags/specification.md>)

## AI overview

The paper combines LLM-driven specification inference with weakest-precondition (WP) analysis in the Move Prover, a verifier for the Move smart contract language. The agent derives specifications from code and uses a tool that calls the prover to infer and verify contracts, including mechanical contracts needed to prove higher-level properties. In an evaluation of 26 targets--24 drawn from Aptos framework functions without specifications--the agent completed over 90% of runs with or without WP, using Sol 5.6 and Terra 5.6. Adding WP reduced cost by 11-21% overall and 40-64% on targets without loops. The evidence describes this evaluation, not broader performance across languages or programs.

## Source excerpt

arXiv:2605.10005v3 Announce Type: replace-cross Abstract: Adoption of formal verification has long been hindered by the cost of manual specification. To prove high-level properties, one must also write contracts for supporting functions, many of which are mechanical and low-level. Specification inference automatically derives such contracts from the program. We present a hybrid of mechanical and agentic inference for Move, a smart contract language, integrated into its verifier, the Move Prover. A large language model (LLM) agent drives inference and verification through a tool that calls the Move Prover and derives specifications from code by weakest-precondition (WP) analysis. We evaluate our approach on 26 targets, 24 of them extracted from public Move functions of the Aptos framework that have no specifications, under a frontier model and a mid-tier model of the same family (Sol 5.6 and Terra 5.6). With and without WP, the agent completes over 90% of its runs, so agentic inference is effective on its own. Adding WP lowers its cost by 11-21% overall and by 40-64% on targets without loops.