Neuro-Symbolic Generation and Validation of Memory-Aware Formal Function Specifications
New framework uses LLMs and symbolic provers to create machine-checked specifications for memory-safe software.
A team of researchers has developed a new neuro-symbolic AI framework designed to automate the creation of formal specifications for C programs that manipulate memory. This addresses a major bottleneck in software verification, where precise, expert-written specs are required to prove code correctness, especially as large language models (LLMs) generate more systems-level code. The pipeline starts by using LLMs to generate candidate specifications from natural language problem descriptions and function signatures. It then employs an iterative refinement process, using feedback from compiler diagnostics and symbolic provers to validate and correct the outputs.
A key innovation is the method for validating candidate specs: the system attempts to construct a proof for the *negation* of a specification, enabling machine-checked rejection of incorrect but plausible guesses. To support rigorous evaluation, the team introduced LeetCode-C-Spec, a new benchmark of 200 C programming problems. Experiments showed that combining neural generation with symbolic feedback significantly improved both syntactic validity and correctness over LLM-only approaches, filtering false positives that LLMs would accept. This work demonstrates a practical path toward scalable formal verification for memory-safe systems software.
- Automates generation of formal function specs for C code from natural language, targeting memory-manipulating programs.
- Uses a neuro-symbolic pipeline: LLMs for draft generation, symbolic provers for iterative refinement and validation via proof-of-negation.
- Introduced a new 200-problem benchmark, LeetCode-C-Spec, for systematic evaluation of specification synthesis.
Why It Matters
Automates a critical, expert-dependent step in software verification, enabling scalable safety checks for AI-generated systems code.