Static and Dynamic Verification of OCaml Programs: The Gospel Ecosystem (Extended Version)

Tiago Lopes Soares,Ion Chirica,Mário Pereira
2024-07-26
Abstract:We present our work on the collaborative use of dynamic and static analysis tools for the verification of software written in the OCaml language. We build upon Gospel, a specification language for OCaml that can be used both in dynamic and static analyses. We employ Ortac, for runtime assertion checking, and Cameleer and CFML for the deductive verification of OCaml code. We report on the use of such tools to build a case study of collaborative analysis of a non-trivial OCaml program. This shows how these tools nicely complement each others, while at the same highlights the differences when writing specification targeting dynamic or static analysis methods.
Logic in Computer Science
What problem does this paper attempt to address?
The paper primarily aims to address the following issues: 1. **Combining Dynamic and Static Analysis Tools**: The paper proposes a method for jointly using dynamic analysis (such as Runtime Assertion Checking, RAC) and static verification tools to improve the efficiency and accuracy of software verification written in the OCaml language. 2. **Design and Application of Specification Language**: It introduces a specification language called Gospel, which can be shared by both dynamic and static analysis tools to ensure these tools can work collaboratively based on the same specifications. 3. **Development of Toolchain**: The authors have developed a series of tools, including Ortac (for runtime assertion checking), Cameleer (an automatic active verification tool), and CFML (an interactive verification framework). These tools can handle specifications written in the Gospel language and verify OCaml programs. 4. **Practical Case Study**: The paper demonstrates how to use the aforementioned toolchain and techniques for software verification through a practical case (path detection algorithm), particularly focusing on the dynamic analysis of auxiliary data structures (such as queues and hash tables) and the static verification process of the path detection algorithm itself. In summary, the main goal of this paper is to explore how to effectively combine dynamic analysis with static verification to enhance the verification capability and efficiency of OCaml programs, and it validates the effectiveness of this approach through a practical case study.