Skip to content
Snippets Groups Projects
Commit ff244cf1 authored by Ralf Jung's avatar Ralf Jung
Browse files

also show Box conversions

parent 505d86a5
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -115,22 +115,44 @@ Section typing. ...@@ -115,22 +115,44 @@ Section typing.
Proof. Proof.
intros E L. iApply type_fn; [solve_typing..|]. iIntros "/= !#". intros E L. iApply type_fn; [solve_typing..|]. iIntros "/= !#".
iIntros (α ϝ ret arg). inv_vec arg=>x. simpl_subst. iIntros (α ϝ ret arg). inv_vec arg=>x. simpl_subst.
iApply type_jump; [solve_typing..|]. rewrite /tctx_incl /=. iApply type_jump; [solve_typing..|].
iIntros (??) "_ _ $". rewrite !tctx_interp_singleton /tctx_elt_interp /=. iIntros (??) "#LFT _ $ Hty". rewrite !tctx_interp_singleton /=. done.
by iIntros "$".
Qed. Qed.
Definition cell_from_mut : val := Definition cell_from_mut : val :=
funrec: <> ["x"] := return: ["x"]. funrec: <> ["x"] := return: ["x"].
Lemma cell_from_mut_type ty `{!TyWf ty} : Lemma cell_from_mut_type ty `{!TyWf ty} :
typed_val cell_get_mut (fn( α, ; &uniq{α} ty) &uniq{α} (cell ty)). typed_val cell_from_mut (fn( α, ; &uniq{α} ty) &uniq{α} (cell ty)).
Proof.
intros E L. iApply type_fn; [solve_typing..|]. iIntros "/= !#".
iIntros (α ϝ ret arg). inv_vec arg=>x. simpl_subst.
iApply type_jump; [solve_typing..|].
iIntros (??) "#LFT _ $ Hty". rewrite !tctx_interp_singleton /=. done.
Qed.
Definition cell_into_box : val :=
funrec: <> ["x"] := return: ["x"].
Lemma cell_into_box_type ty `{!TyWf ty} :
typed_val cell_into_box (fn(;box (cell ty)) box ty).
Proof. Proof.
intros E L. iApply type_fn; [solve_typing..|]. iIntros "/= !#". intros E L. iApply type_fn; [solve_typing..|]. iIntros "/= !#".
iIntros (α ϝ ret arg). inv_vec arg=>x. simpl_subst. iIntros (α ϝ ret arg). inv_vec arg=>x. simpl_subst.
iApply type_jump; [solve_typing..|]. rewrite /tctx_incl /=. iApply type_jump; [solve_typing..|].
iIntros (??) "_ _ $". rewrite !tctx_interp_singleton /tctx_elt_interp /=. iIntros (??) "#LFT _ $ Hty". rewrite !tctx_interp_singleton /=. done.
by iIntros "$". Qed.
Definition cell_from_box : val :=
funrec: <> ["x"] := return: ["x"].
Lemma cell_from_box_type ty `{!TyWf ty} :
typed_val cell_from_box (fn(; box ty) box (cell ty)).
Proof.
intros E L. iApply type_fn; [solve_typing..|]. iIntros "/= !#".
iIntros (α ϝ ret arg). inv_vec arg=>x. simpl_subst.
iApply type_jump; [solve_typing..|].
iIntros (??) "#LFT _ $ Hty". rewrite !tctx_interp_singleton /=. done.
Qed. Qed.
(** Reading from a cell *) (** Reading from a cell *)
......
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