protected DependencySet forceAddType(final ATermAppl c, final DependencySet ds) { // add to effected list if (OpenlletOptions.TRACK_BRANCH_EFFECTS && _abox.getBranchIndex() >= 0) _abox.getBranchEffectTracker().add(_abox.getBranchIndex(), getName()); // if we are checking entailment using a precompleted ABox, _abox.branch // is set to -1. however, since applyAllValues is done automatically // and the edge used in applyAllValues may depend on a _branch we want // this type to be deleted when that edge goes away, i.e. we backtrack // to a position before the max dependency of this type int b = _abox.getBranchIndex(); final int max = ds.max(); if (b == -1 && max != 0) b = max + 1; final DependencySet out = ds.copy(b); _depends.put(c, out); _abox.setChanged(true); return out; }
protected DependencySet forceAddType(final ATermAppl c, final DependencySet ds) { // add to effected list if (OpenlletOptions.TRACK_BRANCH_EFFECTS && _abox.getBranchIndex() >= 0) _abox.getBranchEffectTracker().add(_abox.getBranchIndex(), getName()); // if we are checking entailment using a precompleted ABox, _abox.branch // is set to -1. however, since applyAllValues is done automatically // and the edge used in applyAllValues may depend on a _branch we want // this type to be deleted when that edge goes away, i.e. we backtrack // to a position before the max dependency of this type int b = _abox.getBranchIndex(); final int max = ds.max(); if (b == -1 && max != 0) b = max + 1; final DependencySet out = ds.copy(b); _depends.put(c, out); _abox.setChanged(true); return out; }
private void updateBranchesOfABox(final AddBranchDependency branch, final ABox abox) { final List<Branch> branches = abox.getBranches(); // decrease branch id for each branch after the branch we're removing // also need to change the dependency set for each label for (int i = branch.getBranch().getBranchIndexInABox(); i < branches.size(); i++) { final Branch br = branches.get(i); // cast for ease DependencySet termDepends = br.getTermDepends(); // update the term depends in the branch if (termDepends.getBranch() > branch.getBranch().getBranchIndexInABox()) termDepends = termDepends.copy(termDepends.getBranch() - 1); for (int j = branch.getBranch().getBranchIndexInABox(); j < _kb.getABox().getBranches().size(); j++) if (termDepends.contains(j)) { termDepends.remove(j); termDepends.add(j - 1); break; } br.setTermDepends(termDepends); } branches.remove(branch.getBranch()); // remove the actual branch }
private void updateBranchesOfABox(final AddBranchDependency branch, final ABox abox) { final List<Branch> branches = abox.getBranches(); // decrease branch id for each branch after the branch we're removing // also need to change the dependency set for each label for (int i = branch.getBranch().getBranchIndexInABox(); i < branches.size(); i++) { final Branch br = branches.get(i); // cast for ease DependencySet termDepends = br.getTermDepends(); // update the term depends in the branch if (termDepends.getBranch() > branch.getBranch().getBranchIndexInABox()) termDepends = termDepends.copy(termDepends.getBranch() - 1); for (int j = branch.getBranch().getBranchIndexInABox(); j < _kb.getABox().getBranches().size(); j++) if (termDepends.contains(j)) { termDepends.remove(j); termDepends.add(j - 1); break; } br.setTermDepends(termDepends); } branches.remove(branch.getBranch()); // remove the actual branch }
public boolean setSame(final Node node, final DependencySet ds) { if (isSame(node)) return false; if (isDifferent(node)) { //CHW - added for incremental reasoning support - this is needed as we will need to backjump if possible if (OpenlletOptions.USE_INCREMENTAL_CONSISTENCY) _abox.setClash(Clash.nominal(this, ds.union(_mergeDepends, _abox.doExplanation()).union(node._mergeDepends, _abox.doExplanation()), node.getName())); else _abox.setClash(Clash.nominal(this, ds, node.getName())); return false; } _mergedTo = node; _mergeDepends = ds.copy(_abox.getBranchIndex()); node.addMerged(this); return true; }
public boolean setSame(final Node node, final DependencySet ds) { if (isSame(node)) return false; if (isDifferent(node)) { //CHW - added for incremental reasoning support - this is needed as we will need to backjump if possible if (OpenlletOptions.USE_INCREMENTAL_CONSISTENCY) _abox.setClash(Clash.nominal(this, ds.union(_mergeDepends, _abox.doExplanation()).union(node._mergeDepends, _abox.doExplanation()), node.getName())); else _abox.setClash(Clash.nominal(this, ds, node.getName())); return false; } _mergedTo = node; _mergeDepends = ds.copy(_abox.getBranchIndex()); node.addMerged(this); return true; }
public boolean setDifferent(final Node node, final DependencySet dsParam) { DependencySet ds = dsParam; // add to effected list if (_abox.getBranchIndex() >= 0 && OpenlletOptions.TRACK_BRANCH_EFFECTS) _abox.getBranchEffectTracker().add(_abox.getBranchIndex(), node.getName()); if (isDifferent(node)) return false; if (isSame(node)) { ds = ds.union(getMergeDependency(true), _abox.doExplanation()); ds = ds.union(node.getMergeDependency(true), _abox.doExplanation()); _abox.setClash(Clash.nominal(this, ds, node.getName())); if (!ds.isIndependent()) return false; } ds = ds.copy(_abox.getBranchIndex()); _differents.put(node, ds); node.setDifferent(this, ds); _abox.setChanged(true); return true; }
public boolean setDifferent(final Node node, final DependencySet dsParam) { DependencySet ds = dsParam; // add to effected list if (_abox.getBranchIndex() >= 0 && OpenlletOptions.TRACK_BRANCH_EFFECTS) _abox.getBranchEffectTracker().add(_abox.getBranchIndex(), node.getName()); if (isDifferent(node)) return false; if (isSame(node)) { ds = ds.union(getMergeDependency(true), _abox.doExplanation()); ds = ds.union(node.getMergeDependency(true), _abox.doExplanation()); _abox.setClash(Clash.nominal(this, ds, node.getName())); if (!ds.isIndependent()) return false; } ds = ds.copy(_abox.getBranchIndex()); _differents.put(node, ds); node.setDifferent(this, ds); _abox.setChanged(true); return true; }
clashDepends = clashDepends.copy(_abox.getBranchIndex()); _abox.setClash(Clash.atomic(this, clashDepends, positive));
clashDepends = clashDepends.copy(_abox.getBranchIndex()); _abox.setClash(Clash.atomic(this, clashDepends, positive));
_applyNext[MAX] = 0; ds = ds.copy(_abox.getBranchIndex());
_applyNext[MAX] = 0; ds = ds.copy(_abox.getBranchIndex());
_logger.fine("MERG: " + y + " -> " + z + " " + ds); ds = ds.copy(_abox.getBranchIndex());
_logger.fine("MERG: " + y + " -> " + z + " " + ds); ds = ds.copy(_abox.getBranchIndex());