index.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. .. SPDX-License-Identifier: GPL-2.0 or GPL-3.0
  2. .. Copyright © 2019 Ariadne Devos
  3. Specifying and proving programs
  4. ===============================
  5. For formally proving programs correct, annotations in ACSL
  6. are interwoven with the source code, which can be fed into
  7. Frama-C for submission to automatic theorem provers.
  8. A specification of ACSL is available on https://frama-c.com,
  9. as is the free-software Frama-C platform (both GUI and CUI).
  10. A few guidelines are given.
  11. Contracts
  12. ---------
  13. The contract of a function is given where it is declared:
  14. the header file for exported functions. If a proposition
  15. is conditional on presence or absence of :ref:`speculation <speculation>`,
  16. this is modelled as being conditional on `S` or `NS` respectively,
  17. defined in `<sHT/nospec.h> `.
  18. Lemmas
  19. ------
  20. Invariants' names are suffixed by `I`, before any speculation suffix.
  21. Loops
  22. -----
  23. Specify relevant invariants, the frame (`assigns:`) and `variant:`
  24. for proving termination (if applicable). Frama-C cannot guess
  25. the invariants or the frame, and typically has little trouble
  26. proving them, but only if they are correct.