Skip to main content

Ortac: Runtime Assertion Checking for OCaml (Tool Paper)

  • Conference paper
  • First Online:
Runtime Verification (RV 2021)

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

Included in the following conference series:

Abstract

Runtime assertion checking (RAC) is a convenient set of techniques that lets developers abstract away the process of verifying the correctness of their programs by writing formal specifications and automating their verification at runtime.

In this work, we present ortac, a runtime assertion checking tool for OCaml libraries and programs. OCaml is a functional programming language in which idioms rely on an expressive type system, modules, and interface abstractions. ortac consumes interfaces annotated with type invariants and function contracts and produces code wrappers with the same signature that check these specifications at runtime. It provides a flexible framework for traditional assertion checking, monitoring misbehaviors without interruptions, and automated fuzz testing for OCaml programs.

This paper presents an overview of ortac features and highlights its main design choices.

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 64.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 84.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

References

  1. afl-fuzzAmerican fuzzy lop. https://lcamtuf.coredump.cx/afl/

  2. Barnett, M.: Code contracts for .NET: runtime verification and so much more. In: Barringer, H., et al. (eds.) RV 2010. LNCS, vol. 6418, pp. 16–17. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-16612-9_2

    Chapter  Google Scholar 

  3. Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# programming system: an overview. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 49–69. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-30569-9_3

    Chapter  Google Scholar 

  4. Barnett, M., Schulte, W.: Contracts, components, and their runtime verification on the.net platform. Technical report MSR-TR-2002-38, April 2002. https://www.microsoft.com/en-us/research/publication/contracts-components-and-their-runtime-verification-on-the-net-platform/

  5. Barnett, M., Schulte, W.: Runtime verification of .NET contracts, vol. 65, pp. 199–208. Elsevier (2003). https://www.microsoft.com/en-us/research/publication/runtime-verification-of-net-contracts/

  6. Baudin, P., Cuoq, P., Filliâtre, J.C., Marché, C., Monate, B., Moy, Y., Prevosto, V.: ACSL: ANSI/ISO C specification language (2008)

    Google Scholar 

  7. Burdy, L., et al.: An overview of JML tools and applications. Electron. Notes Theor. Comput. Sci. 80, 75–91 (2003). https://doi.org/10.1016/S1571-0661(04)80810-7. https://www.sciencedirect.com/science/article/pii/S1571066104808107. www.jmlspecs.org Eighth International Workshop on Formal Methods for Industrial Critical Systems (FMICS 2003)

  8. Chalin, P.: JML support for primitive arbitrary precision numeric types: definition and semantics. J. Object Technol. 3, 57–79 (2004)

    Article  Google Scholar 

  9. Charguéraud, A., Filliâtre, J.C., Lourenço, C., Pereira, M.: GOSPEL -providing OCaml with a formal specification language. In: FM 2019–23rd International Symposium on Formal Methods, Porto, Portugal, October 2019. https://hal.inria.fr/hal-02157484

  10. Cheon, Y., Leavens, G.: A runtime assertion checker for the java modeling language (JML), January 2002

    Google Scholar 

  11. Cok, D.R.: OpenJML: JML for Java 7 by extending OpenJDK. In: Bobaru, M., Havelund, K., Holzmann, G.J., Joshi, R. (eds.) NFM 2011. LNCS, vol. 6617, pp. 472–479. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-20398-5_35

    Chapter  Google Scholar 

  12. Delahaye, M., Kosmatov, N., Signoles, J.: Common specification language for static and dynamic analysis of C programs. In: Proceedings of the ACM Symposium on Applied Computing, pp. 1230–1235, March 2013. https://doi.org/10.1145/2480362.2480593

  13. Filliâtre, J.-C., Paskevich, A.: Why3—where programs meet provers. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 125–128. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37036-6_8

    Chapter  Google Scholar 

  14. Kosmatov, N., Petiot, G., Signoles, J.: An optimized memory monitoring for runtime assertion checking of C programs. In: Legay, A., Bensalem, S. (eds.) RV 2013. LNCS, vol. 8174, pp. 167–182. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-40787-1_10. https://hal-cea.archives-ouvertes.fr/cea-01834990

  15. Kosmatov, N., Maurica, F., Signoles, J.: Efficient runtime assertion checking for properties over mathematical numbers. In: Deshmukh, J., Ničković, D. (eds.) RV 2020. LNCS, vol. 12399, pp. 310–322. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-60508-7_17

    Chapter  Google Scholar 

  16. McCormick, J.W., Chapin, P.C.: Building High Integrity Applications with SPARK. Cambridge University Press, Cambridge (2015)

    Book  Google Scholar 

  17. Meyer, B.: Applying “design by contract’’. Computer 25(10), 40–51 (1992). https://doi.org/10.1109/2.161279

    Article  Google Scholar 

  18. Pottier, F.: Strong automated testing of OCaml libraries. In: Journées Francophones des Langages Applicatifs (JFLA), February 2021. http://cambium.inria.fr/~fpottier/publis/pottier-monolith-2021.pdf

  19. Signoles, J., Cuoq, P., Kirchner, F., Kosmatov, N., Prevosto, V., Yakobowski, B.: Frama-C: a software analysis perspective, vol. 27 (2012). https://doi.org/10.1007/s00165-014-0326-7

  20. Signoles, J., Kosmatov, N., Vorobyov, K.: E-ACSL, a runtime verification tool for safety and security of C programs (tool paper). In: RV-CuBES (2017). https://doi.org/10.29007/fpdh

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jean-Christophe Filliâtre .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Filliâtre, JC., Pascutto, C. (2021). Ortac: Runtime Assertion Checking for OCaml (Tool Paper). In: Feng, L., Fisman, D. (eds) Runtime Verification. RV 2021. Lecture Notes in Computer Science(), vol 12974. Springer, Cham. https://doi.org/10.1007/978-3-030-88494-9_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-88494-9_13

  • Published:

  • Publisher Name: Springer, Cham

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

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

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics