proposition: Lemma cmd_get_preserve_pre : ∀ ℓ (pre : precond), get_pre_cond ℓ pre → ⊢ ⦃ λ '(s₀, s₁), pre (s₀, s₁) ⦄ x ← cmd (cmd_get ℓ) ;; ret x ≈ x ← cmd (cmd_get ℓ) ;; ret x ⦃ λ '(a₀, s₀) '(a₁, s₁), pre (s₀, s₁) ∧ a₀ = a₁ ⦄.
proof: Proof. intros ℓ pre h. simpl. eapply from_sem_jdg. simpl. intros [s₀ s₁]. hnf. intro P. hnf. intros [hpre hpost]. simpl. exists ( SDistr_unit _ ( (get_heap s₀ ℓ, s₀), (get_heap s₁ ℓ, s₁) ) ). split. - apply SDistr_unit_F_choice_prod_coupling. reflexivity. - intros [] [] e. unfold SDistr_unit in e. rewrite dunit1E in e. apply ge0_eq in e. noconf e. eapply hpost. intuition auto. Qed.
imports: Coq(Utf8) Relational(OrderEnrichedCategory OrderEnrichedRelativeMonadExamples) mathcomp(ssrnat ssreflect ssrfun ssrbool ssrnum eqtype choice reals distr seq all_algebra fintype realsum) extructures(ord fset fmap) Mon(SPropBase) Crypt(Prelude Axioms ChoiceAsOrd SubDistr Couplings RulesStateProb UniformStateProb UniformDistrLemmas StateTransfThetaDens StateTransformingLaxMorph choice_type pkg_core_definition pkg_notation pkg_tactics pkg_composition pkg_heap pkg_semantics pkg_lookup pkg_advantage pkg_invariants pkg_distr) Equations.Prop.DepElim Equations(Equations) Crypt(FreeProbProg)