Skip to main content

A Proof Score Approach to Formal Verification of an Imperative Programming Language Compiler

  • Conference paper
  • First Online:
Structured Object-Oriented Formal Language and Method (SOFL+MSVL 2017)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 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. 2.

    A set of trans rules could be included in a CafeOBJ specification, but trans rules are not used in this paper.

  3. 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. 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. 5.

    Some descriptions on the proof score are inserted.

  6. 6.

    The slides used are available at http://www.jaist.ac.jp/~kokichi/class/TUW1207+08/.

References

  1. Bao, N.Q.T.: Verifying the correctness of compiler for an imperative programming language. Master’s thesis, School of Information Science, JAIST (2011)

    Google Scholar 

  2. Daudier, D.: Verification of compilers based on algebraic specifications. Technical report, ISAE ENSMA (2017)

    Google Scholar 

  3. 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)

    Google Scholar 

  4. 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)

    Google Scholar 

  5. 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

    Chapter  Google Scholar 

  6. Futatsugi, K., Goguen, J.A., Jouannaud, J.P., Meseguer, J.: Principles of OBJ2. In: 12th ACM SIGPLAN-SIGACT POPL, pp. 52–66. ACM (1985)

    Google Scholar 

  7. Ogata, K., Futatsugi, K.: Operational semantics of rewriting with the on-demand evaluation strategy. In: 15th ACM SAC, pp. 756–764. ACM (2000)

    Google Scholar 

  8. Leroy, X.: A formally verified compiler back-end. J. Autom. Reason. 43, 363–446 (2009)

    Article  MathSciNet  Google Scholar 

  9. Leroy, X.: Formal verification of a realistic compiler. Commun. ACM 52, 107–115 (2009)

    Article  Google Scholar 

  10. Goguen, J.A., Malcolm, G.: Algebraic Semantics of Imperative Programs. The MIT Press, Cambridge (1996)

    MATH  Google Scholar 

  11. 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

    Google Scholar 

  12. Roşu, G., Şerbănuţă, T.F.: An overview of the K semantic framework. J. Logic Algebraic Program. 79, 397–434 (2010)

    Article  MathSciNet  Google Scholar 

  13. Hathhorn, C., Ellison, C., Roşu, G.: Defining the undefinedness of C. In: 36th ACM SIGPLAN PLDI, pp. 336–345. ACM (2015)

    Google Scholar 

  14. Bogdănaş, D., Roşu, G.: K-Java: a complete semantics of Java. In: 42nd ACM SIGPLAN-SIGACT POPL, pp. 445–456. ACM (2015)

    Article  Google Scholar 

  15. 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

    Book  MATH  Google Scholar 

  16. Jacobs, B., Rutten, J.: An introduction to (co)algebras and (co)induction. In: Advanced Topics in Bisimulation and Coinduction, pp. 38–99 (2011)

    Google Scholar 

  17. Goguen, J.A., Malcolm, G.: A hidden agenda. Theoret. Comput. Sci. 245, 55–101 (2000)

    Article  MathSciNet  Google Scholar 

  18. Diaconescu, R., Futatsugi, K.: Behavioural coherence in object-oriented algebraic specification. J. Univers. Comput. Sci. 6, 74–96 (2011)

    MathSciNet  MATH  Google Scholar 

  19. 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

    Chapter  Google Scholar 

  20. Futatsugi, K.: Introduction to specification and verification in CafeOBJ (2012). http://www.informatik.tuwien.ac.at/news/630

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kazuhiro Ogata .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics