use of com.dat3m.dartagnan.program.Program in project Dat3M by hernanponcedeleon.
the class PrinterTest method PrintLinux3.
@Test()
public void PrintLinux3() throws Exception {
Program p = new ProgramParser().parse(new File(ResourceHelper.LITMUS_RESOURCE_PATH + "litmus/C/manual/atomic/C-atomic-01.litmus"));
assertNotNull(new Printer().print(p));
assertNotNull(p.getAss().toString());
}
use of com.dat3m.dartagnan.program.Program in project Dat3M by hernanponcedeleon.
the class PrinterTest method PrintLinux.
@Test()
public void PrintLinux() throws Exception {
Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "litmus/C-rcu-link-after.litmus"));
assertNotNull(new Printer().print(p));
assertNotNull(p.getAss().toString());
}
use of com.dat3m.dartagnan.program.Program in project Dat3M by hernanponcedeleon.
the class PrinterTest method PrintBpl1.
// Test to call toString() of most events
@Test()
public void PrintBpl1() throws Exception {
Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "boogie/concurrency/fib_bench-1-O0.bpl"));
assertNotNull(new Printer().print(p));
LoopUnrolling.newInstance().run(p);
Compilation.newInstance().run(p);
assertNotNull(new Printer().print(p));
}
use of com.dat3m.dartagnan.program.Program in project Dat3M by hernanponcedeleon.
the class PrinterTest method PrintAARCH64.
@Test()
public void PrintAARCH64() throws Exception {
Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "litmus/MP+popl+poap.litmus"));
assertNotNull(new Printer().print(p));
assertNotNull(p.getAss().toString());
}
use of com.dat3m.dartagnan.program.Program 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