public class ProductLatticeCPO extends ConceptGraph
ProductLatticeConcept
s,
this class provides the implementation for all complete partial order
operations on the product lattice. Note that this complete partial order
implementation is not derived from a graph of the concepts, but rather by
doing comparison operations that depend on the structure of the individual
lattices that comprise the product lattice. For example, take a product
lattice P that is composed of two lattices L1 and L2. Each lattice element
concept in P is a tuple of the form <C(L1), C(L2)>. To decide the
relationship between two concepts in p1 and p2 in P, it is determined by
the relationships of the individual concepts in their tuples. So:
p1 ≥ p2 iff C1(L1) ≥ C2(L1) and C1(L2) ≥ C2(L2)Red (cshelton) |
Red (cshelton) |
CPO.BoundType
HIGHER, INCOMPARABLE, LOWER, SAME
Constructor and Description |
---|
ProductLatticeCPO(ProductLatticeOntology productOntology)
Create a new ProductLatticeCPO from the given list of
ProductLatticeConcepts.
|
Modifier and Type | Method and Description |
---|---|
Concept |
bottom()
Return the bottom element of this CPO.
|
int |
compare(java.lang.Object e1,
java.lang.Object e2)
Compare two concepts in the product lattice ontology.
|
ProductLatticeConcept[] |
downSet(java.lang.Object e)
Compute the down-set of an element in this concept graph.
|
Concept |
greatestLowerBound(java.lang.Object e1,
java.lang.Object e2)
Compute the greatest lower bound (GLB) of two elements.
|
Concept |
leastUpperBound(java.lang.Object e1,
java.lang.Object e2)
Compute the least upper bound (LUB) of two elements.
|
NonProductLatticeCounterExample |
nonLatticeReason()
Return the reason why this CPO is not a lattice, or null if it is.
|
Concept |
top()
Return the top element of this CPO.
|
greatestElement, greatestLowerBound, isLattice, leastElement, leastUpperBound, upSet
public ProductLatticeCPO(ProductLatticeOntology productOntology)
productOntology
- The product lattice ontology for which this CPO
is a complete partial order.public Concept bottom()
bottom
in interface CPO<Concept>
bottom
in class ConceptGraph
null
if the bottom does not exist.public int compare(java.lang.Object e1, java.lang.Object e2)
ProductLatticeConcept
, otherwise an exception will be thrown.
This method returns one of ptolemy.graph.CPO.LOWER, ptolemy.graph.CPO.SAME,
ptolemy.graph.CPO.HIGHER, ptolemy.graph.CPO.INCOMPARABLE, indicating the
first argument is lower than, equal to, higher than, or incomparable with
the second argument in the product lattice hierarchy, respectively.compare
in interface CPO<Concept>
compare
in class ConceptGraph
e1
- An instance of ProductLatticeConcept
.e2
- An instance of ProductLatticeConcept
.java.lang.IllegalArgumentException
- If one or both arguments are not
instances of ProductLatticeConcept
, the arguments are not from
the same ontology, or either argument has an empty or null concept tuple list.public ProductLatticeConcept[] downSet(java.lang.Object e)
downSet
in interface CPO<Concept>
downSet
in class ConceptGraph
e
- An Object representing a ProductLatticeConcept in this
concept graph.java.lang.IllegalArgumentException
- If the passed object is not a
ProductLatticeConcept or does not belong to this CPO.public Concept greatestLowerBound(java.lang.Object e1, java.lang.Object e2)
greatestLowerBound
in interface CPO<Concept>
greatestLowerBound
in class ConceptGraph
e1
- An Object representing an element in this CPO.e2
- An Object representing an element in this CPO.null
if the GLB does not exist.java.lang.IllegalArgumentException
- Thrown if the product lattice concept
greatest lower bound cannot be created from the component greatest lower
bound concepts.public NonProductLatticeCounterExample nonLatticeReason()
nonLatticeReason
in class ConceptGraph
null
otherwise.public Concept leastUpperBound(java.lang.Object e1, java.lang.Object e2)
leastUpperBound
in interface CPO<Concept>
leastUpperBound
in class ConceptGraph
e1
- An Object representing an element in this CPO.e2
- An Object representing an element in this CPO.java.lang.IllegalArgumentException
- Thrown if the product lattice concept
least upper bound cannot be created from the component least upper bound
concepts.public Concept top()
top
in interface CPO<Concept>
top
in class ConceptGraph
null
if the top does not exist.