}
public void expand(ExistsDescriptionGraph existsDescriptionGraph,Node forNode) {
if (m_tableau.m_tableauMonitor!=null)
m_tableau.m_tableauMonitor.existentialExpansionStarted(existsDescriptionGraph,forNode);
m_newNodes.clear();
DescriptionGraph descriptionGraph=existsDescriptionGraph.getDescriptionGraph();
DependencySet dependencySet=m_extensionManager.getConceptAssertionDependencySet(existsDescriptionGraph,forNode);
Object[] auxiliaryTuple=m_auxiliaryTuples1[m_descriptionGraphIndices.get(descriptionGraph).intValue()];
auxiliaryTuple[0]=descriptionGraph;
for (int vertex=0;vertex<descriptionGraph.getNumberOfVertices();vertex++) {
Node newNode;
if (vertex==existsDescriptionGraph.getVertex())
newNode=forNode;
else
newNode=m_tableau.createNewGraphNode(forNode.getClusterAnchor(),dependencySet);
m_newNodes.add(newNode);
auxiliaryTuple[vertex+1]=newNode;
}
m_extensionManager.addTuple(auxiliaryTuple,dependencySet,true);
// Replace all nodes with the canonical node because the nodes might have been merged
for (int vertex=0;vertex<descriptionGraph.getNumberOfVertices();vertex++) {
Node newNode=m_newNodes.get(vertex);
dependencySet=newNode.addCanonicalNodeDependencySet(dependencySet);
m_newNodes.set(vertex,newNode.getCanonicalNode());
}
// Now add the graph layout
for (int vertex=0;vertex<descriptionGraph.getNumberOfVertices();vertex++)
m_extensionManager.addConceptAssertion(descriptionGraph.getAtomicConceptForVertex(vertex),m_newNodes.get(vertex),dependencySet,true);
for (int edgeIndex=0;edgeIndex<descriptionGraph.getNumberOfEdges();edgeIndex++) {
DescriptionGraph.Edge edge=descriptionGraph.getEdge(edgeIndex);
m_extensionManager.addRoleAssertion(edge.getAtomicRole(),m_newNodes.get(edge.getFromVertex()),m_newNodes.get(edge.getToVertex()),dependencySet,true);
}
m_newNodes.clear();
if (m_tableau.m_tableauMonitor!=null)
m_tableau.m_tableauMonitor.existentialExpansionFinished(existsDescriptionGraph,forNode);