Binary search insertion point
In a sorted integer array, binary search returns an index at most the array length.
Permanent public credit, certificates, and points. Unpaid; uses your AI plan.
The exact statement
theorem BinarySearch_spec_satisfied (a: Array Int) (key: Int) (h_precond : BinarySearch_precond (a) (key)) :
BinarySearch_postcond (a) (key) (BinarySearch (a) (key) h_precond) h_precondIn a sorted integer array, binary search returns an index at most the array length. Every entry before it is less than the key, and every entry from it onward is at least the key.
