use of dartagnan.program.HighLocation in project Dat3M by hernanponcedeleon.
the class Encodings method initsUniquePath.
public static BoolExpr initsUniquePath(Program p, Context ctx) {
BoolExpr prec = ctx.mkTrue();
BoolExpr post = ctx.mkTrue();
for (Event e : p.getEvents().stream().filter(e -> e instanceof MemEvent).collect(Collectors.toSet())) {
prec = ctx.mkAnd(prec, ctx.mkOr(e.getGuard(), ctx.mkNot(e.executes(ctx))));
}
for (Event e : p.getEvents().stream().filter(e -> e instanceof Init && e.getLoc() instanceof HighLocation).collect(Collectors.toSet())) {
BoolExpr guards = ctx.mkAnd(ctx.mkLt(ctx.mkSub(uniqueValue(e, ctx), ctx.mkInt(1)), initValue(e, ctx)), ctx.mkGt(ctx.mkAdd(uniqueValue(e, ctx), ctx.mkInt(1)), initValue(e, ctx)));
post = ctx.mkAnd(post, guards);
}
return ctx.mkImplies(prec, post);
}
use of dartagnan.program.HighLocation in project Dat3M by hernanponcedeleon.
the class Encodings method getReachedStateLow.
public static BoolExpr getReachedStateLow(Program p, Model model, Context ctx) {
Set<Location> locs = p.getEvents().stream().filter(e -> e instanceof MemEvent).map(e -> e.getLoc()).filter(l -> !(l instanceof HighLocation)).collect(Collectors.toSet());
BoolExpr reachedState = ctx.mkTrue();
for (Location loc : locs) {
reachedState = ctx.mkAnd(reachedState, ctx.mkEq(lastValueLoc(loc, ctx), model.getConstInterp(lastValueLoc(loc, ctx))));
}
return reachedState;
}
use of dartagnan.program.HighLocation in project Dat3M by hernanponcedeleon.
the class Encodings method diffInitialHigh.
public static BoolExpr diffInitialHigh(Program p, Context ctx) {
Set<Event> highInits = p.getEvents().stream().filter(e -> e instanceof Init).filter(e -> e.getLoc() instanceof HighLocation).collect(Collectors.toSet());
BoolExpr initState = ctx.mkTrue();
for (Event e : highInits) {
if (e.getLoc().getIValue() == null) {
initState = ctx.mkAnd(initState, ctx.mkNot(ctx.mkEq(initValue(e, ctx), initValue2(e, ctx))));
}
}
return initState;
}
use of dartagnan.program.HighLocation in project Dat3M by hernanponcedeleon.
the class Encodings method getInitialHigh.
public static BoolExpr getInitialHigh(Program p, Model model, Context ctx, boolean var1, boolean val1) {
Set<Event> highInits = p.getEvents().stream().filter(e -> e instanceof Init).filter(e -> e.getLoc() instanceof HighLocation).collect(Collectors.toSet());
BoolExpr reachedState = ctx.mkTrue();
for (Event e : highInits) {
IntExpr var = var1 ? initValue(e, ctx) : initValue2(e, ctx);
IntExpr val = val1 ? initValue(e, ctx) : initValue2(e, ctx);
if (e.getLoc().getIValue() == null) {
reachedState = ctx.mkAnd(reachedState, ctx.mkEq(var, model.getConstInterp(val)));
}
}
return reachedState;
}
Aggregations