proposition: Lemma refine_For_Map {resultT resultT'} : forall comp (f : resultT' -> resultT), refine (For (results <- comp; ret (map f results))) (results <- For comp; ret (map f results)).
proof: Proof. Local Transparent Query_For. intros; unfold Query_For; autorewrite with monad laws. f_equiv; intro. intros ? ?; computes_to_inv; subst. computes_to_econstructor; rewrite Permutation_map; eauto. Local Opaque Query_For. Qed.
imports: Coq.Vectors.Vector Coq.Strings.Ascii Coq.Bool.Bool Coq.Lists.List Fiat.Common.Tactics.CacheStringConstant Fiat.Computation.Decidable Fiat.Computation.IfDec Fiat.Computation.FoldComp Fiat.Computation.FueledFix Fiat.Computation.ListComputations Fiat.QueryStructure.Automation.Common Fiat.QueryStructure.Automation.MasterPlan Fiat.QueryStructure.Implementation.DataStructures.BagADT.BagADT Fiat.QueryStructure.Automation.IndexSelection Fiat.QueryStructure.Specification.SearchTerms.ListPrefix Fiat.QueryStructure.Automation.SearchTerms.FindStringPrefixSearchTerms Fiat.QueryStructure.Automation.QSImplementation Bedrock.Word Fiat.Narcissus.Common.Specs Fiat.Narcissus.BinLib.Core Fiat.Narcissus.Examples.DnsOpt Fiat.Narcissus.Lib2.DomainNameOpt Fiat.Examples.DnsServer.Packet Fiat.Examples.DnsServer.DecomposeSumField Fiat.Examples.DnsServer.DnsLemmas Fiat.Examples.DnsServer.DnsAutomation Fiat.Examples.DnsServer.AuthoritativeDNSSchema