Commit dd28723e authored by Ralf Jung's avatar Ralf Jung
Browse files

let-lemmas for simple sim

parent aaa597f0
...@@ -29,15 +29,10 @@ Definition ex1_opt : function := ...@@ -29,15 +29,10 @@ Definition ex1_opt : function :=
Lemma ex1_sim_body fs ft : ⊨ᶠ{fs,ft} ex1 ex1_opt. Lemma ex1_sim_body fs ft : ⊨ᶠ{fs,ft} ex1 ex1_opt.
Proof. Proof.
apply (sim_fun_simple1 10)=>// rf es css et cs vs vt FREL ??. simplify_eq/=. apply (sim_fun_simple1 10)=>// rf es css et cs vs vt FREL ??. simplify_eq/=.
(* InitCall *) (* InitCall *)
apply sim_simple_init_call=> c /= {css}. apply sim_simple_init_call=> c /= {css}.
(* Alloc *) (* Alloc *)
sim_apply sim_simple_alloc_local=> l t /=. sim_apply sim_simple_alloc_local=> l t /=.
(*
(* Let *) (* Let *)
sim_apply sim_body_let_place. simpl. sim_apply sim_simple_let_place=>/=.
*)
Abort. Abort.
...@@ -80,6 +80,7 @@ Proof. ...@@ -80,6 +80,7 @@ Proof.
clear. simpl. intros r n vs σs vt σt HH. exact: HH. clear. simpl. intros r n vs σs vt σt HH. exact: HH.
Qed. Qed.
(** * Administrative *)
Lemma sim_simple_init_call fs ft r n es css et cst Φ : Lemma sim_simple_init_call fs ft r n es css et cst Φ :
( c: call_id, ( c: call_id,
let r' := res_callState c (csOwned ) in let r' := res_callState c (csOwned ) in
...@@ -90,13 +91,25 @@ Proof. ...@@ -90,13 +91,25 @@ Proof.
apply HH; done. apply HH; done.
Qed. Qed.
(** * Memory *)
Lemma sim_simple_alloc_local fs ft r n T css cst Φ : Lemma sim_simple_alloc_local fs ft r n T css cst Φ :
( (l: loc) (t: tag), ( (l: loc) (t: tag),
let r' := res_mapsto l (init_stack t) in let r' := res_mapsto l (init_stack t) in
Φ (r r') n (PlaceR l t T) css (PlaceR l t T) cst) Φ (r r') n (PlaceR l t T) css (PlaceR l t T) cst)
r ⊨ˢ{n,fs,ft} (Alloc T, css) (Alloc T, cst) : Φ. r ⊨ˢ{n,fs,ft} (Alloc T, css) (Alloc T, cst) : Φ.
Proof. Proof.
intros HH σs σt <-<-. apply sim_body_alloc_local=>/=. apply HH. intros HH σs σt <-<-. apply sim_body_alloc_local=>/=. eauto.
Qed. Qed.
(** * Pure *)
Lemma sim_simple_let_val fs ft r n x (vs1 vt1: value) es2 et2 css cst Φ :
r ⊨ˢ{n,fs,ft} (subst x vs1 es2, css) (subst x vt1 et2, cst) : Φ
r ⊨ˢ{n,fs,ft} (let: x := vs1 in es2, css) ((let: x := vt1 in et2), cst) : Φ.
Proof. intros HH σs σt <-<-. apply sim_body_let; eauto. Qed.
Lemma sim_simple_let_place fs ft r n x ls lt ts tt tys tyt es2 et2 css cst Φ :
r ⊨ˢ{n,fs,ft} (subst x (Place ls ts tys) es2, css) (subst x (Place lt tt tyt) et2, cst) : Φ
r ⊨ˢ{n,fs,ft} (let: x := Place ls ts tys in es2, css) ((let: x := Place lt tt tyt in et2), cst) : Φ.
Proof. intros HH σs σt <-<-. apply sim_body_let; eauto. Qed.
End simple. End simple.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment