论文标题
来自有效库的规范指导的基于组件的合成
Specification-Guided Component-Based Synthesis from Effectful Libraries
论文作者
论文摘要
基于组件的合成旨在使用一组库提供的API构建程序。这些API通常会产生效果,这使得推理潜在合成候选者的正确性是具有挑战性的。这是因为有效的库程序对全球状态的变化会影响它们的组成方式,从而产生了一个很大的搜索空间,该空间可能会混淆典型的枚举合成技术。但是,如果将这些效果的性质暴露为规范的一部分,则可以使用演绎合成方法来帮助指导搜索组件。在本文中,我们提出了一种新的规范引导的合成程序,该过程使用HOARE式的前后条件来表达潜在的库组件候选者的细粒度效应,以驱动双向合成搜索策略。该过程在旨在在现有上下文的情况下构建更大术语的前向搜索过程之间交替,但否则该过程并不意识到实际目标,而后向搜索机制寻求与所需目标一致的术语,但否则该术语不知道必须合成这些术语的上下文。为了进一步提高效率和可扩展性,我们将冲突驱动的学习过程集成到合成算法中,该算法提供了先前遇到的不成功搜索路径的语义表征,该搜索路径用于修剪随着合成的过程,该搜索路径可修剪可能的候选者空间。我们已经在称为钴的工具中实现了我们的想法,并证明了其在配备有效规格的OCAML库中定义的许多具有挑战性的合成问题。
Component-based synthesis seeks to build programs using the APIs provided by a set of libraries. Oftentimes, these APIs have effects, which make it challenging to reason about the correctness of potential synthesis candidates. This is because changes to global state made by effectful library procedures affect how they may be composed together, yielding an intractably large search space that can confound typical enumerative synthesis techniques. If the nature of these effects are exposed as part of their specification, however, deductive synthesis approaches can be used to help guide the search for components. In this paper, we present a new specification-guided synthesis procedure that uses Hoare-style pre- and post-conditions to express fine-grained effects of potential library component candidates to drive a bi-directional synthesis search strategy. The procedure alternates between a forward search process that seeks to build larger terms given an existing context but which is otherwise unaware of the actual goal, alongside a backward search mechanism that seeks terms consistent with the desired goal but which is otherwise unaware of the context from which these terms must be synthesized. To further improve efficiency and scalability, we integrate a conflict-driven learning procedure into the synthesis algorithm that provides a semantic characterization of previously encountered unsuccessful search paths that is used to prune the space of possible candidates as synthesis proceeds. We have implemented our ideas in a tool called Cobalt and demonstrate its effectiveness on a number of challenging synthesis problems defined over OCaml libraries equipped with effectful specifications.