m_elements=elements;
m_knownSubsumptions=new Graph<AtomicConcept>();
m_possibleSubsumptions=new Graph<AtomicConcept>();
}
public Hierarchy<AtomicConcept> classify() {
Individual freshIndividual=Individual.createAnonymous("fresh-individual");
if (!m_tableau.isSatisfiable(false,Collections.singleton(Atom.create(m_topElement,freshIndividual)),null,null,Collections.singleton(Atom.create(m_bottomElement,freshIndividual)),null,getSubsumptionTestDescription(m_topElement,m_bottomElement)))
return Hierarchy.emptyHierarchy(m_elements,m_topElement,m_bottomElement);
Relation<AtomicConcept> relation=new Relation<AtomicConcept>() {
public boolean doesSubsume(AtomicConcept parent,AtomicConcept child) {
Set<AtomicConcept> allKnownSubsumers=getKnownSubsumers(child);
if (allKnownSubsumers.contains(parent))
return true;
else if (!allKnownSubsumers.contains(parent) && !m_possibleSubsumptions.getSuccessors(child).contains(parent))
return false;
Individual freshIndividual=Individual.createAnonymous("fresh-individual");
boolean isSubsumedBy=!m_tableau.isSatisfiable(true,Collections.singleton(Atom.create(child,freshIndividual)),null,null,Collections.singleton(Atom.create(parent,freshIndividual)),null,getSubsumptionTestDescription(child,parent));
if (!isSubsumedBy)
prunePossibleSubsumers();
return isSubsumedBy;
}