Next: , Previous: , Up: srfi sets-and-bags   [Index]


2.37.9 Subsets

NOTE The following three predicates do not obey the trichotomy law and therefore do not constitute a total order on sets.

Function: set=? set0 set
Function: bag=? bag0 bag

Return #t if each set or bag contains the same elements.

(import (vicare) (srfi :113) (srfi :114))

(bag=? (bag fixnum-comparator 1 2 2 3)
       (bag fixnum-comparator 1 2 2 3))
⇒ #t

(bag=? (bag fixnum-comparator 1 2 3)
       (bag fixnum-comparator 1 2 2 3))
⇒ #f
Function: set<? set0 set
Function: bag<? bag0 bag

Return #t if each set or bag, other than the last, is a proper subset of the following set or bag; return #f otherwise.

(import (vicare) (srfi :113) (srfi :114))

(bag<? (bag fixnum-comparator 1 2 3)
       (bag fixnum-comparator 1 2 2 3))
⇒ #t

(bag<? (bag fixnum-comparator 1 2 2 3)
       (bag fixnum-comparator 1 2 3))
⇒ #f
Function: set>? set0 set
Function: bag>? bag0 bag

Return #t if each set or bag, other than the last, is a proper superset of the following set or bag; return #f otherwise.

(import (vicare) (srfi :113) (srfi :114))

(bag>? (bag fixnum-comparator 1 2 3)
       (bag fixnum-comparator 1 2 2 3))
⇒ #f

(bag>? (bag fixnum-comparator 1 2 2 3)
       (bag fixnum-comparator 1 2 3))
⇒ #t
Function: set<=? set0 set
Function: bag<=? bag0 bag

Return #t if each set or bag, other than the last, is a subset of the following set or bag; return #f otherwise.

(import (vicare) (srfi :113) (srfi :114))

(bag<=? (bag fixnum-comparator 1 2 3)
        (bag fixnum-comparator 1 2 2 3))
⇒ #t

(bag<=? (bag fixnum-comparator 1 2 2 3)
        (bag fixnum-comparator 1 2 3))
⇒ #f
Function: set>=? set0 set
Function: bag>=? bag0 bag

Return #t if each set or bag, other than the last, is a superset of the following set or bag; return #f otherwise.

(import (vicare) (srfi :113) (srfi :114))

(bag>=? (bag fixnum-comparator 1 2 3)
        (bag fixnum-comparator 1 2 2 3))
⇒ #f

(bag>=? (bag fixnum-comparator 1 2 2 3)
        (bag fixnum-comparator 1 2 3))
⇒ #t

Next: , Previous: , Up: srfi sets-and-bags   [Index]