re-add tightening and use it when messing with scopes

e.g. "coe [_ ⇒ A] @p @q s" should immediately reduce to "s",
but if the "_ ⇒ A" happened to use an SY it didn't.

this will still happen if a wrong SY sneaks in but the alternative is
re-traversing the term over and over every time whnf runs
This commit is contained in:
rhiannon morris 2023-04-17 20:56:31 +02:00
parent a5ccf0215a
commit 3fb8580f85
16 changed files with 534 additions and 304 deletions

View file

@ -164,9 +164,8 @@ mutual
<*> fromPDimWith ds q
<*> fromPTermWith ds ns val
-- [todo] direct translation for homo comp?
Comp (i, ty) p q val r (j0, val0) (j1, val1) =>
map E $ CompH
map E $ CompH'
<$> fromPTermDScope ds ns [< i] ty
<*> fromPDimWith ds p
<*> fromPDimWith ds q
@ -201,7 +200,7 @@ mutual
if all isNothing xs then
SN <$> fromPTermWith ds ns t
else
SY (fromSnocVect $ map (maybe Unused UN) xs)
ST (fromSnocVect $ map (maybe Unused UN) xs)
<$> fromPTermWith ds (ns ++ xs) t
private
@ -213,7 +212,7 @@ mutual
if all isNothing xs then
SN <$> fromPTermWith ds ns t
else
SY (fromSnocVect $ map (maybe Unused UN) xs)
DST (fromSnocVect $ map (maybe Unused UN) xs)
<$> fromPTermWith (ds ++ xs) ns t