public void restoreLocal(final Individual ind, final Branch br) { _abox.getStats()._localRestores++; _abox.setClash(null); _abox.setBranchIndex(br.getBranchIndexInABox()); final Map<Node, Boolean> visited = new HashMap<>(); restoreLocal(ind, br.getBranchIndexInABox(), visited); for (final Map.Entry<Node, Boolean> entry : visited.entrySet()) { final boolean restored = entry.getValue(); if (restored) _allValuesRule.apply((Individual) entry.getKey()); } }
public void restoreLocal(final Individual ind, final Branch br) { _abox.getStats()._localRestores++; _abox.setClash(null); _abox.setBranchIndex(br.getBranchIndexInABox()); final Map<Node, Boolean> visited = new HashMap<>(); restoreLocal(ind, br.getBranchIndexInABox(), visited); for (final Map.Entry<Node, Boolean> entry : visited.entrySet()) { final boolean restored = entry.getValue(); if (restored) _allValuesRule.apply((Individual) entry.getKey()); } }
@Override public void addDifferent(final ATermAppl i1, final ATermAppl i2) { if (null == i1 || null == i2) return; // set addition flag _changes.add(ChangeType.ABOX_ADD); // if we can use incremental consistency checking then add to // pseudomodel if (canUseIncConsistency()) { // TODO: refactor the access to the updatedIndividuals and // newIndividuals - add get method _abox.getIncrementalChangeTracker().addUpdatedIndividual(_abox.getIndividual(i1)); _abox.getIncrementalChangeTracker().addUpdatedIndividual(_abox.getIndividual(i2)); // add to pseudomodel - note _branch must be temporarily set to 0 to // ensure that asssertion // will not be restored during backtracking final int branch = _abox.getBranchIndex(); _abox.setBranchIndex(0); _abox.addDifferent(i1, i2); _abox.setBranchIndex(branch); } _abox.addDifferent(i1, i2); _logger.finer(() -> "diff " + i1 + " " + i2); }
@Override public void addDifferent(final ATermAppl i1, final ATermAppl i2) { if (null == i1 || null == i2) return; // set addition flag _changes.add(ChangeType.ABOX_ADD); // if we can use incremental consistency checking then add to // pseudomodel if (canUseIncConsistency()) { // TODO: refactor the access to the updatedIndividuals and // newIndividuals - add get method _abox.getIncrementalChangeTracker().addUpdatedIndividual(_abox.getIndividual(i1)); _abox.getIncrementalChangeTracker().addUpdatedIndividual(_abox.getIndividual(i2)); // add to pseudomodel - note _branch must be temporarily set to 0 to // ensure that asssertion // will not be restored during backtracking final int branch = _abox.getBranchIndex(); _abox.setBranchIndex(0); _abox.addDifferent(i1, i2); _abox.setBranchIndex(branch); } _abox.addDifferent(i1, i2); _logger.finer(() -> "diff " + i1 + " " + i2); }
clashPath.add(clashNode.getName()); _abox.setBranchIndex(br.getBranchIndexInABox()); _abox.setClash(null);
@Override public void initialize(final Expressivity expressivity) { _mergeList.clear(); _mnx.add(null); // add a null entry so Branch._branch _index will match with the _index in this array assert _abox.size() == 1 : "This strategy can only be used with originally empty ABoxes"; _blocking = BlockingFactory.createBlocking(expressivity); final Individual root = _abox.getIndIterator().next(); applyUniversalRestrictions(root); _selfRule.apply(root); _mayNeedExpanding.add(root); _abox.setBranchIndex(1); _abox.getStats()._treeDepth = 1; _abox.setChanged(true); _abox.setComplete(false); _abox.setInitialized(true); }
@Override public void initialize(final Expressivity expressivity) { _mergeList.clear(); _mnx.add(null); // add a null entry so Branch._branch _index will match with the _index in this array assert _abox.size() == 1 : "This strategy can only be used with originally empty ABoxes"; _blocking = BlockingFactory.createBlocking(expressivity); final Individual root = _abox.getIndIterator().next(); applyUniversalRestrictions(root); _selfRule.apply(root); _mayNeedExpanding.add(root); _abox.setBranchIndex(1); _abox.getStats()._treeDepth = 1; _abox.setChanged(true); _abox.setComplete(false); _abox.setInitialized(true); }
clashPath.add(clashNode.getName()); _abox.setBranchIndex(br.getBranchIndexInABox()); _abox.setClash(null);
/** * Restore a branch add dependency * * @param assertion * @param branch */ private void restoreBranchAdd(final ATermAppl assertion, final AddBranchDependency branch) { DependencyIndex._logger.fine(() -> " Removing branch add? " + branch.getBranch()); final DependencySet ds = branch.getBranch().getTermDepends(); // get merge dependency ds.removeExplain(assertion); // remove the dependency if (ds.getExplain().isEmpty()) // undo merge if empty { DependencyIndex._logger.fine(" Actually removing branch!"); final ABox abox = _kb.getABox(); phase1(branch, abox); // TODO rename this function when you find the its semantic. if (OpenlletOptions.TRACK_BRANCH_EFFECTS) abox.getBranchEffectTracker().remove(branch.getBranch().getBranchIndexInABox() + 1); updateBranchesOfABox(branch, abox); // Next update abox branches abox.setBranchIndex(abox.getBranchIndex() - 1); // set the branch counter } }
/** * Restore a branch add dependency * * @param assertion * @param branch */ private void restoreBranchAdd(final ATermAppl assertion, final AddBranchDependency branch) { DependencyIndex._logger.fine(() -> " Removing branch add? " + branch.getBranch()); final DependencySet ds = branch.getBranch().getTermDepends(); // get merge dependency ds.removeExplain(assertion); // remove the dependency if (ds.getExplain().isEmpty()) // undo merge if empty { DependencyIndex._logger.fine(" Actually removing branch!"); final ABox abox = _kb.getABox(); phase1(branch, abox); // TODO rename this function when you find the its semantic. if (OpenlletOptions.TRACK_BRANCH_EFFECTS) abox.getBranchEffectTracker().remove(branch.getBranch().getBranchIndexInABox() + 1); updateBranchesOfABox(branch, abox); // Next update abox branches abox.setBranchIndex(abox.getBranchIndex() - 1); // set the branch counter } }
_abox.setBranchIndex(0); _abox.setBranchIndex(branch);
_abox.setBranchIndex(0); _abox.setBranchIndex(branch);
_abox.setBranchIndex(DependencySet.NO_BRANCH); _abox.setBranchIndex(remember);
_abox.setBranchIndex(DependencySet.NO_BRANCH); _abox.setBranchIndex(remember);
public void restore(final Branch br) _abox.setBranchIndex(br.getBranchIndexInABox()); _abox.setClash(null);
_abox.setBranchIndex(0); _abox.setBranchIndex(_abox.getBranches().size() + 1); _abox.getStats()._treeDepth = 1; _abox.setChanged(true);
_abox.setBranchIndex(0); _abox.setBranchIndex(_abox.getBranches().size() + 1); _abox.getStats()._treeDepth = 1; _abox.setChanged(true);
public void restore(final Branch br) _abox.setBranchIndex(br.getBranchIndexInABox()); _abox.setClash(null);
_abox.setBranchIndex(DependencySet.NO_BRANCH); _abox.setBranchIndex(branch);
_abox.setBranchIndex(DependencySet.NO_BRANCH); _abox.setBranchIndex(branch);