aboutsummaryrefslogtreecommitdiff
path: root/frontend/unitype.dcl
diff options
context:
space:
mode:
authormartinw2001-01-19 10:51:27 +0000
committermartinw2001-01-19 10:51:27 +0000
commitc043530c7fbc813aff2e5c919c2ae496d5229ad4 (patch)
tree9782403258abbba9bdf3f5b0533da4fd46b6f360 /frontend/unitype.dcl
parentbugfixing dcl cashing, expanding synonym types after a whole module component (diff)
uniqueness unification for types of functions that are generated
during the transformation phase git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@292 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/unitype.dcl')
-rw-r--r--frontend/unitype.dcl29
1 files changed, 22 insertions, 7 deletions
diff --git a/frontend/unitype.dcl b/frontend/unitype.dcl
index 0c4f726..636d0e1 100644
--- a/frontend/unitype.dcl
+++ b/frontend/unitype.dcl
@@ -3,11 +3,17 @@ definition module unitype
import StdEnv
import syntax, analunitypes
-/* MW3 moved to syntax:
-:: CoercionPosition =
- { cp_expression :: !Expression
+:: CoercionState =
+ { crc_type_heaps :: !.TypeHeaps
+ , crc_coercions :: !.Coercions
+ , crc_td_infos :: !.TypeDefInfos
}
-*/
+
+class coerce a :: !Sign !{# CommonDefs} !{# BOOLVECT} !TypePosition !a !a !*CoercionState -> (!Optional TypePosition, !*CoercionState)
+
+instance coerce AType
+
+:: TypePosition :== [Int]
AttrUni :== 0
AttrMulti :== 1
@@ -30,10 +36,11 @@ isUniqueAttribute :: !Int !Coercions -> Bool
BITINDEX temp_var_id :== temp_var_id >> 5
BITNUMBER temp_var_id :== temp_var_id bitand 31
+set_bit :: !Int !*{# BOOLVECT} -> .{# BOOLVECT}
-determineAttributeCoercions :: !AType !AType !Bool !CoercionPosition !u:{! Type} !*Coercions !{# CommonDefs }
- !{# BOOLVECT } !*TypeDefInfos !*TypeHeaps !*ErrorAdmin
- -> (!u:{! Type}, !*Coercions, !*TypeDefInfos, !*TypeHeaps, !*ErrorAdmin)
+determineAttributeCoercions :: !AType !AType !Bool !u:{! Type} !*Coercions !{# CommonDefs }
+ !{# BOOLVECT } !*TypeDefInfos !*TypeHeaps
+ -> (!Optional (TypePosition, AType), !u:{! Type}, !*Coercions, !*TypeDefInfos, !*TypeHeaps)
:: AttributePartition :== {# Int}
@@ -49,3 +56,11 @@ uniquenessError :: !CoercionPosition !String !*ErrorAdmin -> *ErrorAdmin
liftSubstitution :: !*{! Type} !{# CommonDefs }!{# BOOLVECT } !Int !*TypeVarHeap !*TypeDefInfos -> (*{! Type}, !Int, !*TypeVarHeap, !*TypeDefInfos)
+:: ExpansionState =
+ { es_type_heaps :: !.TypeHeaps
+ , es_td_infos :: !.TypeDefInfos
+ }
+
+class expandType a :: !{# CommonDefs } !{# BOOLVECT } !a !*(!u:{! Type}, !*ExpansionState) -> (!a, !*(!u:{! Type}, !*ExpansionState))
+
+instance expandType AType