Skip to main content

Verifying Fortran Programs with CIVL

  • 765 Accesses

Part of the Lecture Notes in Computer Science book series (LNCS,volume 13243)


Fortran is widely used in computational science, engineering, and high performance computing. This paper presents an extension to the CIVL verification framework to check correctness properties of Fortran programs. Unlike previous work that translates Fortran to C, LLVM IR, or other intermediate formats before verification, our work allows CIVL to directly consume Fortran source files. We extended the parsing, translation, and analysis phases to support Fortran-specific features such as array slicing and reshaping, and to find program violations that are specific to Fortran, such as argument aliasing rule violations, invalid use of variable and function attributes, or defects due to Fortran’s unspecified expression evaluation order. We demonstrate the usefulness of our tool on a verification benchmark suite and kernels extracted from a real world application.


  • Fortran
  • verification
  • static analysis
  • model checking


  1. Adams, J.C., Brainerd, W.S., Hendrickson, R.A., Maine, R.E., Martin, J.T., Smith, B.T.: The Fortran 2003 Handbook: the Complete Syntax, Features and Procedures. Springer Science & Business Media (2008).

  2. Baranová, Z., Barnat, J., Kejstová, K., Kučera, T., Lauko, H., Mrázek, J., Ročkai, P., Štill, V.: Model checking of C and C++ with DIVINE 4. In: Automated Technology for Verification and Analysis. LNCS, vol. 10482, pp. 201–207. Springer, Cham (2017).

  3. Barnett, M., Chang, B.Y.E., DeLine, R., Jacobs, B., Leino, K.R.M.: Boogie: A modular reusable verifier for object-oriented programs. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.P. (eds.) Formal Methods for Components and Objects, 4th International Symposium (FMCO 2005). Lecture Notes in Computer Science, vol. 4111, pp. 364–387. Springer (2005).

  4. Barrett, C., Conway, C.L., Deters, M., Hadarean, L., Jovanović, D., King, T., Reynolds, A., Tinelli, C.: CVC4. In: Gopalakrishnan, G., Qadeer, S. (eds.) Computer Aided Verification - 23rd International Conference, CAV 2011, Snowbird, UT, USA, July 14-20, 2011. Proceedings. Lecture Notes in Computer Science, vol. 6806, pp. 171–177. Springer (2011),

  5. 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. Wrocław, Poland (August 2011),

  6. Boyer, R.S., Moore, J.S.: A verification condition generator for Fortran. Tech. Rep. CSL-103, SRI International, Computer Science Laboratory, Menlo Park, CA (June 1980),

  7. Cadar, C., Dunbar, D., Engler, D.: KLEE: Unassisted and automatic generation of high-coverage tests for complex systems programs. Proc. 8th USENIX Symposium on Operating Systems Design and Implementation (OSDI’08) (2008)

    Google Scholar 

  8. Clarke, L.A.: A system to generate test data and symbolically execute programs. IEEE Trans. Softw. Eng. 2, 215–222 (May 1976).

  9. Cleanscape Software International: FORTRAN-lint: a pre-compile analysis tool,, accessed 13-Oct-2021

  10. Dingle, N.: Not only Fortran and MPI: POP’s view of HPC software in Europe,, accessed 14-Oct-2021

  11. Feldman, S.I.: A Fortran to C converter. SIGPLAN Fortran Forum 9(2), 21–22 (Oct 1990).

  12. Flang Fortran language front-end., accessed 09-Oct-2021

  13. Garzella, J.J., Baranowski, M., He, S., Rakamarić, Z.: Leveraging compiler intermediate representation for multi- and cross-language verification. In: Beyer, D., Zufferey, D. (eds.) Verification, Model Checking, and Abstract Interpretation. pp. 90–111. Springer, Cham (2020).

  14. Grosse-Kunstleve, R.W., Terwilliger, T.C., Sauter, N.K., Adams, P.D.: Automatic Fortran to C++ conversion with FABLE. Source Code for Biology and Medicine 7(5) (2012).

  15. Gurfinkel, A., Kahsai, T., Navas, J.A.: SeaHorn: A framework for verifying C programs (competition contribution). In: Baier, C., Tinelli, C. (eds.) Tools and Algorithms for the Construction and Analysis of Systems. Lecture Notes in Computer Science, vol. 9035, pp. 447–450. Springer Berlin Heidelberg, Berlin, Heidelberg (2015).

  16. Lattner, C., Adve, V.: LLVM: a compilation framework for lifelong program analysis & transformation. In: Proceedings of the International Symposium on Code Generation and Optimization (CGO’04). pp. 75–86. IEEE Computer Society (2004).

  17. Lawrence Livermore National Laboratory: CORAL benchmark codes (2014),, accessed 14-Oct-2021

  18. Message Passing Interface Forum: MPI: A Message-Passing Interface standard, version 3.1 (Jun 2015),

  19. Moniot, R.K.: ftnchek: a static analyzer for Fortran 77,, accessed 09-Oct-2021

  20. de Moura, L., Bjørner, N.: Z3: An efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) Tools and Algorithms for the Construction and Analysis of Systems, 14th International Conference, TACAS 2008, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2008, Budapest, Hungary, March 29-April 6, 2008. Proceedings. Lecture Notes in Computer Science, vol. 4963, pp. 337–340. Springer (2008).

  21. NEK5000: a fast and scalable high-order solver for computational fluid dynamics (2021),, accessed 14-Oct-2021

  22. Nguyen, T.V.N., Irigoin, F.: Alias verification for Fortran code optimization. Electronic Notes in Theoretical Computer Science 65(2), 52–66 (2002)., COCV’02, Compiler Optimization Meets Compiler Verification (Satellite Event of ETAPS 2002)

  23. Noller, Y., Păsăreanu, C.S., Fromherz, A., Le, X.B.D., Visser, W.: Symbolic Pathfinder for SV-COMP. In: Beyer, D., Huisman, M., Kordon, F., Steffen, B. (eds.) Tools and Algorithms for the Construction and Analysis of Systems. pp. 239–243. Springer, Cham (2019).

  24. NVIDIA: CUDA Toolkit Documentation, v11.4.2,, accessed 14-Oct-2021

  25. Open Group: IEEE Std 1003.1: Standard for information technology—Portable Operating System Interface (POSIX(R)) base specifications, issue 7: pthread.h (2018),

  26. OpenMP Architecture Review Board: OpenMP Application Programming Interface (Nov 2020),, version 5.1

  27. Orchard, D., Contrastin, M., Danish, M., Rice, A.: Verifying spatial properties of array computations. Proceedings of the ACM on Programming Languages 1(OOPSLA), 1–30 (Oct 2017)., article no. 75

  28. Parr, T.: The Definitive ANTLR4 Reference. The Pragmatic Bookshelf, Dallas, TX (2013),

  29. Polyhedron Solutions: Linux Fortran compiler diagnostic comparisons,, accessed 13-Oct-2021

  30. Rakamarić, Z., Emmi, M.: SMACK: Decoupling source language details from verifier implementation. In: Biere, A., Bloem, R. (eds.) Proceedings of the 26th International Conference on Computer Aided Verification (CAV). Lecture Notes in Computer Science, vol. 8559, pp. 106–113. Springer (2014).

  31. Rasmussen, C.E., et al.: OFP: Open Fortran Project,, accessed 14-Oct-2021

  32. Rosner, R., Calder, A., Dursi, L., Fryxell, B., Lamb, D., Niemeyer, J., Olson, K., Ricker, P., Timmes, F., Truran, J., Tufo, H., Young, Y.N., Zingale, M., Lusk, E., Stevens, R.: Flash code: Studying astrophysical thermonuclear flashes. Computing in Science and Engineering 2, 33–41 (2000).

  33. Siegel, S.F., Zheng, M., Luo, Z., Zirkel, T.K., Marianiello, A.V., Edenhofner, J.G., Dwyer, M.B., Rogers, M.S.: CIVL: The Concurrency Intermediate Verification Language. In: SC15: Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis. ACM, New York (Nov 2015)., article no. 61, pages 1–12

  34. Sinz, C., Merz, F., Falke, S.: LLBMC: A bounded model checker for LLVM’s intermediate representation. In: Flanagan, C., König, B. (eds.) Tools and Algorithms for the Construction and Analysis of Systems. Lecture Notes in Computer Science, vol. 7214, pp. 542–544. Springer, Berlin, Heidelberg (2012).

  35. Synopsys: Synopsys static analysis (Coverity) Fortran syntax analysis,, accessed 13-Oct-2021

  36. Verma, G., Shi, Y., Liao, C., Chapman, B., Yan, Y.: Enhancing DataRaceBench for evaluating data race detection tools. In: 2020 IEEE/ACM 4th International Workshop on Software Correctness for HPC Applications (Correctness). pp. 20–30. IEEE (2020).

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to Wenhao Wu .

Editor information

Editors and Affiliations

Rights and permissions

Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

Reprints and Permissions

Copyright information

© 2022 The Author(s)

About this paper

Verify currency and authenticity via CrossMark

Cite this paper

Wu, W., Hückelheim, J., Hovland, P.D., Siegel, S.F. (2022). Verifying Fortran Programs with CIVL. In: Fisman, D., Rosu, G. (eds) Tools and Algorithms for the Construction and Analysis of Systems. TACAS 2022. Lecture Notes in Computer Science, vol 13243. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-99523-2

  • Online ISBN: 978-3-030-99524-9

  • eBook Packages: Computer ScienceComputer Science (R0)