arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.09854cs.LO
收藏

用OCaml编写的图算法的自动验证

Auto-active Verification of Graph Algorithms, Written in OCaml

Daniel Castanho, Mário Pereira

摘要:

函数式编程为构建结构正确的软件提供了完美的基础。这种范式的语言通常具有最先进的类型系统,良好的抽象机制和定义良好的执行模型。我们声称,所有这些都使得用函数式语言编写的软件成为正式认证的优秀目标。然而,令人惊讶的是,诸如演绎验证之类的技术很少应用于用主流函数式语言编写的大规模程序。在本文中,我们希望解决这种情况,并提出现实的OCaml实现的自动活动证明。我们选择从OCamlgraph库发布的实现作为我们的目标,因为这是一个大规模和广泛使用的OCaml代码。我们使用Cameleer,最近提出的OCaml程序的演绎验证工具,进行选定的案例研究的证明。绝大多数这样的证明都是使用SMT求解器全自动完成的,并且当需要时,我们可以在Why3 IDE中应用轻量级交互式证明(Cameleer将输入程序转换为等效的WhyML,Why3验证框架的语言)。据我们所知,这些是第一个用OCaml编写的图算法的机械化,大部分是自动化的证明。

英文摘要:

Functional programming offers the perfect ground for building correct-by-construction software. Languages of such paradigm normally feature state-of-the-art type systems, good abstraction mechanisms, and well-defined execution models. We claim that all of these make software written in a functional language excellent targets for formal certification. Yet, somehow surprising, techniques such as deductive verification have been seldom applied to large-scale programs, written in mainstream functional languages. In this paper, we wish to address this situation and present the auto-active proof of realistic OCaml implementations. We choose implementations issued from the OCamlgraph library as our target, since this is both a large-scale and widely-used piece of OCaml code. We use Cameleer, a recently proposed tool for the deductive verification of OCaml programs, to conduct the proofs of the selected case studies. The vast majority of such proofs are completed fully-automatically, using SMT solvers, and when needed we can apply lightweight interactive proof inside the Why3 IDE (Cameleer translates an input program into an equivalent WhyML one, the language of the Why3 verification framework). To the best of our knowledge, these are the first mechanized, mostly-automated proofs of graph algorithms written in OCaml.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