proposition: Lemma format_string_aligned_ByteString {numBytes} : forall (s : string) (ce : CacheFormat) (ce' : CacheFormat) (c : _ -> Comp _) (v : Vector.t _ numBytes), refine (c (addE ce (8 * String.length s))) (ret (build_aligned_ByteString v, ce')) -> refine (((FixStringOpt.format_string s) ThenC c) ce) (ret (build_aligned_ByteString (append (StringToBytes s) v), ce')).
proof: Proof. unfold compose, Bind2; autorewrite with monad laws; intros. rewrite format_string_ByteString. simplify with monad laws. unfold snd at 1. rewrite H. simplify with monad laws. simpl. rewrite <- build_aligned_ByteString_append; simpl. reflexivity. Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.ZArith.ZArith Coq.Strings.Ascii Coq.Strings.String Coq.Arith.Mult Coq.Vectors.Vector Fiat.Common.SumType Fiat.Common.BoundedLookup Fiat.Common.ilist Fiat.Common.DecideableEnsembles Fiat.Computation Fiat.Narcissus.Common.Specs Fiat.Narcissus.Common.ComposeOpt Fiat.Narcissus.Formats.FixStringOpt Fiat.Narcissus.Formats.StringOpt Fiat.Narcissus.Formats.EnumOpt Fiat.Narcissus.Formats.FixListOpt Fiat.Narcissus.Formats.SumTypeOpt Fiat.Narcissus.Formats.AsciiOpt Fiat.Narcissus.BinLib.AlignedByteString Fiat.Narcissus.BinLib.AlignWord Fiat.Common.IterateBoundedIndex Fiat.Common.Tactics.CacheStringConstant Bedrock.Word