/** * Sets the _blocker to the parent of _current _blocker and checks if if the new _blocker candidate is allowed to block. Root _nodes are not allowed to * block. * * @return <code>true</code> if the new _blocker candidate is allowed to block */ public boolean moveBlockerUp() { _blocker = _blocker.getParent(); _rolesToBlocked = null; return !_blocker.isRoot(); }
@Override final public boolean isLeaf() { return !isRoot() && _outEdges.isEmpty(); }
@Override final public boolean isLeaf() { return !isRoot() && _outEdges.isEmpty(); }
/** * Sets the _blocker to the parent of _current _blocker and checks if if the new _blocker candidate is allowed to block. Root _nodes are not allowed to * block. * * @return <code>true</code> if the new _blocker candidate is allowed to block */ public boolean moveBlockerUp() { _blocker = _blocker.getParent(); _rolesToBlocked = null; return !_blocker.isRoot(); }
private Bool isCachedSat(final Individual x) { if (x.isRoot()) return Bool.UNKNOWN; final ATermAppl c = createConcept(x); final Bool sat = isCachedSat(c); if (sat.isUnknown()) { _logger.finest(() -> "??? Cache miss for " + c); _cachedNodes.put(x, c); } else if (!_cacheSafety.isPresent() || !_cacheSafety.get().isSafe(c, x)) { _logger.finer(() -> "*** Cache unsafe for " + c); return Bool.UNKNOWN; } else _logger.finer(() -> "*** Cache hit for " + c + " sat = " + sat); return sat; }
private Bool isCachedSat(final Individual x) { if (x.isRoot()) return Bool.UNKNOWN; final ATermAppl c = createConcept(x); final Bool sat = isCachedSat(c); if (sat.isUnknown()) { _logger.finest(() -> "??? Cache miss for " + c); _cachedNodes.put(x, c); } else if (!_cacheSafety.isPresent() || !_cacheSafety.get().isSafe(c, x)) { _logger.finer(() -> "*** Cache unsafe for " + c); return Bool.UNKNOWN; } else _logger.finer(() -> "*** Cache hit for " + c + " sat = " + sat); return sat; }
protected boolean isDirectlyBlockedInt(final Individual blocked) { final Individual parentBlocked = blocked.getParent(); if (blocked.isRoot() || parentBlocked.isRoot()) return false; final BlockingContext cxt = new BlockingContext(blocked); while (cxt.moveBlockerUp()) if (isDirectlyBlockedBy(cxt)) { blocked.setBlocked(true); _logger.finer(() -> blocked + " blocked by " + cxt._blocker); return true; } if (OpenlletOptions.USE_ANYWHERE_BLOCKING) { assert cxt._blocker.isRoot(); return isDirectlyBlockedByDescendant(cxt); } return false; }
protected boolean isDirectlyBlockedInt(final Individual blocked) { final Individual parentBlocked = blocked.getParent(); if (blocked.isRoot() || parentBlocked.isRoot()) return false; final BlockingContext cxt = new BlockingContext(blocked); while (cxt.moveBlockerUp()) if (isDirectlyBlockedBy(cxt)) { blocked.setBlocked(true); _logger.finer(() -> blocked + " blocked by " + cxt._blocker); return true; } if (OpenlletOptions.USE_ANYWHERE_BLOCKING) { assert cxt._blocker.isRoot(); return isDirectlyBlockedByDescendant(cxt); } return false; }
public boolean isBlocked(final Individual blocked) { final Optional<Timer> timer = blocked.getABox().getKB().getTimers().startTimer("blocking"); try { return !blocked.isRoot() && (isIndirectlyBlocked(blocked) || isDirectlyBlockedInt(blocked)); } finally { timer.ifPresent(t -> t.stop()); } }
public boolean isBlocked(final Individual blocked) { final Optional<Timer> timer = blocked.getABox().getKB().getTimers().startTimer("blocking"); try { return !blocked.isRoot() && (isIndirectlyBlocked(blocked) || isDirectlyBlockedInt(blocked)); } finally { timer.ifPresent(t -> t.stop()); } }
protected boolean isDirectlyBlockedByDescendant(final BlockingContext cxt) { if (cxt._blocked.getParent().equals(cxt._blocker)) return false; if (!cxt._blocker.isRoot() && isDirectlyBlockedBy(cxt)) { cxt._blocked.setBlocked(true); _logger.finer(() -> cxt._blocked + " _blocked by " + cxt._blocker); return true; } final Individual blocker = cxt._blocker; for (final Edge e : blocker.getOutEdges()) { final Node child = e.getTo(); if (cxt.moveBlockerDown(child)) { if (isDirectlyBlockedByDescendant(cxt) || cxt._blocker.isRoot()) return true; cxt.moveBlockerUp(); } } return false; }
protected boolean isDirectlyBlockedByDescendant(final BlockingContext cxt) { if (cxt._blocked.getParent().equals(cxt._blocker)) return false; if (!cxt._blocker.isRoot() && isDirectlyBlockedBy(cxt)) { cxt._blocked.setBlocked(true); _logger.finer(() -> cxt._blocked + " _blocked by " + cxt._blocker); return true; } final Individual blocker = cxt._blocker; for (final Edge e : blocker.getOutEdges()) { final Node child = e.getTo(); if (cxt.moveBlockerDown(child)) { if (isDirectlyBlockedByDescendant(cxt) || cxt._blocker.isRoot()) return true; cxt.moveBlockerUp(); } } return false; }
private static boolean parentNeedsExpanding(final Individual x) { if (x.isRoot()) return false; final Individual parent = x.getParent(); return parent.canApply(Node.ATOM) || parent.canApply(Node.OR) || parent.canApply(Node.SOME) || parent.canApply(Node.MIN) || parent.canApply(Node.MAX); }
private static boolean parentNeedsExpanding(final Individual x) { if (x.isRoot()) return false; final Individual parent = x.getParent(); return parent.canApply(Node.ATOM) || parent.canApply(Node.OR) || parent.canApply(Node.SOME) || parent.canApply(Node.MIN) || parent.canApply(Node.MAX); }
validateTypes(node, node.getTypes(Node.MAX)); if (!node.isRoot())
validateTypes(node, node.getTypes(Node.MAX)); if (!node.isRoot())