🤖 AI Summary
This work proposes an end-to-end approach that integrates large language models with formal verification to automatically generate correct and reliable Prolog programs from natural language prompts alone. Leveraging Claude, the method translates English specifications into Prolog code and accompanying test cases, and—novelty—incorporates the LPTP theorem prover to perform fully automated formal verification of critical properties such as typing, termination, and uniqueness. In experiments, the system successfully produced 58 logic procedures, 508 test cases, and 257 lemmas, yielding 11,800 lines of human-reviewed proof code that all passed LPTP verification. This represents a pioneering step toward merging “vibe-coding” with “vericoding,” establishing a new paradigm for trustworthy program synthesis.
📝 Abstract
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.