use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.
the class RelInt method getMaxTupleSet.
@Override
public TupleSet getMaxTupleSet() {
if (maxTupleSet == null) {
maxTupleSet = new TupleSet();
for (Thread t : task.getProgram().getThreads()) {
List<Event> events = t.getCache().getEvents(FilterBasic.get(Tag.VISIBLE));
for (Event e1 : events) {
for (Event e2 : events) {
maxTupleSet.add(new Tuple(e1, e2));
}
}
}
removeMutuallyExclusiveTuples(maxTupleSet);
}
return maxTupleSet;
}
use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.
the class RelPo method getMaxTupleSet.
@Override
public TupleSet getMaxTupleSet() {
if (maxTupleSet == null) {
maxTupleSet = new TupleSet();
for (Thread t : task.getProgram().getThreads()) {
List<Event> events = t.getCache().getEvents(filter);
for (int i = 0; i < events.size(); i++) {
Event e1 = events.get(i);
for (int j = i + 1; j < events.size(); j++) {
Event e2 = events.get(j);
maxTupleSet.add(new Tuple(e1, e2));
}
}
}
removeMutuallyExclusiveTuples(maxTupleSet);
}
return maxTupleSet;
}
use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.
the class RelComposition method getMinTupleSetRecursive.
@Override
public TupleSet getMinTupleSetRecursive() {
if (recursiveGroupId > 0 && maxTupleSet != null) {
ExecutionAnalysis exec = analysisContext.get(ExecutionAnalysis.class);
minTupleSet = r1.getMinTupleSetRecursive().postComposition(r2.getMinTupleSetRecursive(), (t1, t2) -> exec.isImplied(t1.getFirst(), t1.getSecond()) || exec.isImplied(t2.getSecond(), t1.getSecond()));
removeMutuallyExclusiveTuples(minTupleSet);
return minTupleSet;
}
return getMinTupleSet();
}
use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.
the class RelComposition method encodeApprox.
@Override
protected BooleanFormula encodeApprox(SolverContext ctx) {
BooleanFormulaManager bmgr = ctx.getFormulaManager().getBooleanFormulaManager();
BooleanFormula enc = bmgr.makeTrue();
TupleSet r1Set = r1.getEncodeTupleSet();
TupleSet r2Set = r2.getEncodeTupleSet();
TupleSet minSet = getMinTupleSet();
for (Tuple tuple : encodeTupleSet) {
BooleanFormula expr = bmgr.makeFalse();
if (minSet.contains(tuple)) {
expr = getExecPair(tuple, ctx);
} else {
for (Tuple t1 : r1Set.getByFirst(tuple.getFirst())) {
Tuple t2 = new Tuple(t1.getSecond(), tuple.getSecond());
if (r2Set.contains(t2)) {
expr = bmgr.or(expr, bmgr.and(r1.getSMTVar(t1, ctx), r2.getSMTVar(t2, ctx)));
}
}
}
enc = bmgr.and(enc, bmgr.equivalence(this.getSMTVar(tuple, ctx), expr));
}
return enc;
}
use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.
the class RelIntersection method encodeApprox.
@Override
public BooleanFormula encodeApprox(SolverContext ctx) {
BooleanFormulaManager bmgr = ctx.getFormulaManager().getBooleanFormulaManager();
BooleanFormula enc = bmgr.makeTrue();
TupleSet min = getMinTupleSet();
for (Tuple tuple : encodeTupleSet) {
if (min.contains(tuple)) {
enc = bmgr.and(enc, bmgr.equivalence(this.getSMTVar(tuple, ctx), getExecPair(tuple, ctx)));
continue;
}
BooleanFormula opt1 = r1.getSMTVar(tuple, ctx);
BooleanFormula opt2 = r2.getSMTVar(tuple, ctx);
enc = bmgr.and(enc, bmgr.equivalence(this.getSMTVar(tuple, ctx), bmgr.and(opt1, opt2)));
}
return enc;
}
Aggregations