Search in sources :

Example 6 with EdgeDirection

use of com.dat3m.dartagnan.solver.caat.misc.EdgeDirection 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)

Aggregations

EdgeDirection (com.dat3m.dartagnan.solver.caat.misc.EdgeDirection)6 Edge (com.dat3m.dartagnan.solver.caat.predicates.relationGraphs.Edge)6 EventData (com.dat3m.dartagnan.verification.model.EventData)6 Stream (java.util.stream.Stream)6 Function (java.util.function.Function)5 java.util (java.util)4 Thread (com.dat3m.dartagnan.program.Thread)3 BigInteger (java.math.BigInteger)3 Iterators (com.google.common.collect.Iterators)2 List (java.util.List)2 Map (java.util.Map)2 Spliterator (java.util.Spliterator)2 IntStream (java.util.stream.IntStream)2 StreamSupport (java.util.stream.StreamSupport)2