Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Reports, Documentation, and Standards
  4. Towards Automating Grammar Equivalence Checking
 
report

Towards Automating Grammar Equivalence Checking

Kandhadai Madhavan, Ravichandhran  
•
Mayer, Mikael  
•
Gulwani, Sumit
Show more
2015

We consider from practical perspective the (generally undecidable) problem of checking equivalence of context-free grammars. We present both techniques for proving equivalence, as well as techniques for finding counter-examples that establish non-equivalence. Among the key building blocks of our approach is a novel algorithm for efficiently enumerating and sampling words and parse trees from arbitrary context-free grammars; the algorithm supports polynomial time random access to words belonging to the grammar. Furthermore, we propose an algorithm for proving equivalence of context-free grammars that is complete for LL grammars, yet can be invoked on any context-free grammar, including ambiguous grammars. Our techniques successfully find discrepancies between different syntax specifications of several real-world languages, and is capable of detecting fine-grained incremental modifications performed on grammars. Our evaluation shows that our tool improves significantly on the existing available state of the art tools. In addition, we used these algorithms to develop an online tutoring system for grammars that we then used in an undergraduate course on computer language processing. On questions involving grammar constructions, our system was able to automatically evaluate the correctness of 95% equivalence questions: it disproved 74% of cases and proved 21% of them. This opens up the possibility of using our tool in massive open online courses to introduce grammars to large populations of students.

  • Files
  • Details
  • Metrics
Type
report
Author(s)
Kandhadai Madhavan, Ravichandhran  
Mayer, Mikael  
Gulwani, Sumit
Kuncak, Viktor  orcid-logo
Date Issued

2015

Total of pages

15

Subjects

Context-free Grammar

•

Equivalence

•

Enumeration

•

Compilation

•

Verification

Written at

EPFL

EPFL units
LARA  
Available on Infoscience
March 26, 2015
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/112754
Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés