public boolean isSafe(ATermAppl c, Individual ind) {
Edge parentEdge = getParentEdge( ind );
Role r = parentEdge.getRole();
Individual parent = parentEdge.getFrom();
ABox abox = parent.getABox();
if( !isParentSafe( abox.getKB(), r, parent ) )
return false;
Iterator<CachedNode> nodes = getCachedNodes( abox, c );
if( !nodes.hasNext() )
return false;
if( interactsWithInverses( abox.getKB(), r ) ) {
while( nodes.hasNext() ) {
CachedNode node = nodes.next();
if( node.isBottom() )
return true;
else if( node.isTop() || !node.isComplete() )
return false;
if( !isSafe( abox.getKB(), parent, r.getInverse(), node ) )
return false;
}
}
return true;