diff options
author | ronny | 1999-10-05 13:09:14 +0000 |
---|---|---|
committer | ronny | 1999-10-05 13:09:14 +0000 |
commit | db9e59813541e06caece64592854862bab9c0138 (patch) | |
tree | ae7cef5982a377261188aed09dc0f0cc95c50f8c /frontend/unitype.dcl | |
parent | Standard project directories initialized by cvs2svn. (diff) |
Initial import
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/unitype.dcl')
-rw-r--r-- | frontend/unitype.dcl | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/frontend/unitype.dcl b/frontend/unitype.dcl new file mode 100644 index 0000000..3769c19 --- /dev/null +++ b/frontend/unitype.dcl @@ -0,0 +1,48 @@ +definition module unitype + +import StdEnv +import syntax, analunitypes + +:: CoercionPosition = + { cp_expression :: !Expression + } + +AttrUni :== 0 +AttrMulti :== 1 +FirstAttrVar :== 2 + +instance toInt TypeAttribute + +:: CoercionTree = CT_Node !Int !CoercionTree !CoercionTree | CT_Empty | CT_Unique | CT_NonUnique /* | CT_Existential !Int */ + +:: Coercions = { coer_demanded :: !.{! .CoercionTree}, coer_offered :: !.{! .CoercionTree }} + +isNonUnique :: !CoercionTree -> Bool +isUnique :: !CoercionTree -> Bool +// isExistential :: !CoercionTree -> Bool + +:: BOOLVECT :== Int + +BITINDEX temp_var_id :== temp_var_id >> 5 +BITNUMBER temp_var_id :== temp_var_id bitand 31 + +determineAttributeCoercions :: !AType !AType !Bool !CoercionPosition !u:{! Type} !*Coercions !{# CommonDefs } + !{# BOOLVECT } !*TypeDefInfos !*TypeHeaps !*ErrorAdmin + -> (!u:{! Type}, !*Coercions, !*TypeDefInfos, !*TypeHeaps, !*ErrorAdmin) + +:: AttributePartition :== {# Int} + +partitionateAttributes :: !{! CoercionTree} !{! *CoercionTree} -> (!AttributePartition, !{! CoercionTree}) + +newInequality :: !Int !Int !*Coercions -> *Coercions + +tryToMakeNonUnique :: !Int !*Coercions -> (!Bool, !*Coercions) + +tryToMakeUnique :: !Int !*Coercions -> (!Bool, !*Coercions) + +uniquenessError :: !CoercionPosition !String !*ErrorAdmin -> *ErrorAdmin + +liftSubstitution :: !*{! Type} !{# CommonDefs } !Int !*TypeVarHeap !*TypeDefInfos -> (*{! Type}, !Int, !*TypeVarHeap, !*TypeDefInfos) + +instance <<< CoercionPosition + |