summaryrefslogtreecommitdiff
path: root/fp1/week4/mart/StdSet.dcl
blob: 0c702ca7416d112f9ef948c5d9ef3864b874f293 (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
definition module StdSet

import StdClass

::	Set a

toSet			:: [a]             -> Set a | Eq a
fromSet			:: (Set a)         -> [a]

isEmptySet		:: (Set a)         -> Bool
isDisjoint		:: (Set a) (Set a) -> Bool  | Eq a
isSubset		:: (Set a) (Set a) -> Bool  | Eq a
isStrictSubset	:: (Set a) (Set a) -> Bool  | Eq a
memberOfSet		:: a       (Set a) -> Bool  | Eq a
union           :: (Set a) (Set a) -> Set a | Eq a
intersection	:: (Set a) (Set a) -> Set a | Eq a
nrOfElements	:: (Set a) -> Int
without			:: (Set a) (Set a) -> Set a | Eq a

product			:: (Set a) (Set b) -> Set (a,b)

instance zero (Set a)
instance ==   (Set a) | Eq a

powerSet		:: (Set a)         -> Set (Set a) | Eq a