use of org.batfish.symbolic.abstraction.Abstraction in project batfish by batfish.
the class PropertyChecker method findAllNetworkSlices.
private Tuple<Stream<Supplier<NetworkSlice>>, Long> findAllNetworkSlices(HeaderQuestion q, @Nullable Graph graph, boolean useDefaultCase) {
if (q.getUseAbstraction()) {
HeaderSpace h = q.getHeaderSpace();
int numFailures = q.getFailures();
System.out.println("Start verification");
System.out.println("Using headerspace: " + h.getDstIps());
DestinationClasses dcs = DestinationClasses.create(_batfish, graph, h, useDefaultCase);
System.out.println("Number of edges: " + dcs.getGraph().getAllRealEdges().size());
System.out.println("Created destination classes");
System.out.println("Num Classes: " + dcs.getHeaderspaceMap().size());
long l = System.currentTimeMillis();
ArrayList<Supplier<NetworkSlice>> ecs = NetworkSlice.allSlices(dcs, numFailures);
l = System.currentTimeMillis() - l;
System.out.println("Created BDDs");
return new Tuple<>(ecs.parallelStream(), l);
} else {
List<Supplier<NetworkSlice>> singleEc = new ArrayList<>();
Graph g = graph == null ? new Graph(_batfish) : graph;
Abstraction a = new Abstraction(g, null);
NetworkSlice slice = new NetworkSlice(q.getHeaderSpace(), a, false);
Supplier<NetworkSlice> sup = () -> slice;
singleEc.add(sup);
return new Tuple<>(singleEc.stream(), 0L);
}
}
Aggregations