In syntax-guided synthesis, one of the challenges is to reduce the enormous size of the search space. We observe that most search spaces are not just flat sets of programs, but can be endowed with a structure that we call an oriented metric. Oriented metrics measure the distance between programs, like ordinary metrics do, but are designed for settings in which operations have an orientation. Our focus is on the string and the bitvector domains, where operations like concatenation and bitwise conjunction transform an input into an output in a way that is not symmetric. We develop several new oriented metrics for these domains. Oriented metrics are designed for search space reduction, and we present four techniques: (i) pruning the search space to a ball around the ground truth, (ii) factorizing the search space by an equivalence that is induced by the oriented metric, (iii) abstracting the oriented metric (and hence the equivalence) and refining it, and (iv) improving the enumeration order by learning from abstract information. We acknowledge that these techniques are inspired by developments in the literature. By understanding their roots in oriented metrics, we can substantially increase their applicability and efficiency. We have integrated these techniques into a new synthesis algorithm and implemented the algorithm in a new solver. Notably, our solver is generic in the oriented metric over which it computes. We conducted experiments in the string and the bitvector domains, and consistently improve the performance over the state-of-the-art by more than an order of magnitude.
翻译:在语法引导的综合中,挑战之一在于缩减庞大的搜索空间规模。我们观察到,大多数搜索空间不仅仅是程序的扁平集合,而是可以赋予一种我们称之为定向度量的结构。定向度量如同普通度量一样衡量程序之间的距离,但专为操作具有方向性的场景设计。我们的研究聚焦于字符串和位向量领域,其中诸如拼接和按位合取等操作以非对称的方式将输入转换为输出。我们为这些领域开发了若干新的定向度量。定向度量旨在实现搜索空间缩减,我们提出了四种技术:(i) 将搜索空间剪枝至围绕真实解的球域内,(ii) 通过定向度量诱导的等价关系对搜索空间进行因式分解,(iii) 对定向度量(及其诱导的等价关系)进行抽象与精化,以及(iv) 通过从抽象信息中学习来改进枚举顺序。我们承认这些技术受到文献中已有进展的启发。通过理解其与定向度量的内在联系,我们能够显著提升其适用性与效率。我们将这些技术集成至一种新的综合算法中,并在新求解器中实现了该算法。值得注意的是,我们的求解器在计算所基于的定向度量方面具有通用性。我们在字符串和位向量领域进行了实验,其性能始终比现有最优方法提升超过一个数量级。