通过定向引理合成证明函数式程序等价性
Proving Functional Program Equivalence via Directed Lemma Synthesis
AI总结:
针对结构归纳法不足以证明函数式程序等价性的问题,本文提出定向引理合成方法,将引理合成归约为特殊程序合成问题,相比现有最优方法大幅缩短运行时间并解决更多任务。
摘要:
证明函数式程序之间的等价性是程序验证中的一个基础问题,通常需要对代数数据类型(ADTs)和结构递归的组合进行推理。现代定理证明器通过应用结构归纳法来解决这个问题,但结构归纳法不足以证明许多等价定理。在这类情况下,研究者必须构造一组引理,通过额外的归纳证明这些引理,再利用这些引理证明原定理。然而,目前对于归纳证明需要哪些引理、以及如何自动合成这些引理,仍缺乏系统性的认知。本文提出了定向引理合成方法,这是一种通过程序合成技术发现关键引理,从而实现等价证明自动化的有效方法。我们首先识别了两种对归纳友好的命题形式,它们能为证明的推进提供形式化保证。随后我们提出了两种策略,用于合成并应用引理,从而将证明目标转化为对归纳友好的形式。两种策略都将引理合成归约为一类特殊的程序合成问题,可通过高效算法求解。实验结果证明了我们方法的有效性:与采用基于启发式的引理枚举的现有最优等价检查器相比,定向引理合成平均节省95.47%的运行时间,并且在标准基准集的扩展版本上多解决了38个任务。
英文摘要:
Proving equivalence between functional programs is a fundamental problem in program verification, which often amounts to reasoning about algebraic data types (ADTs) and compositions of structural recursions. Modern theorem provers address this problem by applying structural induction, which is insufficient for proving many equivalence theorems. In such cases, one has to invent a set of lemmas, prove these lemmas by additional induction, and use these lemmas to prove the original theorem. There is, however, a lack of systematic understanding of what lemmas are needed for inductive proofs and how these lemmas can be synthesized automatically. This paper presents directed lemma synthesis, an effective approach to automating equivalence proofs by discovering critical lemmas using program synthesis techniques. We first identify two induction-friendly forms of propositions that give formal guarantees to the progress of the proof. We then propose two tactics that synthesize and apply lemmas, thereby transforming the proof goal into induction-friendly forms. Both tactics reduce lemma synthesis to a specialized class of program synthesis problems with efficient algorithms. Experimental results demonstrate the effectiveness of our approach: Compared to state-of-the-art equivalence checkers employing heuristic-based lemma enumeration, directed lemma synthesis saves 95.47% runtime on average and solves 38 more tasks over an extended version of the standard benchmark set.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。