anchor.diff:              let c = Util.Map.getOrDefault router [] maxroutes
               {Actions=List.rev vs; Control={Aggregates=a; Tags=b; MaxRoutes=c}}) result
       {PolInfo = polInfo; RConfigs = routerConfigs}
  +
   
   /// Ensure well-formedness for controlling 
   /// traffic entering the network. MED and prepending allow
  
positive.code:     | Some a, Some b ->
          if a.NumFailures < b.NumFailures then x else y
  
  
  module Update = 
  
      let updateConfig f (config:T) =
          let rconfigs = Map.map f config.RConfigs
          {PolInfo = config.PolInfo; RConfigs = rconfigs}
  
      let updateActions f (config:T) = 
          updateConfig (fun router rconf ->
              let actions = List.choose f rconf.Actions
              {Actions = actions; Control = rconf.Control}
          ) config
  
      let updateFilter f (config:T) =
          updateActions (fun (pred, acts) -> 
              match acts with 
              | Originate -> Some (pred, Originate)
              | Filters fs -> Some (pred, (Filters (List.choose f fs)))
          ) config
  
      let updateAllow f (config:T) = 
          updateFilter (fun filt -> 
              match filt with 
              | Deny -> Some Deny
              | Allow ((m,lp),es) as v -> 
                  match f m lp es with 
                  | None -> None 
                  | Some (m',lp',es') -> Some (Allow ((m',lp'),es'))
          ) config
  
      let updateMods f (config:T) = 
          updateAllow (fun m lp es -> 
              let es' = List.choose (f m lp) es 
              Some (m,lp,es')
          ) config
  
      let updateMod f (config:T) = 
          updateMods (fun m lp (peer,mods) -> 
              Some (peer, List.choose (f m lp peer) mods)
          ) config
  
  // TODO: don't reindex the no-export community
  let reindexCommunities (config:T) : T = 
      let reindex = Util.Reindexer(HashIdentity.Structural)
      // reindex all communities used in modification
      let changeModComms _ _ _ modif = 
          match modif with 
          | SetComm(c) ->
              let c' = string (reindex.Index c)
              Some (SetComm c')
          | _ -> Some modif
      // reindex all communities matched against
      let changeMatchComms m lp es = 
          match m with 
          | State(c,p) -> 
              let c' = string (reindex.Index c) 
  
negative.code:         | Allow ((m1,_),es1), Allow ((m2,_),es2) -> 
              disjointMatch m1 m2
  
  
      let inline eqExports (f1: Filter) (f2: Filter) = 
          match f1, f2 with
          | Deny, Deny -> true
  