(define-struct pr (fst snd)) ;; pairs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; INTERFACE Set ;; lst->set : [Listof X] -> [Set X] ;; create a set from the given list of objects ;; contains? : [Set X] X -> Boolean ;; is elt a member of set? ;; add-elt : [Set X] X -> [Set X] ;; create a set from the given set and object ;; union : [Set X] [Set X] -> [Set X] ;; create the set that contains the elements of both ;; intersect : [Set X] [Set X] -> [Set X] ;; create the set that contains the elements ;; that the two sets share ;; cartesian : [Set X] [Set Y] -> [Set (make-pr X Y)] ;; create all possible (make-pr .. ..) of elements from ;; set1 and set2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; HOMEWORK for Thursday's class: ;; Assuming the following data definition for [Set X], define ;; the functions in the interfact above. You should attempt ;; all the functions except cartesian; we'll do cartesian in ;; class tomorrow. ;; A [Set X] is [List-of X] ;; where order does not matter and duplicates ARE allowed