Search in sources :

Example 6 with TupleSet

use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.

the class BasicRegRelation method mkTupleSets.

private void mkTupleSets() {
    maxTupleSet = new TupleSet();
    minTupleSet = new TupleSet();
    Dependency dep = analysisContext.requires(Dependency.class);
    for (Event regReader : getEvents()) {
        for (Register register : getRegisters(regReader)) {
            Dependency.State r = dep.of(regReader, register);
            for (Event regWriter : r.may) {
                maxTupleSet.add(new Tuple(regWriter, regReader));
            }
            for (Event regWriter : r.must) {
                minTupleSet.add(new Tuple(regWriter, regReader));
            }
        }
    }
}
Also used : TupleSet(com.dat3m.dartagnan.wmm.utils.TupleSet) Register(com.dat3m.dartagnan.program.Register) Event(com.dat3m.dartagnan.program.event.core.Event) Dependency(com.dat3m.dartagnan.program.analysis.Dependency) Tuple(com.dat3m.dartagnan.wmm.utils.Tuple)

Example 7 with TupleSet

use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.

the class RelCo method getMinTupleSet.

@Override
public TupleSet getMinTupleSet() {
    if (minTupleSet == null) {
        minTupleSet = new TupleSet();
        WmmAnalysis wmmAnalysis = analysisContext.get(WmmAnalysis.class);
        if (wmmAnalysis.isLocallyConsistent()) {
            applyLocalConsistencyMinSet();
        }
    }
    return minTupleSet;
}
Also used : TupleSet(com.dat3m.dartagnan.wmm.utils.TupleSet) WmmAnalysis(com.dat3m.dartagnan.wmm.analysis.WmmAnalysis)

Example 8 with TupleSet

use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.

the class RelLoc method getMaxTupleSet.

@Override
public TupleSet getMaxTupleSet() {
    if (maxTupleSet == null) {
        AliasAnalysis alias = analysisContext.get(AliasAnalysis.class);
        maxTupleSet = new TupleSet();
        Collection<Event> events = task.getProgram().getCache().getEvents(FilterBasic.get(MEMORY));
        for (Event e1 : events) {
            for (Event e2 : events) {
                if (alias.mayAlias((MemEvent) e1, (MemEvent) e2)) {
                    maxTupleSet.add(new Tuple(e1, e2));
                }
            }
        }
        removeMutuallyExclusiveTuples(maxTupleSet);
    }
    return maxTupleSet;
}
Also used : TupleSet(com.dat3m.dartagnan.wmm.utils.TupleSet) MemEvent(com.dat3m.dartagnan.program.event.core.MemEvent) Event(com.dat3m.dartagnan.program.event.core.Event) AliasAnalysis(com.dat3m.dartagnan.program.analysis.AliasAnalysis) Tuple(com.dat3m.dartagnan.wmm.utils.Tuple)

Example 9 with TupleSet

use of com.dat3m.dartagnan.wmm.utils.TupleSet in project Dat3M by hernanponcedeleon.

the class RelExt method getMaxTupleSet.

@Override
public TupleSet getMaxTupleSet() {
    if (maxTupleSet == null) {
        maxTupleSet = new TupleSet();
        List<Thread> threads = task.getProgram().getThreads();
        for (int i = 0; i < threads.size(); i++) {
            Thread t1 = threads.get(i);
            for (int j = i + 1; j < threads.size(); j++) {
                Thread t2 = threads.get(j);
                for (Event e1 : t1.getCache().getEvents(FilterBasic.get(Tag.VISIBLE))) {
                    for (Event e2 : t2.getCache().getEvents(FilterBasic.get(Tag.VISIBLE))) {
                        maxTupleSet.add(new Tuple(e1, e2));
                        maxTupleSet.add(new Tuple(e2, e1));
                    }
                }
            }
        }
    }
    return maxTupleSet;
}
Also used : TupleSet(com.dat3m.dartagnan.wmm.utils.TupleSet) Event(com.dat3m.dartagnan.program.event.core.Event) Tuple(com.dat3m.dartagnan.wmm.utils.Tuple) Thread(com.dat3m.dartagnan.program.Thread)

Example 10 with TupleSet

use of com.dat3m.dartagnan.wmm.utils.TupleSet 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;
}
Also used : BooleanFormulaManager(org.sosy_lab.java_smt.api.BooleanFormulaManager) TupleSet(com.dat3m.dartagnan.wmm.utils.TupleSet) ExecutionAnalysis(com.dat3m.dartagnan.program.analysis.ExecutionAnalysis) SolverContext(org.sosy_lab.java_smt.api.SolverContext) Event(com.dat3m.dartagnan.program.event.core.Event) Tuple(com.dat3m.dartagnan.wmm.utils.Tuple) BooleanFormula(org.sosy_lab.java_smt.api.BooleanFormula) Relation(com.dat3m.dartagnan.wmm.relation.Relation) Sets(com.google.common.collect.Sets) TupleSet(com.dat3m.dartagnan.wmm.utils.TupleSet) ExecutionAnalysis(com.dat3m.dartagnan.program.analysis.ExecutionAnalysis) Tuple(com.dat3m.dartagnan.wmm.utils.Tuple)

Aggregations

TupleSet (com.dat3m.dartagnan.wmm.utils.TupleSet)47 Tuple (com.dat3m.dartagnan.wmm.utils.Tuple)36 Event (com.dat3m.dartagnan.program.event.core.Event)27 BooleanFormula (org.sosy_lab.java_smt.api.BooleanFormula)16 BooleanFormulaManager (org.sosy_lab.java_smt.api.BooleanFormulaManager)16 ExecutionAnalysis (com.dat3m.dartagnan.program.analysis.ExecutionAnalysis)11 Thread (com.dat3m.dartagnan.program.Thread)10 Relation (com.dat3m.dartagnan.wmm.relation.Relation)8 SolverContext (org.sosy_lab.java_smt.api.SolverContext)8 Sets (com.google.common.collect.Sets)7 MemEvent (com.dat3m.dartagnan.program.event.core.MemEvent)5 Set (java.util.Set)5 AliasAnalysis (com.dat3m.dartagnan.program.analysis.AliasAnalysis)4 HashSet (java.util.HashSet)4 Collectors (java.util.stream.Collectors)4 Tag (com.dat3m.dartagnan.program.event.Tag)3 WmmAnalysis (com.dat3m.dartagnan.wmm.analysis.WmmAnalysis)3 LogManager (org.apache.logging.log4j.LogManager)3 Logger (org.apache.logging.log4j.Logger)3 GlobalSettings (com.dat3m.dartagnan.GlobalSettings)2