TL;DR
This paper introduces Proverbot9001, a novel system that uses machine learning, specifically neural networks, to automate the generation of correctness proofs for software. By learning from existing proofs, Proverbot9001 can automatically prove a significant percentage of theorem statements, dramatically reducing the manual effort required for foundational verification.
What Problem Does This Paper Address?
Foundational verification, where software correctness is proven using interactive theorem provers like Coq, offers a high degree of assurance. However, this process is extremely labor-intensive, requiring highly trained experts and significant time investment (e.g., 6 person-years for the CompCert compiler). This high cost is a major barrier to the broader adoption of foundational verification. The paper aims to alleviate this burden by automating a substantial portion of the proof generation process.
Methods
Proverbot9001 employs a two-stage machine learning approach:
- Tactic Prediction (Ptac): A feed-forward neural network predicts the most likely "tactic" (a proof command) to apply next. This model uses hand-engineered features such as the head of the current goal, the previously used tactic, and the most relevant hypothesis.
- Argument Prediction (Parg): Once a tactic is predicted, a separate recurrent neural network (RNN) predicts the arguments for that tactic. This model considers the goal, hypotheses, and the similarity between the goal and hypotheses.
A key innovation is the argument-first approach: the argument predictor's scores influence the selection of tactics, rather than the other way around. This is achieved by combining tactic and argument scores multiplicatively. The system also incorporates several tree pruning techniques to guide the proof search more effectively. Furthermore, Proverbot9001 preprocesses proof commands to handle more complex structures, making them amenable to its learning model.
Datasets
The primary dataset used for training and evaluation is derived from the CompCert verified C compiler. The authors split the CompCert dataset into training (162 files) and testing (13 files) sets. They also evaluated Proverbot9001 on three other Coq projects from the Coq Contrib collection: concat, float, and zfc.
Key Insights and Ideas
- Argument-Driven Tactic Selection: The insight that argument prediction should inform tactic selection, rather than just being a secondary step, is crucial. This allows the system to focus on generating complete, executable proof commands.
- Feature Engineering for Proofs: The paper highlights the importance of domain-specific features (like previous tactics and goal/hypothesis heads) for effectively training neural networks on proof generation tasks.
- Data Preprocessing for Learnability: Desugaring complex proof commands (tacticals) into simpler, linear sequences significantly improves the model's ability to learn and generalize.
- Cross-Project Transfer Learning: Proverbot9001 demonstrates the ability to be trained on one project (CompCert) and effectively predict proofs in other, distinct projects, suggesting broad applicability.
Key Results
- Automated Proof Completion: Proverbot9001 can automatically produce proofs for 28% of theorem statements in the CompCert test dataset when combined with solver-based tooling (CoqHammer).
- Significant Improvement over State-of-the-Art: Without any external solvers, Proverbot9001 achieves a 19.36% proof completion rate, which is a 4X improvement over previous state-of-the-art machine learning models for proof generation in Coq.
- Tactic and Argument Accuracy: The core prediction model can reproduce the correct tactic name 32% of the time. When the tactic is correct, the argument is predicted correctly 89% of the time.
- Cross-Project Performance: When trained on CompCert, Proverbot9001 achieved 17.7% on
concat, 13.48% onfloat, and 17.01% onzfc, demonstrating effective transfer learning. - Comparison with CoqGym: Proverbot9001 significantly outperforms CoqGym, the previous state-of-the-art, solving 138 proofs compared to CoqGym's 48 proofs (when both are augmented with CoqHammer). Combining both systems further increases the success rate.
Limitations and Future Work
- Restricted Proof Command Model: Proverbot9001's current model primarily handles proof commands with single arguments (hypothesis identifiers or goal tokens). While it can find alternative proofs for more complex commands, its direct prediction domain is limited.
- Search Depth and Width: The performance is sensitive to search parameters like depth and width. While the default settings are effective, further exploration could yield better results.
- Future Work: The authors suggest exploring more expressive proof command models, potentially incorporating graph representations of terms (as seen in other recent work), and further investigating cross-project transfer learning. They also note that while their system is effective, it still requires significant manual effort for the most complex proofs.
Summary updated