Exercise Generation on Language Specification

  • J. João AlmeidaEmail author
  • Eliana Grande
  • Georgi Smirnov
Conference paper
Part of the Advances in Intelligent Systems and Computing book series (AISC, volume 569)


Exercise generation on language specification is a challenging problem, because of the richness of the objects in the domain. In this paper we discuss Mgbeg (Meta-Grammar-Based Exercise Generator) – a toolkit for exercise generation on context-free languages. Mgbeg approach is based on a meta-grammar formalism and tool, used to define a set of similar exercises. Mgbeg is simple attributed grammar used to describe the set of valid exercise (and randomly generate one of them). Each exercise typically contains several attributes calculated during the generation steps: namely, one or more formal specification of the language (context free grammar); the exercise statement; other information such as examples, common mistakes, validation data, to be used in the construction of the exercise statement, solution, and assessment steps. Complementary the toolkit provides a grammar module, with functionality for grammar comparison, sentence generation and recognition; a template engine (to help in textual attributes calculation).



The work of Eliana Grande was supported by PIQ IF Goiano through the fellowship no. 02/2013. The work of J.J. Almeida was supported by COMPETE: POCI-01-0145-FEDER-007043 and FCT – Fundação para a Ciência e Tecnologia within the Project Scope: UID/CEC/00319/2013.


  1. 1.
    Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley Longman Publishing Co., Inc., Boston (1986)zbMATHGoogle Scholar
  2. 2.
    Almeida, J., Araújo, I., Brito, I., Carvalho, N., Machado, G.J., Pereira, R.M., Smirnov, G.: Math exercise generation and smart assessment. In: Workshop of TICAMES (Information and Communication Technology in Higher Education: Learning Mathematics), CISTI-2013, pp. 1014–1019 (2013)Google Scholar
  3. 3.
    Almeida, J.J., Grande, E., Smirnov, G.: Context-free grammars: exercise generation and probabilistic assessment. In: 5th Symposium on Languages, Applications and Technologies (SLATE 2016), OpenAccess Series in Informatics (OASIcs), vol. 51, pp. 1–8. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2016)Google Scholar
  4. 4.
    Cousot, P., Cousot, R.: Grammar analysis and parsing by abstract interpretation. In: Reps, T., Sagiv, M., Bauer, J. (eds.) Program Analysis and Compilation, Theory and Practice. LNCS, vol. 4444, pp. 175–200. Springer, Heidelberg (2007). doi: 10.1007/978-3-540-71322-7_9 CrossRefGoogle Scholar
  5. 5.
    Donnelly, C., Stallman, R.: Bison: the YACC-compatible parser generator. Technical report, GNU (2004)Google Scholar
  6. 6.
    Eisenbach, A.: phpSyntaxTree - drawing syntax trees made easy, Tool page (2015).
  7. 7.
    Hasebe, Y.: RSyntaxTree - yet another syntax tree generator made with ruby and RMagick, Tool page (2016).
  8. 8.
    Jackson, Q.T.: Disambiguation as a quantifiable computational process. Technical report 3 (2000).
  9. 9.
    José Neto, J.: Introdução à compilação. Livros Técnicos e Científicos, Rio de Janeiro (2016)Google Scholar
  10. 10.
    Salomaa, A.: Formal Languages. Academic Press, New York (1973)zbMATHGoogle Scholar
  11. 11.
    Salomaa, A., Soittola, M.: Automata-Theoretic Aspects of Formal Power Series. Springer, New York (1978)CrossRefzbMATHGoogle Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  • J. João Almeida
    • 1
    Email author
  • Eliana Grande
    • 2
  • Georgi Smirnov
    • 2
  1. 1.Department of Informatics, AlgoritmiUniversidade Do MinhoBragaPortugal
  2. 2.Department of Math and ApplicationsUniversidade Do MinhoBragaPortugal

Personalised recommendations