use of dartagnan.program.Location in project Dat3M by hernanponcedeleon.
the class Encodings method encodeReachedState.
public static BoolExpr encodeReachedState(Program p, Model model, Context ctx) {
Set<Location> locs = p.getEvents().stream().filter(e -> e instanceof MemEvent).map(e -> e.getLoc()).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))));
}
Set<Event> executedEvents = p.getEvents().stream().filter(e -> model.getConstInterp(e.executes(ctx)).isTrue()).collect(Collectors.toSet());
Set<Register> regs = executedEvents.stream().filter(e -> e instanceof Local | e instanceof Load).map(e -> e.getReg()).collect(Collectors.toSet());
for (Register reg : regs) {
reachedState = ctx.mkAnd(reachedState, ctx.mkEq(lastValueReg(reg, ctx), model.getConstInterp(lastValueReg(reg, ctx))));
}
return reachedState;
}
use of dartagnan.program.Location in project Dat3M by hernanponcedeleon.
the class MapSSA method clone.
public MapSSA clone() {
MapSSA map = new MapSSA();
map.locMap = new ConcurrentHashMap<Location, Integer>();
map.regMap = new ConcurrentHashMap<Register, Integer>();
for (Register reg : regMap.keySet()) {
map.put(reg, this.get(reg));
}
for (Location loc : locMap.keySet()) {
map.put(loc, this.get(loc));
}
return map;
}
Aggregations