OCaml is particularly well-fitted for formal verification. On one hand, it is a multi-paradigm language with a well-defined semantics, allowing one to write clean, concise, type-safe, and efficient code. On the other hand, it is a language of choice for the implementation of sensible software, e.g., industrial compilers, proof assistants, and automated solvers. Yet, with the notable exception of some interactive tools, formal verification has been seldom applied to OCaml-written programs. In this paper, we present the ongoing project Cameleer, aiming for the development of a deductive verification tool for OCaml, with a clear focus on proof automation. We leverage on the recently proposed GOSPEL, Generic OCaml SPE cification Language, to attach rigorous, yet readable, behavioral specification to OCaml code. The formally-specified program is fed to our toolchain, which translates it into an equivalent program in WhyML, the programming and specification language of the Why3 verification framework. Finally, Why3 is used to compute verification conditions for the generated program, which can be discharged by off-the-shelf SMT solvers. We present successful applications of the Cameleer tool to prove functional correctness of several significant case studies, like FIFO queues (ephemeral and applicative implementations) and leftist heaps, issued from existing OCaml libraries.
翻译:OCaml 特别适合正式的核查。 一方面, 它是一种多式比方语言, 具有定义明确的语义, 允许您写清、 简洁、 类型安全、 高效的代码。 另一方面, 它是一种用于实施明智软件的首选语言, 例如工业编译器、 校对助理 和自动化解答器。 然而, 除一些互动工具外, 正式的核查很少适用于 Ocaml 编写的程序 。 在本文中, 我们介绍一个正在进行的项目 Cameleer, 旨在为OCaml 开发一个推论性核查工具, 明确侧重于证据自动化 。 我们利用最近提出的 GOSPEL 、 通用 Ocaml SPEGPE 、 通用 Ocaml SPE 化语言, 对 Ocaml 代码附加严格但可读的行为规范 。 正式指定的程序被反馈给我们的工具链, 将它转换成一个与 Ohelmelle 相同的程序, 3 核查框架 的编程和规格语言 。 最后, 为什么 3 用来对生成的 Smalleral lical 应用程序的校验验证条件进行校验验证条件,,, 像 成功的校正 的校验程序, 的校正的校正的校正的校正。