final Map<Formula, int[]> rootLits = new LinkedHashMap<Formula,int[]>();
final Map<Formula, Node> rootNodes = new LinkedHashMap<Formula, Node>();
final Set<Formula> roots = log().roots();
for(Iterator<TranslationRecord> itr = core(); itr.hasNext();) {
final TranslationRecord rec = itr.next();
if (roots.contains(rec.translated())) {
// simply record the most recent output value for each formula:
// this is guaranteed to be the final output value for that
// formula because of the translation log guarantee that the
// log is replayed in the order of translation: i.e. a child's
// output value is always recorded before the parent's
int[] val = rootLits.get(rec.translated());
if (val==null) {
val = new int[1];
rootLits.put(rec.translated(), val);
}
val[0] = rec.literal();
rootNodes.put(rec.translated(), rec.node());
}
}
final SparseSequence<Formula> lits = new TreeSequence<Formula>();
for(Map.Entry<Formula,int[]> entry : rootLits.entrySet()) {