@Override public Set<ATermAppl> getExplanationSet() { if (_lastClash == null) throw new OpenError("No clashExplanation was generated!"); return _lastClash.getDepends().getExplain(); }
@Override public Set<ATermAppl> getExplanationSet() { if (_lastClash == null) throw new OpenError("No clashExplanation was generated!"); return _lastClash.getDepends().getExplain(); }
/** * Equals method */ @Override public boolean equals(final Object other) { if (other instanceof ClashDependency) return _assertion.equals(((ClashDependency) other)._assertion) && _clash.getNode().equals(((ClashDependency) other)._clash.getNode()) && _clash.getType() == ((ClashDependency) other)._clash.getType() && _clash.getDepends().equals(((ClashDependency) other)._clash.getDepends()); else return false; }
@Override public void setClash(final Clash clash) { if (clash != null) { if (_logger.isLoggable(Level.FINER)) { _logger.finer("CLSH: " + clash); if (clash.getDepends().max() > _branchIndex && _branchIndex != -1) _logger.severe("Invalid _clash dependency " + clash + " > " + _branchIndex); } if (_branchIndex == DependencySet.NO_BRANCH && clash.getDepends().getBranch() == DependencySet.NO_BRANCH) _assertedClashes.add(clash); if (_clash != null) { _logger.finer(() -> "Clash was already set \nExisting: " + _clash + "\nNew : " + clash); if (_clash.getDepends().max() < clash.getDepends().max()) return; } } _clash = clash; // CHW - added for incremental deletions if (OpenlletOptions.USE_INCREMENTAL_DELETION) _kb.getDependencyIndex().setClashDependencies(_clash); }
/** * Equals method */ @Override public boolean equals(final Object other) { if (other instanceof ClashDependency) return _assertion.equals(((ClashDependency) other)._assertion) && _clash.getNode().equals(((ClashDependency) other)._clash.getNode()) && _clash.getType() == ((ClashDependency) other)._clash.getType() && _clash.getDepends().equals(((ClashDependency) other)._clash.getDepends()); else return false; }
@Override public void setClash(final Clash clash) { if (clash != null) { if (_logger.isLoggable(Level.FINER)) { _logger.finer("CLSH: " + clash); if (clash.getDepends().max() > _branchIndex && _branchIndex != -1) _logger.severe("Invalid _clash dependency " + clash + " > " + _branchIndex); } if (_branchIndex == DependencySet.NO_BRANCH && clash.getDepends().getBranch() == DependencySet.NO_BRANCH) _assertedClashes.add(clash); if (_clash != null) { _logger.finer(() -> "Clash was already set \nExisting: " + _clash + "\nNew : " + clash); if (_clash.getDepends().max() < clash.getDepends().max()) return; } } _clash = clash; // CHW - added for incremental deletions if (OpenlletOptions.USE_INCREMENTAL_DELETION) _kb.getDependencyIndex().setClashDependencies(_clash); }
@Override public String toString() { return "[Clash " + getNode() + " " + getType() + " " + getDepends().toString() + (_args == null ? "" : " " + Arrays.asList(_args)) + "]"; }
@Override public String toString() { return "[Clash " + getNode() + " " + getType() + " " + getDepends().toString() + (_args == null ? "" : " " + Arrays.asList(_args)) + "]"; }
/** * Hashcode method TODO: this may not be sufficient */ @Override public int hashCode() { return _clash.getType().hashCode() + _clash.getDepends().hashCode() + _clash.getNode().hashCode() + _assertion.hashCode(); }
/** * Hashcode method TODO: this may not be sufficient */ @Override public int hashCode() { return _clash.getType().hashCode() + _clash.getDepends().hashCode() + _clash.getNode().hashCode() + _assertion.hashCode(); }
/** * Restore a clash dependency * * @param assertion * @param clash */ private void restoreClash(final ATermAppl assertion, final ClashDependency clash) { DependencyIndex._logger.fine(() -> " Restoring clash dependency clash: " + clash.getClash()); clash.getClash().getDepends().removeExplain(assertion); // remove the dependency if (clash.getClash().getDepends().getExplain().isEmpty() && clash.getClash().getDepends().isIndependent()) // undo clash if empty and is independent { DependencyIndex._logger.fine(() -> " Actually removing clash!"); _kb.getABox().setClash(null); } }
/** * Restore a clash dependency * * @param assertion * @param clash */ private void restoreClash(final ATermAppl assertion, final ClashDependency clash) { DependencyIndex._logger.fine(() -> " Restoring clash dependency clash: " + clash.getClash()); clash.getClash().getDepends().removeExplain(assertion); // remove the dependency if (clash.getClash().getDepends().getExplain().isEmpty() && clash.getClash().getDepends().isIndependent()) // undo clash if empty and is independent { DependencyIndex._logger.fine(() -> " Actually removing clash!"); _kb.getABox().setClash(null); } }
return; for (final ATermAppl nextAtom : clash.getDepends().getExplain()) //loop over ds if (_kb.getSyntacticAssertions().contains(nextAtom)) //check if this assertion exists
return; for (final ATermAppl nextAtom : clash.getDepends().getExplain()) //loop over ds if (_kb.getSyntacticAssertions().contains(nextAtom)) //check if this assertion exists
final int lastBranch = _abox.getClash().getDepends().max(); newBranch.setLastClash(_abox.getClash().getDepends()); _abox.getClash().getDepends().remove(lastBranch); if (_logger.isLoggable(Level.FINE)) _logger.fine("FAIL: " + lastBranch);
public Clash copyTo(final ABoxImpl abox) { return new Clash(abox.getNode(getNode().getName()), getType(), getDepends(), _clashExplanation); }
public Clash copyTo(final ABoxImpl abox) { return new Clash(abox.getNode(getNode().getName()), getType(), getDepends(), _clashExplanation); }
public boolean tryNext() { // nothing more to try, update the clash dependency if (getTryNext() == getTryCount()) if (!_abox.isClosed()) _abox.setClash(Clash.unexplained(getNode(), _termDepends)); else _abox.getClash().setDepends(getCombinedClash()); // if there is no clash try next possibility if (!_abox.isClosed()) tryBranch(); // there is a clash so there is no point in trying this // _branch again. remove this _branch from clash dependency if (_abox.isClosed()) if (!OpenlletOptions.USE_INCREMENTAL_DELETION) _abox.getClash().getDepends().remove(getBranchIndexInABox()); return !_abox.isClosed(); }
public boolean tryNext() { // nothing more to try, update the clash dependency if (getTryNext() == getTryCount()) if (!_abox.isClosed()) _abox.setClash(Clash.unexplained(getNode(), _termDepends)); else _abox.getClash().setDepends(getCombinedClash()); // if there is no clash try next possibility if (!_abox.isClosed()) tryBranch(); // there is a clash so there is no point in trying this // _branch again. remove this _branch from clash dependency if (_abox.isClosed()) if (!OpenlletOptions.USE_INCREMENTAL_DELETION) _abox.getClash().getDepends().remove(getBranchIndexInABox()); return !_abox.isClosed(); }
final DependencySet clashDepends = _abox.getClash().getDepends();