private void runRecursively(final Taxonomy<ATermAppl> t, final ATermAppl downMonotonic, final ATermAppl rootCandidate, final ResultBinding binding, final Set<ATermAppl> toDo, final boolean direct, final boolean strict) { final int size = _result.size(); _logger.fine(() -> "Trying : " + rootCandidate + ", done=" + toDo); if (!strict) { toDo.remove(rootCandidate); runNext(binding, Collections.singletonList(downMonotonic), rootCandidate); } if (strict || _result.size() > size) { // final Set<ATermAppl> subs = t.getSFlattenedSubs(rootCandidate, // direct); final Set<ATermAppl> subs = flatten(t.getSubs(rootCandidate, direct)); for (final ATermAppl subject : subs) { if (!toDo.contains(subject)) continue; runRecursively(t, downMonotonic, subject, binding, toDo, false, false); } } else { _logger.fine(() -> "Skipping subs of " + rootCandidate); // toDo.removeAll(t.getFlattenedSubs(rootCandidate, false)); toDo.removeAll(flatten(t.getSubs(rootCandidate, false))); } }
private void runRecursively(final Taxonomy<ATermAppl> t, final ATermAppl downMonotonic, final ATermAppl rootCandidate, final ResultBinding binding, final Set<ATermAppl> toDo, final boolean direct, final boolean strict) { final int size = _result.size(); _logger.fine(() -> "Trying : " + rootCandidate + ", done=" + toDo); if (!strict) { toDo.remove(rootCandidate); runNext(binding, Collections.singletonList(downMonotonic), rootCandidate); } if (strict || _result.size() > size) { // final Set<ATermAppl> subs = t.getSFlattenedSubs(rootCandidate, // direct); final Set<ATermAppl> subs = flatten(t.getSubs(rootCandidate, direct)); for (final ATermAppl subject : subs) { if (!toDo.contains(subject)) continue; runRecursively(t, downMonotonic, subject, binding, toDo, false, false); } } else { _logger.fine(() -> "Skipping subs of " + rootCandidate); // toDo.removeAll(t.getFlattenedSubs(rootCandidate, false)); toDo.removeAll(flatten(t.getSubs(rootCandidate, false))); } }
private void runRecursively(final Taxonomy<ATermAppl> t, final ATermAppl downMonotonic, final ATermAppl rootCandidate, final ResultBinding binding, final Set<ATermAppl> toDo, final boolean direct, final boolean strict) { final int size = _result.size(); _logger.fine(() -> "Trying : " + rootCandidate + ", done=" + toDo); if (!strict) { toDo.remove(rootCandidate); runNext(binding, Collections.singletonList(downMonotonic), rootCandidate); } if (strict || _result.size() > size) { // final Set<ATermAppl> subs = t.getSFlattenedSubs(rootCandidate, // direct); final Set<ATermAppl> subs = flatten(t.getSubs(rootCandidate, direct)); for (final ATermAppl subject : subs) { if (!toDo.contains(subject)) continue; runRecursively(t, downMonotonic, subject, binding, toDo, false, false); } } else { _logger.fine(() -> "Skipping subs of " + rootCandidate); // toDo.removeAll(t.getFlattenedSubs(rootCandidate, false)); toDo.removeAll(flatten(t.getSubs(rootCandidate, false))); } }
classCandidates = flatten(_kb.getTypes(tI, direct)); // TODO instanceCandidates = Collections.singleton(tI); rhsCandidates = flatten(_kb.getSuperClasses(scLHS, direct)); else lhsCandidates = flatten(_kb.getSubClasses(scRHS, direct)); rhsCandidates = flatten(_kb.getSuperClasses(subject, direct)); if (strict) rhsCandidates.removeAll(_kb.getEquivalentClasses(subject)); spRhsCandidates = flatten(_kb.getSuperProperties(spLHS, direct)); if (strict) spRhsCandidates.removeAll(_kb.getEquivalentProperties(spLHS)); spLhsCandidates = flatten(_kb.getSubProperties(spRHS, direct)); if (strict) spLhsCandidates.removeAll(_kb.getEquivalentProperties(spRHS)); spRhsCandidates = flatten(_kb.getSuperProperties(subject, direct)); if (strict) spRhsCandidates.removeAll(_kb.getEquivalentProperties(subject));
classCandidates = flatten(_kb.getTypes(tI, direct)); // TODO instanceCandidates = Collections.singleton(tI); rhsCandidates = flatten(_kb.getSuperClasses(scLHS, direct)); else lhsCandidates = flatten(_kb.getSubClasses(scRHS, direct)); rhsCandidates = flatten(_kb.getSuperClasses(subject, direct)); if (strict) rhsCandidates.removeAll(_kb.getEquivalentClasses(subject)); spRhsCandidates = flatten(_kb.getSuperProperties(spLHS, direct)); if (strict) spRhsCandidates.removeAll(_kb.getEquivalentProperties(spLHS)); spLhsCandidates = flatten(_kb.getSubProperties(spRHS, direct)); if (strict) spLhsCandidates.removeAll(_kb.getEquivalentProperties(spRHS)); spRhsCandidates = flatten(_kb.getSuperProperties(subject, direct)); if (strict) spRhsCandidates.removeAll(_kb.getEquivalentProperties(subject));
classCandidates = flatten(_kb.getTypes(tI, direct)); // TODO instanceCandidates = Collections.singleton(tI); rhsCandidates = flatten(_kb.getSuperClasses(scLHS, direct)); else lhsCandidates = flatten(_kb.getSubClasses(scRHS, direct)); rhsCandidates = flatten(_kb.getSuperClasses(subject, direct)); if (strict) rhsCandidates.removeAll(_kb.getEquivalentClasses(subject)); spRhsCandidates = flatten(_kb.getSuperProperties(spLHS, direct)); if (strict) spRhsCandidates.removeAll(_kb.getEquivalentProperties(spLHS)); spLhsCandidates = flatten(_kb.getSubProperties(spRHS, direct)); if (strict) spLhsCandidates.removeAll(_kb.getEquivalentProperties(spRHS)); spRhsCandidates = flatten(_kb.getSuperProperties(subject, direct)); if (strict) spRhsCandidates.removeAll(_kb.getEquivalentProperties(subject));