Skip to content

Commit 5283062

Browse files
committed
cleanup old code
1 parent ba60c57 commit 5283062

File tree

6 files changed

+6
-65
lines changed

6 files changed

+6
-65
lines changed

frontend/src/Language/Granule/Checker/Types.hs

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -570,45 +570,6 @@ renameBeta oldName newName t =
570570
renamer :: Id -> Id
571571
renamer id = if id == oldName then newName else id
572572

573-
renameBetaInvert :: (?globals :: Globals)
574-
=> Span
575-
-- Explain how coeffects should be related by a solver constraint
576-
-> (Span -> Coeffect -> Coeffect -> Type -> Constraint)
577-
-> Type -- name
578-
-> Type -- type
579-
-- Indicates whether the first type or second type is a specification
580-
-> SpecIndicator
581-
-- Flag to say whether this type is actually an effect or not
582-
-> Mode
583-
-> Checker (Type, Substitution)
584-
585-
-- Ref case
586-
-- i.e., Rename id a = Ref id' a'
587-
-- therefore check `id ~ id'` and then recurse
588-
renameBetaInvert sp rel name (TyApp (TyApp (TyCon c) name') s) spec mode
589-
| internalName c == "Ref" = do
590-
-- Compute equality on names
591-
(_, subst) <- equalTypesRelatedCoeffects sp rel name name' spec mode
592-
(s, subst') <- renameBetaInvert sp rel name s spec mode
593-
substFinal <- combineSubstitutions sp subst subst'
594-
return (TyApp (TyApp (TyCon c) name') s, substFinal)
595-
596-
renameBetaInvert sp rel name (TyApp (TyCon c) name') spec mode
597-
| internalName c == "FloatArray" = do
598-
-- Compute equality on names
599-
(_, subst) <- equalTypesRelatedCoeffects sp rel name name' spec mode
600-
return (TyApp (TyCon c) name', subst)
601-
602-
renameBetaInvert sp rel name (TyApp (TyApp (TyCon c) t1) t2) spec mode
603-
| internalName c == "," = do
604-
(t1', subst1) <- renameBetaInvert sp rel name t1 spec mode
605-
(t2', subst2) <- renameBetaInvert sp rel name t2 spec mode
606-
substFinal <- combineSubstitutions sp subst1 subst2
607-
return (TyApp (TyApp (TyCon c) t1') t2', substFinal)
608-
609-
renameBetaInvert _ _ name t _ _ = return (t, [])
610-
611-
-- Check if `Rename id a ~ a'` which may involve some normalisation in the
612573
-- case where `a'` is a variable
613574
eqRenameFunction :: (?globals :: Globals)
614575
=> Span
@@ -626,23 +587,6 @@ eqRenameFunction sp rel oldName newName t t' ind = do
626587
(eq, u) <- equalTypesRelatedCoeffects sp rel t'' t' ind Types
627588
return (eq, u)
628589

629-
-- eqRenameFunction sp rel name t (TyApp (TyApp (TyCon (internalName d -> "Rename")) name') t') ind = do
630-
-- (_, subst). <- equalTypesRelatedCoeffects sp rel name name' ind Types
631-
-- (eq, subst') <- eqRenameFunction sp rel name t t' ind
632-
-- substFinal <- combineSubstitutions sp subst subst'
633-
-- return (eq, substFinal)
634-
635-
-- eqRenameFunction sp rel name (TyVar v) t ind = do
636-
-- (t', subst) <- renameBetaInvert sp rel name t ind Types
637-
-- (eq, subst') <- equalTypesRelatedCoeffects sp rel t' (TyVar v) ind Types
638-
-- substFinal <- combineSubstitutions sp subst subst'
639-
-- return (eq, substFinal)
640-
641-
-- eqRenameFunction sp rel name t t' ind = do
642-
-- t'' <- renameBeta name t
643-
-- (eq, u) <- equalTypesRelatedCoeffects sp rel t'' t' ind Types
644-
-- return (eq, u)
645-
646590
-- | Is this protocol dual to the other?
647591
isDualSession :: (?globals :: Globals)
648592
=> Span
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Type checking failed:
1+
Type checking failed:
22
Counter example: frontend/tests/cases/negative/graded/polySemiring.gr:2:1:
33
When checking `foo`, (1 : s) + (1 : s) is not approximatable by r for type s
44

55
Counter-example:
6-
r = 3 :: s
6+
r = 3 :: s

frontend/tests/cases/negative/graded/semiringsDontHaveCommutativeMult.gr.output

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Counter example: frontend/tests/cases/negative/graded/semiringsDontHaveCommutati
33
When checking `poly`, c * ((1 : k) + (1 : k)) is not approximatable by (((1 : k)) + ((1 : k))) * c for type k
44

55
Counter-example:
6-
c = 0 :: k
6+
c = 3 :: k
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
example : Int [1]
22
example =
33
clone [42] as x
4-
in (unpack <id' , a'> = x in (share a'))
4+
in (unpack <id' , a'> = x in (share a'))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Type checking failed:
2-
Type constraint error: frontend/tests/cases/negative/unique/cloneNonCloneable.gr:1:1:
3-
Constraint `Cloneable Int` does not hold or is not provided by the type constraint assumptions here.
2+
Type error: frontend/tests/cases/negative/unique/cloneNonCloneable.gr:4:9:
3+
Expcted an existential type on the left-hand side of unpack, but got `*Int`
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
Type checking failed:
2-
Ownership error: frontend/tests/cases/negative/unique/uniqueProduct.gr:2:58:
3-
Cannot guarantee usage of reference to value of type `FloatArray id` at permission `Star`.
4-
52
Linearity error: frontend/tests/cases/negative/unique/uniqueProduct.gr:5:22:
63
Linear variable `arrs` is used more than once.

0 commit comments

Comments
 (0)