proposition: Corollary TrieBag_enumerateOK'' : forall l st1 search_term, (forall (k : X.t) (subtrie : Trie), InA (PX.eqke (elt:=Trie)) (k, subtrie) l -> TrieOK subtrie (st1 ++ [k])) -> Permutation (List.filter (fun a => negb (TrieBag_bfind_matcher (Some st1, search_term) a)) (flatten (List.map benumerate (fold_left (fun (a : list (BagType)) (p : key * Trie) => (Trie_enumerate (snd p)) ++ a) l [ ])))) (flatten (List.map benumerate (fold_left (fun (a : list (BagType)) (p : key * Trie) => (Trie_enumerate (snd p)) ++ a) l [ ]))).
proof: Proof. intros; generalize (@TrieBag_enumerateOK' l st1 search_term H); clear. induction (flatten (List.map benumerate (fold_left (fun (a : list (BagType)) (p : key * Trie) => (Trie_enumerate (snd p)) ++ a) l [ ]))); simpl; eauto. find_if_inside; intros; simpl. symmetry in H; apply Permutation_nil in H; discriminate. eauto. Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Fiat.QueryStructure.Implementation.DataStructures.Bags.BagsInterface Fiat.QueryStructure.Implementation.DataStructures.Bags.BagsProperties Coq.FSets.FMapInterface Coq.FSets.FMapFacts Coq.FSets.FMapAVL Coq.ZArith.ZArith Fiat.Common Fiat.Common.List.ListFacts Fiat.Common.List.FlattenList Fiat.Common.SetEqProperties Fiat.Common.FMapExtensions Fiat.Common.List.PermutationFacts Fiat.QueryStructure.Specification.SearchTerms.ListPrefix