public Collection<? extends AtomVariable> getPrerequisitesVars(final Collection<AtomVariable> bound) { return _helper.getPrerequisiteVars(bound); }
public Collection<? extends AtomVariable> getPrerequisitesVars(final Collection<AtomVariable> bound) { return _helper.getPrerequisiteVars(bound); }
if (bound.containsAll(helper.getPrerequisiteVars(bound))) if (bound.containsAll(unsat.getPrerequisiteVars(bound)))
/** * Reorder the binding helpers so that completely bound binding helpers are push as far up the list as they can be */ private static void optimize(final List<BindingHelper> helpers) { final Set<AtomVariable> bound = new HashSet<>(); for (int i = 0; i < helpers.size(); i++) { // Move any helpers which are completely bound and satisfied // to this point int j = 0; while (i + j < helpers.size()) { final BindingHelper helper = helpers.get(i + j); if (bound.containsAll(helper.getBindableVars(bound)) && bound.containsAll(helper.getPrerequisiteVars(bound))) { helpers.remove(i + j); helpers.add(i, helper); i++; // Bump - since it is bound, we won't need to keep track of its bindable vars. } else j++; // Keep searching } // May have moved off the list. if (i < helpers.size()) bound.addAll(helpers.get(i).getBindableVars(bound)); } }
if (bound.containsAll(helper.getPrerequisiteVars(bound))) if (bound.containsAll(unsat.getPrerequisiteVars(bound)))
/** * Reorder the binding helpers so that completely bound binding helpers are push as far up the list as they can be */ private static void optimize(final List<BindingHelper> helpers) { final Set<AtomVariable> bound = new HashSet<>(); for (int i = 0; i < helpers.size(); i++) { // Move any helpers which are completely bound and satisfied // to this point int j = 0; while (i + j < helpers.size()) { final BindingHelper helper = helpers.get(i + j); if (bound.containsAll(helper.getBindableVars(bound)) && bound.containsAll(helper.getPrerequisiteVars(bound))) { helpers.remove(i + j); helpers.add(i, helper); i++; // Bump - since it is bound, we won't need to keep track of its bindable vars. } else j++; // Keep searching } // May have moved off the list. if (i < helpers.size()) bound.addAll(helpers.get(i).getBindableVars(bound)); } }