Search in sources :

Example 1 with AssertInline

use of com.dat3m.dartagnan.asserts.AssertInline in project Dat3M by hernanponcedeleon.

the class LoopUnrolling method updateAssertions.

private void updateAssertions(Program program) {
    if (program.getAss() != null) {
        // but I was under the impression that assFilter was used for Litmus tests.
        return;
    }
    List<Event> assertions = new ArrayList<>();
    for (Thread t : program.getThreads()) {
        assertions.addAll(t.getCache().getEvents(FilterBasic.get(Tag.ASSERTION)));
    }
    AbstractAssert ass = new AssertTrue();
    if (!assertions.isEmpty()) {
        ass = new AssertInline((Local) assertions.get(0));
        for (int i = 1; i < assertions.size(); i++) {
            ass = new AssertCompositeOr(ass, new AssertInline((Local) assertions.get(i)));
        }
    }
    program.setAss(ass);
    logger.info("Updated assertions after unrolling.");
}
Also used : AssertTrue(com.dat3m.dartagnan.asserts.AssertTrue) ArrayList(java.util.ArrayList) Event(com.dat3m.dartagnan.program.event.core.Event) Local(com.dat3m.dartagnan.program.event.core.Local) AbstractAssert(com.dat3m.dartagnan.asserts.AbstractAssert) AssertCompositeOr(com.dat3m.dartagnan.asserts.AssertCompositeOr) Thread(com.dat3m.dartagnan.program.Thread) AssertInline(com.dat3m.dartagnan.asserts.AssertInline)

Example 2 with AssertInline

use of com.dat3m.dartagnan.asserts.AssertInline in project Dat3M by hernanponcedeleon.

the class VerificationTask method updateAssertions.

private void updateAssertions(Program program) {
    List<Event> assertions = program.getCache().getEvents(FilterBasic.get(ASSERTION));
    AbstractAssert ass = new AssertTrue();
    if (!assertions.isEmpty()) {
        ass = new AssertInline((Local) assertions.get(0));
        for (int i = 1; i < assertions.size(); i++) {
            ass = new AssertCompositeOr(ass, new AssertInline((Local) assertions.get(i)));
        }
    }
    program.setAss(ass);
}
Also used : AssertTrue(com.dat3m.dartagnan.asserts.AssertTrue) Event(com.dat3m.dartagnan.program.event.core.Event) Local(com.dat3m.dartagnan.program.event.core.Local) AbstractAssert(com.dat3m.dartagnan.asserts.AbstractAssert) AssertCompositeOr(com.dat3m.dartagnan.asserts.AssertCompositeOr) AssertInline(com.dat3m.dartagnan.asserts.AssertInline)

Aggregations

AbstractAssert (com.dat3m.dartagnan.asserts.AbstractAssert)2 AssertCompositeOr (com.dat3m.dartagnan.asserts.AssertCompositeOr)2 AssertInline (com.dat3m.dartagnan.asserts.AssertInline)2 AssertTrue (com.dat3m.dartagnan.asserts.AssertTrue)2 Event (com.dat3m.dartagnan.program.event.core.Event)2 Local (com.dat3m.dartagnan.program.event.core.Local)2 Thread (com.dat3m.dartagnan.program.Thread)1 ArrayList (java.util.ArrayList)1