Skip to main content

Verified Software Units for Simple DFA Modules and Objects in C

  • Conference paper
  • First Online:
Leveraging Applications of Formal Methods, Verification and Validation. Software Engineering (ISoLA 2022)

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

Included in the following conference series:

Abstract

Finite state machines occur ubiquitously in modern software, often in the form of C code that is synthesized from higher-level descriptions. To explore how the resulting code bases can be integrated into foundational verification infrastructures, we present formal specifications and machine-checked proofs of DFA representations using VST, a higher-order separation logic for C implemented in the Coq proof assistant. Paying particular attention to modularity and API-level representation hiding, we consider statically linked modules as well as object-inspired programming styles. Exploiting the abstraction capabilities of a recent VST enhancement, Verified Software Units (VSU), we complement separate compilation by separate verification and obtain instances of behavioral subtyping as separation logic entailments between suitable object representation predicates.

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

Access this chapter

Institutional subscriptions

References

  1. Alur, R.: Formal analysis of hierarchical state machines. In: Dershowitz, N. (ed.) Verification: Theory and Practice. LNCS, vol. 2772, pp. 42–66. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-39910-0_3

    Chapter  Google Scholar 

  2. Appel, A.W., Beringer, L., Cao, Q.: Verifiable C. Software Foundations, vol. 5 (2021). https://softwarefoundations.cis.upenn.edu/vc-current/index.html

  3. Appel, A.W., et al.: Program Logics for Certified Compilers. Cambridge University Press, Cambridge (2014)

    Book  MATH  Google Scholar 

  4. Appel, A.W., Naumann, D.A.: Verified sequential malloc/free. In: Ding, C., Maas, M. (eds.) ISMM 2020: 2020 ACM SIGPLAN International Symposium on Memory Management, pp. 48–59. ACM (2020). https://doi.org/10.1145/3381898.3397211

  5. Motor Industry Software Reliability Association: MISRA-C:2012 Guidelines for the use of the C language in critical systems (2012). https://www.misra.org.uk, MIRA Ltd

  6. Autosar Consortium: Specification of C implementation rules, V1.0.5, R3.1 (2008). https://www.autosar.org/fileadmin/user_upload/standards/classic/3-1/AUTOSAR_SWS_C_ImplementationRules.pdf

  7. Balzer, R.M.: Dataless programming. In: American Federation of Information Processing Societies: Proceedings of the AFIPS 19667 Fall Joint Computer Conference. AFIPS Conference Proceedings, vol. 31, pp. 535–544. AFIPS/ACM/Thomson Book Company (1967). https://doi.org/10.1145/1465611.1465683

  8. Barras, B., et al.: The Coq Proof Assistant reference manual. Technical report, INRIA (1998)

    Google Scholar 

  9. Beringer, L.: Verified software units. In: ESOP 2021. LNCS, vol. 12648, pp. 118–147. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-72019-3_5

    Chapter  Google Scholar 

  10. Beringer, L.: Verified Software Units for simple DFA modules and objects in C - Coq sources (2022). https://www.cs.princeton.edu/~eberinge/Isola2022sources.tar.gz

  11. Beringer, L., Appel, A.W.: Abstraction and subsumption in modular verification of C programs. Formal Methods Syst. Des. 58(1), 322–345 (2021)

    Google Scholar 

  12. g Bertot, Y., Castéran, P.: Coq’Art: interactive theorem proving and program development. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-662-07964-5

  13. Blazy, S., Leroy, X.: Mechanized semantics for the Clight subset of the C language. J. Autom. Reason. 43(3), 263–288 (2009). http://gallium.inria.fr/~xleroy/publi/Clight.pdf

  14. Calcagno, C., O’Hearn, P.W., Yang, H.: Local action and abstract separation logic. In: 22nd IEEE Symposium on Logic in Computer Science (LICS 2007), pp. 366–378. IEEE Computer Society (2007). https://doi.org/10.1109/LICS.2007.30

  15. Cao, Q., Beringer, L., Gruetter, S., Dodds, J., Appel, A.W.: VST-Floyd: a separation logic tool to verify correctness of C programs. J. Autom. Reasoning 61(1–4), 367–422 (2018)

    Google Scholar 

  16. Dockins, R., Hobor, A., Appel, A.W.: A fresh look at separation algebras and share accounting. In: APLAS: 7th Asian Symposium on Programming Languages and Systems, pp. 161–177 (2009)

    Google Scholar 

  17. Doczkal, C., Smolka, G.: Regular Language Representations in the Constructive Type Theory of Coq. J. Autom. Reason. 61(1–4), 521–553 (2018)

    Article  MathSciNet  MATH  Google Scholar 

  18. Harel, D.: Statecharts: a visual formalism for complex systems. Sci. Comput. Program. 8(3), 231–274 (1987)

    Article  MathSciNet  MATH  Google Scholar 

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

    Article  MATH  Google Scholar 

  20. Hobor, A., Dockins, R., Appel, A.W.: A theory of indirection via approximation. In: Proceedings 37th Annual ACM Symposium on Principles of Programming Languages (POPL 2010), pp. 171–185 (2010)

    Google Scholar 

  21. Hofmann, M., Pierce, B.C.: Positive subtyping. Inf. Comput. 126(1), 11–33 (1996). https://doi.org/10.1006/inco.1996.0031

    Article  MathSciNet  MATH  Google Scholar 

  22. Kay, A.C.: The early history of Smalltalk. In: Lee, J.A.N., Sammet, J.E. (eds.) History of Programming Languages Conference (HOPL-II), Preprints, pp. 69–95. ACM (1993). https://doi.org/10.1145/154766.155364

  23. Leavens, G.T., Naumann, D.A.: Behavioral subtyping, specification inheritance, and modular reasoning. ACM Trans. Program. Lang. Syst. 37(4), 13:1–13:88 (2015). https://doi.org/10.1145/2766446

  24. Liskov, B., Wing, J.M.: A behavioral notion of subtyping. ACM Trans. Program. Lang. Syst. 16(6), 1811–1841 (1994). https://doi.org/10.1145/197320.197383

  25. McBride, C.: Dependently Typed Functional Programs and their Proofs. Ph.D. thesis, LFCS, University of Edinburgh (1999)

    Google Scholar 

  26. O’Hearn, P.W.: Separation logic. Commun. ACM 62(2), 86–95 (2019). https://doi.org/10.1145/3211968

    Article  Google Scholar 

  27. Parkinson, M.J., Bierman, G.M.: Separation logic, abstraction and inheritance. In: Necula, G.C., Wadler, P. (eds.) Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2008, pp. 75–86. ACM (2008). https://doi.org/10.1145/1328438.1328451

  28. Reynolds, J.C.: GEDANKEN - a simple typeless language based on the principle of completeness and the reference concept. Commun. ACM 13(5), 308–319 (1970). https://doi.org/10.1145/362349.362364

    Article  MATH  Google Scholar 

  29. Reynolds, J.C.: Separation logic: a logic for shared mutable data structures. In: 17th IEEE Symposium on Logic in Computer Science (LICS 2002), pp. 55–74. IEEE Computer Society (2002). https://doi.org/10.1109/LICS.2002.1029817

  30. Yannakakis, M.: Hierarchical state machines. In: van Leeuwen, J., Watanabe, O., Hagiya, M., Mosses, P.D., Ito, T. (eds.) TCS 2000. LNCS, vol. 1872, pp. 315–330. Springer, Heidelberg (2000). https://doi.org/10.1007/3-540-44929-9_24

    Chapter  Google Scholar 

Download references

Funding

Funding Information. This material is based on work supported by the Defense Advanced Research Projects Agency (DARPA), Contract No. HR001120C0160. Additional support was provided by the National Science Foundation under the award 1005849, Verified High Performance Data Structure Implementations.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lennart Beringer .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Beringer, L. (2022). Verified Software Units for Simple DFA Modules and Objects in C. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation. Software Engineering. ISoLA 2022. Lecture Notes in Computer Science, vol 13702. Springer, Cham. https://doi.org/10.1007/978-3-031-19756-7_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-19756-7_14

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-19755-0

  • Online ISBN: 978-3-031-19756-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics