Skip to main content

LLVM-Based Code Generation for B

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8941))

Abstract

We present b2llvm, a multi-platform code generator for the B-method. The b2llvm code generator currently handles the following elements of the B language: simple data types, imperative instructions and component compositions. In particular, this paper describes a translation for essential implementation constructs of the B language into LLVM source code, implemented into the b2llvm compiler. We use an example-based approach for this description.

V. Medeiros Jr—The research presented in this paper was partially supported by CNPq projects 308008/2012-0 and 573964/2008-4 (National Institute of Science and Technology for Software Engineer - INES).

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   44.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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abrial, J.-R.: The B-book: assigning programs to meanings. University Press, Cambridge (1996)

    Book  MATH  Google Scholar 

  2. Ambert, F., Bouquet, F., Legeard, B., Peureux, F., et al.: BZ-Testing-Tools (2002)

    Google Scholar 

  3. Bodeveix, J.-P., Filali, M., Muñoz, C.: A formalization of the B-method in Coq and PVS. In: Electronic Proc. B-User Group Meeting FM 99, pp. 33–49 (1999)

    Google Scholar 

  4. Chartier, P.: Formalisation of B in Isabelle/HOL. In: Bert, D. (ed.) B 1998. LNCS, vol. 1393, pp. 66–82. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  5. ClearSy. ComenC, B0 implementation translation into C language (2008). http://www.comenc.eu

  6. ClearSy. Atelier B User Manual Version 4.0. Clearsy System Engineering (2009)

    Google Scholar 

  7. Jaeger, É., Dubois, C.: Why would you trust B? In: Dershowitz, N., Voronkov, A. (eds.) LPAR 2007. LNCS (LNAI), vol. 4790, pp. 288–302. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  8. Lattner, C., Adve, V.S.: LLVM: a compilation framework for lifelong program analysis & transformation. In: 2nd IEEE/ACM International Symposium on Code Generation and Optimization, pp. 75–88 (2004)

    Google Scholar 

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

    Article  Google Scholar 

  10. Leuschel, M., Butler, M.: ProB: An automated analysis toolset for the B method. Software Tools for Technology Transfer (STTT) 10(2), 185–203 (2008)

    Article  Google Scholar 

  11. de Matos, E.C.B., Moreira, A.M.: Beta: A B based testing approach. In: Gheyi, R., Naumann, D. (eds.) SBMF 2012. LNCS, vol. 7498, pp. 51–66. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  12. Zhao, J., Nagarakatte, S., Martin, M.M.K., Zdancewic, S.: Formalizing the LLVM intermediate representation for verified program transformations. In: POPL, pp. 427–440 (2012)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to David Déharbe .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Bonichon, R., Déharbe, D., Lecomte, T., Medeiros, V. (2015). LLVM-Based Code Generation for B. In: Braga, C., Martí-Oliet, N. (eds) Formal Methods: Foundations and Applications. SBMF 2014. Lecture Notes in Computer Science(), vol 8941. Springer, Cham. https://doi.org/10.1007/978-3-319-15075-8_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-15075-8_1

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-15074-1

  • Online ISBN: 978-3-319-15075-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics