Skip to content

Commit

Permalink
Simplify typing rule for Pi
Browse files Browse the repository at this point in the history
  • Loading branch information
jespercockx committed Sep 24, 2024
1 parent 56492fa commit aa1db09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Agda/Core/Typechecker.agda
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,18 @@ checkLambda : ∀ Γ (@0 x : Name)
(u : Term (x ◃ α))
(ty : Type α)
TCM (Γ ⊢ TLam x u ∶ ty)
checkLambda ctx x u (El sp (TPi y tu tv)) =
TyLam <$> checkType (ctx , x ∶ tu) u (renameTopType (rezzScope ctx) tv)
checkLambda ctx x u (El s ty) = do
let r = rezzScope ctx

⟨ y ⟩ (tu , tv) ⟨ rtp ⟩ reduceToPi r ty
"couldn't reduce a term to a pi type"
let gc = CRedR rtp CRefl
let gc = CRedR rtp (CPi CRefl CRefl)
sp = piSort (typeSort tu) (typeSort tv)

d checkType (ctx , x ∶ tu) u (renameTopType (rezzScope ctx) tv)
return $ TyConv (TyLam {k = sp} d) gc

return $ TyConv (TyLam {k = sp} {r = r} d) gc

{-# COMPILE AGDA2HS checkLambda #-}

checkLet : Γ (@0 x : Name)
Expand Down
4 changes: 2 additions & 2 deletions src/Agda/Core/Typing.agda
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ data TyTerm {α} Γ where

TyLam
: {@0 r : Rezz α}
Γ , x ∶ a ⊢ u ∶ renameTopType r b
Γ , x ∶ a ⊢ u ∶ b
-------------------------------
Γ ⊢ TLam x u ∶ El k (TPi y a b)
Γ ⊢ TLam x u ∶ El k (TPi x a b)

TyApp
: {b : Type α} {@0 r : Rezz α}
Expand Down

0 comments on commit aa1db09

Please sign in to comment.