fix function η with subsingleton types

This commit is contained in:
rhiannon morris 2024-05-12 20:29:09 +02:00
parent c9f66bb6af
commit d2a117fe61
4 changed files with 54 additions and 2 deletions

View file

@ -277,8 +277,16 @@ namespace Term
toLamBody e = E $ App (weakE 1 e) (BVT 0 e.loc) e.loc
eta : Loc -> Elim 0 n -> ScopeTerm 0 n -> Eff EqualInner ()
eta loc e (S _ (N _)) = clashT loc ctx ty s t
eta _ e (S _ (Y b)) = compare0 defs ctx' sg res.term (toLamBody e) b
eta loc e (S _ (N b)) =
if qty /= One then
if !(isSubSing defs ctx sg arg) then
compare0 defs ctx' sg res.term (toLamBody e) (weakT 1 b)
else
clashT loc ctx ty s t
else
clashT loc ctx ty s t
eta _ e (S _ (Y b)) =
compare0 defs ctx' sg res.term (toLamBody e) b
compare0' defs ctx sg ty@(Sig {fst, snd, _}) s t = withEqual $
case (s, t) of