Re:Software engineering research is a train wreck
by NohatCoder on Tuesday July 20, 2021 @03:40PM
(#27898278)
Sorting is one of the more favorable tasks for being specified this way, for much code there is no simpler way to verify the output than running the same or equivalent code again.
If your specification language is not Turing complete then there is simply stuff you cannot specify. Of course, just because it isn't Turing complete doesn't mean it isn't perfectly adequate for writing bugs.
One way to look at things is to say the permutation and ordering property checkers are the specification and the actual sorting algorithm is the implementation.
To your point about the specifications being Turing complete, some tools will put restrictions on the specifications to make function termination highly likely. COQ for instance requires that recursive functions be "decreasing in their inputs" AKA that subsequent calls to the same function are passed fewer items or elements than the parent.