use of com.dat3m.dartagnan.program.analysis.ThreadSymmetry in project Dat3M by hernanponcedeleon.
the class SymmetryReduction method run.
public void run(Program program) {
ThreadSymmetry symm = ThreadSymmetry.withoutMappings(program);
Set<? extends EquivalenceClass<Thread>> symmClasses = symm.getNonTrivialClasses();
if (symmClasses.isEmpty()) {
return;
}
for (EquivalenceClass<Thread> c : symmClasses) {
Thread rep = c.getRepresentative();
if (rep.getEvents().stream().noneMatch(x -> x.is(Tag.ASSERTION))) {
continue;
}
rep.setName(rep.getName() + "__symm_unique");
for (Thread t : c.stream().filter(x -> x != rep).collect(Collectors.toList())) {
for (Event e : t.getEvents()) {
if (e.is(Tag.ASSERTION)) {
e.getSuccessor().delete();
e.delete();
}
}
t.clearCache();
}
}
logger.info("Reduced symmetry of {} many symmetry classes", symmClasses.size());
}
Aggregations