From 61948c672d3a98027383e4bcc6b95d2db492f974 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Tue, 3 Mar 2015 12:09:15 +0100 Subject: StdSet werkend --- week4/mart/StdSet.dcl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 week4/mart/StdSet.dcl (limited to 'week4/mart/StdSet.dcl') 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) -- cgit v1.2.3