fact: Definition BagUpdateCorrect {TContainer TItem TSearchTerm TUpdateTerm : Type} (RepInv : TContainer -> Prop) (ValidUpdate : TUpdateTerm -> Prop) (bfind : TContainer -> TSearchTerm -> list TItem) (bfind_matcher : TSearchTerm -> TItem -> bool) (benumerate : TContainer -> list TItem) (bupdate_transform : TUpdateTerm -> TItem -> TItem) (bupdate : TContainer -> TSearchTerm -> TUpdateTerm -> list TItem * TContainer) := forall container search_term update_term (containerCorrect : RepInv container) (valid_update : ValidUpdate update_term), Permutation (benumerate (snd (bupdate container search_term update_term))) ((snd (List.partition (bfind_matcher search_term) (benumerate container))) ++ List.map (bupdate_transform update_term) (fst (List.partition (bfind_matcher search_term) (benumerate container)))) /\ Permutation (fst (bupdate container search_term update_term)) (fst (List.partition (bfind_matcher search_term) (benumerate container))).
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.Program.Program Coq.Sorting.Permutation