The predicate (subset? x lst ) tests whether the set x is a subset of the set lst.
(subset? '() '(a b)) = #t(subset? '(a c e) '(a b c d e)) = #t
(subset? '(a f) '(a b c d e)) = #f
(define (subset? x lst)
(if (pair? x)
(and (memv (car x) lst)
(subset? (cdr x) lst))
(null? x)) )
Contents    Page-10    Prev    Next    Page+10    Index