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));
}
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.");
}
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);
}
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);
}
Aggregations