use of com.dat3m.dartagnan.wmm.utils.Tuple in project Dat3M by hernanponcedeleon.
the class RelDomainIdentity method encodeApprox.
@Override
protected BooleanFormula encodeApprox(SolverContext ctx) {
BooleanFormulaManager bmgr = ctx.getFormulaManager().getBooleanFormulaManager();
BooleanFormula enc = bmgr.makeTrue();
for (Tuple tuple1 : encodeTupleSet) {
Event e = tuple1.getFirst();
BooleanFormula opt = bmgr.makeFalse();
// TODO: Optimize using minSets (but no CAT uses this anyway)
for (Tuple tuple2 : r1.getMaxTupleSet().getByFirst(e)) {
opt = bmgr.or(r1.getSMTVar(e, tuple2.getSecond(), ctx));
}
enc = bmgr.and(enc, bmgr.equivalence(this.getSMTVar(e, e, ctx), opt));
}
return enc;
}
use of com.dat3m.dartagnan.wmm.utils.Tuple in project Dat3M by hernanponcedeleon.
the class RelDomainIdentity 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.getFirst(), t.getSecond())).map(t -> new Tuple(t.getFirst(), t.getFirst())).forEach(minTupleSet::add);
}
return minTupleSet;
}
use of com.dat3m.dartagnan.wmm.utils.Tuple 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.Tuple 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.Tuple 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;
}
Aggregations