proposition: Lemma format_sequence_correct {cache : Cache} {S V1 T : Type} {P : CacheDecode -> Prop} {P_inv1 P_inv2 : (CacheDecode -> Prop) -> Prop} (P_inv_pf : cache_inv_Property P (fun P => P_inv1 P /\ P_inv2 P)) (monoid : Monoid T) (f : S -> V1) (Source_Predicate : S -> Prop) (View_Predicate1 : V1 -> Prop) (format1 : FormatM V1 T) (format2 : FormatM S T ) (decode1 : DecodeM (V1 * T) T) (decode_1_OK : cache_inv_Property P P_inv1 -> CorrectDecoder monoid View_Predicate1 View_Predicate1 eq format1 decode1 P format1) (View_Predicate_OK : forall s, Source_Predicate s -> View_Predicate1 (f s)) (decode2 : V1 -> DecodeM (S * T) T) (decode2_pf : forall v1 : V1, cache_inv_Property P P_inv2 -> View_Predicate1 v1 -> CorrectDecoder monoid (fun s => Source_Predicate s /\ IsProj f v1 s) (fun s => Source_Predicate s /\ IsProj f v1 s) eq format2 (decode2 v1) P format2) : CorrectDecoder monoid Source_Predicate Source_Predicate eq (format1 ◦ f ++ format2) (sequence_Decode decode1 decode2) P (format1 ◦ f ++ format2).
proof: Proof. eapply sequence_Compose_format_decode_correct; try eassumption. intros; subst; eauto. Qed.
imports: Coq.ZArith.ZArith Fiat.Common Fiat.Computation.Notations Fiat.Narcissus.Common.Specs Fiat.Narcissus.Common.WordFacts Fiat.Computation.Refinements.General Fiat.Narcissus.BaseFormats