Skip to content

Can Code Specify a System Precisely Enough to Formally Verify It?

Jul 2026 · arXiv.org · Vol abs/2607.05076 · 1 citation · 17 references
Computer Science

TL;DR

Evaluating the payment workflow of an operational restaurant point-of-sale system, which must keep the register, payment terminal, and payment processor in agreement, finds the core protocol is correct relative to a hand-built, line-cited model under a precisely stated failure model.

Abstract

Formal verification is seldom applied to production software, because writing and maintaining a model has historically cost more than it returns. A companion study [1] extended SysMoBench [4] with a lower-cost alternative: specifications are graded against traces captured from the running system. It found that when large language models write the specifications, reliability is governed by the structure of the specification contract, not the language. This paper evaluates both on production software: the payment workflow of an operational restaurant point-of-sale system, which must keep the register, payment terminal, and payment processor in agreement. We report three results. First, the core protocol is correct relative to a hand-built, line-cited model under a precisely stated failure model. The audit found seven failure-handling gaps, nearly all with a common root cause; three were reproduced as real executions, and a patch closing them was re-checked with all failure gates enabled, after which a follow-up patch closed a defect the re-check itself exposed. Systematic extensions of the failure model (crash-restart, stale reads, two attempts) each found the windows they were designed to probe. Second, a single probe of the production payment sandbox exposed a response-shape divergence that makes an entire recovery ladder unreachable against the live API. The emulator-based audit could not detect it, because code and emulator share the same misreading: a correlated-oracle failure. Third, the companion study's central finding replicates across seven models from two vendors: contract structure, not language, governs what LLMs specify reliably. The replication concerns the ordering of contracts and the failure taxonomy, not the absolute level: only the strongest models reached the corpus ceiling, and the harder task restores discriminating power the benchmark had lost.

View source

Similar papers

Review Sep 2026

Trust the Spec, Not the Code - A Specification-First, AI-Assisted Case Study in Online Banking

It is argued that AI removes much of that cost: natural language enriched with lightweight mathematics, written in \LaTeX, can serve as an intermediate specification language that is precise enough to reason over and prove, while a large language model reviews it for ambiguity, drafts proofs, and generates the implemen...

E. Farchi · 0 citations
Conference Open access Jul 2026

Show Me The Money: An Exercise in Proof-Driven Software Understanding

This work demonstrates how the strategic combination of theorem proving and model checking provides a path for delivering robust assurance to legacy systems.

Joseph Tafese, Karthik Nukala, Hassen Saïdi et al. · 0 citations
Jul 2026

Foundational Refinement Proofs for Deployed Bytecode, at the Price of Tokens

It is concluded that foundational mechanized proofs can now be bought at the price of tokens, and that this shift can reshape how verification frameworks are architected.

Lefteris Lazaropoulos, Zoe Paraskevopoulou · 0 citations
Preprint Sep 2026

Large Language Models and Language Server Protocol: a match made in context

This article introduces Eiffel-tools, a language server protocol (LSP) implementation for the Eiffel programming language that uses Large Language Models (LLMs) to aid the development of statically verified software. The tool provides various interactive and non-interactive commands to produce code and specifications....

Alessandro Schena, I. Mustafin, Julia Kotovich · 0 citations

Automated Generation of RISC-V Extensions with Formal Correctness Guarantees

Janus is presented, an LLM-assisted framework that synthe-sizes custom instructions integrated into the Ibex RISC-V core while keeping correctness outside the agent, demonstrating a practical path for using LLMs to explore ISA specialization without making the agent part of the trusted correctness boundary.

Elisavet Lydia Alvanaki, Jia-Kun Wang, Eugenio Muscinelli et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.