proposition: Corollary refine_SuccessfulInsert_Bind ResultT: forall qsSchema (qs : QueryStructure qsSchema) Ridx tup b (k : _ -> Comp ResultT), computes_to {idx | UnConstrFreshIdx (GetRelation qs Ridx) idx} b -> refine (x2 <- {x : bool | SuccessfulInsertSpec qs Ridx qs {| elementIndex := b; indexedElement := tup |} x}; k (qs, x2)) (k (qs, false)).
proof: Proof. unfold SuccessfulInsertSpec; intros. rewrite <- refineEquiv_bind_unit with (f := k). rewrite <- refine_SuccessfulInsert by eauto. rewrite refineEquiv_bind_bind. setoid_rewrite refineEquiv_bind_unit; f_equiv. Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.Strings.String Coq.ZArith.ZArith Coq.Lists.List Coq.Logic.FunctionalExtensionality Coq.Sets.Ensembles Fiat.Computation Fiat.Computation.Refinements.Iterate_Decide_Comp Fiat.ADT Fiat.ADTRefinement Fiat.ADTNotation Fiat.QueryStructure.Specification.Representation.QueryStructureSchema Fiat.ADTRefinement.BuildADTRefinements Fiat.QueryStructure.Specification.Representation.QueryStructure Fiat.Common.Ensembles.IndexedEnsembles Fiat.Common.IterateBoundedIndex Fiat.QueryStructure.Specification.Operations.Query Fiat.QueryStructure.Specification.Operations.Insert Fiat.QueryStructure.Implementation.Constraints.ConstraintChecksRefinements