spark-2014

Spark-Ada postcondition for array total

痞子三分冷 提交于 2021-02-10 05:52:30
问题 How does one write a Spark postcondition for a function that sums the elements of an array? (Spark 2014, but if someone shows me how to do it for an earlier Spark I should be able to adapt it.) So if I have: type Positive_Array is array (Positive range <>) of Positive; function Array_Total(The_Array: Positive_Array) return Positive with Post => Array_Total'Return = -- What goes here? is -- and so on I don't need to worry about overflow in my particular case (I know what the total was at