Basically this could be something like this, D based example:
void process_list(List aList)
in(aList.isSorted, "List must be sorted!")
do
{
// do something
}
However the O() cost of calling isSorted() has an impact on overall cost for process_list() on every call, hence why the way contracts are executed is usually configurable in languages that have them available.
its easy as in "simple to implement and execute" but not cheap, because it may require scanning large amounts of memory. You have to visit every list entry.
Whats trivial for a very small list, may be a no-go for gigabyte-sized lists.