Search in sources :

Example 1 with Local

use of com.dat3m.dartagnan.program.event.core.Local in project Dat3M by hernanponcedeleon.

the class SvcompProcedures method __VERIFIER_assert.

private static void __VERIFIER_assert(VisitorBoogie visitor, Call_cmdContext ctx) {
    IExpr expr = (IExpr) ctx.call_params().exprs().accept(visitor);
    Register ass = visitor.programBuilder.getOrCreateRegister(visitor.threadCount, "assert_" + visitor.assertionIndex, expr.getPrecision());
    visitor.assertionIndex++;
    if (expr instanceof IConst && ((IConst) expr).getValue().equals(BigInteger.ONE)) {
        return;
    }
    Local event = EventFactory.newLocal(ass, expr);
    event.addFilters(Tag.ASSERTION);
    visitor.programBuilder.addChild(visitor.threadCount, event);
    Label end = visitor.programBuilder.getOrCreateLabel("END_OF_T" + visitor.threadCount);
    visitor.programBuilder.addChild(visitor.threadCount, EventFactory.newJump(new Atom(ass, NEQ, expr), end));
}
Also used : Register(com.dat3m.dartagnan.program.Register) Label(com.dat3m.dartagnan.program.event.core.Label) Local(com.dat3m.dartagnan.program.event.core.Local)

Example 2 with Local

use of com.dat3m.dartagnan.program.event.core.Local 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 3 with Local

use of com.dat3m.dartagnan.program.event.core.Local in project Dat3M by hernanponcedeleon.

the class StdProcedures method __assert.

private static void __assert(VisitorBoogie visitor, Call_cmdContext ctx) {
    Register ass = visitor.programBuilder.getOrCreateRegister(visitor.threadCount, "assert_" + visitor.assertionIndex, ARCH_PRECISION);
    visitor.assertionIndex++;
    ExprInterface expr = (ExprInterface) ctx.call_params().exprs().accept(visitor);
    if (expr instanceof IConst && ((IConst) expr).getValue().compareTo(BigInteger.ONE) == 0) {
        return;
    }
    Local event = EventFactory.newLocal(ass, expr);
    event.addFilters(Tag.ASSERTION);
    visitor.programBuilder.addChild(visitor.threadCount, event);
}
Also used : ExprInterface(com.dat3m.dartagnan.expression.ExprInterface) Register(com.dat3m.dartagnan.program.Register) Local(com.dat3m.dartagnan.program.event.core.Local) IConst(com.dat3m.dartagnan.expression.IConst)

Example 4 with Local

use of com.dat3m.dartagnan.program.event.core.Local 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

Local (com.dat3m.dartagnan.program.event.core.Local)4 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 Register (com.dat3m.dartagnan.program.Register)2 Event (com.dat3m.dartagnan.program.event.core.Event)2 ExprInterface (com.dat3m.dartagnan.expression.ExprInterface)1 IConst (com.dat3m.dartagnan.expression.IConst)1 Thread (com.dat3m.dartagnan.program.Thread)1 Label (com.dat3m.dartagnan.program.event.core.Label)1 ArrayList (java.util.ArrayList)1