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.
翻译:以构成部分为基础的合成,寻求利用一组图书馆提供的API建立程序。这些API往往具有效果,因此难以理解潜在合成候选人的正确性。这是因为,由有效的图书馆程序对全球状态所作的改变影响到它们如何组合在一起,从而产生一个难以吸引的大搜索空间,从而可以混淆典型的模拟合成技术。但是,如果这些影响的性质在其规格中暴露出来,那么可以使用扣减合成方法来帮助指导查找组成部分。在本文件中,我们提出了一个新的规格指导综合程序,使用Hoare式的规格前和后期条件来表达潜在的图书馆组成部分候选人的细微影响,以驱动双向合成搜索战略。程序将寻求在现有背景下建立较大术语,但却在其他方面不了解实际目标的前瞻性搜索进程与寻求与预期目标相符的术语的后退搜索机制一起,但又不知道这些术语必须综合的背景。为了进一步提高效率和可调和可调和性,我们将一个潜在图书馆候选人的细微影响纳入图书馆的细微影响,以表达双向综合搜索搜索战略。我们用了一个先向分析的方法将一个具有挑战性的结构,我们用了一个不稳的合成工具,我们用了一种可操作的模拟的系统。