}
}
}
protected void applyFunctionalMaxRule(Literal x, Role r, DependencySet ds) {
EdgeList edges = x.getInEdges().getEdges(r);
// if there is not more than one edge then func max rule won't be triggered
if (edges.size() <= 1) {
return;// continue;
}
// find all distinct R-neighbors of x
Set<Node> neighbors = edges.getNeighbors(x);
// if there is not more than one neighbor then func max rule won't be triggered
if (neighbors.size() <= 1) {
return;// continue;
}
Individual head = null;
DependencySet headDS = null;
// find a nominal node to use as the head
for (int edgeIndex = 0; edgeIndex < edges.size(); edgeIndex++) {
Edge edge = edges.edgeAt(edgeIndex);
Individual ind = edge.getFrom();
if (ind.isNominal() && (head == null || ind.getNominalLevel() < head.getNominalLevel())) {
head = ind;
headDS = edge.getDepends();
}
}
// if there is no nominal in the merge list we need to create one
if (head == null) {
head = abox.addFreshIndividual(null, ds);
}
else {
ds = ds.union(headDS, abox.doExplanation());
}
for (int i = 0; i < edges.size(); i++) {
Edge edge = edges.edgeAt(i);
Individual next = edge.getFrom();
if (next.isPruned()) {
continue;
}