Sorting logics