summaryrefslogtreecommitdiff
path: root/week4/mart/StdSet.dcl
diff options
context:
space:
mode:
authorMart Lubbers2015-03-03 12:09:15 +0100
committerMart Lubbers2015-03-03 12:09:15 +0100
commit61948c672d3a98027383e4bcc6b95d2db492f974 (patch)
tree28d9c156ed48dc4d730786d603f76bcaee335ba8 /week4/mart/StdSet.dcl
parentIk begrijp deze opgave niet echt... (diff)
StdSet werkend
Diffstat (limited to 'week4/mart/StdSet.dcl')
-rw-r--r--week4/mart/StdSet.dcl25
1 files changed, 25 insertions, 0 deletions
diff --git a/week4/mart/StdSet.dcl b/week4/mart/StdSet.dcl
new file mode 100644
index 0000000..6cad7f1
--- /dev/null
+++ b/week4/mart/StdSet.dcl
@@ -0,0 +1,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)