summaryrefslogtreecommitdiff
path: root/week4/camil/StdSet.dcl
diff options
context:
space:
mode:
authorCamil Staps2015-03-02 13:58:22 +0100
committerCamil Staps2015-03-02 13:58:22 +0100
commitbee9e3d3599389dcafab90a2b0ae9ceedc30de97 (patch)
treea545cf750b0ba91687825fefe99138bf330fc1bd /week4/camil/StdSet.dcl
parentUpdated w3 to let maximum have O(1) (diff)
6.3
Diffstat (limited to 'week4/camil/StdSet.dcl')
-rw-r--r--week4/camil/StdSet.dcl25
1 files changed, 25 insertions, 0 deletions
diff --git a/week4/camil/StdSet.dcl b/week4/camil/StdSet.dcl
new file mode 100644
index 0000000..6cad7f1
--- /dev/null
+++ b/week4/camil/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)