high-integrity-systems

“Taking on a Challenge in SPARK Ada” - Sum ghost function in post-condition having unintended behavior

你离开我真会死。 提交于 2020-07-09 04:23:39
问题 I am writing a piece of software in SPARK Ada which requires the post-condition to verify that the function return value is equal to the summed values of an array. Upon proving the file where the function resides, I keep getting an error which doesn't quite add up, no pun intended (I will post screenshots of the code so as to allow a better look). The only acceptable values allowed in the array of size 10 are 0s or 1s. 回答1: In the example below (and opposed to the other answer), I separated