Gem #69: Let s SPARK! Part 2 Author: Yannick Moy, AdaCore Abstract: In this Gem and the previous one, we give you a simple walkthrough of SPARK s capabilities and its integration with GPS. In the previous Gem, we showed how to set up a SPARK project and prove that your SPARK programs are free from uninitialized variable accesses and that they execute without run-time errors. In this Gem, we show how to prove that your SPARK programs respect given contracts. Let s get started ¦ In the last Gem, we proved that procedure Linear_Search was free from uninitialized variable accesses and run-time errors, which are safety properties of Linear_Search. Now we can try to prove a specific behavioral property of Linear_Search, expressed as a contract between Linear_Search and its callers. A contract will consist of a precondition that callers of Linear_Search are responsible for establishing, before calling Linear_Search, and a postcondition that Linear_Search must establish, before returning to the caller. If not present, a default true pre- or postcondition is assumed. Let s prove that when Linear_Search returns with Found = True, the value of Table at Index is Value. This can be expressed in
/lp/association-for-computing-machinery/gem-69-let-s-spark-part-2-o7ISJN3RsG