Skip to main content

Automatic Evaluation of Context-Free Grammars (System Description)

  • Conference paper
Rewriting and Typed Lambda Calculi (RTA 2014, TLCA 2014)

Abstract

We implement an online judge for context-free grammars. Our system contains a list of problems describing formal languages, and asking for grammars generating them. A submitted proposal grammar receives a verdict of acceptance or rejection depending on whether the judge determines that it is equivalent to the reference solution grammar provided by the problem setter. Since equivalence of context-free grammars is an undecidable problem, we consider a maximum length ℓ and only test equivalence of the generated languages up to words of length ℓ. This length restriction is very often sufficient for the well-meant submissions. Since this restricted problem is still NP-complete, we design and implement methods based on hashing, SAT, and automata that perform well in practice.

The authors were supported by an FPU grant (first author) and the FORMALISM project (TIN2007-66523) from the Spanish Ministry of Education and Science.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Agarwal, A.: edX (2012), https://www.edx.org

  2. Alexandrova, S., Balandin, A., Compeau, P., Kladov, A., Rayko, M., Sosa, E., Vyahhi, N., Dvorkin, M.: Rosalind (2012), http://www.rosalind.info

  3. Axelsson, R., Heljanko, K., Lange, M.: Analyzing context-free grammars using an incremental SAT solver. In: Aceto, L., Damgård, I., Goldberg, L.A., Halldórsson, M.M., Ingólfsdóttir, A., Walukiewicz, I. (eds.) ICALP 2008, Part II. LNCS, vol. 5126, pp. 410–422. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  4. Biere, A.: PicoSAT essentials. Journal on Satisfiability, Boolean Modeling and Computation 4(2-4), 75–97 (2008)

    MATH  Google Scholar 

  5. Eén, N., Sörensson, N.: An extensible SAT-solver. In: Giunchiglia, E., Tacchella, A. (eds.) SAT 2003. LNCS, vol. 2919, pp. 502–518. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  6. Ganesh, V., Kieżun, A., Artzi, S., Guo, P.J., Hooimeijer, P., Ernst, M.: HAMPI: A string solver for testing, analysis and vulnerability detection. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 1–19. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  7. García, C., Revilla, M.A.: UVa online judge (1997), http://uva.onlinejudge.org

  8. Hooker, J.N.: Solving the incremental satisfiability problem. Journal of Logic Programming 15(1&2), 177–186 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  9. Hopcroft, J.E., Motwani, R., Ullman, J.D.: Introduction to Automata Theory, Languages, and Computation, 3rd edn. Addison-Wesley (2006)

    Google Scholar 

  10. Khan, S.: Khan Academy (2006), https://www.khanacademy.org

  11. Knuth, D.E.: The Art of Computer Programming, vol. III: Sorting and Searching. Addison-Wesley (1973)

    Google Scholar 

  12. Moskewicz, M.W., Madigan, C.F., Zhao, Y., Zhang, L., Malik, S.: Chaff: Engineering an efficient SAT solver. In: Annual ACM IEEE Design Automation Conference, pp. 530–535. ACM (2001)

    Google Scholar 

  13. Ng, A., Koller, D.: Coursera (2012), https://www.coursera.org

  14. Petit, J., Giménez, O., Roura, S.: Jutge.org: an educational programming judge. In: ACM Special Interest Group on Computer Science Education, pp. 445–450 (2012)

    Google Scholar 

  15. Thrun, S., Stavens, D., Sokolsky, M.: Udacity (2012), https://www.udacity.com

  16. Whittemore, J., Kim, J., Sakallah, K.A.: SATIRE: A new incremental satisfiability engine. In: Design Automation Conference, pp. 542–545 (2001)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Creus, C., Godoy, G. (2014). Automatic Evaluation of Context-Free Grammars (System Description). In: Dowek, G. (eds) Rewriting and Typed Lambda Calculi. RTA TLCA 2014 2014. Lecture Notes in Computer Science, vol 8560. Springer, Cham. https://doi.org/10.1007/978-3-319-08918-8_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-08918-8_10

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-08917-1

  • Online ISBN: 978-3-319-08918-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics