Defining Contexts in Context-Free Grammars

  • Mikhail Barash
  • Alexander Okhotin
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7183)

Abstract

Conjunctive grammars (Okhotin, 2001) are an extension of the standard context-free grammars with a conjunction operation, which maintains most of their practical properties, including many parsing algorithms. This paper introduces a further extension to the model, which is equipped with quantifiers for referring to the left context, in which the substring being defined does occur. For example, a rule \(A \rightarrow a \& \triangleleft{B}\) defines a string a, as long as it is preceded by any string defined by B. The paper gives two equivalent definitions of the model—by logical deduction and by language equations—and establishes its basic properties, including a transformation to a normal form, a cubic-time parsing algorithm, and another recognition algorithm working in linear space.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Aizikowitz, T., Kaminski, M.: LR(0) Conjunctive Grammars and Deterministic Synchronized Alternating Pushdown Automata. In: Kulikov, A., Vereshchagin, N. (eds.) CSR 2011. LNCS, vol. 6651, pp. 345–358. Springer, Heidelberg (2011), http://dx.doi.org/10.1007/978-3-642-20712-9_27 CrossRefGoogle Scholar
  2. 2.
    Chomsky, N.: On certain formal properties of grammars. Information and Control 2(2), 137–167 (1959), http://dx.doi.org/10.1016/S0019-9958(59)90362-6MathSciNetCrossRefMATHGoogle Scholar
  3. 3.
    Čulík II, K., Cohen, R.: LR-regular grammars—an extension of LR(k) grammars. Journal of Computer and System Sciences 7(1), 66–96 (1973), http://dx.doi.org/10.1016/S0022-0000(73)80050-9MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    Ésik, Z., Kuich, W.: Boolean fuzzy sets. International Journal of Foundations of Computer Science 18(6), 1197–1207 (2007), http://dx.doi.org/10.1142/S0129054107005248 MathSciNetCrossRefMATHGoogle Scholar
  5. 5.
    Ford, B.: Parsing expression grammars: a recognition-based syntactic foundation. In: Proceedings of POPL 2004, Venice, Italy, January 14-16, pp. 111–122 (2004), http://doi.acm.org/10.1145/964001.964011
  6. 6.
    Ginsburg, S., Rice, H.G.: Two families of languages related to ALGOL. Journal of the ACM 9, 350–371 (1962), http://dx.doi.org/10.1145/321127.321132 MathSciNetCrossRefMATHGoogle Scholar
  7. 7.
    Jeż, A.: Conjunctive grammars can generate non-regular unary languages. International Journal of Foundations of Computer Science 19(3), 597–615 (2008), http://dx.doi.org/10.1142/S012905410800584X MathSciNetCrossRefMATHGoogle Scholar
  8. 8.
    Jeż, A., Okhotin, A.: Conjunctive grammars over a unary alphabet: undecidability and unbounded growth. Theory of Computing Systems 46(1), 27–58 (2010), http://dx.doi.org/10.1007/s00224-008-9139-5 MathSciNetCrossRefMATHGoogle Scholar
  9. 9.
    Jarzabek, S., Krawczyk, T.: LL-regular grammars. Information Processing Letters 4, 31–37 (1975), http://dx.doi.org/10.1016/0020-0190(75)90009-5MathSciNetCrossRefMATHGoogle Scholar
  10. 10.
    Kountouriotis, V., Nomikos, C., Rondogiannis, P.: Well-founded semantics for Boolean grammars. Information and Computation 207(9), 945–967 (2009), http://dx.doi.org/10.1016/j.ic.2009.05.002 MathSciNetCrossRefMATHGoogle Scholar
  11. 11.
    Okhotin, A.: Conjunctive grammars. Journal of Automata, Languages and Combinatorics 6(4), 519–535 (2001)MathSciNetMATHGoogle Scholar
  12. 12.
    Okhotin, A.: Conjunctive grammars and systems of language equations. Programming and Computer Science 28(5), 243–249 (2002), http://dx.doi.org/10.1023/A:1020213411126 MathSciNetCrossRefMATHGoogle Scholar
  13. 13.
    Okhotin, A.: Boolean grammars. Information and Computation 194(1), 19–48 (2004), http://dx.doi.org/10.1016/j.ic.2004.03.006 MathSciNetCrossRefMATHGoogle Scholar
  14. 14.
    Okhotin, A.: The dual of concatenation. Theoretical Computer Science 345(2-3), 425–447 (2005), http://dx.doi.org/10.1016/j.tcs.2005.07.019 MathSciNetCrossRefMATHGoogle Scholar
  15. 15.
    Okhotin, A.: Generalized LR parsing algorithm for Boolean grammars. International Journal of Foundations of Computer Science 17(3), 629–664 (2006), http://dx.doi.org/10.1142/S0129054106004029 MathSciNetCrossRefMATHGoogle Scholar
  16. 16.
    Okhotin, A.: Recursive descent parsing for Boolean grammars. Acta Informatica 44(3-4), 167–189 (2007), http://dx.doi.org/10.1007/s00236-007-0045-0 MathSciNetCrossRefMATHGoogle Scholar
  17. 17.
    Okhotin, A.: Fast Parsing for Boolean Grammars: A Generalization of Valiant’s Algorithm. In: Gao, Y., Lu, H., Seki, S., Yu, S. (eds.) DLT 2010. LNCS, vol. 6224, pp. 340–351. Springer, Heidelberg (2010), http://dx.doi.org/10.1007/978-3-642-14455-4_31 CrossRefGoogle Scholar
  18. 18.
    Okhotin, A., Reitwießner, C.: Conjunctive grammars with restricted disjunction. Theoretical Computer Science 411(26-28), 2559–2571 (2010), http://dx.doi.org/10.1016/j.tcs.2010.03.015 MathSciNetCrossRefMATHGoogle Scholar
  19. 19.
    Parr, T., Fisher, K.: LL(*): the foundation of the ANTLR parser generator. In: Programming Language Design and Implementation, PLDI 2011, San Jose, USA, June 4-8, pp. 425–436 (2011), http://dx.doi.org/10.1145/1993316.1993548
  20. 20.
    Sikkel, K.: Parsing Schemata. Springer, Heidelberg (1997)CrossRefMATHGoogle Scholar
  21. 21.
    Valiant, L.G.: General context-free recognition in less than cubic time. Journal of Computer and System Sciences 10(2), 308–314 (1975), http://dx.doi.org/10.1016/S0022-0000(75)80046-8 MathSciNetCrossRefMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Mikhail Barash
    • 1
    • 2
  • Alexander Okhotin
    • 1
  1. 1.Department of MathematicsUniversity of TurkuTurkuFinland
  2. 2.Turku Centre for Computer ScienceTurkuFinland

Personalised recommendations