Skip to content
Snippets Groups Projects
Commit 54ebef8d authored by Dan Frumin's avatar Dan Frumin
Browse files

WIP alternative contextual refinement definition

parent bbd59d64
No related branches found
No related tags found
1 merge request!5Alternative definition of contextual refinement
...@@ -303,6 +303,33 @@ Proof. ...@@ -303,6 +303,33 @@ Proof.
eapply typed_ctx_compose; eauto. eapply typed_ctx_compose; eauto.
Qed. Qed.
(* Alternative formulation of contextual refinement
without restricting to contexts of the ground type *)
Definition ctx_refines_alt (Γ : stringmap type)
(e e' : expr) (τ : type) : Prop := K thp σ₀ σ₁ v1 τ',
typed_ctx K Γ τ τ'
rtc erased_step ([fill_ctx K e], σ₀) (of_val v1 :: thp, σ₁)
thp' σ₁' v2, rtc erased_step ([fill_ctx K e'], σ₀) (of_val v2 :: thp', σ₁').
Lemma ctx_refines_impl_alt Γ e1 e2 τ :
(Γ e1 ctx e2 : τ)
ctx_refines_alt Γ e1 e2 τ.
Proof.
intros H C thp σ0 σ1 v1 τ' HC Hstep.
pose (C' := (CTX_AppR (λ: <>, #true)%E)::C).
cut ( (thp' : list expr) σ₁',
rtc erased_step ([fill_ctx C' e2], σ0)
(of_val #true :: thp', σ₁')).
- unfold C'; simpl.
destruct 1 as (thp' & σ1' & Hstep').
exists thp', σ1'.
admit.
- eapply (H C' thp _ σ1 #true TBool).
+ repeat econstructor; eauto.
+ repeat econstructor; eauto.
+ unfold C'. simpl.
admit.
Admitted.
Definition ctx_equiv Γ e1 e2 τ := Definition ctx_equiv Γ e1 e2 τ :=
(Γ e1 ctx e2 : τ) (Γ e2 ctx e1 : τ). (Γ e1 ctx e2 : τ) (Γ e2 ctx e1 : τ).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment