How do i check if a certain value is the largest element in an array? this is in the Ada language. I have the function finding the largest element, and it works.. now i want to run a post condition that check that that value is the largest.
Share
Loop through the array, failing if you find an element that is larger or if you don’t find an element that is equal?
Revisiting this in 2020, post Ada 2012, a pair of quantifiers might do the trick; see the postcondition of
Largest_Member: