Skip to main content
QUICK REVIEW

[Paper Review] Proof Pattern Search in Coq/SSReflect

Jónathan Heras, Ekaterina Komendantskaya|arXiv (Cornell University)|Feb 1, 2014
Logic, programming, and type systemsComputer Science8 references6 citations
TL;DR

This paper enhances ML4PG, a machine learning tool for Coq/SSReflect, by introducing recurrent clustering to extract features from Coq terms—including definitions, types, and lemma statements—enabling discovery of similar proof patterns beyond just tactic sequences. It introduces proof-patches to capture strategies at any proof stage and uses automaton-shaped representations to visualize correlated features, significantly improving pattern interpretability and accuracy in suggesting reusable proof ideas across libraries.

ABSTRACT

ML4PG is an extension of the Proof General interface, allowing the user to invoke machine-learning algorithms and find proof similarities in Coq/SSReect libraries. In this paper, we present three new improvements to ML4PG. First, a new method of "recurrent clustering" is introduced to collect statistical features from Coq terms. Now the user can receive suggestions about similar definitions, types and lemma statements, in addition to proof strategies. Second, Coq proofs are split into patches to capture proof strategies that could arise at different stages of a proof. Finally, we improve ML4PG's output introducing an automaton-shape representation for proof patterns.

Motivation & Objective

  • To address the limitation of existing Coq search tools, which require users to specify exact patterns, by enabling goal-independent, unsupervised discovery of reusable proof strategies.
  • To extend ML4PG beyond tactic sequences to include structural features of Coq terms—such as definitions, types, and lemma statements—thereby capturing deeper proof similarities.
  • To improve interpretability of machine-learning clusters by introducing an automaton-shape representation that visualizes correlated proof features and tactic transitions.
  • To enable detection of proof patterns at any stage of a proof, not just early steps, by decomposing proofs into modular patches.
  • To increase the accuracy and relevance of suggested proof patterns through recurrent clustering of syntactic and semantic features across entire Coq libraries.

Proposed method

  • Introduces recurrent clustering—a novel technique for extracting statistical features from Coq terms, including definitions, types, and lemma statements, to detect structural similarities.
  • Splits proofs into proof-patches to analyze and compare strategy patterns at any stage of the proof, not just the first few steps.
  • Applies feature selection using correlation-based methods (from Weka) to identify the most relevant features influencing cluster formation, such as tactic types, goal shapes, and auxiliary lemma usage.
  • Represents discovered proof patterns as automaton-shaped diagrams, where states correspond to goal configurations and transitions to tactics, with feature correlations annotated.
  • Uses the entire Coq/SSReflect library syntax as input for clustering, increasing the scope and accuracy of pattern detection.
  • Employs a hybrid approach combining statistical clustering with symbolic analysis to link similar proof fragments across different lemmas and libraries.

Experimental results

Research questions

  • RQ1How can proof patterns in Coq/SSReflect be detected beyond sequences of tactics, incorporating structural features of definitions, types, and lemma statements?
  • RQ2What techniques enable the detection of proof strategies at any stage of a proof, rather than only in early steps?
  • RQ3How can machine-learning clusters of proof fragments be made interpretable to users, especially in identifying which features contributed to similarity?
  • RQ4To what extent does recurrent clustering of Coq terms improve the accuracy and relevance of suggested proof patterns compared to prior methods?
  • RQ5Can automaton-shaped representations effectively communicate the logical flow and correlated features of discovered proof patterns?

Key findings

  • Recurrent clustering significantly improves feature extraction by capturing syntactic and semantic similarities across Coq terms, including definitions and lemma statements, beyond just tactic sequences.
  • Proof-patches allow ML4PG to detect and suggest strategies even in deep proof steps—such as the 15th–20th or 115th–120th steps—enabling detection of complex, non-local patterns.
  • The automaton-shape representation successfully visualizes correlated features and tactic transitions, making clusters interpretable and highlighting key proof strategies.
  • With default settings, ML4PG correctly identifies the most similar lemma (e.g., Lemma 1) and relevant patches from other lemmas, reducing irrelevant suggestions.
  • Feature selection via correlation-based methods identifies key contributors to clustering, such as tactic types, goal symbols (e.g., ∑), and auxiliary lemma usage, improving cluster relevance.
  • The extended ML4PG system now supports goal-independent, unsupervised discovery of proof patterns across diverse domains, including formalized mathematics and software certification.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.