Automatic Goal Clone Detection in Rocq

📅 2025-04-27
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
In proof engineering—particularly within the Rocq framework—target cloning (i.e., α-equivalent yet duplicated proof goals) induces redundancy, increased maintenance overhead, and script bloat. To address this, we introduce the first systematic application of formal α-equivalence to target clone detection, proposing a precise, Gallina-term–based decision procedure that integrates static analysis and structural matching. Our method identifies three categories of redundancy: exact clones, generalized clones, and semantically equivalent goals proven via distinct derivation paths. Evaluated on CoqGym—a benchmark comprising 40 real-world Coq projects—our approach scales effectively, detecting an average of 27.73 clones per project, thereby revealing substantial untapped potential for proof reuse. This work establishes the first scalable, formally verifiable, goal-level redundancy detection framework for automated proof engineering, providing an empirical foundation for future advances in proof refactoring and synthesis.

Technology Category

Application Category

📝 Abstract
Proof engineering in Rocq is a labor-intensive process, and as proof developments grow in size, redundancy and maintainability become challenges. One such redundancy is goal cloning, i.e., proving {alpha}-equivalent goals multiple times, leading to wasted effort and bloated proof scripts. In this paper, we introduce clone-finder, a novel technique for detecting goal clones in Rocq proofs. By leveraging the formal notion of {alpha}-equivalence for Gallina terms, clone-finder systematically identifies duplicated proof goals across large Rocq codebases. We evaluate clone-finder on 40 real-world Rocq projects from the CoqGym dataset. Our results reveal that each project contains an average of 27.73 instances of goal clone. We observed that the clones can be categorized as either exact goal duplication, generalization, or {alpha}-equivalent goals with different proofs, each signifying varying levels duplicate effort. Our findings highlight significant untapped potential for proof reuse in Rocq-based formal verification projects, paving the way for future improvements in automated proof engineering.
Problem

Research questions and friction points this paper is trying to address.

Detects duplicate proof goals in Rocq to reduce redundancy
Identifies α-equivalent goals wasting effort in large codebases
Categorizes clones to enable proof reuse in formal verification
Innovation

Methods, ideas, or system contributions that make the work stand out.

Leverages α-equivalence for Gallina terms
Systematically identifies duplicated proof goals
Evaluated on 40 real-world Rocq projects
🔎 Similar Papers
No similar papers found.