一句话:提出 Coq 库 SpaceSearch,让用户在证明助手中构建并验证求解器辅助工具,再提取到 Rosette 高效执行。
许多验证工具将领域问题归约为 SMT 查询,但归约本身的正确性很少被验证,因此求解器输出未必能建立领域级性质。SpaceSearch 是一个在 Coq 中开发求解器辅助工具的库:用户基于其接口构建工具,并证明接口结果足以推出高层性质;随后工具可提取为 Rosette 等实现,接口由底层 SMT 求解器高效实例化。该工作还引入并行化与增量式优化。评估中,SaltShaker 发现 RockSalt 的 7 个和 STOKE 的 1 个 bug,修复后在 2 小时内验证 15,255 条指令实例的语义一致;BGProof 是经验证的 BGP 配置检查器,可扩展至 240 KLOC 工业配置,发现 19 个不一致且无误报,并在未验证实现中发现 2 个 bug。
Many verification tools build on automated solvers. These tools reduce problems in a specific application domain (e.g., compiler optimization validation) to queries that can be discharged with a highly optimized solver. But the correctness of the reductions themselves is rarely verified in practice, limiting the confidence that the solver's output establishes the desired domain-level property. This paper presents SpaceSearch, a new library for developing solver-aided tools within a proof assistant. A user builds their solver-aided tool in Coq against the SpaceSearch interface, and the user then verifies that the results provided by the interface are sufficient to establish the tool's desired high-level properties. Once verified, the tool can be extracted to an implementation in a solver-aided language (e.g., Rosette), where SpaceSearch provides an efficient instantiation of the SpaceSearch interface with calls to an underlying SMT solver. This combines the strong correctness guarantees of developing a tool in a proof assistant with the high performance of modern SMT solvers. This paper also introduces new optimizations for such verified solver-aided tools, including parallelization and incrementalization. We evaluate SpaceSearch by building and verifying two solver-aided tools. The first, SaltShaker, checks that RockSalt's x86 semantics for a given instruction agrees with STOKE's x86 semantics. SaltShaker identified 7 bugs in RockSalt and 1 bug in STOKE. After these systems were patched by their developers, SaltShaker verified the semantics' agreement on 15,255 instruction instantiations in under 2h. The second tool, BGProof, is a verified version of an existing Border Gateway Protocol (BGP) router configuration checker. Like the existing checker, BGProof scales to checking industrial configurations spanning over 240 KLOC, identifying 19 configuration inconsistencies with no false positives. However, the correctness of BGProof has been formally proven, and we found 2 bugs in the unverified implementation. These results demonstrate that SpaceSearch is a practical approach to developing efficient, verified solver-aided tools.
@article{WeitzLHTET17,
title = {SpaceSearch: a library for building and verifying solver-aided tools},
author = {Konstantin Weitz and Steven Lyubomirsky and Stefan Heule and Emina Torlak and Michael D. Ernst and Zachary Tatlock},
journal = {Proceedings of the ACM on Programming Languages},
volume = {1},
number = {ICFP},
year = {2017},
doi = {10.1145/3110269}
}