© Andrew T. Shvets 2020Andrew T. ShvetsBeginning Ada Programminghttps://doi.org/10.1007/978-1-4842-5428-8_14
14. Contracts and Proofs
Andrew T. Shvets1
Providence, RI, USA
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 ...