use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.
the class RelInverse method encodeApprox.
@Override
protected BooleanFormula encodeApprox(SolverContext ctx) {
BooleanFormulaManager bmgr = ctx.getFormulaManager().getBooleanFormulaManager();
BooleanFormula enc = bmgr.makeTrue();
TupleSet minSet = getMinTupleSet();
for (Tuple tuple : encodeTupleSet) {
BooleanFormula opt = minSet.contains(tuple) ? getExecPair(tuple, ctx) : r1.getSMTVar(tuple.getInverse(), ctx);
enc = bmgr.and(enc, bmgr.equivalence(this.getSMTVar(tuple, ctx), opt));
}
return enc;
}
use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.
the class RelRangeIdentity method getMinTupleSet.
@Override
public TupleSet getMinTupleSet() {
if (minTupleSet == null) {
ExecutionAnalysis exec = analysisContext.get(ExecutionAnalysis.class);
minTupleSet = new TupleSet();
r1.getMinTupleSet().stream().filter(t -> exec.isImplied(t.getSecond(), t.getFirst())).map(t -> new Tuple(t.getSecond(), t.getSecond())).forEach(minTupleSet::add);
}
return minTupleSet;
}
use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.
the class RelTrans method getFullEncodeTupleSet.
private TupleSet getFullEncodeTupleSet(TupleSet tuples) {
TupleSet processNow = new TupleSet(Sets.intersection(tuples, getMaxTupleSet()));
TupleSet result = new TupleSet();
while (!processNow.isEmpty()) {
TupleSet processNext = new TupleSet();
result.addAll(processNow);
for (Tuple tuple : processNow) {
Event e1 = tuple.getFirst();
Event e2 = tuple.getSecond();
for (Tuple t : r1.getMaxTupleSet().getByFirst(e1)) {
Event e3 = t.getSecond();
if (e3.getCId() != e1.getCId() && e3.getCId() != e2.getCId() && transitiveReachabilityMap.get(e3).contains(e2)) {
result.add(new Tuple(e1, e3));
processNext.add(new Tuple(e3, e2));
}
}
}
processNext.removeAll(result);
processNow = processNext;
}
return result;
}
use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.
the class RelTrans method initializeRelationAnalysis.
@Override
public void initializeRelationAnalysis(VerificationTask task, Context context) {
super.initializeRelationAnalysis(task, context);
fullEncodeTupleSet = new TupleSet();
transitiveReachabilityMap = null;
}
use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.
the class RelTrans method addEncodeTupleSet.
@Override
public void addEncodeTupleSet(TupleSet tuples) {
TupleSet activeSet = new TupleSet(Sets.intersection(Sets.difference(tuples, encodeTupleSet), maxTupleSet));
encodeTupleSet.addAll(activeSet);
TupleSet fullActiveSet = getFullEncodeTupleSet(activeSet);
if (fullEncodeTupleSet.addAll(fullActiveSet)) {
fullActiveSet.removeAll(getMinTupleSet());
r1.addEncodeTupleSet(fullActiveSet);
}
}
Aggregations