use 'binds' instead of 'In' for environments

This commit is contained in:
Michael Sippel 2024-09-22 13:37:11 +02:00
parent 4fde2442f1
commit 080aa0ffec
2 changed files with 5 additions and 4 deletions

View file

@ -6,6 +6,7 @@ Require Import Atom.
Import AtomImpl.
From Coq Require Import Lists.List.
Import ListNotations.
Require Import Environment.
Open Scope ladder_type_scope.
Open Scope ladder_expr_scope.
@ -19,7 +20,7 @@ Inductive morphism_path : env -> type_DeBruijn -> type_DeBruijn -> Prop :=
(Γ |- τ ~~> τ')
| M_Single : forall Γ h τ τ',
In (h, [< τ ->morph τ' >]) Γ ->
(binds h [< τ ->morph τ' >] Γ) ->
(Γ |- τ ~~> τ')
| M_Chain : forall Γ τ τ' τ'',
@ -63,7 +64,7 @@ Inductive translate_morphism_path : env -> type_DeBruijn -> type_DeBruijn -> exp
[{ λ (σ ~ τ) morph (m (%0 des τ)) as σ }])
| Translate_Single : forall Γ h τ τ',
In (h, [< τ ->morph τ' >]) Γ ->
binds h [< τ ->morph τ' >] Γ ->
(Γ |- [[ τ ~~> τ' ]] = [{ $h }])
| Translate_Chain : forall Γ τ τ' τ'' m1 m2,

View file

@ -13,7 +13,7 @@ Open Scope ladder_expr_scope.
Reserved Notation "Γ '|-' x '\is' X" (at level 101).
Inductive typing : env -> expr_DeBruijn -> type_DeBruijn -> Prop :=
| T_Var : forall Γ x τ,
(In (x, τ) Γ) ->
(binds x τ Γ) ->
(Γ |- [{ $x }] \is τ)
| T_Let : forall Γ L s σ t τ,
@ -79,7 +79,7 @@ Inductive translate_typing : env -> expr_DeBruijn -> type_DeBruijn -> expr_DeBru
| Expand_Let : forall Γ L e e' t t' σ τ,
(Γ |- e \is σ) ->
(forall x : atom, x `notin` L ->
( (x,σ)::Γ |- (expr_open t (ex_fvar x)) \is τ) ->
( (x,σ)::Γ |- (expr_open (ex_fvar x) t) \is τ) ->
( (x,σ)::Γ |- [[ t \is τ ]] = t' )
) ->
(Γ |- [[ e \is σ ]] = e') ->