arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.08862cs.LOcs.DScs.PL
收藏

使用 ACL2 验证 Knuth 舞蹈链的 Rust 实现

Verification of a Rust Implementation of Knuth's Dancing Links using ACL2

David S. Hardin

AI总结:

本文介绍 Rust 子集 RAR 中舞蹈链优化的循环双向链表实现,并使用 ACL2 定理证明器验证其功能正确性,旨在利用 Rust 进行硬件/软件协同保证。

摘要:

舞蹈链(Dancing Links)指的是对循环双向链表数据结构实现的一种优化,该优化支持快速移除和恢复列表元素。舞蹈链优化主要用于快速求解精确覆盖问题的算法中,并由 Knuth 在其开创性系列著作《计算机程序设计艺术》第 4B 卷中推广。我们描述了在 Rust 编程语言中实现舞蹈链优化,以及使用 ACL2 定理证明器对其进行形式化验证。在过去几年中,Rust 作为 C/C++ 的现代内存安全继任者,在 Amazon、Google 和 Microsoft 等公司获得了广泛认可,并正在被集成到 Linux 和 Windows 操作系统内核中。我们对 Rust 的兴趣源于其作为硬件/软件协同保证语言的潜力,可应用于关键系统。我们构建了一个 Rust 子集,灵感来自 Russinoff 的受限算法 C(RAC),并富有想象力地将其命名为受限算法 Rust(RAR)。在之前的工作中,我们描述了 RAR 工具链的初步实现,其中我们将 RAR 源代码直接转译为 RAC。通过这样做,我们以最少的时间和精力投入利用了现有的多种硬件/软件协同保证工具。在本文中,我们描述了 RAR Rust 子集,介绍了改进后的 RAR 工具链原型,并详细说明了在 RAR 中采用舞蹈链优化的循环双向链表数据结构的设计与验证,使用 ACL2 定理证明器完成了功能正确性的完整证明。

英文摘要:

Dancing Links connotes an optimization to a circular doubly-linked list data structure implementation which provides for fast list element removal and restoration. The Dancing Links optimization is used primarily in fast algorithms to find exact covers, and has been popularized by Knuth in Volume 4B of his seminal series The Art of Computer Programming. We describe an implementation of the Dancing Links optimization in the Rust programming language, as well as its formal verification using the ACL2 theorem prover. Rust has garnered significant endorsement in the past few years as a modern, memory-safe successor to C/C++ at companies such as Amazon, Google, and Microsoft, and is being integrated into both the Linux and Windows operating system kernels. Our interest in Rust stems from its potential as a hardware/software co-assurance language, with application to critical systems. We have crafted a Rust subset, inspired by Russinoff's Restricted Algorithmic C (RAC), which we have imaginatively named Restricted Algorithmic Rust, or RAR. In previous work, we described our initial implementation of a RAR toolchain, wherein we simply transpile the RAR source into RAC. By so doing, we leverage a number of existing hardware/software co-assurance tools with a minimum investment of time and effort. In this paper, we describe the RAR Rust subset, describe our improved prototype RAR toolchain, and detail the design and verification of a circular doubly-linked list data structure employing the Dancing Links optimization in RAR, with full proofs of functional correctness accomplished using the ACL2 theorem prover.

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

↑