Cameleer:OCaml的演绎验证工具(扩展版)
Cameleer: a Deductive Verification Tool for OCaml (extended version)
摘要:
OCaml特别适合于形式化验证。一方面,它是一种具有良好定义的语义的多范式语言,允许编写干净,简洁,类型安全和高效的代码。另一方面,它是实现合理软件的首选语言,例如,工业编译器、证明助手和自动求解器。然而,除了一些交互式工具之外,形式化验证很少应用于OCaml编写的程序。在本文中,我们介绍了正在进行的项目Cameleer,旨在为OCaml开发一个演绎验证工具,重点是证明自动化。我们利用最近提出的GOSPEL,通用OCaml SPE规范化语言,附加严格的,但可读的,行为规范的OCaml代码。正式指定的程序被馈送到我们的工具链,该工具链将其转换为WhyML中的等效程序,WhyML是Why3验证框架的编程和规约语言。最后,Why3是用来计算验证条件所产生的程序,它可以由现成的SMT求解器放电。我们提出了成功的应用程序的Cameleer工具,以证明功能的正确性的几个重要的案例研究,如FIFO队列(短暂的和适用的实现)和左堆,从现有的OCaml库发出。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。