long satCount = kb.getABox().stats.satisfiabilityCount;
long consCount = kb.getABox().stats.consistencyCount;
if (q.getDistVars().isEmpty()) {
if (QueryEngine.execBooleanABoxQuery(q)) {
results.add(new ResultBindingImpl());
}
} else {
final Map<ATermAppl, Set<ATermAppl>> varBindings = new HashMap<ATermAppl, Set<ATermAppl>>();
for (final ATermAppl currVar : q
.getDistVarsForType(VarType.INDIVIDUAL)) {
ATermAppl rolledUpClass = q.rollUpTo(currVar,
Collections.EMPTY_SET, false);
if (log.isLoggable( Level.FINER ))
log.finer("Rolled up class " + rolledUpClass);
varBindings.put(currVar, kb.getInstances(rolledUpClass));
}
if (log.isLoggable( Level.FINER ))
log.finer("Var bindings: " + varBindings);
final List<ATermAppl> varList = new ArrayList<ATermAppl>(
varBindings.keySet()); // TODO
final Map<ATermAppl, Collection<ResultBinding>> goodLists = new HashMap<ATermAppl, Collection<ResultBinding>>();
final ATermAppl first = varList.get(0);
final Collection<ResultBinding> c = new HashSet<ResultBinding>();
for (final ATermAppl a : varBindings.get(first)) {
final ResultBinding bind = new ResultBindingImpl();
bind.setValue(first, a);
c.add(bind);
}
goodLists.put(first, c);