From bee9e3d3599389dcafab90a2b0ae9ceedc30de97 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 2 Mar 2015 13:58:22 +0100 Subject: 6.3 --- files/practicum/StdSet.icl | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'files/practicum') diff --git a/files/practicum/StdSet.icl b/files/practicum/StdSet.icl index b152f37..6cad7f1 100644 --- a/files/practicum/StdSet.icl +++ b/files/practicum/StdSet.icl @@ -1,5 +1,25 @@ -implementation module StdSet +definition module StdSet -import StdEnv +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