Continuing my efforts transcribing from Dafny to SPARK I run into problems making a precondition for an array that should be sorted on invoking the function:
type Integer_Array is array (Positive range <>) of Integer;
function BinarySearch(a : Integer_Array; key: Integer) return Integer
with
-- requires forall i,j :: 0 <= i < j < a.Length ==> a[i] <= a[j] // a is a sorted array
Pre => ((a'Length >= 2) and then (for all i in 1 .. a'Length - 1 => a(i-1) < a(i)))
-- | ^---- array index check might fail
-- \------------- array index check might fail
What have I missed?