Abstract
Augmented Backus-Naur Form (ABNF) is a standardized formal grammar notation used in several Internet syntax specifications. This paper describes (i) a formalization of the syntax and semantics of the ABNF notation and (ii) a verified parser that turns ABNF grammar text into a formal representation usable in declarative specifications of correct parsing of ABNF-specified languages. This work has been developed in the ACL2 theorem prover.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
The meta circularity of the definition of the concrete syntax of ABNF in ABNF is broken by the human in the loop, who defines an abstract syntax of ABNF in ACL2.
- 2.
Future work includes exploring mechanisms to “plug” such external predicates into the ABNF semantics.
- 3.
Future work includes exploring the formulation of an unambiguous ABNF grammar of ABNF that provably defines the same language as the current ambiguous one.
- 4.
References
Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools, 2nd edn. Pearson, London (2007)
Avigad, J., Zach, R.: The epsilon calculus. In: Zalta, E.N. (ed.) The Stanford Encyclopedia of Philosophy, summer 2016 edn. Metaphysics Research Lab, Stanford University (2016). https://plato.stanford.edu/archives/sum2016/entries/epsilon-calculus/
Backus, J.W., et al.: Report on the algorithmic language ALGOL 60. Commun. ACM 3(5), 299–314 (1960)
Barthwal, A.: A formalisation of the theory of context-free languages in higher-order logic. Ph.D. thesis. The Australian National University (2010)
Barthwal, A., Norrish, M.: Verified, executable parsing. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 160–174. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-00590-9_12
Berners-Lee, T., Fielding, R., Masinter, L.: Uniform Resource Identifier (URI): Generic syntax. Request for Comments (RFC) 3986, January 2005
Boyer, R.S., Moore, J.S.: A Computational Logic. Academic Press, Cambridge (1979)
Bray, T.: The JavaScript Object Notation (JSON) data interchange format. Request for Comments (RFC) 7159, March 2014
Crocker, D., Overell, P.: Augmented BNF for syntax specifications: ABNF. Request for Comments (RFC) 5234, January 2008
Doczkal, C., Kaiser, J.-O., Smolka, G.: A constructive theory of regular languages in Coq. In: Gonthier, G., Norrish, M. (eds.) CPP 2013. LNCS, vol. 8307, pp. 82–97. Springer, Cham (2013). https://doi.org/10.1007/978-3-319-03545-1_6
Fielding, R., Reschke, J.: Hypertext Transfer Protocol (HTTP/1.1): Message syntax and routing. Request for Comments (RFC) 7230, June 2014
Gross, J.S.: An extensible framework for synthesizing efficient, verified parsers. Master’s thesis. Massachusetts Institute of Technology (2015)
Jourdan, J.-H., Pottier, F., Leroy, X.: Validating LR(1) parsers. In: Seidl, H. (ed.) ESOP 2012. LNCS, vol. 7211, pp. 397–416. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-28869-2_20
Kaufmann, M., Moore, J.S.: The ACL2 theorem prover: Web page. http://www.cs.utexas.edu/users/moore/acl2
Kaufmann, M., Moore, J.S.: A precise description of the ACL2 logic. Technical report. Department of Computer Sciences, University of Texas at Austin (1998)
Koprowski, A., Binsztok, H.: TRX: a formally verified parser interpreter. Log. Methods Comput. Sci. 7(2), 1–26 (2011)
Kumar, R., Myreen, M.O., Norrish, M., Owens, S.: CakeML: a verified implementation of ML. In: Proceedings of 41st ACM SIGPLAN Symposium on Principles of Programming Languages, POPL, pp. 179–191 (2014)
Kyzivat, P.: Case-sensitive string support in ABNF. Request for Comments (RFC) 7405, December 2014
Linhart, C., Klein, A., Heled, R., Orrin, S.: HTTP request smuggling. White paper, Watchfire (2005)
Nipkow, T.: Verified lexical analysis. In: Proceedings of 11th International Conference on Theorem Proving in Higher-Order Logics, TPHOL, pp. 1–15 (1998)
Parr, T., Fisher, K.: LL(*): the foundation of the ANTLR parser generator. In: Proceedings of 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI, pp. 425–436 (2011)
Ridge, T.: Simple, efficient, sound and complete combinator parsing for all context-free grammars, using an Oracle. In: Combemale, B., Pearce, D.J., Barais, O., Vinju, J.J. (eds.) SLE 2014. LNCS, vol. 8706, pp. 261–281. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-11245-9_15
Swords, S., Davis, J.: Fix your types. In: Proceedings of 13th International Workshop on the ACL2 Theorem Prover and Its Applications (2015)
The ACL2 Community: The ACL2 theorem prover and community books: Source code. http://github.com/acl2/acl2
The ACL2 Community: The ACL2 theorem prover and community books: User manual. http://www.cs.utexas.edu/~moore/acl2/manuals/current/manual
Thomas, L.D.: APG: ABNF Parser Generator. http://www.coasttocoastresearch.com
Wisnesky, R., Malecha, G., Morrisett, G.: Certified web services in Ynot. In: Proceedings of 5th International Workshop on Automated Specification and Verification of Web Systems, WWV, pp. 5–19 (2009)
Acknowledgements
This work was supported by DARPA under Contract No. FA8750-15-C-0007.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Switzerland AG
About this paper
Cite this paper
Coglio, A. (2018). A Formalization of the ABNF Notation and a Verified Parser of ABNF Grammars. In: Piskac, R., Rümmer, P. (eds) Verified Software. Theories, Tools, and Experiments. VSTTE 2018. Lecture Notes in Computer Science(), vol 11294. Springer, Cham. https://doi.org/10.1007/978-3-030-03592-1_10
Download citation
DOI: https://doi.org/10.1007/978-3-030-03592-1_10
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-03591-4
Online ISBN: 978-3-030-03592-1
eBook Packages: Computer ScienceComputer Science (R0)