© Andrew T. Shvets 2020
A. T. ShvetsBeginning Ada Programminghttps://doi.org/10.1007/978-1-4842-5428-8_14

14. Contracts and Proofs

Andrew T. Shvets1 
(1)
Providence, RI, USA
 

What You Will Get Out of This Chapter

This chapter will dive into a very powerful technique of “proving” that your code works. This is something very unique to Ada 2012. None of the previous versions have them. They are used to ensure that certain conditions are met before executing a method, and certain changes were made after the execution has stopped.

They are absolutely brilliant. Every time that you need to double-check that some conditional value is met before running that function, you would need to put it in an if statement. This can turn problematic if your logic ever changes, ...

Get Beginning Ada Programming: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.