Skip to main content

Abstract

Adapting sequential legacy software to parallel environments can not only save time and money, but additionally avoids the loss of valuable domain knowledge hidden in existing code. A common parallelization approach is the use of standardized parallel design patterns, which allow making best use of parallel programming interfaces such as OpenMP. When such patterns cannot be implemented directly, it can be necessary to apply code transformations beforehand to suitably re-shape the input program. In this paper, we describe how we used Abstract Execution, a semi-automatic program proving technique for second-order program properties, to formally prove the conditional correctness of the restructuring techniques CU Repositioning, Loop Splitting and Geometric Decomposition—for all input programs. The latter two techniques require an advanced modeling technique based on families of abstract location sets.

This work was funded by the Hessian LOEWE initiative within the Software-Factory 4.0 project.

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.

    Note that a strongest loop invariant is not necessarily inductive. Indeed, if there are runs of the analyzed programs not satisfying the postcondition, there is no inductive invariant, although there is always a strongest one.

References

  1. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Boston (1986)

    MATH  Google Scholar 

  2. Ahrendt, W., Beckert, B., Bubel, R., Hähnle, R., Schmitt, P.H., Ulbrich, M. (eds.): Deductive Software Verification - The KeY Book. LNCS, vol. 10001. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-49812-6

    Book  Google Scholar 

  3. Balser, M., Reif, W., Schellhorn, G., Stenzel, K., Thums, A.: Formal system development with KIV. In: Maibaum, T. (ed.) FASE 2000. LNCS, vol. 1783, pp. 363–366. Springer, Heidelberg (2000). https://doi.org/10.1007/3-540-46428-X_25

    Chapter  Google Scholar 

  4. Barthe, G., Crespo, J.M., Kunz, C.: Relational verification using product programs. In: Butler, M., Schulte, W. (eds.) FM 2011. LNCS, vol. 6664, pp. 200–214. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-21437-0_17

    Chapter  Google Scholar 

  5. Beckert, B., Ulbrich, M.: Trends in relational program verification. In: Müller, P., Schaefer, T. (eds.) Principled Software Development, pp. 41–58. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-98047-8_3

    Chapter  Google Scholar 

  6. Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development - Coq’Art: The Calculus of Inductive Constructions. TTCS. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-662-07964-5

    Book  MATH  Google Scholar 

  7. Blom, S., Huisman, M.: The VerCors tool for verification of concurrent programs. In: Jones, C., Pihlajasaari, P., Sun, J. (eds.) FM 2014. LNCS, vol. 8442, pp. 127–131. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-06410-9_9

    Chapter  Google Scholar 

  8. Bobot, F., Filliâtre, J.C., Marché, C., Paskevich, A.: Why3: shepherd your herd of provers. In: Boogie 2011: First International Workshop on Intermediate Verification Languages, pp. 53–64 (2011)

    Google Scholar 

  9. Boyer, R.S., Elspas, B., Levitt, K.N.: SELECT–a formal system for testing and debugging programs by symbolic execution. ACM SIGPLAN Not. 10(6), 234–245 (1975)

    Article  Google Scholar 

  10. Bubel, R., Roth, A., Rümmer, P.: Ensuring the correctness of lightweight tactics for JavaCard dynamic logic. Electr. Notes Theor. Comput. Sci. 199, 107–128 (2008). https://doi.org/10.1016/j.entcs.2007.11.015

    Article  MathSciNet  MATH  Google Scholar 

  11. Dong, J., Sun, Y., Zhao, Y.: Design pattern detection by template matching. In: Wainwright, R.L., Haddad, H. (eds.) Proceedings of the 2008 ACM Symposium on Applied Computing (SAC), pp. 765–769. ACM (2008)

    Google Scholar 

  12. Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley Signature Series, 2nd edn. Addison-Wesley Professional, Boston (2018)

    MATH  Google Scholar 

  13. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Boston (1995)

    MATH  Google Scholar 

  14. Garrido, A., Meseguer, J.: Formal specification and verification of Java refactorings. In: Proceedings of the 6th IEEE International Workshop on Source Code Analysis and Manipulation, SCAM 2006, pp. 165–174. IEEE Computer Society, Washington, D.C. (2006). https://doi.org/10.1109/SCAM.2006.16

  15. Godlin, B., Strichman, O.: Regression verification: proving the equivalence of similar programs. Softw. Test. Verif. Reliab. 23(3), 241–258 (2013). https://doi.org/10.1002/stvr.1472

    Article  Google Scholar 

  16. Hähnle, R., Huisman, M.: Deductive software verification: from pen-and-paper proofs to industrial tools. In: Steffen, B., Woeginger, G. (eds.) Computing and Software Science. LNCS, vol. 10000, pp. 345–373. Springer, Cham (2019). https://doi.org/10.1007/978-3-319-91908-9_18

    Chapter  Google Scholar 

  17. Hoare, C.A.R.: An axiomatic basis for computer programming. Commun. ACM 12(10), 576–580 (1969)

    Article  Google Scholar 

  18. Huda, Z.U., Jannesari, A., Wolf, F.: Using template matching to infer parallel design patterns. TACO 11(4), 64:1–64:21 (2015). https://doi.org/10.1145/2688905

    Article  Google Scholar 

  19. Jacobs, B., Smans, J., Philippaerts, P., Vogels, F., Penninckx, W., Piessens, F.: VeriFast: a powerful, sound, predictable, fast verifier for C and Java. In: Bobaru, M., Havelund, K., Holzmann, G.J., Joshi, R. (eds.) NFM 2011. LNCS, vol. 6617, pp. 41–55. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-20398-5_4

    Chapter  Google Scholar 

  20. Jahr, R., Gerdes, M., Ungerer, T.: A pattern-supported parallelization approach. In: Balaji, P., Guo, M., Huang, Z. (eds.) Proceedings of the 2013 PPOPP International Workshop on Programming Models and Applications for Multicores and Manycores (PMAM), pp. 53–62. ACM (2013). https://doi.org/10.1145/2442992.2442998

  21. Kassios, I.T.: The Dynamic Frames Theory. Formal Asp. Comput. 23(3), 267–288 (2011). https://doi.org/10.1007/s00165-010-0152-5

    Article  MathSciNet  MATH  Google Scholar 

  22. Khatchadourian, R., Tang, Y., Bagherzadeh, M., Ahmed, S.: Safe automated refactoring for intelligent parallelization of Java 8 streams. In: Atlee, J.M., Bultan, T., Whittle, J. (eds.) Proceedings of the 41st International Conference on Software Engineering (ICSE), pp. 619–630. IEEE/ACM (2019). https://doi.org/10.1109/ICSE.2019.00072

  23. King, J.C.: Symbolic execution and program testing. Commun. ACM 19(7), 385–394 (1976)

    Article  MathSciNet  Google Scholar 

  24. Kovács, L., Voronkov, A.: First-order theorem proving and Vampire. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 1–35. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39799-8_1

    Chapter  Google Scholar 

  25. Kundu, S., Tatlock, Z., Lerner, S.: Proving optimizations correct using parameterized program equivalence. In: Proceedings of the PLDI 2009, pp. 327–337 (2009)

    Google Scholar 

  26. Leino, K.R.M.: Dafny: an automatic program verifier for functional correctness. In: Clarke, E.M., Voronkov, A. (eds.) LPAR 2010. LNCS (LNAI), vol. 6355, pp. 348–370. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-17511-4_20

    Chapter  MATH  Google Scholar 

  27. Li, Z., Jannesari, A., Wolf, F.: Discovery of potential parallelism in sequential programs. In: 42nd International Conference on Parallel Processing, ICPP, pp. 1004–1013. IEEE Computer Society (2013)

    Google Scholar 

  28. Li, Z., Jannesari, A., Wolf, F.: An efficient data-dependence profiler for sequential and parallel programs. In: Proceedings of the 29th IEEE International Parallel and Distributed Processing Symposium (IPDPS), Hyderabad, India, pp. 484–493. IEEE Computer Society, May 2015. https://doi.org/10.1109/IPDPS.2015.41

  29. Lopes, N.P., Menendez, D., Nagarakatte, S., Regehr, J.: Practical verification of peephole optimizations with alive. Commun. ACM 61(2), 84–91 (2018)

    Article  Google Scholar 

  30. Massingill, B.L., Mattson, T.G., Sanders, B.A.: Parallel programming with a pattern language. Int. J. Softw. Tools Technol. Transf. 3(2), 217–234 (2001). https://doi.org/10.1007/s100090100045

    Article  MATH  Google Scholar 

  31. Mattson, T.G., Sanders, B., Massingill, B.: Patterns for Parallel Programming. Pearson Education, London (2004)

    MATH  Google Scholar 

  32. 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). https://doi.org/10.1007/978-3-540-78800-3_24

    Chapter  Google Scholar 

  33. Nipkow, T., Wenzel, M., Paulson, L.C. (eds.): Isabelle/HOL. LNCS, vol. 2283. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45949-9

    Book  MATH  Google Scholar 

  34. Norouzi, M., Wolf, F., Jannesari, A.: Automatic construct selection and variable classification in OpenMP. In: Proceedings of the International Conference on Supercomputing (ICS), Phoenix, AZ, USA, pp. 330–341. ACM, Jun 2019. https://doi.org/10.1145/3330345.3330375

  35. Steinhöfel, D.: Abstract Execution: automatically proving infinitely many programs. Ph.D. thesis, Technical University of Darmstadt, Department of Computer Science, Darmstadt, Germany (2020). https://doi.org/10.25534/tuprints-00008540

  36. Steinhöfel, D., Hähnle, R.: Modular, correct compilation with automatic soundness proofs. In: Margaria, T., Steffen, B. (eds.) ISoLA 2018. LNCS, vol. 11244, pp. 424–447. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-03418-4_25

    Chapter  Google Scholar 

  37. Steinhöfel, D., Hähnle, R.: Abstract Execution. In: Proceedings of the Third World Congress on Formal Methods - The Next 30 Years (FM), pp. 319–336 (2019). https://doi.org/10.1007/978-3-030-30942-8_20

Download references

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Reiner Hähnle , Asmae Heydari Tabar , Arya Mazaheri , Mohammad Norouzi , Dominic Steinhöfel or Felix Wolf .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Hähnle, R., Heydari Tabar, A., Mazaheri, A., Norouzi, M., Steinhöfel, D., Wolf, F. (2020). Safer Parallelization. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation: Engineering Principles. ISoLA 2020. Lecture Notes in Computer Science(), vol 12477. Springer, Cham. https://doi.org/10.1007/978-3-030-61470-6_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-61470-6_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-61469-0

  • Online ISBN: 978-3-030-61470-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics