arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2407.09143cs.PL
收藏

面向含指针程序演绎合成的高阶规约(扩展版)

Higher-Order Specifications for Deductive Synthesis of Programs with Pointers (Extended Version)

David Young, Ziyi Yang, Ilya Sergey, Alex Potanin

AI总结:

针对合成分离逻辑存在的样板谓词过多、规约依赖数据结构具体布局的问题,提出高级前端语言Pika及布局无关合成器,提升SuSLik的表达力与易用性,生成的C代码性能可比肩甚至优于Haskell。

摘要:

合成分离逻辑(Synthetic Separation Logic,SSL)是支撑SuSLik的形式化体系,SuSLik是针对类C语言中操作基于堆的链式数据结构的可证明正确程序进行演绎合成的前沿方法。尽管SSL表达能力较强,但它存在两个缺陷,限制了其实用性。第一,其核心规约组件归纳谓词仅支持数据结构形状的一阶定义,导致用于描述常见模式的“样板”谓词大量激增。第二,SSL要求数据结构具备具体定义才能合成操作这些结构的程序,这意味着每当涉及的结构布局发生改动,就必须修改合成任务对应的规约。\n我们提出大幅提升用于合成的分离逻辑规约的抽象层级,既简化该方法,也让规约更易用、更易读易懂。我们避免了在规约中重复声明底层表示细节,通过抽象掉内存中特定布局的细节,实现同一数据结构不同实现的复用。我们提出的新型高级前端语言Pika显著提升了SuSLik的表达能力。\n我们实现了一个从Pika到SuSLik的布局无关合成器,支持从类似普通函数式程序的高层规约一键合成带原地内存更新的C程序,同时附带这些程序满足分离逻辑风格规约的完整证明。我们的实验表明,该工具生成的C代码性能表现具有竞争力,有时甚至比Haskell更快。

英文摘要:

Synthetic Separation Logic (SSL) is a formalism that powers SuSLik, the state-of-the-art approach for the deductive synthesis of provably-correct programs in C-like languages that manipulate Heap-based linked data structures. Despite its expressivity, SSL suffers from two shortcomings that hinder its utility. First, its main specification component, inductive predicates, only admits first-order definitions of data structure shapes, which leads to the proliferation of ''boiler-plate'' predicates for specifying common patterns. Second, SSL requires concrete definitions of data structures to synthesise programs that manipulate them, which results in the need to change a specification for a synthesis task every time changes are introduced into the layout of the involved structures. We propose to significantly lift the level of abstraction used in writing Separation Logic specifications for synthesis -- both simplifying the approach and making the specifications more usable and easy to read and follow. We avoid the need to repetitively re-state low-level representation details throughout the specifications -- allowing the reuse of different implementations of the same data structure by abstracting away the details of a specific layout used in memory. Our novel high-level front-end language called Pika significantly improves the expressiveness of SuSLik. We implemented a layout-agnostic synthesiser from Pika to SuSLik enabling push-button synthesis of C programs with in-place memory updates, along with the accompanying full proofs that they meet Separation Logic-style specifications, from high-level specifications that resemble ordinary functional programs. Our experiments show that our tool can produce C code that is comparable in its performance characteristics and is sometimes faster than Haskell.

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

↑