// which is blockable and has successor x
// (so y is an inv(r) predecessor of x)
boolean apply = false;
EdgeList edges = x.getRPredecessorEdges(r.getInverse());
for (int e = 0; e < edges.size(); e++) {
Edge edge = edges.edgeAt(e);
Individual pred = edge.getFrom();
if (pred.isBlockable()) {
apply = true;
break;
}
}
if (!apply)
return;
if (x.getMaxCard(r) < n)
return;
if (x.hasDistinctRNeighborsForMin(r, n, ATermUtils.TOP, true))
return;
// if( n == 1 ) {
// throw new InternalReasonerException(
// "Functional rule should have been applied " +
// x + " " + x.isNominal() + " " + edges);
// }
int guessMin = x.getMinCard(r, c);
if (guessMin == 0)
guessMin = 1;
// TODO not clear what the correct ds is so be pessimistic and include everything
DependencySet ds = x.getDepends(mc);
edges = x.getRNeighborEdges(r);
for (int e = 0; e < edges.size(); e++) {
Edge edge = edges.edgeAt(e);
ds = ds.union(edge.getDepends(), strategy.getABox().doExplanation());
}
GuessBranch newBranch = new GuessBranch(strategy.getABox(), strategy, x, r, guessMin, n, c, ds);
strategy.addBranch(newBranch);