lean4-htt/tests/lean/run/337.lean
Leonardo de Moura 4bbcd305b5 fix: disable implicit-lambdas when elaborating patterns
@Kha, Jason's example on issue #337 suggests that injecting
implicit-lambdas while elaborating patterns is problematic.
The elaborator was injecting `fun {Γ} =>` before the
pattern variable `ftm`.
So, I disabled the implicit-lambda during pattern elaboration. I
didn't find an example where it would be useful.

see #337

cc @JasonGross
2021-03-08 15:45:30 -08:00

39 lines
1.4 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

section
variable (G : Type 1) (T : Type 1)
(EG : G → G → Type)
(getCtx : T → G)
inductive CtxSyntaxLayer where
inductive TySyntaxLayer where
| arrow : {Γ : G} → (A B : T) → EG Γ (getCtx A) → EG Γ (getCtx B) → TySyntaxLayer
end
section
variable (G : Type 1) (T : Type 1) (Tm : Type 1)
(EG : G → G → Type) (ET : T → T → Type)
(getCtx : T → G) (getTy : Tm → T)
(TAlgebra : TySyntaxLayer G T EG getCtx → T)
inductive TmSyntaxLayer where
| app : {Γ : G} → (A B : T) → (Actx : EG Γ (getCtx A)) → (Bctx : EG Γ (getCtx B))
→ (f x : Tm)
→ ET (getTy f) (TAlgebra (TySyntaxLayer.arrow A B Actx Bctx))
→ ET (getTy x) A
→ TmSyntaxLayer
end
structure Ty where
ctx : Type
ty : ctx → Type
structure Tm where
ty : Ty
tm : ∀ {Γ}, ty.ty Γ
def ECtx : Type → Type → Type := (PLift $ · = ·)
def ETy : Ty → Ty → Type := (PLift $ · = ·)
def ETm : Tm → Tm → Type := (PLift $ · = ·)
def interpTyStep : TySyntaxLayer Type Ty ECtx Ty.ctx → Ty
| TySyntaxLayer.arrow (Γ:=Γ) A B (PLift.up Actx) (PLift.up Bctx) => Ty.mk Γ (λ γ => A.ty (cast Actx γ) → B.ty (cast Bctx γ))
def interpTmStep : TmSyntaxLayer Type Ty Tm ECtx ETy Ty.ctx Tm.ty interpTyStep → Tm
| TmSyntaxLayer.app (Γ:=Γ1) A B (PLift.up Actx) (PLift.up Bctx) { ty := fty , tm := ftm } x (PLift.up fTy) (PLift.up xTy)
=> sorry