Sorted predicate and decision procedure for it. Similar to ziman's EvenList.