@Test public void testGetSrcLocationBdds() { String hostname = "c"; String ifaceName = "iface"; OriginateInterface originateInterface = new OriginateInterface(hostname, ifaceName); OriginateInterfaceLink originateInterfaceLink = new OriginateInterfaceLink(hostname, ifaceName); PostInVrf postInVrf = new PostInVrf(hostname, "vrf"); BDD ifaceOriginateBdd = PKT.getDstIp().value(1); BDD ifaceLinkBdd = PKT.getDstIp().value(2); BDD postInVrfBdd = PKT.getSrcIp().value(3); BDDReachabilityAnalysis analysis = new BDDReachabilityAnalysis( PKT, ImmutableSet.of(originateInterface, originateInterfaceLink), Stream.of( new Edge(originateInterface, Query.INSTANCE, ifaceOriginateBdd), new Edge(originateInterfaceLink, postInVrf, ifaceLinkBdd), new Edge(postInVrf, Query.INSTANCE, postInVrfBdd)), PKT.getFactory().one()); InterfaceLocation ifaceLocation = new InterfaceLocation(hostname, ifaceName); InterfaceLinkLocation ifaceLinkLocation = new InterfaceLinkLocation(hostname, ifaceName); assertThat( analysis.getSrcLocationBdds(), equalTo( ImmutableMap.of( ifaceLocation, ifaceOriginateBdd, ifaceLinkLocation, ifaceLinkBdd.and(postInVrfBdd)))); }
public Map<Location, BDD> getSrcLocationBdds() { Map<StateExpr, BDD> reverseReachableStates = computeReverseReachableStates(); ImmutableMap.Builder<Location, BDD> srcLocBdds = ImmutableMap.builder(); for (Entry<StateExpr, BDD> e : reverseReachableStates.entrySet()) { Optional<Location> srcLoc = OriginationStateExprToLocation.toLocation(e.getKey()); srcLoc.ifPresent(loc -> srcLocBdds.put(loc, e.getValue())); } return srcLocBdds.build(); }
BDDReachabilityAnalysis { public Map<Location, BDD> getSrcLocationBdds() { Map<StateExpr, BDD> reverseReachableStates = computeReverseReachableStates(); ImmutableMap.Builder<Location, BDD> srcLocBdds = ImmutableMap.builder(); for (Entry<StateExpr, BDD> e : reverseReachableStates.entrySet()) { Optional<Location> srcLoc = OriginationStateExprToLocation.toLocation(e.getKey()); srcLoc.ifPresent(loc -> srcLocBdds.put(loc, e.getValue())); } return srcLocBdds.build(); } }
BDDReachabilityAnalysis { public Map<Location, BDD> getSrcLocationBdds() { Map<StateExpr, BDD> reverseReachableStates = computeReverseReachableStates(); ImmutableMap.Builder<Location, BDD> srcLocBdds = ImmutableMap.builder(); for (Entry<StateExpr, BDD> e : reverseReachableStates.entrySet()) { Optional<Location> srcLoc = OriginationStateExprToLocation.toLocation(e.getKey()); srcLoc.ifPresent(loc -> srcLocBdds.put(loc, e.getValue())); } return srcLocBdds.build(); } BDDReachabilityAnalysis(
      BDDPacket packet,
      Set<StateExpr> ingressLocationStates,
      Stream<Edge> edges,
      BDD queryHeaderSpaceBdd); }
BDDReachabilityAnalysis { public Map<Location, BDD> getSrcLocationBdds() { Map<StateExpr, BDD> reverseReachableStates = computeReverseReachableStates(); ImmutableMap.Builder<Location, BDD> srcLocBdds = ImmutableMap.builder(); for (Entry<StateExpr, BDD> e : reverseReachableStates.entrySet()) { Optional<Location> srcLoc = OriginationStateExprToLocation.toLocation(e.getKey()); srcLoc.ifPresent(loc -> srcLocBdds.put(loc, e.getValue())); } return srcLocBdds.build(); } BDDReachabilityAnalysis(
      BDDPacket packet,
      Set<StateExpr> ingressLocationStates,
      Stream<Edge> edges,
      BDD queryHeaderSpaceBdd); Map<StateExpr, BDD> computeReverseReachableStates(Map<StateExpr, BDD> roots); Map<StateExpr, BDD> computeForwardReachableStates(); Map<StateExpr, BDD> computeForwardReachableStates(
      Map<StateExpr, BDD> initialReachableStates); BDDPacket getBDDPacket(); ImmutableSet<StateExpr> getIngressLocationStates(); Map<IngressLocation, BDD> getIngressLocationReachableBDDs(); Map<IngressLocation, BDD> getIngressLocationReachableBDDs(Map<StateExpr, BDD> roots); Map<Location, BDD> getSrcLocationBdds(); Map<StateExpr, Map<StateExpr, Transition>> getForwardEdgeMap(); Table<StateExpr, StateExpr, Transition> getForwardEdgeTable(); }
BDDReachabilityAnalysis { public Map<Location, BDD> getSrcLocationBdds() { Map<StateExpr, BDD> reverseReachableStates = computeReverseReachableStates(); ImmutableMap.Builder<Location, BDD> srcLocBdds = ImmutableMap.builder(); for (Entry<StateExpr, BDD> e : reverseReachableStates.entrySet()) { Optional<Location> srcLoc = OriginationStateExprToLocation.toLocation(e.getKey()); srcLoc.ifPresent(loc -> srcLocBdds.put(loc, e.getValue())); } return srcLocBdds.build(); } BDDReachabilityAnalysis(
      BDDPacket packet,
      Set<StateExpr> ingressLocationStates,
      Stream<Edge> edges,
      BDD queryHeaderSpaceBdd); Map<StateExpr, BDD> computeReverseReachableStates(Map<StateExpr, BDD> roots); Map<StateExpr, BDD> computeForwardReachableStates(); Map<StateExpr, BDD> computeForwardReachableStates(
      Map<StateExpr, BDD> initialReachableStates); BDDPacket getBDDPacket(); ImmutableSet<StateExpr> getIngressLocationStates(); Map<IngressLocation, BDD> getIngressLocationReachableBDDs(); Map<IngressLocation, BDD> getIngressLocationReachableBDDs(Map<StateExpr, BDD> roots); Map<Location, BDD> getSrcLocationBdds(); Map<StateExpr, Map<StateExpr, Transition>> getForwardEdgeMap(); Table<StateExpr, StateExpr, Transition> getForwardEdgeTable();  }