fact: Definition IndexedBag_bupdate (container: IndexedBag) (key_searchterm: (option TKey) * SearchTermType) (updateTerm : UpdateTermType) : (list TItem) * IndexedBag := let (key_option, search_term) := key_searchterm in match key_option with | Some k => match find k container with | Some bag => let (d,r) := bupdate bag search_term updateTerm in (d, add k r container) | None => (nil, container) end | None => fold (fun k bag (res : (list TItem) * (t BagType)) => match bupdate bag search_term updateTerm with | (d, r) => let (d', r') := res in (d ++ d', add k r r') end) (container) ([], empty BagType) end.
imports: Fiat.QueryStructure.Implementation.DataStructures.Bags.BagsInterface Fiat.QueryStructure.Implementation.DataStructures.Bags.BagsProperties Coq.FSets.FMapInterface Coq.FSets.FMapFacts Coq.Arith.PeanoNat Fiat.Common Fiat.Common.List.ListFacts Fiat.Common.List.FlattenList Fiat.Common.SetEqProperties Fiat.Common.FMapExtensions Fiat.Common.List.PermutationFacts