Skip to content
Snippets Groups Projects
Commit 79cb9880 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Remove redundant expression typing rules for nat/unit/bool.

parent 909ddcab
No related branches found
No related tags found
No related merge requests found
Pipeline #29474 passed
...@@ -36,15 +36,6 @@ Section fundamental. ...@@ -36,15 +36,6 @@ Section fundamental.
by iApply refines_ret. by iApply refines_ret.
Qed. Qed.
Lemma bin_log_related_unit Δ Γ : {Δ;Γ} #() log #() : ().
Proof. value_case. Qed.
Lemma bin_log_related_nat Δ Γ (n : nat) : {Δ;Γ} #n log #n : TNat.
Proof. value_case. Qed.
Lemma bin_log_related_bool Δ Γ (b : bool) : {Δ;Γ} #b log #b : TBool.
Proof. value_case. Qed.
Lemma bin_log_related_pair Δ Γ e1 e2 e1' e2' (τ1 τ2 : type) : Lemma bin_log_related_pair Δ Γ e1 e2 e1' e2' (τ1 τ2 : type) :
({Δ;Γ} e1 log e1' : τ1) -∗ ({Δ;Γ} e1 log e1' : τ1) -∗
({Δ;Γ} e2 log e2' : τ2) -∗ ({Δ;Γ} e2 log e2' : τ2) -∗
...@@ -502,9 +493,6 @@ Section fundamental. ...@@ -502,9 +493,6 @@ Section fundamental.
+ by iApply bin_log_related_var. + by iApply bin_log_related_var.
+ iIntros (γ) "#H". simpl. rel_values. + iIntros (γ) "#H". simpl. rel_values.
iModIntro. by iApply fundamental_val. iModIntro. by iApply fundamental_val.
+ iApply bin_log_related_unit.
+ by iApply bin_log_related_nat.
+ by iApply bin_log_related_bool.
+ iApply bin_log_related_nat_binop; first done; + iApply bin_log_related_nat_binop; first done;
by iApply fundamental. by iApply fundamental.
+ iApply bin_log_related_bool_binop; first done; + iApply bin_log_related_bool_binop; first done;
......
...@@ -104,16 +104,12 @@ Instance insert_binder (A : Type): Insert binder A (stringmap A) := ...@@ -104,16 +104,12 @@ Instance insert_binder (A : Type): Insert binder A (stringmap A) :=
(** Typing itself *) (** Typing itself *)
Inductive typed : stringmap type expr type Prop := Inductive typed : stringmap type expr type Prop :=
| Var_typed Γ x τ : Γ !! x = Some τ Γ Var x : τ | Var_typed Γ x τ :
Γ !! x = Some τ
Γ Var x : τ
| Val_typed Γ v τ : | Val_typed Γ v τ :
v : τ v : τ
Γ Val v : τ Γ Val v : τ
| Unit_typed Γ :
Γ #() : ()
| Nat_typed Γ (n : nat) :
Γ #n : TNat
| Bool_typed Γ (b : bool) :
Γ #b : TBool
| BinOp_typed_nat Γ op e1 e2 τ : | BinOp_typed_nat Γ op e1 e2 τ :
Γ e1 : TNat Γ e2 : TNat Γ e1 : TNat Γ e2 : TNat
binop_nat_res_type op = Some τ binop_nat_res_type op = Some τ
...@@ -126,20 +122,20 @@ Inductive typed : stringmap type → expr → type → Prop := ...@@ -126,20 +122,20 @@ Inductive typed : stringmap type → expr → type → Prop :=
Γ e1 : ref τ Γ e2 : ref τ Γ e1 : ref τ Γ e2 : ref τ
Γ BinOp EqOp e1 e2 : TBool Γ BinOp EqOp e1 e2 : TBool
| Pair_typed Γ e1 e2 τ1 τ2 : | Pair_typed Γ e1 e2 τ1 τ2 :
Γ e1 : τ1 Γ e2 : τ2 Γ e1 : τ1 Γ e2 : τ2
Γ (e1, e2) : τ1 * τ2 Γ (e1, e2) : τ1 * τ2
| Fst_typed Γ e τ1 τ2 : | Fst_typed Γ e τ1 τ2 :
Γ e : τ1 * τ2 Γ e : τ1 * τ2
Γ Fst e : τ1 Γ Fst e : τ1
| Snd_typed Γ e τ1 τ2 : | Snd_typed Γ e τ1 τ2 :
Γ e : τ1 * τ2 Γ e : τ1 * τ2
Γ Snd e : τ2 Γ Snd e : τ2
| InjL_typed Γ e τ1 τ2 : | InjL_typed Γ e τ1 τ2 :
Γ e : τ1 Γ e : τ1
Γ InjL e : τ1 + τ2 Γ InjL e : τ1 + τ2
| InjR_typed Γ e τ1 τ2 : | InjR_typed Γ e τ1 τ2 :
Γ e : τ2 Γ e : τ2
Γ InjR e : τ1 + τ2 Γ InjR e : τ1 + τ2
| Case_typed Γ e0 e1 e2 τ1 τ2 τ3 : | Case_typed Γ e0 e1 e2 τ1 τ2 τ3 :
Γ e0 : τ1 + τ2 Γ e0 : τ1 + τ2
Γ e1 : (τ1 τ3) Γ e1 : (τ1 τ3)
...@@ -164,18 +160,18 @@ Inductive typed : stringmap type → expr → type → Prop := ...@@ -164,18 +160,18 @@ Inductive typed : stringmap type → expr → type → Prop :=
Γ e : (: τ) Γ e : (: τ)
Γ e #() : τ.[τ'/] Γ e #() : τ.[τ'/]
| TFold Γ e τ : | TFold Γ e τ :
Γ e : τ.[(μ: τ)%ty/] Γ e : τ.[(μ: τ)%ty/]
Γ e : (μ: τ) Γ e : (μ: τ)
| TUnfold Γ e τ : | TUnfold Γ e τ :
Γ e : (μ: τ)%ty Γ e : (μ: τ)%ty
Γ rec_unfold e : τ.[(μ: τ)%ty/] Γ rec_unfold e : τ.[(μ: τ)%ty/]
| TPack Γ e τ τ' : | TPack Γ e τ τ' :
Γ e : τ.[τ'/] Γ e : τ.[τ'/]
Γ e : (: τ) Γ e : (: τ)
| TUnpack Γ e1 x e2 τ τ2 : | TUnpack Γ e1 x e2 τ τ2 :
Γ e1 : (: τ) Γ e1 : (: τ)
<[x:=τ]>( Γ) e2 : (Autosubst_Classes.subst (ren (+1)) τ2) <[x:=τ]>( Γ) e2 : (Autosubst_Classes.subst (ren (+1)) τ2)
Γ (unpack: x := e1 in e2) : τ2 Γ (unpack: x := e1 in e2) : τ2
| TFork Γ e : Γ e : () Γ Fork e : () | TFork Γ e : Γ e : () Γ Fork e : ()
| TAlloc Γ e τ : Γ e : τ Γ Alloc e : ref τ | TAlloc Γ e τ : Γ e : τ Γ Alloc e : ref τ
| TLoad Γ e τ : Γ e : ref τ Γ Load e : τ | TLoad Γ e τ : Γ e : ref τ Γ Load e : τ
...@@ -193,15 +189,15 @@ with val_typed : val → type → Prop := ...@@ -193,15 +189,15 @@ with val_typed : val → type → Prop :=
| Nat_val_typed (n : nat) : #n : TNat | Nat_val_typed (n : nat) : #n : TNat
| Bool_val_typed (b : bool) : #b : TBool | Bool_val_typed (b : bool) : #b : TBool
| Pair_val_typed v1 v2 τ1 τ2 : | Pair_val_typed v1 v2 τ1 τ2 :
v1 : τ1 v1 : τ1
v2 : τ2 v2 : τ2
PairV v1 v2 : (τ1 * τ2) PairV v1 v2 : (τ1 * τ2)
| InjL_val_typed v τ1 τ2 : | InjL_val_typed v τ1 τ2 :
v : τ1 v : τ1
InjLV v : (τ1 + τ2) InjLV v : (τ1 + τ2)
| InjR_val_typed v τ1 τ2 : | InjR_val_typed v τ1 τ2 :
v : τ2 v : τ2
InjRV v : (τ1 + τ2) InjRV v : (τ1 + τ2)
| Rec_val_typed f x e τ1 τ2 : | Rec_val_typed f x e τ1 τ2 :
<[f:=TArrow τ1 τ2]>(<[x:=τ1]>∅) e : τ2 <[f:=TArrow τ1 τ2]>(<[x:=τ1]>∅) e : τ2
RecV f x e : (τ1 τ2) RecV f x e : (τ1 τ2)
......
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