Papers
Topics
Authors
Recent
Search
2000 character limit reached

ASTactic: Neural Tactic Synthesis

Updated 15 June 2026
  • ASTactic is a deep learning-based model for automated theorem proving in Coq, representing tactic commands as abstract syntax trees.
  • It employs a tree-structured encoder–decoder framework to synthesize contextually valid tactics and reduce argument search complexity.
  • The integration with Coq and complementary use of traditional tactics, like hammer, achieves state-of-the-art proof success rates.

ASTactic is a deep learning-based model for automated theorem proving in the Coq proof assistant, designed to generate tactic commands as programs represented by abstract syntax trees (ASTs). Developed in the context of the CoqGym environment, ASTactic formalizes the task of tactic synthesis as a conditional program generation problem, where model outputs are structured according to the syntax and semantics of the Ltac tactic language. The architecture leverages tree-structured neural models to encode proof states and decode tactic trees, focusing on producing in-vocabulary tactics with arguments drawn from semantically valid options. The approach combines neural program synthesis with semantic pruning, enabling more efficient and effective search in the space of interactive proofs (Yang et al., 2019).

1. Formalization of Tactic Generation

In interactive theorem proving with Coq, proofs are constructed by iteratively issuing tactics that manipulate a proof state, which itself consists of a global environment Γ\Gamma of named premises and a list of current goals G1,G2,G_1, G_2, \dots with local contexts Δi\Delta_i. Tactics tTt \in \mathcal{T} from Ltac are parameterized commands executed by Coq, updating the current proof state or resulting in failure.

ASTactic’s objective is to learn a conditional distribution P(tS)P(t\mid S) over the large space of well-formed Coq tactics, given the current proof state SS. In practice, the tactic space T\mathcal{T} is restricted to a context-free grammar of atomic Ltac tactics, with parameters (e.g., identifiers, integers) synthesized only from currently available, syntactically valid options. This constraint drastically reduces the complexity of argument search and aligns tactic generation with Coq’s semantics.

2. Neural Architecture: Encoder–Decoder over Trees

ASTactic adopts an encoder–decoder framework where both the input (proof state) and output (tactic program) are tree-structured.

Encoder: Each goal GG and each premise rΓΔr \in \Gamma \cup \Delta is parsed as a Coq term AST, composed of constructors (App, Lambda, Match, etc.). These ASTs are embedded using a bottom-up child-sum TreeLSTM [Tai et al., 2015]. For each node vv with constructor G1,G2,G_1, G_2, \dots0 and children G1,G2,G_1, G_2, \dots1, the TreeLSTM updates hidden and cell states: G1,G2,G_1, G_2, \dots2 where G1,G2,G_1, G_2, \dots3 is a learned embedding per constructor. The root state G1,G2,G_1, G_2, \dots4 is taken as the embedding for each term. Goal and premise embeddings are tagged to indicate their role, and, for efficiency, only up to G1,G2,G_1, G_2, \dots5 premises are encoded per state.

Decoder: The model produces tactic programs as ASTs corresponding to the Ltac grammar, generating each node in depth-first sequence. The decoder maintains a GRU state G1,G2,G_1, G_2, \dots6 at each step, which summarizes the current expansion context: G1,G2,G_1, G_2, \dots7 where G1,G2,G_1, G_2, \dots8 encodes the prior production rule, G1,G2,G_1, G_2, \dots9 encodes the parent node and expansion rule, Δi\Delta_i0 is the current nonterminal, Δi\Delta_i1 the goal embedding, and Δi\Delta_i2 an attention-weighted summary of premise embeddings.

At each expansion step, a production rule is selected via a softmax over learned parameters: Δi\Delta_i3 For argument synthesis:

  • Premise identifiers: Each premise is scored by attention;
  • Small integers: Chosen by discrete softmax;
  • Quantified variables: Uniform selection among variables in Δi\Delta_i4.

3. Probabilistic Modeling of Tactics

Let Δi\Delta_i5 be a tactic AST with node set Δi\Delta_i6. The probability of generating Δi\Delta_i7 in proof state Δi\Delta_i8 factors as: Δi\Delta_i9 where tTt \in \mathcal{T}0 is the decoder state at node tTt \in \mathcal{T}1. For terminal nodes, the generation further conditions on the corresponding argument classifier, with context restrictions reflecting the current proof environment. This supports both deterministic (highest-probability) and stochastic decoding.

