AI
LLM-powered language server bridges AI and formal verification for bug-free code
Researchers have built Eiffel-tools, an LSP implementation that harnesses large language models alongside static verifiers to automatically generate and fix code in the Eiffel programming language.
Researchers have published a new approach to combining large language models with formal verification tools, demonstrating how AI-assisted development can meet the demands of statically verified software. The work centers on Eiffel-tools, a language server protocol implementation designed specifically for the Eiffel programming language.
How it works#
Eiffel-tools bridges the gap between generative AI and software correctness by integrating LLMs with a static verifier. The system accepts interactive and non-interactive commands to produce both code and formal specifications. Rather than simply accepting LLM output as-is, the tool grounds the model's suggestions using domain-specific knowledge about the Eiffel language and project context. It then automatically validates each generated piece of code against formal verification rules, correcting or rejecting outputs that fail to meet requirements. When generation attempts fall short, the system handles retries systematically.
Key capabilities#
The tool's architecture relies on crafting rich, programmatic prompts that encode project-specific constraints and language rules. This precision-targeting approach helps the LLM produce output more likely to pass verification on the first attempt. Beyond code generation, the system includes a bug-fixing capability that automatically detects and corrects errors in existing code.
Measured results#
Testing on two public datasets with three different models showed the approach can successfully repair between 76% and 95% of bugs, depending on the model and prompt configuration chosen. The results reveal a predictable trade-off: allowing more repair attempts generally increases the success rate, but at the cost of additional computation. This suggests the tool offers developers a tunable balance between resource efficiency and code quality assurance.

