Averest


PartialOrders Module

This module implements functions for checking whether a given binary relation satisfies some properties of partial orders, directed sets, and lattices. It is restricted, however, to finite relations and sets.

Functions and values

Function or value Description

CheckPartialOrderRelation elements rel

Full Usage: CheckPartialOrderRelation elements rel

Parameters:
    elements : seq<'a>
    rel : Set<'a * 'a>

Returns: Set<'a> * Set<'a * 'a> * Set<'a * 'a * 'a>

Checks whether the relation rel is a partial order relation, i.e., whether it is reflexive, antisymmetric, and transitive. It returns a triple (missRefl,missAntisym,missTrans) whose sets contain the missing parts, i.e., x missing reflexivity, (x,y) being both with (y,x) in the relation but not being the same, and (x,y,z) in missTrans when (x,y) and (y,z) are in the relation but (x,z) is not.

elements : seq<'a>
rel : Set<'a * 'a>
Returns: Set<'a> * Set<'a * 'a> * Set<'a * 'a * 'a>

ComputeBounds elements rel m

Full Usage: ComputeBounds elements rel m

Parameters:
    elements : Set<'a>
    rel : Set<'a * 'a>
    m : Set<'a>

Returns: Set<'a> * Set<'a>

Compute the lower and upper bounds for a given set m. The result is a pair (lowerBounds,upperBounds) with the bounds.

elements : Set<'a>
rel : Set<'a * 'a>
m : Set<'a>
Returns: Set<'a> * Set<'a>

GetElements rel

Full Usage: GetElements rel

Parameters:
    rel : Set<'a * 'a>

Returns: Set<'a>

get the elements that occur in a binary relation rel

rel : Set<'a * 'a>
Returns: Set<'a>

Hasse2Dot ostr rel

Full Usage: Hasse2Dot ostr rel

Parameters:

write Hasse diagram to a dot file

ostr : TextWriter
rel : Set<string * string>

InfSup elements rel m

Full Usage: InfSup elements rel m

Parameters:
    elements : Set<'a>
    rel : Set<'a * 'a>
    m : Set<'a>

Returns: Set<'a> * Set<'a>

Compute the infimum and the supremum for a given set m. The result is a pair (infimum,supremum) that should be singleton sets when the infimum and supremum, respectively, exists, and is empty otherwise.

elements : Set<'a>
rel : Set<'a * 'a>
m : Set<'a>
Returns: Set<'a> * Set<'a>

IsDirectedSet elements rel m

Full Usage: IsDirectedSet elements rel m

Parameters:
    elements : Set<'a>
    rel : Set<'a * 'a>
    m : 'b

Returns: Set<'a * 'a>

Check whether a given set m is a directed set in the partial order. It returns a set noUpper of pairs (x,y) that do not have an upper bound, hence, m is a directed set if the returned set is empty.

elements : Set<'a>
rel : Set<'a * 'a>
m : 'b
Returns: Set<'a * 'a>

IsLattice elements rel m

Full Usage: IsLattice elements rel m

Parameters:
    elements : Set<'a>
    rel : Set<'a * 'a>
    m : 'b

Returns: Set<'a * 'a> * Set<'a * 'a>

Check whether a given set m is a lattice in the partial order. It returns a pair (noInf,noSup) of sets of pairs (x,y) that do not have an infimum and supremum, respectively.

elements : Set<'a>
rel : Set<'a * 'a>
m : 'b
Returns: Set<'a * 'a> * Set<'a * 'a>

ParseRelation rel

Full Usage: ParseRelation rel

Parameters:
    rel : string

Returns: Set<string * string>

parse a binary relation from a string e.g. "(a,b),(a,c),(a,d),(b,e)"

rel : string
Returns: Set<string * string>

PartialOrderTool qscoll

Full Usage: PartialOrderTool qscoll

Parameters:

PartialOrderTool is the function to be called from the web page; it expects the following key/value pairs:

  • PartialOrder: a binary relation like "(b,g),(c,f),(c,g)"
  • Subset: a set like "b,c,d"
  • ReflTrans: whether the reflexive-transitive closure should be used

qscoll : NameValueCollection

ReflexiveTransitiveClosure elements rel

Full Usage: ReflexiveTransitiveClosure elements rel

Parameters:
    elements : seq<'a>
    rel : Set<'a * 'a>

Returns: Set<'a * 'a>

compute the reflexive-transitive closure of a binary relation

elements : seq<'a>
rel : Set<'a * 'a>
Returns: Set<'a * 'a>

UndoReflexiveTransitiveClosure elements rel

Full Usage: UndoReflexiveTransitiveClosure elements rel

Parameters:
    elements : Set<'a>
    rel : Set<'a * 'a>

Returns: Set<'a * 'a>

remove reflexive and transitive pairs from a relation, e.g. to draw the Hasse diagram

elements : Set<'a>
rel : Set<'a * 'a>
Returns: Set<'a * 'a>