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;
}
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);
}
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);
}
}
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);
}
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();
}
Aggregations