4. Training Strategy and Hyperparameters

ASTactic is trained on pairs tTt \in \mathcal{T}2 with tTt \in \mathcal{T}3 the ground-truth tactic AST executed in state tTt \in \mathcal{T}4 (extracted from 44,000 human-written proofs in CoqGym). Teacher forcing is employed: the target AST is traversed in depth-first order, with the network unrolled along ground-truth expansions, and losses accumulated as cross-entropy on both production rule and argument generation: tTt \in \mathcal{T}5 The optimization uses RMSProp [Tieleman & Hinton, 2012] with learning rate tTt \in \mathcal{T}6, weight decay tTt \in \mathcal{T}7, embedding/hidden sizes tTt \in \mathcal{T}8, over five epochs and batch size tTt \in \mathcal{T}9 (online updates). Training completes in a few days on a single GTX 1080 GPU.

ASTactic is integrated with the Coq execution environment using a beam-search–enhanced depth-first search:

  1. Given initial state P(tS)P(t\mid S)0, invoke a recursive DFS-Prove procedure.
  2. For each proof state, built-in Coq tactics (trivial, auto, intuition, easy, hammer) are applied first.
  3. If none succeed, ASTactic proposes a beam of candidate tactics (via beam search over P(tS)P(t\mid S)1); candidates are executed and resulting states recursed upon up to a maximum search depth (50) or wall time (10 minutes), pruning duplicate states.
  4. Communication with Coq uses SerAPI (“Undo; …; t”) and reconstructs new states post-tactic application.

6. Empirical Results on CoqGym and Comparative Evaluation

Experiments on CoqGym use a split of 123 Coq projects: 43,844 proofs for training, 13,875 for validation, 13,137 for testing. Performance is measured by proof success rate—the percentage of theorems fully proved within 300 tactics and 10 minutes.

Method Success Rate
trivial 2.4%
auto 2.9%
intuition 4.4%
easy 4.9%
hammer (20s) 17.8%
hammer (10 min) 24.8%
ASTactic 12.2%
ASTactic + auto 12.8%
ASTactic + hammer (20s) 23.6%
ASTactic + hammer (10 min) 30.0%

Combining ASTactic with “hammer” results in a new state-of-the-art 30.0% proof success rate (vs. 24.8% for hammer alone). Beam width controls a trade-off between computational time and coverage: width 20 yields 12.2% success at approximately 3.3 seconds per proof. Generated proofs are relatively short (6.0 steps on average vs. 12.5 for humans), and the number of tactics tried per proof is much lower than prior automaton-based systems (200 vs. 10,000 for SEPIA).

7. Strengths, Limitations, and Prospects

Strengths:

  • Learns to synthesize in-vocabulary tactics with contextually valid arguments, contrasting with fixed-vocabulary or retrieval techniques.
  • Employs semantic constraints to drastically reduce argument search complexity.
  • Complements external automated theorem provers (“hammers”), providing a clear additive gain in proof success.
  • Proof search is efficient, requiring fewer calls to Coq per proof.

Limitations:

  • The tactic grammar is a hand-pruned subset of full Ltac; complex compound tactics (e.g., P(tS)P(t\mid S)2), repetition, and custom tactics are excluded.
  • The encoder only attends to a maximum of 10 premises, potentially limiting effectiveness; more comprehensive premise selection remains open.
  • Proofs are generated stepwise using a Markovian GRU, making long-range proof planning challenging.

Potential Extensions:

  • Extending coverage to the full Ltac language, including compound tactics and repetition.
  • Use of end-to-end reinforcement learning, treating ASTactic as a policy to improve proof-space exploration.
  • Explicit modeling of premise selection, potentially with learned attention over entire libraries.
  • Transfer to other proof assistants, such as Isabelle or HOL Light.

ASTactic exemplifies an overview of neural program generation and symbolic proof search, offering a data-driven framework for interactive theorem proving that leverages both syntax and domain semantics (Yang et al., 2019).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to ASTactic Model.