LR(K) Parser Construction Using Bottom-Up Formal Analysis

Design and construction of an error-free compiler is a difficult and challenging process. The main functionality of a compiler is to translate a source code to an executable machine code correctly and efficiently. In formal verification of software, semantics of a language has more meanings than the syntax. It means source program verification does not give guarantee the generated code is correct. This is because the compiler may lead to an incorrect target program due to bugs in itself. It means verification of a compiler is much more important than verification of a source program. In this paper, we present a new approach by linking context-free grammar and Z notation to construct LR(K) parser. This has several advantages because correctness of the compiler depends on describing rules that must be written in formal languages. First, we have defined grammar then language derivation procedure is given using right-most derivations. Verification of a given language is done by recursive procedures based on the words. Ambiguity of a language is checked and verified. The specification is analyzed and validated using Z/Eves tool. Formal proofs are presented using powerful techniques of reduction and rewriting available in Z/Eves.

[1]  Jonathan P. Bowen,et al.  Introduction to Formal Methods , 2006 .

[2]  Joël Ouaknine,et al.  State/Event-Based Software Model Checking , 2004, IFM.

[3]  伊藤 正美 Algebraic theory of automata and languages , 2004 .

[4]  John Derrick,et al.  Structural Refinement in Object-Z/CSP , 2000, IFM.

[5]  Jeanine Souquières,et al.  Integration of UML and B specification techniques: systematic transformation from OCL expressions into B , 2002, Ninth Asia-Pacific Software Engineering Conference, 2002..

[6]  Nazir Ahmad Zafar,et al.  Formal Parsing Analysis of Context-Free Grammar using Left Most Derivations , 2011, ICSEA 2011.

[7]  Tuan D. Pham Computing with words in formal methods , 2000, Int. J. Intell. Syst..

[8]  Raymond T. Boute,et al.  Integrating Formal Methods by Unifying Abstractions , 2004, IFM.

[9]  Jim Woodcock,et al.  Verifying the CICS File Control API with Z/Eves: An Experiment in the Verified Software Repository , 2007, 12th IEEE International Conference on Engineering Complex Computer Systems (ICECCS 2007).

[10]  Alan Bundy,et al.  Constructing Induction Rules for Deductive Synthesis Proofs , 2006, CLASE.

[11]  W. Wechler The concept of fuzziness in automata and language theory , 1978 .

[12]  Monika Heiner,et al.  Modeling Safety-Critical Systems with Z and Petri Nets , 1999, SAFECOMP.

[13]  Jin Song Dong,et al.  Integrating Object-Z with timed automata , 2005, 10th IEEE International Conference on Engineering of Complex Computer Systems (ICECCS'05).

[14]  Christian Lindig,et al.  Random testing of C calling conventions , 2005, AADEBUG'05.

[15]  Chris Verhoef,et al.  Generation of components for software renovation factories from context-free grammars , 1997, Proceedings of the Fourth Working Conference on Reverse Engineering.

[16]  M. Balakrishna,et al.  Automatic creation and tuning of context free grammars for interactive voice response systems , 2005, 2005 International Conference on Natural Language Processing and Knowledge Engineering.

[17]  Masami Ito,et al.  Algebraic Theory of Automata & Languages , 2004 .

[18]  Nancy A. Lynch,et al.  The Theory of Timed I/o Automata , 2003 .

[19]  Bill Stoddart,et al.  Integrated Formal Methods , 2001, Lecture Notes in Computer Science.

[20]  Jeannette M. Wing A specifier's introduction to formal methods , 1990, Computer.

[21]  K. Peeva Fuzzy automata and languages: theory and applications , 2004 .

[22]  Jin Song Dong,et al.  Blending Object-Z and Timed CSP: an introduction to TCOZ , 1998, Proceedings of the 20th International Conference on Software Engineering.

[23]  Robert L. Constable,et al.  Constructively formalizing automata theory , 2000, Proof, Language, and Interaction.

[24]  C. J. Burgess The Role of Formal Methods in Software Engineering Education and Industry , 1995 .

[25]  Marc Frappier,et al.  Synthesizing B Specifications from EB3 Attribute Definitions , 2005, IFM.

[26]  Anthony Hall Correctness by Construction: Integrating Formality into a Commercial Development Process , 2002, FME.

[27]  Daniel Jackson,et al.  Alcoa: the Alloy constraint analyzer , 2000, Proceedings of the 2000 International Conference on Software Engineering. ICSE 2000 the New Millennium.

[28]  Uwe Nestmann,et al.  A formal semantics for protocol narrations , 2005, Theor. Comput. Sci..

[29]  Jeanine Souquières,et al.  Integration of UML Views using B Notation , 2002 .

[30]  Samuel Skulsky A Theory of Time , 1938, Philosophy of Science.

[31]  John W. Lockwood,et al.  Context-Free-Grammar based Token Tagger in Reconfigurable Devices , 2006, ICDE Workshops.

[32]  J. Michael Spivey,et al.  The Z notation - a reference manual , 1992, Prentice Hall International Series in Computer Science.

[33]  Jonathan P. Bowen,et al.  Formalization of software testing criteria using the Z notation , 2001, 25th Annual International Computer Software and Applications Conference. COMPSAC 2001.

[34]  Uwe Nestmann,et al.  A formal semantics for protocol narrations , 2007, Theor. Comput. Sci..

[35]  Sofiène Tahar,et al.  Formalization of Cadence SPW Fixed-Point Arithmetic in HOL , 2002, IFM.

[36]  Wang Yi,et al.  Timed Patterns: TCOZ to Timed Automata , 2004, ICFEM.

[37]  James A. Anderson Automata theory with modern applications , 2006 .

[38]  Tuan D. Pham,et al.  Computing with words in formal methods , 2000, Int. J. Intell. Syst..

[39]  Hassan Reza,et al.  A Formal Specification of a Programming Language: Design of Pit , 2006, Second International Symposium on Leveraging Applications of Formal Methods, Verification and Validation (isola 2006).

[40]  David Aspinall,et al.  Optimisation Validation , 2007, COCV@ETAPS.

[41]  D. J. Creasey,et al.  The importance of formal specification in the design of hardware systems , 1994 .

[42]  Sofiène Tahar,et al.  Verification of Probabilistic Properties in HOL Using the Cumulative Distribution Function , 2007, IFM.