论文标题
基于代数的循环合成推理
Algebra-Based Reasoning for Loop Synthesis
论文作者
论文摘要
可证明的正确的软件是我们软件驱动的社会的关键挑战之一。程序综合 - 构建满足给定规范的程序的任务 - 是实现这一目标的一种策略。然后,此任务的结果是一个按设计正确的程序。与程序验证的领域一样,处理循环是成功合成过程的主要成分之一。 我们提出了一种用于满足给定多项式循环不变的环路的算法。我们正在考虑的循环类别可以通过具有恒定系数的代数复发方程系统进行建模,从而编码程序变量之间具有仿射操作的程序循环。我们通过精确表征满足给定不变的所有循环的集合,将循环合成的任务转变为多项式约束问题。我们证明了方法的合理性,以及与程序变量数量的先验固定上限相对于其完整性。我们的工作有应用于满足给定多项式循环不变的程序验证以及来自代数关系的数字序列的综合循环。为了了解合成循环的方法和启发式方法的可行性,我们使用Absynth工具实施和评估该方法。
Provably correct software is one of the key challenges of our software-driven society. Program synthesis -- the task of constructing a program satisfying a given specification -- is one strategy for achieving this. The result of this task is then a program which is correct by design. As in the domain of program verification, handling loops is one of the main ingredients to a successful synthesis procedure. We present an algorithm for synthesizing loops satisfying a given polynomial loop invariant. The class of loops we are considering can be modeled by a system of algebraic recurrence equations with constant coefficients, encoding thus program loops with affine operations among program variables. We turn the task of loop synthesis into a polynomial constraint problem, by precisely characterizing the set of all loops satisfying the given invariant. We prove soundness of our approach, as well as its completeness with respect to an a priori fixed upper bound on the number of program variables. Our work has applications towards synthesizing loops satisfying a given polynomial loop invariant, program verification, as well as generating number sequences from algebraic relations. To understand viability of the methodology and heuristics for synthesizing loops, we implement and evaluate the method using the Absynth tool.