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 onS
was given bysetOrder([b1, ..., bm], [a1, ..., an])
.
- largest: (List S, (S, S) -> Boolean) -> S
largest(l, fn)
returns the largest element ofl
where the partial ordering induced by setOrder is completed into a total one byfn
.
- largest: List S -> S if S has OrderedSet
largest l
returns the largest element ofl
where 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)
comparesa
andb
in the partial ordering induced by setOrder.
- less?: (S, S, (S, S) -> Boolean) -> Boolean
less?(a, b, fn)
comparesa
andb
in the partial ordering induced by setOrder, and returnsfn(a, b)
ifa
andb
are not comparable in that ordering.
- more?: (S, S) -> Boolean if S has OrderedSet
more?(a, b)
comparesa
andb
in the partial ordering induced by setOrder, and uses the ordering onS
ifa
andb
are not comparable in the partial ordering.
- setOrder: (List S, List S) -> Void
setOrder([b1, ..., bm], [a1, ..., an])
defines a partial ordering onS
givenby:
(1)b1 < b2 < ... < bm < a1 < a2 < ... < an
. (2)bj < c < ai
forc
not among theai
's
andbj
's
. (3) undefined on(c, d)
if neither is among theai
's
,bj
's
.