logic.spad line 612 [edit on github]
holds a complete set together with a structure to codify the partial order. for more documentation see: htm
addArrow!(s, nm, n1, n2)
adds an arrow to the graph s
, where: n1
is the index of the start object n2
is the index of the end object This is done in a non-mutable way, that is, the original poset is not changed instead a new one is constructed.
addObject!(s, n)
adds object with coordinates n
to the graph s
. This is done in a non-mutable way, that is, the original poset is not changed instead a new one is constructed.
Reflexivity requires forall(x
): x<=x This function enforces this by making sure that every element has arrow to itself. That is, the leading diagonal is true
.
Transitivity requires forall(x
, y
, z
): x<=y and y<=z implies x<=z This function enforces this by making sure that the composition of any two arrows is also an arrow.
the covering matrix of a list of elements from a comparison function the list is assumed to be topologically sorted, i.e. w
.r
. to a linear extension of the comparison function f
This function is based on code by Franz Lehner. Notes by Martin Baker on the webpage here:
finitePoset(c, s)
constructs a finite poset where the set and structure is supplied.
finitePoset(c, p)
constructs a finite poset where the set and structure is supplied. The structure is supplied as a predicate function.
getArr(s)
returns a list of all the arrows (or edges) Note: different from getArrows(s
) which is inherited from FiniteGraph(S
)
getVert(s)
returns a list of all the vertices (or objects) of the graph s
. Note: different from getVertices(s
) which is inherited from FiniteGraph(S
)
glb(s, l)
'greatest lower bound' or 'infimum' of l
. In this version of glb
nodes are represented as index values. Not every subset of a poset will have a glb
in which case "failed" will be returned as an error indication.
indexToObject returns
the object at a given index.
isAntiChain?(s)
checks if s
is an antichain, that is any two elements in s
are incomparable.
Antisymmetric requires forall(x
, y
): x<=y and y<=x iff x=y Returns true
if this is the case for every element.
isChain?(s)
checks if s
is a chain, that is any two elements in s
are comparable.
joinIfCan returns
the join of a subset of lattice given by list of elements.
joinIfCan(s, a, b)
returns the join of 'a' and 'b'
In this version of join nodes are represented as index values. In the general case, not every poset will have a join in which case "failed" will be returned as an error indication.
a subset U
with the property that, if x
is in U
and x
>=
y
, then y
is in U
lub(s, l)
is 'least upper bound' or 'supremum' of l
. In this version of lub nodes are represented as index values. Not every subset of a poset will have a lub in which case "failed" will be returned as an error indication.
meetIfCan returns
the meet of a subset of lattice given by list of elements.
meetIfCan(s, a, b)
returns the meet of 'a' and 'b'
In this version of meet nodes are represented as index values. In the general case, not every poset will have a meet in which case "failed" will be returned as an error indication.
moebius incidence
matrix for this poset This function is based on code by Franz Lehner. Notes by Martin Baker on the webpage here:
objectToIndex returns
the index of a given object.
opposite(s)
constructs the opposite in the category theory sense of reversing all the arrows.
powerSetStructure(set)
is a constructor for a Poset where each element is a set
(implemented as a list) and with a subset structure. requires S
to be a list.
setArr(s, la)
sets the list of all arrows (or edges)
setVert(s, lv)
sets the list of all vertices (or objects)
a subset U
with the property that, if x
is in U
and x
<=
y
, then y
is in U
zetaMatrix(P)
returns the matrix of the zeta function This function is based on code by Franz Lehner. Notes by Martin Baker on the webpage here:
FiniteGraph(S)
Preorder(S)