@Test public void testMergeDisjuncts() { BDD v0 = var(0); BDD v1 = var(1); Collection<Transition> actual = mergeDisjuncts( ImmutableList.of( constraint(v0), constraint(v1), eraseAndSet(v0, v0), eraseAndSet(v0, v1), eraseAndSet(v1, v0), eraseAndSet(v1, v1))); Collection<Transition> expected = ImmutableSet.of( constraint(v0.or(v1)), eraseAndSet(v0, v0.or(v1)), eraseAndSet(v1, v0.or(v1))); assertEquals(expected, actual); }
@VisibleForTesting static Collection<Transition> mergeDisjuncts(List<Transition> origDisjuncts) { if (origDisjuncts.size() < 2) { return origDisjuncts; } Set<Transition> disjuncts = new HashSet<>(origDisjuncts); boolean merged = tryMergeDisjunctSet(disjuncts); while (merged) { merged = tryMergeDisjunctSet(disjuncts); } return disjuncts; }
Transitions { @VisibleForTesting static Collection<Transition> mergeDisjuncts(List<Transition> origDisjuncts) { if (origDisjuncts.size() < 2) { return origDisjuncts; } Set<Transition> disjuncts = new HashSet<>(origDisjuncts); boolean merged = tryMergeDisjunctSet(disjuncts); while (merged) { merged = tryMergeDisjunctSet(disjuncts); } return disjuncts; } }
Transitions { @VisibleForTesting static Collection<Transition> mergeDisjuncts(List<Transition> origDisjuncts) { if (origDisjuncts.size() < 2) { return origDisjuncts; } Set<Transition> disjuncts = new HashSet<>(origDisjuncts); boolean merged = tryMergeDisjunctSet(disjuncts); while (merged) { merged = tryMergeDisjunctSet(disjuncts); } return disjuncts; } private  Transitions(); }
Transitions { @VisibleForTesting static Collection<Transition> mergeDisjuncts(List<Transition> origDisjuncts) { if (origDisjuncts.size() < 2) { return origDisjuncts; } Set<Transition> disjuncts = new HashSet<>(origDisjuncts); boolean merged = tryMergeDisjunctSet(disjuncts); while (merged) { merged = tryMergeDisjunctSet(disjuncts); } return disjuncts; } private  Transitions(); static Transition branch(BDD guard, Transition thn, Transition els); static Transition compose(Transition... transitions); static @Nullable Transition mergeComposed(Transition t1, Transition t2); static Transition constraint(BDD bdd); static Transition eraseAndSet(BDD var, BDD value); static Transition eraseAndSet(BDDInteger var, BDD value); @Deprecated static Transition or(); static Transition or(Transition... transitions); static Transition addLastHopConstraint(
      @Nullable LastHopOutgoingInterfaceManager mgr,
      String sendingNode,
      String sendingIface,
      String recvNode,
      String recvIface); static Transition addNoLastHopConstraint(
      @Nullable LastHopOutgoingInterfaceManager mgr, String recvNode, String recvIface); static Transition addOutgoingOriginalFlowFiltersConstraint(
      BDDOutgoingOriginalFlowFilterManager mgr); static Transition addOriginatingFromDeviceConstraint(BDDSourceManager mgr); static Transition addSourceInterfaceConstraint(BDDSourceManager mgr, String iface); static Transition removeNodeSpecificConstraints(
      String node,
      @Nullable LastHopOutgoingInterfaceManager lastHopMgr,
      BDDOutgoingOriginalFlowFilterManager originalFlowFilterMgr,
      BDDSourceManager sourceMgr); @VisibleForTesting static Transition removeOutgoingInterfaceConstraints(
      BDDOutgoingOriginalFlowFilterManager mgr); @VisibleForTesting static Transition removeSourceConstraint(BDDSourceManager mgr); static Transition reverse(Transition transition); }
Transitions { @VisibleForTesting static Collection<Transition> mergeDisjuncts(List<Transition> origDisjuncts) { if (origDisjuncts.size() < 2) { return origDisjuncts; } Set<Transition> disjuncts = new HashSet<>(origDisjuncts); boolean merged = tryMergeDisjunctSet(disjuncts); while (merged) { merged = tryMergeDisjunctSet(disjuncts); } return disjuncts; } private  Transitions(); static Transition branch(BDD guard, Transition thn, Transition els); static Transition compose(Transition... transitions); static @Nullable Transition mergeComposed(Transition t1, Transition t2); static Transition constraint(BDD bdd); static Transition eraseAndSet(BDD var, BDD value); static Transition eraseAndSet(BDDInteger var, BDD value); @Deprecated static Transition or(); static Transition or(Transition... transitions); static Transition addLastHopConstraint(
      @Nullable LastHopOutgoingInterfaceManager mgr,
      String sendingNode,
      String sendingIface,
      String recvNode,
      String recvIface); static Transition addNoLastHopConstraint(
      @Nullable LastHopOutgoingInterfaceManager mgr, String recvNode, String recvIface); static Transition addOutgoingOriginalFlowFiltersConstraint(
      BDDOutgoingOriginalFlowFilterManager mgr); static Transition addOriginatingFromDeviceConstraint(BDDSourceManager mgr); static Transition addSourceInterfaceConstraint(BDDSourceManager mgr, String iface); static Transition removeNodeSpecificConstraints(
      String node,
      @Nullable LastHopOutgoingInterfaceManager lastHopMgr,
      BDDOutgoingOriginalFlowFilterManager originalFlowFilterMgr,
      BDDSourceManager sourceMgr); @VisibleForTesting static Transition removeOutgoingInterfaceConstraints(
      BDDOutgoingOriginalFlowFilterManager mgr); @VisibleForTesting static Transition removeSourceConstraint(BDDSourceManager mgr); static Transition reverse(Transition transition); static final Transition IDENTITY; static final Transition ZERO; }