aboutsummaryrefslogtreecommitdiff
path: root/frontend/containers.dcl
blob: e277237d2d6d73a6c92d98c43c000f382d555621 (plain) (blame)
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
definition module containers

from syntax import ::Optional,::StrictnessList,::Annotation
from StdOverloaded import class toString

:: NumberSet = Numbers !Int !NumberSet | EndNumbers

addNr :: !Int !NumberSet -> NumberSet
inNumberSet :: !Int !NumberSet -> Bool
numberSetUnion :: !NumberSet !NumberSet -> NumberSet
nsFromTo :: !Int -> NumberSet
	// all numbers from 0 to (i-1)
bitvectToNumberSet :: !LargeBitvect -> .NumberSet

numberSetToList :: !NumberSet -> [Int]


:: LargeBitvect :== {#Int}

bitvectCreate :: !Int -> .LargeBitvect 
bitvectSelect :: !Int !LargeBitvect -> Bool
bitvectTestAndSet :: !Int !*LargeBitvect -> (!Bool,!.LargeBitvect)
bitvectSet :: !Int !*LargeBitvect -> .LargeBitvect 
bitvectReset :: !Int !*LargeBitvect -> .LargeBitvect
bitvectSetFirstN :: !Int !*LargeBitvect -> .LargeBitvect 
bitvectResetAll :: !*LargeBitvect -> .LargeBitvect 

add_strictness :: !Int !StrictnessList -> StrictnessList
first_n_strict :: !Int -> StrictnessList
insert_n_strictness_values_at_beginning :: !Int !StrictnessList -> StrictnessList
insert_n_lazy_values_at_beginning :: !Int !StrictnessList -> StrictnessList
arg_strictness_annotation :: !Int !StrictnessList -> Annotation;
arg_is_strict :: !Int !StrictnessList -> Bool;
is_not_strict :: !StrictnessList -> Bool
equal_strictness_lists :: !StrictnessList !StrictnessList -> Bool
more_or_equal_strictness_lists :: !StrictnessList !StrictnessList -> Bool
add_next_strict :: !Int !Int !StrictnessList -> (!Int,!Int,!StrictnessList)
add_next_not_strict :: !Int !Int !StrictnessList -> (!Int,!Int,!StrictnessList)
append_strictness :: !Int !StrictnessList -> StrictnessList
first_n_are_strict :: !Int !StrictnessList -> Bool
remove_first_n :: !Int !StrictnessList -> StrictnessList

:: IntKey :== Int

:: IntKeyHashtable a = IntKeyHashtable !Int !Int !Int !.{!.IntKeyTree a}
	
:: IntKeyTree a = IKT_Leaf | IKT_Node !IntKey a !.(IntKeyTree a) !.(IntKeyTree a)

ikhEmpty :: .(IntKeyHashtable a)
ikhInsert :: !Bool !IntKey !a !*(IntKeyHashtable a) -> (!Bool, !.IntKeyHashtable a)
	// input bool: overide old value, output bool: a new element was inserted
ikhInsert` :: !Bool !IntKey !a !*(IntKeyHashtable a) -> .IntKeyHashtable a
	// bool: overide old value
ikhSearch :: !IntKey !(IntKeyHashtable a) -> .Optional a
ikhSearch` :: !IntKey !(IntKeyHashtable a) -> a
ikhUSearch :: !IntKey !*(IntKeyHashtable a) -> (!.Optional a, !*IntKeyHashtable a)

iktUInsert :: !Bool !IntKey !a !*(IntKeyTree a) -> (!Bool, !.IntKeyTree a)
	// input bool: overide old value, output bool: a new element was inserted
iktFlatten :: !(IntKeyTree a) -> [(IntKey, a)]
iktSearch :: !IntKey !(IntKeyTree a) -> .Optional a
iktSearch` :: !IntKey !(IntKeyTree a) -> a
iktUSearch :: !IntKey !*(IntKeyTree a) -> (!.Optional a,!.IntKeyTree a)

instance toString (IntKeyTree a) | toString a, (IntKeyHashtable a) | toString a