checkNonDecreasing function
Implementation
void checkNonDecreasing(String name, List<double> arr) {
for (int i = 1; i < arr.length; ++i) {
invariant(arr[i] >= arr[i - 1], [
'%s must be monotonically non-decreasing. (%s)',
name,
arr.toString()
]);
}
}