First-Order Logic Definability of Free Languages

  • Violetta Lonati
  • Dino Mandrioli
  • Federica Panella
  • Matteo Pradella
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9139)


Operator Precedence Grammars (OPGs) define a deterministic class of context-free languages, which extend input-driven languages and still enjoy many properties: they are closed w.r.t. Boolean operations, concatenation and Kleene star; the emptiness problem is decidable; they are recognized by a suitable model of pushdown automaton; they can be characterized in terms of a monadic second-order logic. Also, they admit efficient parallel parsing.

In this paper we introduce a subclass of OPGs, namely Free Grammars (FrGs); we prove some of its basic properties, and that, for each such grammar G, a first-order logic formula \(\psi \) can effectively be built so that L(G) is the set of all and only strings satisfying \(\psi \).

FrGs were originally introduced for grammatical inference of programming languages. Our result can naturally boost their applicability; to this end, a tool is made freely available for the semiautomatic construction of FrGs.


  1. 1.
  2. 2.
    Alur, R., Arenas, M., Barceló, P., Etessami, K., Immerman, N., Libkin, L.: First-order and temporal logics for nested words. Log. Methods Comput. Sci. 4(4), 1–14 (2008)CrossRefGoogle Scholar
  3. 3.
    Alur, R., Madhusudan, P.: Adding nesting structure to words. J. ACM 56(3), 1–43 (2009)MathSciNetCrossRefGoogle Scholar
  4. 4.
    Barenghi, A., Crespi Reghizzi, S., Mandrioli, D., Panella, F., Pradella, M.: The PAPAGENO parallel-parser generator. In: Cohen, A. (ed.) CC 2014 (ETAPS). LNCS, vol. 8409, pp. 192–196. Springer, Heidelberg (2014) CrossRefGoogle Scholar
  5. 5.
    Brainerd, W.S.: The minimization of tree automata. Inf. Control 13(5), 484–491 (1968)MATHMathSciNetCrossRefGoogle Scholar
  6. 6.
    Crespi Reghizzi, S., Guida, G., Mandrioli, D.: Noncounting context-free languages. J. ACM 25, 571–580 (1978)MATHMathSciNetCrossRefGoogle Scholar
  7. 7.
    Crespi Reghizzi, S., Mandrioli, D.: A class of grammars generating non-counting languages. Inf. Process. Lett. 7(1), 24–26 (1978)MathSciNetCrossRefGoogle Scholar
  8. 8.
    Crespi Reghizzi, S., Mandrioli, D.: Operator precedence and the visibly pushdown property. J. Comput. Syst. Sci. 78(6), 1837–1867 (2012)MATHMathSciNetCrossRefGoogle Scholar
  9. 9.
    Crespi Reghizzi, S., Mandrioli, D., Martin, D.F.: Algebraic properties of operator precedence languages. Inf. Control 37(2), 115–133 (1978)MATHMathSciNetCrossRefGoogle Scholar
  10. 10.
    Crespi Reghizzi, S., Melkanoff, M.A., Lichten, L.: The use of grammatical inference for designing programming languages. Commun. ACM 16(2), 83–90 (1973)MATHMathSciNetCrossRefGoogle Scholar
  11. 11.
    D’Ulizia, A., Ferri, F., Grifoni, P.: A survey of grammatical inference methods for natural language learning. Artif. Intell. Rev. 36(1), 1–27 (2011). CrossRefGoogle Scholar
  12. 12.
    Fischer, M.J.: Some properties of precedence languages. In: STOC 1969, pp. 181–190 (1969)Google Scholar
  13. 13.
    Grune, D., Jacobs, C.J.: Parsing Techniques: A Practical Guide. Springer, New York (2008)Google Scholar
  14. 14.
    de la Higuera, C.: Grammatical Inference: Learning Automata and Grammars. Cambridge University Press, New York (2010)Google Scholar
  15. 15.
    Kamp, H.: Tense logic and the theory of linear order. Ph.D. thesis. University of California, Los Angeles (1968)Google Scholar
  16. 16.
    Lautemann, C., Schwentick, T., Thérien, D.: Logics for context-free languages. In: Pacholski, L., Tiuryn, J. (eds.) CSL 1994. LNCS, vol. 933, pp. 205–216. Springer, Heidelberg (1995) CrossRefGoogle Scholar
  17. 17.
    Lonati, V., Mandrioli, D., Pradella, M.: Precedence automata and languages. In: Kulikov, A., Vereshchagin, N. (eds.) CSR 2011. LNCS, vol. 6651, pp. 291–304. Springer, Heidelberg (2011) CrossRefGoogle Scholar
  18. 18.
    Lonati, V., Mandrioli, D., Pradella, M.: Logic characterization of invisibly structured languages: the case of floyd languages. In: van Emde Boas, P., Groen, F.C.A., Italiano, G.F., Nawrocki, J., Sack, H. (eds.) SOFSEM 2013. LNCS, vol. 7741, pp. 307–318. Springer, Heidelberg (2013) CrossRefGoogle Scholar
  19. 19.
    McNaughton, R.: Parenthesis grammars. J. ACM 14(3), 490–500 (1967)MATHMathSciNetCrossRefGoogle Scholar
  20. 20.
    McNaughton, R., Papert, S.: Counter-Free Automata. MIT Press, Cambridge (1971) MATHGoogle Scholar
  21. 21.
    Panella, F., Pradella, M., Lonati, V., Mandrioli, D.: Operator precedence \(\omega \)-languages. In: Béal, M.-P., Carton, O. (eds.) DLT 2013. LNCS, vol. 7907, pp. 396–408. Springer, Heidelberg (2013) CrossRefGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  • Violetta Lonati
    • 1
  • Dino Mandrioli
    • 2
  • Federica Panella
    • 2
  • Matteo Pradella
    • 2
  1. 1.DI - Università Degli Studi di MilanoMilanItaly
  2. 2.DEIB - Politecnico di MilanoMilanItaly

Personalised recommendations