-
Notifications
You must be signed in to change notification settings - Fork 4
/
symbol.sig
executable file
·101 lines (81 loc) · 3.37 KB
/
symbol.sig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
(*======================================================================
This file specifies the signature of flat Athena symbols. Every Athena
identifier that is not inside a module is a symbol of this type, e.g.,
when one writes
define x := 3
at the top level, the identifier x is stored as a value of this type.
=======================================================================*)
signature SYMBOL =sig
eqtype symbol
val symbol : string -> symbol
val name : symbol -> string
val symEq: symbol * symbol -> bool
exception Symbol
val printSymCounter: unit -> unit
val hashSymbol:symbol -> Word.word
val code: symbol -> int
val compare: symbol * symbol -> order
val freshSymbol: string option -> symbol
(******* Hash tables for Athena symbols: *******)
type 'a htable
val makeHTable: unit -> 'a htable;
val makeHTableWithInitialSize: int -> 'a htable;
val augmentHT: 'a htable * 'a htable -> unit
val clearHTable: 'a htable -> unit;
val insert: 'a htable * symbol * 'a -> unit
val removeHT: 'a htable * symbol -> 'a
val insertLst: 'a htable * (symbol * 'a) list -> unit
val find: 'a htable * symbol -> 'a option
val numItems: 'a htable -> int
val listItems: 'a htable -> 'a list
val listItemsi : 'a htable -> (symbol * 'a) list
val exists: 'a htable * symbol -> bool
val makePrivateString: string -> string
val makePrivateSymbol: string -> symbol
(******* Functional dictionaries for Athena symbols: *******)
type 'a mapping
val empty_mapping : 'a mapping
val enter : 'a mapping * symbol * 'a -> 'a mapping
val enterLst: 'a mapping * (symbol *'a) list -> 'a mapping
val augment: 'a mapping * 'a mapping -> 'a mapping
val removeBinding: 'a mapping * symbol -> 'a mapping * 'a
val lookUp : 'a mapping * symbol -> 'a option
val map: ('a -> 'a) * 'a mapping -> 'a mapping
val listImages: 'a mapping -> 'a list
val listSymbolsAndImages: 'a mapping -> (symbol * 'a) list
val domainSize: 'a mapping -> int
val listSymbolsInDomain: 'a mapping -> symbol list
(******* Sets for Athena symbols: *******)
type set
val empty_set: set
val singleton: symbol -> set
val isEmpty: set -> bool
val size: set -> int
val equal: set * set -> bool
val setMap: (symbol -> symbol) -> set -> set
val setApp: (symbol -> unit) -> set -> unit
val add: symbol * set -> set
val addLst: symbol list * set -> set
val symListToSet: symbol list -> set
val remove: symbol * set -> set
val union: set * set -> set
val unionLst: set list -> set
val intersection: set * set -> set
val difference: set * set -> set
val isMember: symbol * set -> bool
val listSymbols: set -> symbol list
val fresh: set -> symbol
(******* Athena mappings with retrievable domains: *******)
type 'a mappingWD
val empty_mappingWD : 'a mappingWD
val enterWD : 'a mappingWD * symbol * 'a -> 'a mappingWD
val enterLstWD: 'a mappingWD * (symbol *'a) list -> 'a mappingWD
val augmentWD: 'a mappingWD * 'a mappingWD -> 'a mappingWD
val removeBindingWD: 'a mappingWD * symbol -> 'a mappingWD * 'a
val lookUpWD : 'a mappingWD * symbol -> 'a option
val mapWD: ('a -> 'a) * 'a mappingWD -> 'a mappingWD
val listImagesWD: 'a mappingWD -> 'a list
val listSymbolsAndImagesWD: 'a mappingWD -> (symbol * 'a) list
val domainSizeWD: 'a mappingWD -> int
val listSymbolsInDomainWD: 'a mappingWD -> symbol list
end