Let us suppose we have a sort function.
One way of specifying it is to say that a sort function is any function where if the input/output are vectors $I, O$, then $O_i \leq O_j \forall i < j$ and for every element $e \in I$, the count of $e$ in $I$ is the same as the count of $e$ in $O$.
Another way is to say that a sort function is any function whose output matches the output of insertion sort on the same input.
However the latter specification relies on actually solving the search problem and using it to specify the decision problem (whether an input is sorted or not). Is there a way to formalize the difference between the two so I can only consider specifications of the former variety?