UserDefinedPartialOrdering SΒΆ
setorder.spad line 1 [edit on github]
S: SetCategory
Provides functions to force a partial ordering on any set.
- getOrder: () -> Record(low: List S, high: List S)
getOrder()returns[[b1, ..., bm], [a1, ..., an]]such that the partial ordering onSwas given bysetOrder([b1, ..., bm], [a1, ..., an]).
- largest: (List S, (S, S) -> Boolean) -> S
largest(l, fn)returns the largest element oflwhere the partial ordering induced by setOrder is completed into a total one byfn.
- largest: List S -> S if S has OrderedSet
largest lreturns the largest element oflwhere the partial ordering induced by setOrder is completed into a total one by the ordering onS.
- less?: (S, S) -> Union(Boolean, failed)
less?(a, b)comparesaandbin the partial ordering induced by setOrder.
- less?: (S, S, (S, S) -> Boolean) -> Boolean
less?(a, b, fn)comparesaandbin the partial ordering induced by setOrder, and returnsfn(a, b)ifaandbare not comparable in that ordering.
- more?: (S, S) -> Boolean if S has OrderedSet
more?(a, b)comparesaandbin the partial ordering induced by setOrder, and uses the ordering onSifaandbare not comparable in the partial ordering.
- setOrder: (List S, List S) -> Void
setOrder([b1, ..., bm], [a1, ..., an])defines a partial ordering onSgivenby:(1)b1 < b2 < ... < bm < a1 < a2 < ... < an. (2)bj < c < aiforcnot among theai'sandbj's. (3) undefined on(c, d)if neither is among theai's,bj's.