Abstract
An interpreter for an imperative programming language called Minila has been formally specified in CafeOBJ, an executable specification language, and so have a virtually machine (VM) and a compiler. The compiler transforms a Minila program into an instruction sequence processed by the VM. Since the formal specifications are executable, it is doable to test if for any concrete terminating program p the result of interpreting p is the same as the one of processing by the VM the instruction sequence generated from p by the compiler, where the result is an environment, a variable-value pair collection. The equivalence is called the Minila compiler correctness with respect to p. In addition to test, properties of CafeOBJ specifications can be theorem proved by writing what are called proof scores in CafeOBJ and executing them with CafeOBJ. The Minila compiler correctness for all terminating programs in Minila has been theorem proved.
The research was first conducted by the second author (A2) [1] partially supervised by the third author (A3) when A2 was a Master’s student of JAIST and then reconducted by the first author (A1) [2] supervised by A3 totally independent from A2 when A1 was an internship student of JAIST. The paper is based on the first author’s achievement. This work was partially supported by JSPS KAKENHI Grant Number 26240008.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Minila consists of a minimal essence of procedural programming languages, such as C, and has been used by the third author, et al. for educational purposes (www.jaist.ac.jp/~ogata/lecture/i217/).
- 2.
A set of trans rules could be included in a CafeOBJ specification, but trans rules are not used in this paper.
- 3.
The terminology “proof score” has been coined by Joseph Goguen [5]. The authors suppose that since he was very enthusiastic to music, the terminology came from “music score”.
- 4.
\((\forall y:T2)(\forall z:T3)((\exists x:T1)p(x,y) \Rightarrow q(y,z))\) is equivalent to \((\forall x:T1)(\forall y:T2)(\forall z:T2)(p(x,y) \Rightarrow q(y,z))\).
- 5.
Some descriptions on the proof score are inserted.
- 6.
The slides used are available at http://www.jaist.ac.jp/~kokichi/class/TUW1207+08/.
References
Bao, N.Q.T.: Verifying the correctness of compiler for an imperative programming language. Master’s thesis, School of Information Science, JAIST (2011)
Daudier, D.: Verification of compilers based on algebraic specifications. Technical report, ISAE ENSMA (2017)
Morgan, O.: C compiler validation for embedded targets - qualifying compilers for use in safety-critical projects. A white paper of Solid Sands B.V. (2016)
Diaconescu, R., Futatsugi, K.: CafeOBJ Report - The Language, Proof Techniques, and Methodologies for Object-Oriented Algebraic Specification. AMAST Series in Computing, vol. 6. World Scientific, Singapore (1996)
Goguen, J.A.: Proving and rewriting. In: Kirchner, H., Wechler, W. (eds.) ALP 1990. LNCS, vol. 463, pp. 1–24. Springer, Heidelberg (1990). https://doi.org/10.1007/3-540-53162-9_27
Futatsugi, K., Goguen, J.A., Jouannaud, J.P., Meseguer, J.: Principles of OBJ2. In: 12th ACM SIGPLAN-SIGACT POPL, pp. 52–66. ACM (1985)
Ogata, K., Futatsugi, K.: Operational semantics of rewriting with the on-demand evaluation strategy. In: 15th ACM SAC, pp. 756–764. ACM (2000)
Leroy, X.: A formally verified compiler back-end. J. Autom. Reason. 43, 363–446 (2009)
Leroy, X.: Formal verification of a realistic compiler. Commun. ACM 52, 107–115 (2009)
Goguen, J.A., Malcolm, G.: Algebraic Semantics of Imperative Programs. The MIT Press, Cambridge (1996)
Goguen, J.A., Winkler, T., Meseguer, J., Futatsugi, K.: Introducing OBJ. In: Goguen, J., Malcolm, G. (eds.) Software Engineering with OBJ. ADFM, vol. 2, pp. 3–167. Springer, Heidelberg (2000). https://doi.org/10.1007/978-1-4757-6541-0_1
Roşu, G., Şerbănuţă, T.F.: An overview of the K semantic framework. J. Logic Algebraic Program. 79, 397–434 (2010)
Hathhorn, C., Ellison, C., Roşu, G.: Defining the undefinedness of C. In: 36th ACM SIGPLAN PLDI, pp. 336–345. ACM (2015)
Bogdănaş, D., Roşu, G.: K-Java: a complete semantics of Java. In: 42nd ACM SIGPLAN-SIGACT POPL, pp. 445–456. ACM (2015)
Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.: All About Maude - A High-Performance Logical Framework. LNCS, vol. 4350. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71999-1
Jacobs, B., Rutten, J.: An introduction to (co)algebras and (co)induction. In: Advanced Topics in Bisimulation and Coinduction, pp. 38–99 (2011)
Goguen, J.A., Malcolm, G.: A hidden agenda. Theoret. Comput. Sci. 245, 55–101 (2000)
Diaconescu, R., Futatsugi, K.: Behavioural coherence in object-oriented algebraic specification. J. Univers. Comput. Sci. 6, 74–96 (2011)
Strecker, M.: Formal verification of a Java compiler in Isabelle. In: Voronkov, A. (ed.) CADE 2002. LNCS (LNAI), vol. 2392, pp. 63–77. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45620-1_5
Futatsugi, K.: Introduction to specification and verification in CafeOBJ (2012). http://www.informatik.tuwien.ac.at/news/630
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG, part of Springer Nature
About this paper
Cite this paper
Daudier, D., Ngoc Quoc Bao, T., Ogata, K. (2018). A Proof Score Approach to Formal Verification of an Imperative Programming Language Compiler. In: Tian, C., Nagoya, F., Liu, S., Duan, Z. (eds) Structured Object-Oriented Formal Language and Method. SOFL+MSVL 2017. Lecture Notes in Computer Science(), vol 10795. Springer, Cham. https://doi.org/10.1007/978-3-319-90104-6_13
Download citation
DOI: https://doi.org/10.1007/978-3-319-90104-6_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-90103-9
Online ISBN: 978-3-319-90104-6
eBook Packages: Computer ScienceComputer Science (R0)