Automated Contract Inference for C Code Verification

Tuesday 11 March 2025


Researchers have made a significant breakthrough in the field of software verification, developing a new tool that can automatically infer contracts for C code. This innovation has far-reaching implications for the development and maintenance of safety-critical systems, such as those used in the automotive industry.


The new tool, called AutoDeduct, uses a combination of techniques to automatically infer contracts for helper functions in C programs. Contracts are essentially a set of rules that define the expected behavior of a function, ensuring that it meets certain requirements and specifications. By inferring these contracts automatically, developers can significantly reduce the time and effort required to verify software.


AutoDeduct is built on top of the Frama-C framework, which provides a modular platform for static analysis of C programs. The tool consists of two main components: functional contract inference and auxiliary contract inference. Functional contract inference uses Horn-clause based model checking to infer contracts that specify the expected behavior of a function in terms of its inputs and outputs. Auxiliary contract inference, on the other hand, uses abstract interpretation to infer contracts that provide additional information about the function’s behavior, such as memory safety and pointer validity.


To evaluate the effectiveness of AutoDeduct, researchers used it to verify a real-world C module from the automotive industry. The module had been previously verified manually by experts, but took two person-months to complete. With AutoDeduct, the verification process was completed in just 23 seconds, with no manual intervention required.


The implications of this innovation are significant. By automating the contract inference process, developers can focus on higher-level tasks such as designing and implementing software systems, rather than spending hours manually verifying code. This could lead to faster development times, reduced costs, and improved overall quality of software.


In addition, AutoDeduct has the potential to improve safety and reliability in critical systems. By inferring contracts automatically, developers can ensure that their code meets rigorous standards for correctness and security. This is particularly important in industries such as aerospace, healthcare, and finance, where software failures can have serious consequences.


While there are still some limitations to AutoDeduct, researchers believe that it has the potential to revolutionize the field of software verification. By continuing to develop and refine this technology, they hope to make it possible for developers to create safer, more reliable software with greater ease and efficiency.


Cite this article: “Automated Contract Inference for C Code Verification”, The Science Archive, 2025.


Software Verification, Autodeduct, C Code, Contracts, Safety-Critical Systems, Automotive Industry, Functional Contract Inference, Auxiliary Contract Inference, Horn-Clause Based Model Checking, Abstract Interpretation


Reference: Jesper Amilon, Dilian Gurov, Christian Lidström, Mattias Nyberg, Gustav Ung, Ola Wingbrant, “AutoDeduct: A Tool for Automated Deductive Verification of C Code” (2025).


Leave a Reply