Abstract
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.
Work partially supported by MIUR project PRIN 2010LYA9RH-006.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
This less usual but equivalent definition of axioms as a set has been adopted for parenthesis languages [19] and other input-driven languages; we chose it for this paper to simplify some notations and constructions.
- 2.
An example language that cannot be generated with an \(\doteq \)-acyclic OPM is the following: \(\mathcal {L} = \{a^n {(b c)}^n \mid n\ge 0\} \cup \{b^n {(c a)}^n \mid n\ge 0\} \cup \{c^n (a b)^n \mid n\ge 0\} \).
- 3.
The grammars presented here have been produced by the Flup tool (the whole package, which includes various utilities for the general class of OPLs, is available at [1]). In the future we plan to couple Flup with an additional tool that minimizes the original grammar by applying the classical procedure introduced in [19].
References
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)
Alur, R., Madhusudan, P.: Adding nesting structure to words. J. ACM 56(3), 1–43 (2009)
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)
Brainerd, W.S.: The minimization of tree automata. Inf. Control 13(5), 484–491 (1968)
Crespi Reghizzi, S., Guida, G., Mandrioli, D.: Noncounting context-free languages. J. ACM 25, 571–580 (1978)
Crespi Reghizzi, S., Mandrioli, D.: A class of grammars generating non-counting languages. Inf. Process. Lett. 7(1), 24–26 (1978)
Crespi Reghizzi, S., Mandrioli, D.: Operator precedence and the visibly pushdown property. J. Comput. Syst. Sci. 78(6), 1837–1867 (2012)
Crespi Reghizzi, S., Mandrioli, D., Martin, D.F.: Algebraic properties of operator precedence languages. Inf. Control 37(2), 115–133 (1978)
Crespi Reghizzi, S., Melkanoff, M.A., Lichten, L.: The use of grammatical inference for designing programming languages. Commun. ACM 16(2), 83–90 (1973)
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). http://dx.doi.org/10.1007/s10462-010-9199-1
Fischer, M.J.: Some properties of precedence languages. In: STOC 1969, pp. 181–190 (1969)
Grune, D., Jacobs, C.J.: Parsing Techniques: A Practical Guide. Springer, New York (2008)
de la Higuera, C.: Grammatical Inference: Learning Automata and Grammars. Cambridge University Press, New York (2010)
Kamp, H.: Tense logic and the theory of linear order. Ph.D. thesis. University of California, Los Angeles (1968)
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)
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)
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)
McNaughton, R.: Parenthesis grammars. J. ACM 14(3), 490–500 (1967)
McNaughton, R., Papert, S.: Counter-Free Automata. MIT Press, Cambridge (1971)
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)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Lonati, V., Mandrioli, D., Panella, F., Pradella, M. (2015). First-Order Logic Definability of Free Languages. In: Beklemishev, L., Musatov, D. (eds) Computer Science -- Theory and Applications. CSR 2015. Lecture Notes in Computer Science(), vol 9139. Springer, Cham. https://doi.org/10.1007/978-3-319-20297-6_20
Download citation
DOI: https://doi.org/10.1007/978-3-319-20297-6_20
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-20296-9
Online ISBN: 978-3-319-20297-6
eBook Packages: Computer ScienceComputer Science (R0)