Fred Mesnard, Thierry Marianne, Étienne Payet, Wim Vanhoof
4 min
This study explores the intersection of "vibe-coding"—generating code from informal natural language specifications—and "vericoding," which involves ensuring that generated code meets formal reliability guarantees. The researchers tasked Claude (Opus 4.6) with solving the first 33 exercises of the classic P-99 Prolog problem set. For each problem, the model was required to produce the Prolog implementation, a test file, and formal proofs for properties including type preservation, groundness, termination, uniqueness, and existence.
The authors established a rigorous workflow where Claude was provided with specific instructions via a CLAUDE.md file and a reference guide for LPTP. Because the goal was formal verification, the model was restricted to a pure subset of Prolog (e.g., no cuts, no built-ins) to ensure compatibility with the LPTP theorem prover. The researchers manually audited every output, re-running tests and proof-checking the generated lemmas. For complex functional properties, the authors provided natural language guidance to help the model formulate the necessary logical statements.
Claude successfully generated 58 logic procedures and over 500 tests. Notably, the model proved 257 lemmas, totaling approximately 11,800 lines of proof. The generated code often differed from common online solutions because the model adhered to the strict "pure Prolog" constraints requested. The study also highlights an ongoing effort to integrate the Model Context Protocol (MCP) to allow LLMs to interact directly with LPTP, potentially reducing the need for manual prompt engineering and token-heavy documentation.
This work demonstrates that LLMs can serve as effective assistants for formal verification, not just code generation. By combining the generative capabilities of LLMs with the rigorous checking of automated theorem provers, researchers can bridge the gap between informal requirements and formally verified software, even for complex tasks like prime factorization.
Ninety-Nine Prolog Problems (P-99) is a famous set of Prolog exercises. We solved the first thirty three just by prompting an LLM (Large Language Model). We used Claude from Anthropic. By solved we mean: generate the Prolog code and a test file, run the tests and check whether they pass, then formally prove types, groundness, termination, uniqueness, existence and also sometimes functional correctness with LPTP (Logic Program Theorem Prover). Hence our approach is an experiment in vibe-coding/vericoding of P-99. It is a vibe-coding experiment because we started from informal specifications written in English and let Claude generate the Prolog code. It also fits within vericoding because the LLM proved reliability guarantees on the generated Prolog code. Claude wrote 58 logic procedures, 508 tests, 257 lemmas for a total of 11800 proof lines. We manually checked each file generated by the LLM. We checked the Prolog code, ran the tests, examined the logical statements generated by Claude and proof-checked Claude's proofs with LPTP. This paper describes this experiment and provides the main details so that it can be reproduced by the interested reader.
Sam: So by representing numbers that way, the system can actually prove things about them — rather than just assuming they behave the way we expect?
Alex: Exactly. It removes the wiggle room. When the AI has to work within that kind of rigid structure, it can't paper over gaps in its reasoning. Every claim has to follow from the rules of the system, which is what makes the resulting proofs trustworthy.
Sam: It's a meaningful step toward reliability. If this kind of approach could be standardized — integrated into the tools developers already use — it could change how we build software where mistakes have serious consequences. Medical systems, financial infrastructure, that sort of thing.
Alex: That's the longer-term implication the paper points toward. This study is a proof of concept rather than a finished solution, but it demonstrates a clear path: AI generates the code, a formal checker verifies it, and the loop continues until the proof holds. For anyone working on software where correctness genuinely matters, that's a direction worth taking seriously. Thanks for listening to ResearchPod.