Package ptolemy.data.ontologies.lattice
Class ProductLatticeCPO
- java.lang.Object
- 
- ptolemy.data.ontologies.ConceptGraph
- 
- ptolemy.data.ontologies.lattice.ProductLatticeCPO
 
 
- 
 public class ProductLatticeCPO extends ConceptGraph A complete partial order for product lattice-based ontologies. Given a product lattice defined by a list ofProductLatticeConcepts, 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)- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Charles Shelton
- Pt.AcceptedRating:
- Red (cshelton)
- Pt.ProposedRating:
- Red (cshelton)
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface ptolemy.graph.CPOCPO.BoundType
 
- 
 - 
Field Summary- 
Fields inherited from interface ptolemy.graph.CPOHIGHER, INCOMPARABLE, LOWER, SAME
 
- 
 - 
Constructor SummaryConstructors Constructor Description ProductLatticeCPO(ProductLatticeOntology productOntology)Create a new ProductLatticeCPO from the given list of ProductLatticeConcepts.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Conceptbottom()Return the bottom element of this CPO.intcompare(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.ConceptgreatestLowerBound(java.lang.Object e1, java.lang.Object e2)Compute the greatest lower bound (GLB) of two elements.ConceptleastUpperBound(java.lang.Object e1, java.lang.Object e2)Compute the least upper bound (LUB) of two elements.NonProductLatticeCounterExamplenonLatticeReason()Return the reason why this CPO is not a lattice, or null if it is.Concepttop()Return the top element of this CPO.- 
Methods inherited from class ptolemy.data.ontologies.ConceptGraphgreatestElement, greatestLowerBound, isLattice, leastElement, leastUpperBound, upSet
 
- 
 
- 
- 
- 
Constructor Detail- 
ProductLatticeCPOpublic ProductLatticeCPO(ProductLatticeOntology productOntology) Create a new ProductLatticeCPO from the given list of ProductLatticeConcepts.- Parameters:
- productOntology- The product lattice ontology for which this CPO is a complete partial order.
 
 
- 
 - 
Method Detail- 
bottompublic Concept bottom() Return the bottom element of this CPO. The bottom element is the element in the CPO that is lower than all the other elements.- Specified by:
- bottomin interface- CPO<Concept>
- Specified by:
- bottomin class- ConceptGraph
- Returns:
- An Object representing the bottom element, or
   nullif the bottom does not exist.
 
 - 
comparepublic int compare(java.lang.Object e1, java.lang.Object e2)Compare two concepts in the product lattice ontology. The arguments must be instances ofProductLatticeConcept, 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.- Specified by:
- comparein interface- CPO<Concept>
- Specified by:
- comparein class- ConceptGraph
- Parameters:
- e1- An instance of- ProductLatticeConcept.
- e2- An instance of- ProductLatticeConcept.
- Returns:
- One of CPO.LOWER, CPO.SAME, CPO.HIGHER, CPO.INCOMPARABLE.
- Throws:
- 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.
 
 - 
downSetpublic ProductLatticeConcept[] downSet(java.lang.Object e) Compute the down-set of an element in this concept graph. This is implemented by deferring to the downSet functions of the component graphs and then enumerating all the product results.- Specified by:
- downSetin interface- CPO<Concept>
- Overrides:
- downSetin class- ConceptGraph
- Parameters:
- e- An Object representing a ProductLatticeConcept in this concept graph.
- Returns:
- An array of ProductLatticeConcepts of the down-set of the given argument concept.
- Throws:
- java.lang.IllegalArgumentException- If the passed object is not a ProductLatticeConcept or does not belong to this CPO.
 
 - 
greatestLowerBoundpublic Concept greatestLowerBound(java.lang.Object e1, java.lang.Object e2) Compute the greatest lower bound (GLB) of two elements. The GLB of two elements is the greatest element in the CPO that is lower than or the same as both of the two elements.- Specified by:
- greatestLowerBoundin interface- CPO<Concept>
- Overrides:
- greatestLowerBoundin class- ConceptGraph
- Parameters:
- e1- An Object representing an element in this CPO.
- e2- An Object representing an element in this CPO.
- Returns:
- An Object representing the GLB of the two specified
   elements, or nullif the GLB does not exist.
- Throws:
- java.lang.IllegalArgumentException- Thrown if the product lattice concept greatest lower bound cannot be created from the component greatest lower bound concepts.
 
 - 
nonLatticeReasonpublic NonProductLatticeCounterExample nonLatticeReason() Return the reason why this CPO is not a lattice, or null if it is. A Product Lattice CPO is a lattice if all of its component ontologies are lattices.- Specified by:
- nonLatticeReasonin class- ConceptGraph
- Returns:
- A string representing which subontology is responsible for
   this not being a lattice;
   nullotherwise.
 
 - 
leastUpperBoundpublic Concept leastUpperBound(java.lang.Object e1, java.lang.Object e2) Compute the least upper bound (LUB) of two elements. The LUB of two elements is the least element in the CPO that is greater than or the same as both of the two elements.- Specified by:
- leastUpperBoundin interface- CPO<Concept>
- Specified by:
- leastUpperBoundin class- ConceptGraph
- Parameters:
- e1- An Object representing an element in this CPO.
- e2- An Object representing an element in this CPO.
- Returns:
- Nothing.
- Throws:
- java.lang.IllegalArgumentException- Thrown if the product lattice concept least upper bound cannot be created from the component least upper bound concepts.
 
 - 
toppublic Concept top() Return the top element of this CPO. The top element is the element in the CPO that is higher than all the other elements.- Specified by:
- topin interface- CPO<Concept>
- Specified by:
- topin class- ConceptGraph
- Returns:
- An Object representing the top element, or
   nullif the top does not exist.
 
 
- 
 
-