A Toolchain to Produce Correct-by-Construction OCaml Programs

Jean-Christophe Filliâtre 1 Léon Gondelman 1 Andrei Paskevich 2 Mário Pereira 3 Simão Melo de Sousa 4
2 PROVAL - Proof of Programs
UP11 - Université Paris-Sud - Paris 11, Inria Saclay - Ile de France, CNRS - Centre National de la Recherche Scientifique : UMR
3 TOCCATA - Formally Verified Programs, Certified Tools and Numerical Computations
LRI - Laboratoire de Recherche en Informatique, Inria Saclay - Ile de France
Abstract : This paper presents a methodology to get correct-by-construction OCaml programs using the Why3 tool. First, a formal behavioral specification is given in the form of an OCaml module signature extended with type invariants and function contracts, in the spirit of JML. Second, an implementation is written in the programming language of Why3 and then verified with respect to the specification. Finally, an OCaml program is obtained by an automated translation. Our methodology is illustrated with the proof of a union-find library. Several other proofs of data structures and algorithms are included in the companion artifact to this paper.
Document type :
Preprints, Working Papers, ...
Complete list of metadatas

Cited literature [13 references]  Display  Hide  Download

Contributor : Mário José Parreira Pereira <>
Submitted on : Wednesday, May 2, 2018 - 5:19:56 PM
Last modification on : Thursday, October 3, 2019 - 2:04:03 PM
Long-term archiving on : Tuesday, September 25, 2018 - 3:42:15 AM


Files produced by the author(s)


  • HAL Id : hal-01783851, version 1


Jean-Christophe Filliâtre, Léon Gondelman, Andrei Paskevich, Mário Pereira, Simão Melo de Sousa. A Toolchain to Produce Correct-by-Construction OCaml Programs. 2018. ⟨hal-01783851⟩



Record views


Files downloads