Test if every member of one list is a member of the other
General Forms: (subsetp x y) (subsetp x y :test 'eql) ; same as above (eql as equality test) (subsetp x y :test 'eq) ; same, but eq is equality test (subsetp x y :test 'equal) ; same, but equal is equality test
The guard for a call of
See equality-variants for a discussion of the relation between
(subsetp-eq x lst)is equivalent to (subsetp x lst :test 'eq); (subsetp-equal x lst)is equivalent to (subsetp x lst :test 'equal).
In particular, reasoning about any of these primitives reduces to reasoning
about the function
(defun subsetp-equal (x y) (declare (xargs :guard (and (true-listp y) (true-listp x)))) (cond ((endp x) t) ((member-equal (car x) y) (subsetp-equal (cdr x) y)) (t nil)))