Skip to main content

Tame Your Annotations with MetAcsl: Specifying, Testing and Proving High-Level Properties

  • Conference paper
  • First Online:
Tests and Proofs (TAP 2019)

Abstract

A common way to specify software properties is to associate a contract to each function, allowing the use of various techniques to assess (e.g. to prove or to test) that the implementation is valid with respect to these contracts. However, in practice, high-level properties are not always easily expressible through function contracts. Furthermore, such properties may span across multiple functions, making the specification task tedious, and its assessment difficult and error-prone, especially on large code bases. To address these issues, we propose a new specification mechanism called meta-properties. Meta-properties are enhanced global invariants specified for a set of functions, capable of expressing predicates on values of variables as well as memory related conditions (such as separation) and read or write access constraints. This paper gives a detailed presentation of meta-properties and their support in a dedicated Frama-C plugin MetAcsl, and shows that they are automatically amenable to both deductive verification and testing. This is demonstrated by applying these techniques on two illustrative case studies.

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

Similar content being viewed by others

Notes

  1. 1.

    This feature relies on the Frama-C plugin Callgraph, which makes gross over-approximations of these sets in the presence of indirect calls (i.e. function pointers).

  2. 2.

    Technically, Post can only be used in assigns statements or contract post-conditions.

  3. 3.

    The case studies and their specifications are available at https://huit.re/metatap.

  4. 4.

    We assume a total order for simplicity, but it would also work with a partial one.

  5. 5.

    See https://github.com/gpetiot/Frama-C-Mutation.

  6. 6.

    For example, simplification saves 8 s on the deductive verification of the correct confidentiality implementation (for a total of 24 s).

  7. 7.

    The last row is not relevant for deductive verification, see Sect. 6.2.

  8. 8.

    E-ACSL add checks to ensure that no runtime error (segfaults, overflow, ...) will occur and stops the program upon violation.

References

  1. Kirchner, F., Kosmatov, N., Prevosto, V., Signoles, J., Yakobowski, B.: Frama-C: a software analysis perspective. Formal Aspects Comput. 27, 573–609 (2015)

    Article  MathSciNet  Google Scholar 

  2. Baudin, P.: ACSL: ANSI/ISO C Specification Language (2018). https://framac.com/acsl.html

  3. Robles, V., Kosmatov, N., Prevosto, V., Rilling, L., Le Gall, P.: MetAcsl: specification and verification of high-level properties. In: Vojnar, T., Zhang, L. (eds.) TACAS 2019. LNCS, vol. 11427, pp. 358–364. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-17462-0_22

    Chapter  Google Scholar 

  4. Baudin, P., Bobot, F., Correnson, L., Dargaye, Z.: WP plugin manual (2010). http://frama-c.com/wp.html

  5. Signoles, J., Kosmatov, N., Vorobyov, K.: E-ACSL, a runtime verification tool for safety and security of C programs (tool paper). In: International Workshop on Competitions, Usability, Benchmarks, Evaluation, and Standardisation for Runtime Verification Tools, pp. 164–173 (2017)

    Google Scholar 

  6. Petiot, G., Kosmatov, N., Botella, B., Giorgetti, A., Julliand, J.: How testing helps to diagnose proof failures. Formal Aspects Comput. 30, 629–657 (2018)

    Article  MathSciNet  Google Scholar 

  7. Leavens, G.T., Baker, A.L., Ruby, C.: JML: a notation for detailed design. In: Kilov, H., Rumpe, B., Simmonds, I. (eds.) Behavioral Specifications of Businesses and Systems. SECS, vol. 523, pp. 175–188. Springer, Boston (1999). https://doi.org/10.1007/978-1-4615-5229-1_12

    Chapter  Google Scholar 

  8. Cheon, Y., Perumandla, A.: Specifying and checking method call sequences in JML. In: International Conference on Software Engineering Research and Practice, pp. 511–516 (2005)

    Google Scholar 

  9. Trentelman, K., Huisman, M.: Extending JML specifications with temporal logic. In: Kirchner, H., Ringeissen, C. (eds.) AMAST 2002. LNCS, vol. 2422, pp. 334–348. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45719-4_23

    Chapter  Google Scholar 

  10. Stouls, N., Groslambert, J.: Vérification de propriéts LTL sur des programmes C par génération d’annotations. Research Report (French) (2011)

    Google Scholar 

  11. de Oliveira, S., Prevosto, V., Bensalem, S.: CaFE: a model-checker collaboratif. In: Approches Formelles dans l’Assistance au Developpement Logiciel (2017)

    Google Scholar 

  12. Blatter, L., Kosmatov, N., Le Gall, P., Prevosto, V., Petiot, G.: Static and dynamic verification of relational properties on self-composed C code. In: Dubois, C., Wolff, B. (eds.) TAP 2018. LNCS, vol. 10889, pp. 44–62. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-92994-1_3

    Chapter  Google Scholar 

  13. Pavlova, M., Barthe, G., Burdy, L., Huisman, M., Lanet, J.L.: Enforcing high-level security properties for applets. In: Quisquater, J.J., Paradinas, P., Deswarte, Y., El Kalam, A.A. (eds.) Smart Card Research and Advanced Applications VI. IFIP International Federation for Information Processing, vol. 153, pp. 1–16. Springer, Boston (2004). https://doi.org/10.1007/1-4020-8147-2_1

    Chapter  Google Scholar 

  14. Kiczales, G., et al.: Aspect-oriented programming. In: Akşit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997). https://doi.org/10.1007/BFb0053381

    Chapter  Google Scholar 

Download references

Acknowledgment

This work was partially supported by the project VESSEDIA, which has received funding from the EU Horizon 2020 research and innovation programme under grant agreement No 731453. This work was also partially supported by ANR (grant ANR-18-CE25-0015-01). The work of the first author was partially funded by a Ph.D. grant of the French Ministry of Defense. Many thanks to the anonymous referees for their helpful comments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Virgile Robles .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Robles, V., Kosmatov, N., Prevosto, V., Rilling, L., Le Gall, P. (2019). Tame Your Annotations with MetAcsl: Specifying, Testing and Proving High-Level Properties. In: Beyer, D., Keller, C. (eds) Tests and Proofs. TAP 2019. Lecture Notes in Computer Science(), vol 11823. Springer, Cham. https://doi.org/10.1007/978-3-030-31157-5_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-31157-5_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-31156-8

  • Online ISBN: 978-3-030-31157-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics