org.semanticweb.HermiT.tableau
Class Tableau

java.lang.Object
  extended by org.semanticweb.HermiT.tableau.Tableau
All Implemented Interfaces:
java.io.Serializable

public final class Tableau
extends java.lang.Object
implements java.io.Serializable

This class coordinates the main tableau expansion for a given DLOntology (a normalized and clausified ontology). It represents the state of a run on a set of clauses and coordinates the extension of the ABox and also the retraction of facts when backtracking. Before starting the expansion, the given clauses are (for better performance) preprocessed via the HyperresolutionManager into a compiled and executable form.

See Also:
Serialized Form

Field Summary
private  java.util.Collection<Atom> additionalNegativeFacts
           
private  java.util.Collection<Atom> additionalPositiveFacts
           
protected  int m_allocatedNodes
           
protected  Node m_arbitraryOriginalNode
           
protected  BranchingPoint[] m_branchingPoints
           
protected  Node m_checkedNode
           
protected  int m_currentBranchingPoint
           
protected  DatatypeManager m_datatypeManager
           
protected  DependencySetFactory m_dependencySetFactory
           
protected  DescriptionGraphManager m_descriptionGraphManager
           
protected  DLOntology m_dlOntology
           
protected  java.util.List<java.util.List<ExistentialConcept>> m_existentialConceptsBuffers
           
protected  ExistentialExpansionManager m_existentialExpasionManager
           
protected  ExpansionStrategy m_existentialsExpansionStrategy
           
protected  ExtensionManager m_extensionManager
           
protected  Node m_firstFreeNode
           
protected  GroundDisjunction m_firstGroundDisjunction
           
protected  Node m_firstTableauNode
           
protected  GroundDisjunction m_firstUnprocessedGroundDisjunction
           
protected  HyperresolutionManager m_hyperresolutionManager
           
protected  boolean m_isCurrentModelDeterministic
           
protected  LabelManager m_labelManager
           
protected  Node m_lastMergedOrPrunedNode
           
protected  Node m_lastTableauNode
           
private  boolean m_makeTopRoleUniversal
           
protected  MergingManager m_mergingManager
           
protected  boolean m_needsThingExtension
           
protected  NominalIntroductionManager m_nominalIntroductionManager
           
protected  int m_nonbacktrackableBranchingPoint
           
protected  int m_numberOfMergedOrPrunedNodes
           
protected  int m_numberOfNodeCreations
           
protected  int m_numberOfNodesInTableau
           
protected  java.util.Map<java.lang.String,java.lang.Object> m_parameters
           
protected  TableauMonitor m_tableauMonitor
           
private static long serialVersionUID
           
 
Constructor Summary
Tableau(TableauMonitor tableauMonitor, ExpansionStrategy existentialsExpansionStrategy, DLOntology dlOntology, boolean makeTopRoleUniversal, java.util.Map<java.lang.String,java.lang.Object> parameters)
           
 
Method Summary
 void addGroundDisjunction(GroundDisjunction groundDisjunction)
           
protected  void backtrackLastMergedOrPrunedNode()
           
protected  void backtrackTo(int newCurrentBrancingPoint)
          Backtrack to a certain branching point in the list of branching points that have been set during the run.
protected  void checkTableauList()
           
 void clear()
           
 Node createNewConcreteNode(DependencySet dependencySet, Node parent)
           
 Node createNewGraphNode(Node parent, DependencySet dependencySet)
           
 Node createNewNodeRaw(DependencySet dependencySet, Node parent, NodeType nodeType, int treeDepth)
           
 Node createNewOriginalNode(DependencySet dependencySet, int treeDepth)
           
 Node createNewRootNode(DependencySet dependencySet, int treeDepth)
           
 Node createNewTreeNode(DependencySet dependencySet, Node parent)
           
protected  void destroyLastTableauNode()
           
protected  boolean doIteration()
           
 void extendWithDefinitions(java.util.Collection<DLClause> clauses, java.util.Collection<Atom> positiveFacts, java.util.Collection<Atom> negativeFacts)
          Extend the tableau (semantically the ontology associated with the tableau) with the given clauses and facts which provide *only* definitions for some new atomic concept names.
 Node getCheckedNode()
           
 BranchingPoint getCurrentBranchingPoint()
           
 int getCurrentBranchingPointLevel()
           
 DependencySetFactory getDependencySetFactory()
           
 DescriptionGraphManager getDescriptionGraphManager()
           
 DLOntology getDLOntology()
           
protected  java.util.List<ExistentialConcept> getExistentialConceptsBuffer()
           
 ExistentialExpansionManager getExistentialExpansionManager()
           
 ExpansionStrategy getExistentialsExpansionStrategy()
           
 ExtensionManager getExtensionManager()
           
 Node getFirstTableauNode()
           
 GroundDisjunction getFirstUnprocessedGroundDisjunction()
           
 HyperresolutionManager getHyperresolutionManager()
           
 LabelManager getLabelManager()
           
 Node getLastTableauNode()
           
 MergingManager getMergingManager()
           
 Node getNode(int nodeID)
           
private  Node getNodeForIndividual(java.util.Map<Individual,Node> individualsToNodes, Individual individual)
           
 NominalIntroductionManager getNominalIntroductionManager()
           
 int getNumberOfAllocatedNodes()
           
 int getNumberOfMergedOrPrunedNodes()
           
 int getNumberOfNodeCreations()
           
 int getNumberOfNodesInTableau()
           
 java.util.Map<java.lang.String,java.lang.Object> getParameters()
           
 TableauMonitor getTableauMonitor()
           
 boolean isABoxSatisfiable()
           
 boolean isAsymmetric(AtomicRole role)
           
 boolean isCurrentModelDeterministic()
           
 boolean isDeterministic()
           
 boolean isSatisfiable()
           
 boolean isSatisfiable(AtomicConcept atomicConcept)
           
 boolean isSubsumedBy(AtomicConcept subconcept, AtomicConcept superconcept)
           
protected  void loadABox()
           
private  void loadNegativeFact(Atom atom, java.util.Map<Individual,Node> individualsToNodes)
           
private  void loadPositiveFact(Atom atom, java.util.Map<Individual,Node> individualsToNodes)
           
 void mergeNode(Node node, Node mergeInto, DependencySet dependencySet)
           
 void pruneNode(Node node)
           
 void pushBranchingPoint(BranchingPoint branchingPoint)
          Add a branching point in case we need to backtrack to this state.
 void putExistentialConceptsBuffer(java.util.List<ExistentialConcept> buffer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

m_tableauMonitor

protected final TableauMonitor m_tableauMonitor

m_existentialsExpansionStrategy

protected final ExpansionStrategy m_existentialsExpansionStrategy

m_dlOntology

protected final DLOntology m_dlOntology

m_parameters

protected final java.util.Map<java.lang.String,java.lang.Object> m_parameters

m_makeTopRoleUniversal

private final boolean m_makeTopRoleUniversal

m_dependencySetFactory

protected final DependencySetFactory m_dependencySetFactory

m_extensionManager

protected final ExtensionManager m_extensionManager

m_labelManager

protected final LabelManager m_labelManager

m_hyperresolutionManager

protected HyperresolutionManager m_hyperresolutionManager

m_mergingManager

protected final MergingManager m_mergingManager

m_existentialExpasionManager

protected final ExistentialExpansionManager m_existentialExpasionManager

m_nominalIntroductionManager

protected final NominalIntroductionManager m_nominalIntroductionManager

m_descriptionGraphManager

protected final DescriptionGraphManager m_descriptionGraphManager

m_datatypeManager

protected final DatatypeManager m_datatypeManager

m_needsThingExtension

protected final boolean m_needsThingExtension

m_existentialConceptsBuffers

protected final java.util.List<java.util.List<ExistentialConcept>> m_existentialConceptsBuffers

m_branchingPoints

protected BranchingPoint[] m_branchingPoints

m_currentBranchingPoint

protected int m_currentBranchingPoint

m_nonbacktrackableBranchingPoint

protected int m_nonbacktrackableBranchingPoint

m_isCurrentModelDeterministic

protected boolean m_isCurrentModelDeterministic

m_allocatedNodes

protected int m_allocatedNodes

m_numberOfNodesInTableau

protected int m_numberOfNodesInTableau

m_numberOfMergedOrPrunedNodes

protected int m_numberOfMergedOrPrunedNodes

m_numberOfNodeCreations

protected int m_numberOfNodeCreations

m_firstFreeNode

protected Node m_firstFreeNode

m_firstTableauNode

protected Node m_firstTableauNode

m_lastTableauNode

protected Node m_lastTableauNode

m_lastMergedOrPrunedNode

protected Node m_lastMergedOrPrunedNode

m_arbitraryOriginalNode

protected Node m_arbitraryOriginalNode

m_firstGroundDisjunction

protected GroundDisjunction m_firstGroundDisjunction

m_firstUnprocessedGroundDisjunction

protected GroundDisjunction m_firstUnprocessedGroundDisjunction

m_checkedNode

protected Node m_checkedNode

additionalPositiveFacts

private java.util.Collection<Atom> additionalPositiveFacts

additionalNegativeFacts

private java.util.Collection<Atom> additionalNegativeFacts
Constructor Detail

Tableau

public Tableau(TableauMonitor tableauMonitor,
               ExpansionStrategy existentialsExpansionStrategy,
               DLOntology dlOntology,
               boolean makeTopRoleUniversal,
               java.util.Map<java.lang.String,java.lang.Object> parameters)
Method Detail

extendWithDefinitions

public void extendWithDefinitions(java.util.Collection<DLClause> clauses,
                                  java.util.Collection<Atom> positiveFacts,
                                  java.util.Collection<Atom> negativeFacts)
Extend the tableau (semantically the ontology associated with the tableau) with the given clauses and facts which provide *only* definitions for some new atomic concept names. Do *not* pass any clauses and/or facts which may produce new subsumptions between existing atomic concepts---that would break the subsumption cache. It would be nice to be able to pull these definitions back out again, but due to the way normalization works new definitions may depend upon old ones, so you need to keep the previous definitions any time you add new definitions. In the unlikely event that you get so many definitions that it really slows things down, you need only include all definitions when/if you need to use *any* definitions: i.e. you could keep the original HyperresolutionManager for answering queries which don't involve any complex concepts.


getDLOntology

public DLOntology getDLOntology()

getParameters

public java.util.Map<java.lang.String,java.lang.Object> getParameters()

getTableauMonitor

public TableauMonitor getTableauMonitor()

getExistentialsExpansionStrategy

public ExpansionStrategy getExistentialsExpansionStrategy()

isDeterministic

public boolean isDeterministic()

getDependencySetFactory

public DependencySetFactory getDependencySetFactory()

getExtensionManager

public ExtensionManager getExtensionManager()

getLabelManager

public LabelManager getLabelManager()

getHyperresolutionManager

public HyperresolutionManager getHyperresolutionManager()

getMergingManager

public MergingManager getMergingManager()

getExistentialExpansionManager

public ExistentialExpansionManager getExistentialExpansionManager()

getNominalIntroductionManager

public NominalIntroductionManager getNominalIntroductionManager()

getDescriptionGraphManager

public DescriptionGraphManager getDescriptionGraphManager()

clear

public void clear()

isSatisfiable

public boolean isSatisfiable()

doIteration

protected boolean doIteration()

getCheckedNode

public Node getCheckedNode()

isSatisfiable

public boolean isSatisfiable(AtomicConcept atomicConcept)

isSubsumedBy

public boolean isSubsumedBy(AtomicConcept subconcept,
                            AtomicConcept superconcept)

isAsymmetric

public boolean isAsymmetric(AtomicRole role)

isABoxSatisfiable

public boolean isABoxSatisfiable()

loadPositiveFact

private void loadPositiveFact(Atom atom,
                              java.util.Map<Individual,Node> individualsToNodes)

loadNegativeFact

private void loadNegativeFact(Atom atom,
                              java.util.Map<Individual,Node> individualsToNodes)

loadABox

protected void loadABox()

getNodeForIndividual

private Node getNodeForIndividual(java.util.Map<Individual,Node> individualsToNodes,
                                  Individual individual)

isCurrentModelDeterministic

public boolean isCurrentModelDeterministic()

getCurrentBranchingPointLevel

public int getCurrentBranchingPointLevel()

getCurrentBranchingPoint

public BranchingPoint getCurrentBranchingPoint()

addGroundDisjunction

public void addGroundDisjunction(GroundDisjunction groundDisjunction)

getFirstUnprocessedGroundDisjunction

public GroundDisjunction getFirstUnprocessedGroundDisjunction()

pushBranchingPoint

public void pushBranchingPoint(BranchingPoint branchingPoint)
Add a branching point in case we need to backtrack to this state.

Parameters:
branchingPoint -

backtrackTo

protected void backtrackTo(int newCurrentBrancingPoint)
Backtrack to a certain branching point in the list of branching points that have been set during the run.

Parameters:
newCurrentBrancingPoint -

createNewOriginalNode

public Node createNewOriginalNode(DependencySet dependencySet,
                                  int treeDepth)

createNewRootNode

public Node createNewRootNode(DependencySet dependencySet,
                              int treeDepth)

createNewTreeNode

public Node createNewTreeNode(DependencySet dependencySet,
                              Node parent)

createNewConcreteNode

public Node createNewConcreteNode(DependencySet dependencySet,
                                  Node parent)

createNewGraphNode

public Node createNewGraphNode(Node parent,
                               DependencySet dependencySet)

createNewNodeRaw

public Node createNewNodeRaw(DependencySet dependencySet,
                             Node parent,
                             NodeType nodeType,
                             int treeDepth)

mergeNode

public void mergeNode(Node node,
                      Node mergeInto,
                      DependencySet dependencySet)

pruneNode

public void pruneNode(Node node)

backtrackLastMergedOrPrunedNode

protected void backtrackLastMergedOrPrunedNode()

destroyLastTableauNode

protected void destroyLastTableauNode()

getNumberOfNodeCreations

public int getNumberOfNodeCreations()

getFirstTableauNode

public Node getFirstTableauNode()

getLastTableauNode

public Node getLastTableauNode()

getNumberOfAllocatedNodes

public int getNumberOfAllocatedNodes()

getNumberOfNodesInTableau

public int getNumberOfNodesInTableau()

getNumberOfMergedOrPrunedNodes

public int getNumberOfMergedOrPrunedNodes()

getNode

public Node getNode(int nodeID)

getExistentialConceptsBuffer

protected java.util.List<ExistentialConcept> getExistentialConceptsBuffer()

putExistentialConceptsBuffer

public void putExistentialConceptsBuffer(java.util.List<ExistentialConcept> buffer)

checkTableauList

protected void checkTableauList()