Encoding Floating-Point Numbers Using the SMT Theory in ESBMC: An Empirical Evaluation over the SV-COMP Benchmarks

  • Mikhail Y. R. GadelhaEmail author
  • Lucas C. Cordeiro
  • Denis A. Nicole
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10623)


This paper describes the support for encoding C/C++ programs using the SMT theory of floating-point numbers in ESBMC: an SMT-based context-bounded model checker that provides bit-precise verification of C and C++ programs. In particular, we exploit the availability of two different SMT solvers (MathSAT and Z3) to discharge and check the verification conditions produced by our encoding using the benchmarks from the International Competition on Software Verification (SV-COMP). The experimental results show that our encoding based on MathSAT is able to outperform not only Z3, but also other existing approaches that participated in the most recent edition of SV-COMP.


Floating-point arithmetic Satisfiability modulo theories Software verification Formal methods 


  1. 1.
    Gerrity, G.W.: Computer representation of real numbers. IEEE Trans. Comput. C–31(8), 709–714 (1982)CrossRefzbMATHGoogle Scholar
  2. 2.
    Frantz, G., Simar, R.: Comparing fixed- and floating-point DSPs. SPRY061, Texas Instruments (2004)Google Scholar
  3. 3.
    IEEE: IEEE standard for floating-point arithmetic. Technical report, August 2008Google Scholar
  4. 4.
    Goldberg, D.: What every computer scientist should know about floating point arithmetic. ACM Comput. Surv. 23(1), 5–48 (1991)CrossRefGoogle Scholar
  5. 5.
    Nikolić, Z., Nguyen, H.T., Frantz, G.: Design and implementation of numerical linear algebra algorithms on fixed point DSPs. EURASIP J. Adv. Sig. Proc. 2007(1) (2007)Google Scholar
  6. 6.
    Cordeiro, L.C., Fischer, B.: Verifying multi-threaded software using SMT-based context-bounded model checking. In: ICSE, pp. 331–340 (2011)Google Scholar
  7. 7.
    Cordeiro, L.C., Fischer, B., Marques-Silva, J.: SMT-based bounded model checking for embedded ANSI-C software. IEEE Trans. Softw. Eng. 38(4), 957–974 (2012)CrossRefGoogle Scholar
  8. 8.
    Rümmer, P., Wahl, T.: An SMT-lib theory of binary floating-point arithmetic. In: SMT Workshop (2010)Google Scholar
  9. 9.
    Ismail, H.I., Bessa, I.V., Cordeiro, L.C., Lima Filho, E.B., Chaves Filho, J.E.: DSVerifier: a bounded model checking tool for digital systems. In: Fischer, B., Geldenhuys, J. (eds.) SPIN 2015. LNCS, vol. 9232, pp. 126–131. Springer, Cham (2015). CrossRefGoogle Scholar
  10. 10.
    Abreu, R.B., Gadelha, M.Y.R., Cordeiro, L.C., Filho, E.B.D.L., de Silva Jr., W.S.: Bounded model checking for fixed-point digital filters. J. Braz. Comput. Soc. 22(1), 1:1–1:20 (2016)CrossRefGoogle Scholar
  11. 11.
    Bessa, I., Ismail, H., Cordeiro, L.C., Filho, J.E.C.: Verification of fixed-point digital controllers using direct and delta forms realizations. Des. Autom. Embed. Syst. 20(2), 95–126 (2016)CrossRefGoogle Scholar
  12. 12.
    Bessa, I., Ismail, H., Palhares, R., Cordeiro, L.C., Filho, J.E.C.: Formal non-fragile stability verification of digital control systems with uncertainty. IEEE Trans. Comput. 66(3), 545–552 (2017)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Beyer, D.: Software verification with validation of results. In: Legay, A., Margaria, T. (eds.) TACAS 2017. LNCS, vol. 10206, pp. 331–349. Springer, Heidelberg (2017). CrossRefGoogle Scholar
  14. 14.
    Wang, D., Zhang, C., Chen, G., Gu, M., Sun, J.G.: C code verification based on the extended labeled transition system model. In: D&P@MoDELS, pp. 48–55 (2016)Google Scholar
  15. 15.
    Clarke, E., Kroening, D., Lerda, F.: A tool for checking ANSI-C programs. In: Jensen, K., Podelski, A. (eds.) TACAS 2004. LNCS, vol. 2988, pp. 168–176. Springer, Heidelberg (2004). CrossRefGoogle Scholar
  16. 16.
    Ramalho, M., Freitas, M., Sousa, F., Marques, H., Cordeiro, L.C., Fischer, B.: SMT-based bounded model checking of C++ programs. In: ECBS, pp. 147–156 (2013)Google Scholar
  17. 17.
    Gadelha, M.Y.R., Ismail, H.I., Cordeiro, L.C.: Handling loops in bounded model checking of C programs via k-induction. STTT 19(1), 97–114 (2017)CrossRefGoogle Scholar
  18. 18.
    Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: An efficient method of computing static single assignment form. In: POPL, pp. 25–35 (1989)Google Scholar
  19. 19.
    Brummayer, R., Biere, A.: Boolector: an efficient SMT solver for bit-vectors and arrays. In: Kowalewski, S., Philippou, A. (eds.) TACAS 2009. LNCS, vol. 5505, pp. 174–177. Springer, Heidelberg (2009). CrossRefGoogle Scholar
  20. 20.
    de Moura, L., Bjørner, N.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008). CrossRefGoogle Scholar
  21. 21.
    Cimatti, A., Griggio, A., Schaafsma, B.J., Sebastiani, R.: The MathSAT5 SMT solver. In: Piterman, N., Smolka, S.A. (eds.) TACAS 2013. LNCS, vol. 7795, pp. 93–107. Springer, Heidelberg (2013). CrossRefGoogle Scholar
  22. 22.
    Dutertre, B.: Yices 2.2. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 737–744. Springer, Cham (2014). Google Scholar
  23. 23.
    Barrett, C., Conway, C.L., Deters, M., Hadarean, L., Jovanović, D., King, T., Reynolds, A., Tinelli, C.: CVC4. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 171–177. Springer, Heidelberg (2011). CrossRefGoogle Scholar
  24. 24.
    Brain, M., Tinelli, C., Ruemmer, P., Wahl, T.: An automatable formal semantics for IEEE-754 floating-point arithmetic. In: ARITH, pp. 160–167 (2015)Google Scholar
  25. 25.
    Smith, R.: Working Draft, Standard for Programming Language C++ (2016). Accessed Jan 2017Google Scholar
  26. 26.
    Delmas, D., Goubault, E., Putot, S., Souyris, J., Tekkal, K., Védrine, F.: Towards an industrial use of FLUCTUAT on safety-critical avionics software. In: Alpuente, M., Cook, B., Joubert, C. (eds.) FMICS 2009. LNCS, vol. 5825, pp. 53–69. Springer, Heidelberg (2009). CrossRefGoogle Scholar
  27. 27.
    Davis, M., Logemann, G., Loveland, D.: A machine program for theorem-proving. Commun. ACM 5(7), 394–397 (1962)MathSciNetCrossRefzbMATHGoogle Scholar
  28. 28.
    Ball, T., Bounimova, E., Levin, V., Kumar, R., Lichtenberg, J.: The static driver verifier research platform. In: Touili, T., Cook, B., Jackson, P. (eds.) CAV 2010. LNCS, vol. 6174, pp. 119–122. Springer, Heidelberg (2010). CrossRefGoogle Scholar
  29. 29.
    Brain, M., Joshi, S., Kroening, D., Schrammel, P.: Safety verification and refutation by k-invariants and k-induction. In: Blazy, S., Jensen, T. (eds.) SAS 2015. LNCS, vol. 9291, pp. 145–161. Springer, Heidelberg (2015). CrossRefGoogle Scholar
  30. 30.
    Fu, Z., Su, Z.: XSat: a fast floating-point satisfiability solver. In: Chaudhuri, S., Farzan, A. (eds.) CAV 2016. LNCS, vol. 9780, pp. 187–209. Springer, Cham (2016). Google Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  • Mikhail Y. R. Gadelha
    • 1
    Email author
  • Lucas C. Cordeiro
    • 2
  • Denis A. Nicole
    • 1
  1. 1.Electronics and Computer ScienceUniversity of SouthamptonSouthamptonUK
  2. 2.Department of Computer ScienceUniversity of OxfordOxfordUK

Personalised recommendations