coreclean.dcl 1.62 KB
Newer Older
1
2
3
4
definition module coreclean

// $Id$

5
6
from strat import Strategy
from rule import Rule
7
from syntax import TypeSymbIdent,Ident,TypeVar,ExprInfoPtr,VarInfoPtr
Vincent Zweije's avatar
Refine    
Vincent Zweije committed
8
9

// Transitive necessities
10
11
12
from strat import Substrategy
from spine import Spine,Subspine
from graph import Graph,Node
13
from syntax import SymbolPtr,SymbolTableEntry,STE_Kind,Index,Level,Global,TypeSymbProperties,SignClassification,PropClassification,TypeVarInfoPtr,TypeVarInfo,ExprInfo,VarInfo
14
from general import BITVECT
Vincent Zweije's avatar
Refine    
Vincent Zweije committed
15
from Heap import Ptr,PtrN,HeapN
16
from StdOverloaded import ==
Vincent Zweije's avatar
Refine    
Vincent Zweije committed
17
18
from StdString import String

19
:: SuclTypeSymbol
20
21
22
23
 = SuclUSER TypeSymbIdent   // A user-defined type symbol
 | SuclFN Int               // THE function type for a function with specified arity
 | SuclINT                  // Built-in integer
 | SuclCHAR                 // Etc.
24
25
26
27
28
 | SuclREAL
 | SuclBOOL
 | SuclDYNAMIC
 | SuclFILE
 | SuclWORLD
Vincent Zweije's avatar
Refine    
Vincent Zweije committed
29

30
:: SuclTypeVariable
31
32
33
34
 = SuclANONYMOUS Int
 | SuclNAMED TypeVar

sucltypeheap :: [SuclTypeVariable]
Vincent Zweije's avatar
Refine    
Vincent Zweije committed
35

36
:: SuclSymbol
37
 = SuclUser Ident
38
 | SuclCase ExprInfoPtr
39
 | SuclApply Int
40
 | SuclInt Int
41
 | SuclChar Char
42
 | SuclReal Real
43
 | SuclBool Bool
Vincent Zweije's avatar
Refine    
Vincent Zweije committed
44

45
:: SuclSymbolKind
46
47
48
 = SuclFunction
 | SuclConstructor
 | SuclPrimitive
Vincent Zweije's avatar
Refine    
Vincent Zweije committed
49

50
:: SuclVariable
51
52
53
 = SuclAnonymous Int
 | SuclNamed VarInfoPtr

54
55
suclheap :: [SuclVariable]

56
57
instance == SuclTypeSymbol
instance == SuclTypeVariable
58
instance == SuclSymbol
59
instance == SuclVariable
60
61
62

// Get the type rule and strictness of a built in core clean symbol
coretypeinfo :: SuclSymbol -> (Rule SuclTypeSymbol SuclTypeVariable,[Bool])
63
64
65

// Determine if a list of constructors completely covers a given type
corecomplete :: SuclTypeSymbol -> [SuclSymbol] -> Bool