use of kodkod.engine.satlab.Clause in project org.alloytools.alloy by AlloyTools.
the class CRRStrategy method next.
/**
* Returns the next subset of clauses in the given trace to be analyzed.
*
* @requires {@inheritDoc}
* @ensures {@inheritDoc}
* @return last(this.nexts')
*/
@Override
public final IntSet next(final ResolutionTrace trace) {
final IntSet core = trace.core();
if (excluded == null) {
// the first time this method is called
excluded = new HashSet<Clause>((int) (StrictMath.round(core.size() * .75)));
}
for (IntIterator iter = core.iterator(Integer.MAX_VALUE, Integer.MIN_VALUE); iter.hasNext(); ) {
int index = iter.next();
if (excluded.add(trace.get(index))) {
// haven't tried excluding
// this one
// get all clauses reachable from the conflict clause
IntSet next = trace.reachable(Ints.singleton(trace.size() - 1));
// remove all clauses backward reachable from the excluded
// clause
next.removeAll(trace.backwardReachable(Ints.singleton(index)));
return next;
}
}
return Ints.EMPTY_SET;
}
Aggregations