Package org.semanticweb.HermiT.tableau

Examples of org.semanticweb.HermiT.tableau.Node


            if (this==that)
                return true;
            if (!(that instanceof ValidatedBlockingSignature || that instanceof Node))
                return false;
            if (that instanceof Node) {
                Node thatNode=(Node)that;
                Node thatParent=thatNode.getParent();
                if (thatParent==null) return false;
                ValidatedPairwiseBlockingObject nodeBlockingObject=(ValidatedPairwiseBlockingObject)thatNode.getBlockingObject();
                ValidatedPairwiseBlockingObject parentBlockingObject=(ValidatedPairwiseBlockingObject)thatNode.getBlockingObject();
                return
                    m_blockingRelevantConceptsLabel==nodeBlockingObject.m_blockingRelevantLabel &&
View Full Code Here


                }
                catch (NumberFormatException error) {
                    JOptionPane.showMessageDialog(SubtreeViewer.this,"Invalid node ID '"+nodeIDText+"'.");
                    return;
                }
                Node node=m_debugger.getTableau().getNode(nodeID);
                if (node==null) {
                    JOptionPane.showMessageDialog(SubtreeViewer.this,"Node with ID "+nodeID+" cannot be found.");
                    return;
                }
                findNode(node);
View Full Code Here

    public void refresh() {
        m_subtreeTreeModel.refresh();
    }
    public void findNode(Node node) {
        List<Node> pathToRoot=new ArrayList<Node>();
        Node currentNode=node;
        while (currentNode!=null && currentNode!=m_subtreeTreeModel.getRoot()) {
            pathToRoot.add(currentNode);
            currentNode=m_debugger.getNodeCreationInfo(currentNode).m_createdByNode;
        }
        if (currentNode==null) {
View Full Code Here

       
        public NodeCellRenderer(Debugger debugger) {
            m_debugger=debugger;
        }
        public Component getTreeCellRendererComponent(JTree tree,Object value,boolean selected,boolean expanded,boolean leaf,int row,boolean hasFocus) {
            Node node=(Node)value;
            StringBuffer buffer=new StringBuffer();
            ExistentialConcept existentialConcept=m_debugger.getNodeCreationInfo(node).m_createdByExistential;
            if (existentialConcept==null) {
                buffer.append(node.getNodeID());
                buffer.append(":(root)");
            }
            else if (existentialConcept instanceof AtLeastConcept) {
                AtLeastConcept atLeastConcept=(AtLeastConcept)existentialConcept;
                buffer.append(atLeastConcept.getOnRole().toString(m_debugger.getPrefixes()));
                buffer.append("  -->  ");
                buffer.append(node.getNodeID());
                buffer.append(":[");
                buffer.append(atLeastConcept.getToConcept().toString(m_debugger.getPrefixes()));
                buffer.append("]");
            }
            else {
                // Do nothing for now.
            }
            super.getTreeCellRendererComponent(tree,buffer.toString(),selected,expanded,leaf,row,hasFocus);
            if (!node.isActive())
                setIcon(NOT_ACTIVE_ICON);
            else if (node.isBlocked())
                setIcon(BLOCKED_ICON);
            else if (node.hasUnprocessedExistentials())
                setIcon(WITH_EXISTENTIALS_ICON);
            else {
                switch (node.getNodeType()) {
                case TREE_NODE:
                    setIcon(TREE_NODE_ICON);
                    break;
                case GRAPH_NODE:
                    setIcon(GRAPH_NODE_ICON);
View Full Code Here

        int numberOfNodes=0;
        int inactiveNodes=0;
        int blockedNodes=0;
        int nodesWithExistentials=0;
        int pendingExistentials=0;
        Node node=m_tableau.getFirstTableauNode();
        while (node!=null) {
            numberOfNodes++;
            if (!node.isActive())
                inactiveNodes++;
            else if (node.isBlocked())
                blockedNodes++;
            else {
                if (node.hasUnprocessedExistentials())
                    nodesWithExistentials++;
                pendingExistentials+=node.getUnprocessedExistentials().size();
            }
            node=node.getNextTableauNode();
        }
        m_output.println("Nodes: "+numberOfNodes+"  Inactive nodes: "+inactiveNodes+"  Blocked nodes: "+blockedNodes+"  Nodes with exists: "+nodesWithExistentials+"  Pending existentials: "+pendingExistentials);
    }
View Full Code Here

                Object[] tupleBuffer=retrieval.getTupleBuffer();
                while (!retrieval.afterLast()) {
                    Object roleObject=tupleBuffer[0];
                    if (roleObject instanceof AtomicRole) {
                        AtomicRole atomicrole=(AtomicRole)roleObject;
                        Node node2=(Node)tupleBuffer[2];
                        if (node2.isActive() && node2.getNodeType()==NodeType.NAMED_NODE && individualsForNodes.containsKey(node2)) {
                            Individual successor=individualsForNodes.get(node2);
                            Map<AtomicRole,Map<Individual,Set<Individual>>> relevantRelations;
                            if (retrieval.getDependencySet().isEmpty())
                                relevantRelations=knownObjectPropertyRelations;
                            else
                                relevantRelations=possibleObjectPropertyRelations;
                            Map<Individual,Set<Individual>> relationsForRole=relevantRelations.get(atomicrole);
                            if (relationsForRole==null) {
                                relationsForRole=new HashMap<Individual, Set<Individual>>();
                                relevantRelations.put(atomicrole, relationsForRole);
                            }
                            Set<Individual> successors=relationsForRole.get(ind);
                            if (successors==null) {
                                successors=new HashSet<Individual>();
                                relationsForRole.put(ind, successors);
                            }
                            successors.add(successor);
                        }
                    }
                    retrieval.next();
                }
                // add more possible relations for complex properties
                String indIRI=ind.getIRI();
                AtomicConcept conceptForRole;
                for (Role objectRole : complexObjectRoles) {
                    if (objectRole instanceof AtomicRole) {
                        conceptForRole=AtomicConcept.create("internal:individual-concept#"+((AtomicRole)objectRole).getIRI()+"#"+indIRI);
                    } else {
                        conceptForRole=AtomicConcept.create("internal:individual-concept#inv#"+((InverseRole)objectRole).getInverseOf().getIRI()+"#"+indIRI);
                    }
                    retrieval=tableau.getExtensionManager().getBinaryExtensionTable().createRetrieval(new boolean[] { true,false },ExtensionTable.View.TOTAL);
                    retrieval.getBindingsBuffer()[0]=conceptForRole;
                    retrieval.open();
                    tupleBuffer=retrieval.getTupleBuffer();
                    while (!retrieval.afterLast()) {
                        Node node=(Node)tupleBuffer[1];
                        if (node.isActive() && node.getNodeType()==NodeType.NAMED_NODE && individualsForNodes.containsKey(node)) {
                            AtomicRole atomicrole;
                            Individual first=ind;
                            Individual second=individualsForNodes.get(node);
                            if (objectRole instanceof AtomicRole) {
                                atomicrole=(AtomicRole)objectRole;
View Full Code Here

        }
        records.add(new TestRecord(m_time, m_reasoningTaskDescription.getTaskDescription(Prefixes.STANDARD_PREFIXES), m_testResult));
        m_overallTime+=m_time;
        m_overallNumberOfBacktrackings+=m_numberOfBacktrackings;
        m_numberOfNodes=m_tableau.getNumberOfNodesInTableau()-m_tableau.getNumberOfMergedOrPrunedNodes();
        Node node;
        node=m_tableau.getFirstTableauNode();
        while (node!=null) {
            if (node.isActive() && node.isBlocked() && node.hasUnprocessedExistentials())
                m_numberOfBlockedNodes++;
            node=node.getNextTableauNode();
        }
        m_overallNumberOfNodes+=m_numberOfNodes;
        m_overallNumberOfBlockedNodes+=m_numberOfBlockedNodes;
        m_overallInitialModelSize+=m_initialModelSize;
        m_overallInitiallyBlocked+=m_initiallyBlocked;
View Full Code Here

    public void backtrackToFinished(BranchingPoint newCurrentBrancingPoint) {
        m_numberOfBacktrackings++;
    }
    public void blockingValidationStarted() {
      m_noValidations++;
      Node node;
      if (m_noValidations==1) {
            node=m_tableau.getFirstTableauNode();
            while (node!=null) {
                if (node.isActive()) {
                    m_initialModelSize++;
                    if (node.isBlocked() && node.hasUnprocessedExistentials()) {
                        m_initiallyBlocked++;
                    }
                }
                node=node.getNextTableauNode();
            }
      }
      m_validationStartTime=System.currentTimeMillis();
    }
View Full Code Here

    public void execute(String[] args) {
        int noNodes=0;
        int noUnblockedNodes=0;
        int noDirectlyBlockedNodes=0;
        int noIndirectlyBlockedNodes=0;
        Node node=m_debugger.getTableau().getFirstTableauNode();
        while (node!=null) {
            noNodes++;
            if (node.isDirectlyBlocked())
                noDirectlyBlockedNodes++;
            else if (node.isIndirectlyBlocked())
                noIndirectlyBlockedNodes++;
            else
                noUnblockedNodes++;
            node=node.getNextTableauNode();
        }
        CharArrayWriter buffer=new CharArrayWriter();
        PrintWriter writer=new PrintWriter(buffer);
        writer.println("  Model statistics");
        writer.println("================================================");
View Full Code Here

        m_derivations.pop();
    }
    public void datatypeConjunctionCheckingStarted(DatatypeManager.DConjunction conjunction) {
        List<Atom> atoms=new ArrayList<Atom>();
        for (DatatypeManager.DVariable variable : conjunction.getActiveVariables()) {
            Node node=variable.getNode();
            for (DatatypeRestriction datatypeRestriction : variable.getPositiveDatatypeRestrictions())
                atoms.add(getAtom(new Object[] { datatypeRestriction,node }));
            for (DatatypeRestriction datatypeRestriction : variable.getNegativeDatatypeRestrictions())
                atoms.add(getAtom(new Object[] { datatypeRestriction.getNegation(),node }));
            for (ConstantEnumeration dataValueEnumeration : variable.getPositiveDataValueEnumerations())
View Full Code Here

TOP

Related Classes of org.semanticweb.HermiT.tableau.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.