mlsanityData to 7 Oct 2026

Self-Supervised Learning to Prove Equivalence Between Straight-Line Programs via Rewrite Rules

arXiv 2109.10476 ↗First posted 22 Sep 2021cs.LG cs.PLcited by 3

Not on the map. Why?

Abstract (arXiv)

We target the problem of automatically synthesizing proofs of semantic equivalence between two programs made of sequences of statements. We represent programs using abstract syntax trees (AST), where a given set of semantics-preserving rewrite rules can be applied on a specific AST pattern to generate a transformed and semantically equivalent program. In our system, two programs are equivalent if there exists a sequence of application of these rewrite rules that leads to rewriting one program into the other. We propose a neural network architecture based on a transformer model to generate proofs of equivalence between program pairs. The system outputs a sequence of rewrites, and the validity of the sequence is simply checked by verifying it can be applied. If no valid sequence is produced by the neural network, the system reports the programs as non-equivalent, ensuring by design no programs may be incorrectly reported as equivalent. Our system is fully implemented for one single grammar which can represent straight-line programs with function calls and multiple types. To efficiently train the system to generate such sequences, we develop an original incremental training technique, named self-supervised sample selection. We extensively study the effectiveness of this novel training approach on proofs of increasing complexity and length. Our system, S4Eq, achieves 97% proof success on a curated dataset of 10,000 pairs of equivalent programs.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 32 of its 103 references that are in the map. First posted on arXiv 22 Sep 2021.

Builds on

32 of 103 references.

References · 32

  1. 2017Attention Is All You Needcited by 59,932
  2. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  3. 2020Scaling Laws for Neural Language Modelscited by 6,411
  4. 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
  5. 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
  6. 2016Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translationcited by 1,471
  7. 2017Hindsight Experience Replaycited by 1,096
  8. 2016Abstractive Text Summarization Using Sequence-to-Sequence RNNs and Beyondcited by 809
  9. 2013An Empirical Investigation of Catastrophic Forgetting in Gradient-Based Neural Networkscited by 711
  10. 2020Generative Language Modeling for Automated Theorem Provingcited by 379
  11. 2019Deep Learning for Symbolic Mathematicscited by 266
  12. 2017OpenNMT: Open-source Toolkit for Neural Machine Translationcited by 251
20 more
  1. 2018code2vec: Learning Distributed Representations of Codecited by 249
  2. 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 220
  3. 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 144
  4. 2018An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translationcited by 106
  5. 2021Self-Supervised Bug Detection and Repaircited by 59
  6. 2019Graph Representations for Higher-Order Logic and Theorem Provingcited by 55
  7. 2021Neural Program Repair with Execution-based Backpropagationcited by 50
  8. 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
  9. 2020On the Generalizability of Neural Program Models with respect to Semantic-Preserving Program Transformationscited by 41
  10. 2019DIRE: A Neural Approach to Decompiled Identifier Namingcited by 36
  11. 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Codecited by 36
  12. 2017An Empirical Evaluation of Rule Extraction from Recurrent Neural Networkscited by 21
  13. 2021Generating Bug-Fixes Using Pretrained Transformerscited by 18
  14. 2018Context2Name: A Deep Learning-Based Approach to Infer Natural Variable Names from Usage Contextscited by 11
  15. 2019Learning dynamic polynomial proofscited by 8
  16. 2021Recognizing and Verifying Mathematical Equations using Multiplicative Differential Neural Unitscited by 8
  17. 2020Incremental Unsupervised Domain-Adversarial Training of Neural Networkscited by 7
  18. 2020Equivalence of Dataflow Graphs via Rewrite Rules Using a Graph-to-Sequence Neural Modelcited by 3
  19. 2020Program Equivalence for Assisted Grading of Functional Programs (Extended Version)cited by 2
  20. 2021Proving Equivalence Between Complex Expressions Using Graph-to-Sequence Neural Modelscited by 2

Built on by

Cited by year

Citing papers per year: 2024: 2; 2025: 1.

3 papers.