Proving Functional Program Equivalence via Directed Lemma Synthesis

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Sun, Yican, Ji, Ruyi, Fang, Jian, Jiang, Xuanlin, Chen, Mingshuai, Xiong, Yingfei
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913356837814272
author Sun, Yican
Ji, Ruyi
Fang, Jian
Jiang, Xuanlin
Chen, Mingshuai
Xiong, Yingfei
author_facet Sun, Yican
Ji, Ruyi
Fang, Jian
Jiang, Xuanlin
Chen, Mingshuai
Xiong, Yingfei
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2405_11535
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Proving Functional Program Equivalence via Directed Lemma Synthesis
Sun, Yican
Ji, Ruyi
Fang, Jian
Jiang, Xuanlin
Chen, Mingshuai
Xiong, Yingfei
Programming Languages
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.
title Proving Functional Program Equivalence via Directed Lemma Synthesis
topic Programming Languages
url https://arxiv.org/abs/2405.11535