Search in sources :

Example 16 with EventData

use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.

the class FenceGraph method getNextFence.

public EventData getNextFence(EventData e) {
    List<EventData> fences = threadFencesMap.get(e.getThread());
    if (fences.isEmpty()) {
        return null;
    }
    EventData closestFence = null;
    for (int i = fences.size() - 1; i >= 0; i--) {
        EventData fence = fences.get(i);
        if (fence.getLocalId() > e.getLocalId()) {
            closestFence = fence;
        } else {
            break;
        }
    }
    return closestFence;
}
Also used : EventData(com.dat3m.dartagnan.verification.model.EventData)

Example 17 with EventData

use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.

the class InternalGraph method edgeStream.

@Override
public Stream<Edge> edgeStream(int id, EdgeDirection dir) {
    EventData e = getEvent(id);
    Function<EventData, Edge> edgeMapping = dir == EdgeDirection.OUTGOING ? (x -> new Edge(id, x.getId())) : (x -> new Edge(x.getId(), id));
    return threadEventsMap.get(e.getThread()).stream().map(edgeMapping);
}
Also used : IntStream(java.util.stream.IntStream) List(java.util.List) Stream(java.util.stream.Stream) EventData(com.dat3m.dartagnan.verification.model.EventData) Map(java.util.Map) Thread(com.dat3m.dartagnan.program.Thread) Function(java.util.function.Function) Edge(com.dat3m.dartagnan.solver.caat.predicates.relationGraphs.Edge) EdgeDirection(com.dat3m.dartagnan.solver.caat.misc.EdgeDirection) Edge(com.dat3m.dartagnan.solver.caat.predicates.relationGraphs.Edge) EventData(com.dat3m.dartagnan.verification.model.EventData)

Example 18 with EventData

use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.

the class LocationGraph method repopulate.

@Override
public void repopulate() {
    addrEventsMap = new HashMap<>(model.getAddressReadsMap().size());
    for (BigInteger addr : model.getAddressReadsMap().keySet()) {
        // TODO: This can be improved via a disjoint union class
        Set<EventData> events = new HashSet<>(model.getAddressReadsMap().get(addr));
        events.addAll(model.getAddressWritesMap().get(addr));
        size += events.size() * events.size();
        addrEventsMap.put(addr, events);
    }
}
Also used : BigInteger(java.math.BigInteger) EventData(com.dat3m.dartagnan.verification.model.EventData)

Example 19 with EventData

use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.

the class LocationGraph method edgeStream.

@Override
public Stream<Edge> edgeStream(int id, EdgeDirection dir) {
    EventData e = getEvent(id);
    if (!e.isMemoryEvent()) {
        return Stream.empty();
    }
    Function<EventData, Edge> edgeMapping = dir == EdgeDirection.OUTGOING ? (x -> new Edge(id, x.getId())) : (x -> new Edge(x.getId(), id));
    return addrEventsMap.get(e.getAccessedAddress()).stream().map(edgeMapping);
}
Also used : java.util(java.util) Stream(java.util.stream.Stream) EventData(com.dat3m.dartagnan.verification.model.EventData) BigInteger(java.math.BigInteger) Function(java.util.function.Function) Edge(com.dat3m.dartagnan.solver.caat.predicates.relationGraphs.Edge) EdgeDirection(com.dat3m.dartagnan.solver.caat.misc.EdgeDirection) Edge(com.dat3m.dartagnan.solver.caat.predicates.relationGraphs.Edge) EventData(com.dat3m.dartagnan.verification.model.EventData)

Example 20 with EventData

use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.

the class ProgramOrderGraph method containsById.

@Override
public boolean containsById(int id1, int id2) {
    EventData a = getEvent(id1);
    EventData b = getEvent(id2);
    return a.getThread() == b.getThread() && b.getLocalId() > a.getLocalId();
}
Also used : EventData(com.dat3m.dartagnan.verification.model.EventData)

Aggregations

EventData (com.dat3m.dartagnan.verification.model.EventData)28 Edge (com.dat3m.dartagnan.solver.caat.predicates.relationGraphs.Edge)10 EdgeDirection (com.dat3m.dartagnan.solver.caat.misc.EdgeDirection)6 Stream (java.util.stream.Stream)6 Function (java.util.function.Function)5 Thread (com.dat3m.dartagnan.program.Thread)4 BigInteger (java.math.BigInteger)4 java.util (java.util)4 List (java.util.List)3 Map (java.util.Map)3 Iterators (com.google.common.collect.Iterators)2 Spliterator (java.util.Spliterator)2 IntStream (java.util.stream.IntStream)2 StreamSupport (java.util.stream.StreamSupport)2 Register (com.dat3m.dartagnan.program.Register)1 MemEvent (com.dat3m.dartagnan.program.event.core.MemEvent)1 RMWStore (com.dat3m.dartagnan.program.event.core.rmw.RMWStore)1 EventDomain (com.dat3m.dartagnan.solver.caat4wmm.EventDomain)1 FenceGraph (com.dat3m.dartagnan.solver.caat4wmm.basePredicates.FenceGraph)1 ArrayList (java.util.ArrayList)1