# FUNCTION

# Public

# EMPTY-BAG

Returns an empty bag of the default implementation.

# EMPTY-DYN-TUPLE

Returns an empty dyn-tuple.

# EMPTY-LIST-RELATION (&OPTIONAL ARITY)

We allow the arity to be temporarily unspecified; it will be taken from
the first tuple added, or the first query.

# EMPTY-MAP (&OPTIONAL DEFAULT)

Returns an empty map of the default implementation.

# EMPTY-SEQ (&OPTIONAL DEFAULT)

Returns an empty seq of the default implementation.

# EMPTY-SET

Returns an empty set of the default implementation.

# EMPTY-TUPLE

Returns an empty tuple of the default implementation.

# EMPTY-WB-BAG

Returns an empty wb-bag.

# EMPTY-WB-LIST-RELATION (ARITY)

We allow the arity to be temporarily unspecified; it will be taken from
the first tuple added, or the first query.

# EMPTY-WB-MAP (&OPTIONAL DEFAULT)

Returns an empty wb-map.

# EMPTY-WB-SEQ

Returns an empty wb-seq.

# EMPTY-WB-SET

Returns an empty wb-set.

# FSET-SETUP-READTABLE (READTABLE)

Adds FSet reader macros to `readtable'. Returns `readtable'.

# GET-TUPLE-KEY (NAME &OPTIONAL DEFAULT-FN)

Finds or creates a tuple key named `name'. If the key did not already exist,
and `default-fn' is supplied, it is used to compute a value for lookups where
the tuple has no explicit pair with this key; it is called with one argument,
the tuple.

# HEAD (LIST)

Another name for the `car' operation on lists.

# LASTCONS (LIST)

Returns the last cons of `list'. This is a renaming of the CL function `last'.

# MAP-DEFAULT (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

# MEMBER? (X COLLECTION)

Returns true iff `x' is a member of the set or bag. Stylistically, `contains?'
is preferred over `member?'.

# NONEMPTY? (COLLECTION)

Returns true iff the collection is not empty.

# TAIL (LIST)

Another name for the `cdr' operation on lists.

# TUPLE-KEY-NAME (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

# Undocumented

# BAG? (OBJECT)

# BOUNDED-SET-CONTENTS (BS)

# COLLECTION? (OBJECT)

# EMPTY-QUERY-REGISTRY (&OPTIONAL ARITY)

# EQUAL? (A B)

# MAKE-BOUNDED-SET (UNIVERSE SET &OPTIONAL COMPLEMENT?)

# SETFMAP-DEFAULT (NEW-VALUE INSTANCE)

# MAP? (OBJECT)

# SEQ? (OBJECT)

# SET? (OBJECT)

# SETFTUPLE-KEY-NAME (NEW-VALUE INSTANCE)

# TUPLE? (OBJECT)

# Private

# AUGMENTED-MP (PATTERN METAPATTERN)

Returns a list, of the same length as the pattern, which is like the
metapattern except that each `:single' has been replaced by a cons of
`:single' and the corresponding pattern element.

# BAG-VALUE-SIZE (VALUE)

The number of values represented by `value', which can be more than 1 if
`key' is an `Equivalent-Bag'.

# BOUNDED-SET-COMPLEMENT? (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

# BOUNDED-SET-SET (INSTANCE)

# BOUNDED-SET-UNIVERSE (INSTANCE)

# COMPARE-INTERVALS (IV0 IV1)

Second value is true if the two abut. `:equal' means they overlap.

# COMPLEMENT-SET-COMPLEMENT (INSTANCE)

# DYN-TUPLE-CONTENTS (INSTANCE)

# DYN-TUPLE-DESCRIPTOR (INSTANCE)

# EQUIVALENT-BAG-ALIST (INSTANCE)

# EQUIVALENT-BAG-COMPARE (VAL1 COUNT1 VAL2 COUNT2)

Compares two pairs where the key of either or both may be an `Equivalent-Bag'.

# EQUIVALENT-MAP-ALIST (INSTANCE)

# EQUIVALENT-MAP-COMPARE (KEY1 VAL1 KEY2 VAL2 VAL-FN)

Compares two pairs where the key of either or both may be an `Equivalent-Map'.

# EQUIVALENT-MAP-DIFFERENCE (KEY1 VAL1 KEY2 VAL2)

Both `key1' and `key2' may be single values (representing a single key/value
pair) or `Equivalent-Map's of key/value pairs. That is, if `key1' is a
`Equivalent-Map', `val1' is ignored, and similarly for `key2' and `val2'.
If the difference is nonnull, returns two or three values: if it is a single
pair, returns true, the key, and the value; if it is more than one pair,
returns true and an `Equivalent-Map' of the pairs. If the difference is
empty, returns false.

# EQUIVALENT-MAP-INTERSECT (KEY1 VAL1 KEY2 VAL2 VAL-FN)

Both `key1' and `key2' may be single values (representing a single key/value
pair) or `Equivalent-Map's of key/value pairs. That is, if `key1' is a
`Equivalent-Map', `val1' is ignored, and similarly for `key2' and `val2'.
If the intersection is nonnull, returns two or three values: if it is a
single pair, returns true, the key, and the value; if it is more than one
pair, returns true and an `Equivalent-Map' of the pairs. If the intersection
is null, returns false.

# EQUIVALENT-MAP-LESS (EQVM KEY)

Removes the pair associated with `key' from `eqvm', an `Equivalent-Map'. If
the result is a single pair, it's returned as two values; otherwise one value
is returned, which is an `Equivalent-Map'.

# EQUIVALENT-MAP-UNION (KEY1 VAL1 KEY2 VAL2 &OPTIONAL (VAL-FN #'(LAMBDA (V1 V2) (DECLARE (IGNORE V1)) V2)))

Both `key1' and `key2' may be single values (representing a single key/value
pair) or `Equivalent-Map's of key/value pairs. That is, if `key1' is a
`Equivalent-Map', `val1' is ignored, and similarly for `key2' and `val2'.
Returns one or more new key/value pairs in which the "2" pairs override
the "1" pairs. If the result is a single pair, it's returned as two values;
otherwise one value is returned, which is an `Equivalent-Map'.

# EQUIVALENT-SET-DIFFERENCE (VAL1 VAL2)

Both `val1' and `val2' may be single values (representing singleton sets)
or `Equivalent-Set's of values. If their difference is nonnull, returns
two values: true, and the difference, represented as a single value if a
singleton, else as an `Equivalent-Set'. If the difference is null, returns
`nil'.

# EQUIVALENT-SET-DISJOINT? (VAL1 VAL2)

Both `val1' and `val2' may be single values (representing singleton sets)
or `Equivalent-Set's of values. If their intersection is null, returns
true, else false.

# EQUIVALENT-SET-INTERSECT (VAL1 VAL2)

Both `val1' and `val2' may be single values (representing singleton sets)
or `Equivalent-Set's of values. If their intersection is nonnull, returns
two values: true, and the intersection, represented as a single value if a
singleton, else as an `Equivalent-Set'. If the intersection is null, returns
`nil'.

# EQUIVALENT-SET-MEMBERS (INSTANCE)

# EQUIVALENT-SET-SUBSET? (VAL1 VAL2)

Both `val1' and `val2' may be single values (representing singleton sets)
or `Equivalent-Set's of values. Returns true iff `val2' contains all members
of `val1'.

# EQUIVALENT-SET-UNION (VAL1 VAL2)

Both `val1' and `val2' may be single values (representing singleton sets)
or `Equivalent-Set's of values. Returns their union represented as a single
value if a singleton, else as an `Equivalent-Set'.

# EVERY (PRED SEQUENCE0 &REST MORE-SEQUENCES)

FSet generic version of `cl:every'.

# FSET-SETUP-REREADING-READTABLE (READTABLE)

Adds the FSet rereading reader macros to `readtable'. These reader macros
will correctly read structure printed by the FSet print functions. Returns
`readtable'.

# GET-INDICES (REL AUGMENTED-MP)

Returns a list giving the index to use for each element of `augmented-mp'.

# INTERVAL-KIND (INSTANCE)

# INTERVAL-LOWER (INSTANCE)

# INTERVAL-SET-CONTENTS (INSTANCE)

# INTERVAL-UPPER (INSTANCE)

# MAKE-WB-BAG-TREE-NODE (VALUE COUNT LEFT RIGHT)

The low-level constructor for a bag tree node. `count' is ignored and can be
`nil' if value is an `Equivalent-Bag'.

# MAKE-WB-MAP-TREE-NODE (KEY VALUE LEFT RIGHT)

The low-level constructor for a map tree node.

# MAKE-WB-SEQ-TREE-NODE (LEFT RIGHT)

The low-level constructor for a sequence tree node.

# MAKE-WB-SET-TREE-NODE (VALUE LEFT RIGHT)

The low-level constructor for a set tree node.

# MAP-KEY-SIZE (KEY)

The number of domain values represented by `key', which can be more than 1 if
`key' is an `Equivalent-Map'.

# MY-INTEGER-VALUE (INSTANCE)

# NOTANY (PRED SEQUENCE0 &REST MORE-SEQUENCES)

FSet generic version of `cl:notany'.

# NOTEVERY (PRED SEQUENCE0 &REST MORE-SEQUENCES)

FSet generic version of `cl:notevery'.

# QUERY-REGISTRY-ARITY (INSTANCE)

# QUERY-REGISTRY-INDICES (INSTANCE)

# QUERY-REGISTRY-KEY-INDEX (INSTANCE)

# REDUCED-TUPLE (TUPLE AUGMENTED-MP)

Returns a list of those members of `tuple' corresponding to instantiated
positions in the original pattern.

# SEQ-DEFAULT (INSTANCE)

# SET-VALUE-SIZE (VALUE)

The number of members represented by `value', which can be more than 1 if
`value' is an `Equivalent-Set'.

# SOME (PRED SEQUENCE0 &REST MORE-SEQUENCES)

FSet generic version of `cl:some'.

# SPLIT (PRED COLLECTION)

Deprecated; use `partition'.

# STRING-INSERT (STR IDX CH)

Returns a new string like `str' but with `ch' inserted at `idx'. Careful --
does no bounds checking on `str', which it assumes is simple.

# STRING-SUBSEQ (STR START &OPTIONAL (END (LENGTH STR)))

Returns a subsequence of `str' between `start' and `end'. Careful -- does
no bounds checking on `str', which it assumes is simple.

# STRING-SUBSEQ-INSERT (STR START END IDX CH)

Takes the subsequence of `str' from `start' to `end', then at `idx' within
the result, inserts `ch', returning the new string.

# TEST-MISC

Tests some things that don't need extensive random test cases generated.

# TUPLE-DESC-KEY-SET (INSTANCE)

# TUPLE-DESC-LOCK (INSTANCE)

# TUPLE-DESC-NEXT-DESC-MAP (INSTANCE)

# TUPLE-DESC-PAIRS (INSTANCE)

# TUPLE-DESC-REORDER-MAP-MAP (INSTANCE)

# TUPLE-DESC-SERIAL-NUMBER (INSTANCE)

# TUPLE-KEY-DEFAULT-FN (INSTANCE)

# TUPLE-KEY-NUMBER (INSTANCE)

# UPDATE (FN COLL &REST KEYS)

Returns a new version of `coll' in which the element reached by doing chained
`lookup's on `keys' is updated by `fn'. An example will help a lot here:
instead of writing
(incf (@ (@ (@ foo 'a) 3) 7))
you can write, equivalently
(setq foo (update #'1+ foo 'a 3 7))
This is perhaps most useful in contexts where you don't want to do the `setq'
anyway.

# VECTOR-INSERT (VEC IDX VAL)

Returns a new vector like `vec' but with `val' inserted at `idx'. Careful --
does no bounds checking on `vec', which it assumes is simple.

# VECTOR-INSERT-FROM-STRING (STR IDX VAL)

Returns a new vector like `str' (a string) but with `val' inserted at `idx'.
Careful -- does no bounds checking on `str', which it assumes is simple.

# VECTOR-SET-BINARY-SEARCH (VEC VALUE)

Searches a vector set `vec' for `value'. Returns two values, a symbol and an
index. If `value', or a value equivalent to `value', is in `vec', the symbol
is `:equal' resp. `:unequal', and the index is the position of the value;
otherwise, the symbol is `nil' and the index is where `value' would go if it
were to be inserted.

# VECTOR-SET-BINARY-SEARCH-CFN (VEC VALUE CFN)

Searches a vector set `vec' for `value'. Returns two values, a symbol and an
index. If `value', or a value equivalent to `value', is in `vec', the symbol
is `:equal' resp. `:unequal', and the index is the position of the value;
otherwise, the symbol is `nil' and the index is where `value' would go if it
were to be inserted.

# VECTOR-SET-BINARY-SEARCH-HI (VEC HI)

Returns the index of the right edge of the last member of `vec' that is
below `hi'.

# VECTOR-SET-BINARY-SEARCH-LO (VEC LO)

Returns the index of the left edge of the first member of `vec' that is
above `lo'.

# VECTOR-SET-DIFF (VEC1 VEC2 LO HI)

Returns, as a vector, the set difference of vectors `vec1' less `vec2',
restricted to those members above `lo' and below `hi'.

# VECTOR-SET-DIFF-2 (VEC1 VEC2 LO HI)

Returns, as two vector values, the set difference of vectors `str1' less `str2'
and that of `str2' less `str1', restricted to those members above `lo' and below
`hi'.

# VECTOR-SET-DISJOINT? (VEC1 VEC2 LO HI)

Returns true iff `vec1' does not contain any member of `vec2', restricted
to those members above `lo' and below `hi'.

# VECTOR-SET-INTERSECT (VEC1 VEC2 LO HI)

Returns, as a vector, the intersection of vectors `vec1' and `vec2', restricted
to those members above `lo' and below `hi'.

# VECTOR-SET-SUBSET? (VEC1 VEC2 LO HI)

Returns true iff `vec1' contains all members of `vec2', restricted
to those members above `lo' and below `hi'. `vec2' may be `nil'.

# VECTOR-SET-UNION (VEC1 VEC2 LO HI)

Returns, as a vector, the union of vectors `vec1' and `vec2', restricted to
those members above `lo' and below `hi'.

# VECTOR-SUBSEQ (VEC START &OPTIONAL (END (LENGTH VEC)))

Returns a subsequence of `vec' between `start' and `end', or `nil' if
the result would be of zero length. Careful -- does no bounds checking
on `vec', which it assumes is simple.

# VECTOR-SUBSEQ-INSERT (VEC START END IDX VAL)

Takes the subsequence of `vec' from `start' to `end', then at `idx' within
the result, inserts `val', returning the new vector.

# VECTOR-UPDATE (VEC IDX VAL)

Returns a new vector like `vec' but with `val' at `idx'.

# WB-2-RELATION-MAP0 (INSTANCE)

# WB-2-RELATION-MAP1 (INSTANCE)

# WB-2-RELATION-SIZE (INSTANCE)

# WB-BAG-CONTENTS (INSTANCE)

# WB-BAG-TREE-ARB-PAIR (TREE)

Returns an arbitrary member of the bag and its count. Assumes the bag is
nonempty.

# WB-BAG-TREE-BUILD-NODE (VALUE COUNT LEFT RIGHT)

Constructs a `WB-Bag-Tree', performing one rebalancing step if required.
`value' must already be known to go between `left' and `right'.

# WB-BAG-TREE-DIFF (TREE1 TREE2)

Returns the set difference of `tree1' less `tree2'. Runs in time linear in
the total sizes of the two trees.

# WB-BAG-TREE-DIFF-RNG (TREE1 TREE2 LO HI)

Returns the set difference of `tree1' less `tree2', considering only those
members that are above `lo' and below `hi', and assuming that the root values
of `tree1' and `tree2' are in this range.

# WB-BAG-TREE-FIND-EQUIVALENT (TREE VALUE)

If `tree' contains one or more values equivalent to `value', returns (first
value) true, (second value) either the one value or an `Equivalent-Bag'
containing the values, and (third value) if the second value was a single
value, the corresponding count; otherwise `nil'.

# WB-BAG-TREE-GREATEST-PAIR (TREE)

Assumes `tree' is nonempty. Returns the greatest member, or an arbitrary
greatest member if there are more than one; the second value is the associated
multiplicity.

# WB-BAG-TREE-INTERSECT-RNG (TREE1 TREE2 LO HI)

Returns the intersection of `tree1' with `tree2', considering only those
members that are above `lo' and below `hi', and assuming that the root values
of `tree1' and `tree2' are in this range.

# WB-BAG-TREE-LEAST-PAIR (TREE)

Assumes `tree' is nonempty. Returns the least member, or an arbitrary
least member if there are more than one; the second value is the associated
count.

# WB-BAG-TREE-LESS (TREE VALUE &OPTIONAL (COUNT 1))

Returns `tree' with the count for `value' decremented; if that count was
1, `value' is removed entirely.

# WB-BAG-TREE-LESS-MINIMUM (TREE)

Assumes `tree' is nonempty. Returns a new tree with the minimum value
removed.

# WB-BAG-TREE-MINIMUM-PAIR (TREE)

Assumes `tree' is nonempty. Returns the minimum value and count as two
values. The value may be an `Equivalent-Bag', in which case, as usual, the
count is not meaningful.

# WB-BAG-TREE-MULTIPLICITY (TREE VALUE)

Returns the multiplicity of `value' in `tree', or 0 if `value' does not
appear in `tree'. As a second value, returns the value found, if any.

# WB-BAG-TREE-NODE-COUNT (INSTANCE)

# WB-BAG-TREE-NODE-LEFT (INSTANCE)

# WB-BAG-TREE-NODE-PRINT (NODE STREAM DEPTH)

Print function for `WB-Bag-Tree-Node', q.v.

# WB-BAG-TREE-NODE-RIGHT (INSTANCE)

# WB-BAG-TREE-NODE-SIZE (INSTANCE)

# WB-BAG-TREE-NODE-TOTAL-COUNT (INSTANCE)

# WB-BAG-TREE-NODE-VALUE (INSTANCE)

# WB-BAG-TREE-PRODUCT-RNG (TREE1 TREE2 LO HI)

Returns the Production of `tree1' with `tree2', considering only those
members that are above `lo' and below `hi', and assuming that the root values
of `tree1' and `tree2' are in this range.

# WB-BAG-TREE-RANK (TREE VALUE)

Searches a bag tree `tree' for `value'. Returns two values, a boolean and an
index. If `value', or a value equivalent to `value', is in `tree', the symbol
is true, and the index is the rank of the value; otherwise, the boolean is false
and the index is the rank `value' would have if it were to be added. Note that
if the bag contains equivalent-but-unequal elements, the rank of each of several
such elements is guaranteed consistent only within the same tree (by `eq'), not
between equal trees.

# WB-BAG-TREE-SIZE (TREE)

The number of value/count pairs contained in this tree.

# WB-BAG-TREE-SUM (TREE1 TREE2)

Returns the sum of `tree' and `tree2'.

# WB-BAG-TREE-UNION (TREE1 TREE2)

Returns the union of `tree' and `tree2'.

# WB-BAG-TREE-WITH (TREE VALUE &OPTIONAL (COUNT 1))

Returns `tree' with `value' added with a count of `count' (if it was already
present, its count is incremented by `count'). `value' may be an `Equivalent-Bag'.

# WB-LIST-RELATION-ARITY (INSTANCE)

# WB-LIST-RELATION-INDICES (INSTANCE)

# WB-LIST-RELATION-TUPLES (INSTANCE)

# WB-MAP-CONTENTS (INSTANCE)

# WB-MAP-DEFAULT (INSTANCE)

# WB-MAP-TREE-ARB-PAIR (TREE)

Selects an arbitrary pair of the map. Assumes it is nonnull.

# WB-MAP-TREE-BUILD-NODE (KEY VALUE LEFT RIGHT)

Constructs a `WB-Map-Tree', performing one rebalancing step if required.
`key' must already be known to go between `left' and `right'.

# WB-MAP-TREE-DIFF-2 (TREE1 TREE2)

Returns two values: one containing the pairs that are in `tree1' but not
`tree2', and the other containing the pairs that are in `tree2' but not
`tree1'.

# WB-MAP-TREE-FIND-EQUIVALENT (TREE KEY)

If `tree' contains one or more keys equivalent to `value', returns (first
value) true, (second value) either the one key or an `Equivalent-Map'
containing the values, and (third value) if the second value was a single
key, the corresponding value; otherwise `nil'.

# WB-MAP-TREE-GREATEST-PAIR (TREE)

Assumes `tree' is nonempty. Returns the greatest key and its value, or an
arbitrary greatest key and its value if there are more than one.

# WB-MAP-TREE-LEAST-PAIR (TREE)

Assumes `tree' is nonempty. Returns the least key and its value, or an
arbitrary least key and its value if there are more than one.

# WB-MAP-TREE-LESS (TREE KEY)

Returns a new tree like `tree', but with any entry for `key' removed.

# WB-MAP-TREE-LESS-MINIMUM (TREE)

Assumes `tree' is nonempty. Returns a new tree with the minimum key/value
pair removed.

# WB-MAP-TREE-LOOKUP (TREE KEY)

If `tree' contains a pair whose key is `key', returns two values, true and
the associated value; otherwise `nil'.

# WB-MAP-TREE-MINIMUM-PAIR (TREE)

Assumes `tree' is nonempty. Returns the minimum key and value as two
values. The key may be an `Equivalent-Map', in which case, as usual, the
value is not meaningful.

# WB-MAP-TREE-NODE-KEY (INSTANCE)

# WB-MAP-TREE-NODE-LEFT (INSTANCE)

# WB-MAP-TREE-NODE-PRINT (NODE STREAM DEPTH)

Print function for `WB-Map-Tree-Node', q.v.

# WB-MAP-TREE-NODE-RIGHT (INSTANCE)

# WB-MAP-TREE-NODE-SIZE (INSTANCE)

# WB-MAP-TREE-NODE-VALUE (INSTANCE)

# WB-MAP-TREE-RANK (TREE KEY)

Searches a map tree `tree' for `key'. Returns two values, a boolean and an
index. If `key', or a value equivalent to `key', is in `tree', the boolean
is true, and the index is the rank of the value; otherwise, the boolean is false
and the index is the rank `key' would have if it were to be added. Note that
if the map contains equivalent-but-unequal keys, the rank of each of several
such keys is guaranteed consistent only within the same tree (by `eq'), not
between equal trees.

# WB-MAP-TREE-SIZE (TREE)

The number of key/value pairs contained in this tree.

# WB-MAP-TREE-WITH (TREE KEY VALUE)

Returns a new tree like `tree' but with the pair < `key', `value' > added,
shadowing any previous pair with the same key.

# WB-SEQ-CONTENTS (INSTANCE)

# WB-SEQ-DEFAULT (INSTANCE)

# WB-SEQ-TREE-NODE-LEFT (INSTANCE)

# WB-SEQ-TREE-NODE-PRINT (NODE STREAM DEPTH)

Print function for `WB-Seq-Tree-Node', q.v.

# WB-SEQ-TREE-NODE-RIGHT (INSTANCE)

# WB-SEQ-TREE-NODE-SIZE (INSTANCE)

# WB-SET-CONTENTS (INSTANCE)

# WB-SET-TREE-ARB (TREE)

Selects an arbitrary member of the set. Assumes it is nonnull.

# WB-SET-TREE-BUILD-NODE (VALUE LEFT RIGHT)

Constructs a `WB-Set-Tree', performing one rebalancing step if required.
`value' must already be known to go between `left' and `right'.

# WB-SET-TREE-CONCAT (VALUE LEFT RIGHT)

Corresponds to Adams' `concat3'. Assumes that (all values in `left') <=
`value' <= (all values in `right'); returns a new tree containing all values.
This does more rebalancing than `WB-Set-Tree-Build-Node', which otherwise
has the same contract. `value' may be an `Equivalent-Set'.

# WB-SET-TREE-DIFF (TREE1 TREE2)

Returns the set difference of `tree1' less `tree2'. Runs in time linear in
the total sizes of the two trees.

# WB-SET-TREE-DIFF-2 (TREE1 TREE2)

Returns two values: the set difference of `tree1' less `tree2', and that of
`tree2' less `tree1'. Runs in time linear in the total sizes of the two trees.

# WB-SET-TREE-DIFF-2-RNG (TREE1 TREE2 LO HI)

Returns two values: the set difference of `tree1' less `tree2', and that of
`tree2' less `tree1', considering only those members that are above `lo' and
below `hi', and assuming that the root values of `tree1' and `tree2' are in
this range.

# WB-SET-TREE-DIFF-RNG (TREE1 TREE2 LO HI)

Returns the set difference of `tree1' less `tree2', considering only those
members that are above `lo' and below `hi', and assuming that the root values
of `tree1' and `tree2' are in this range.

# WB-SET-TREE-FIND-EQUAL (TREE VALUE)

If `tree' contains a value equal to `value', returns (first value) true and
(second value) the value; otherwise `nil'.

# WB-SET-TREE-FIND-EQUIVALENT (TREE VALUE)

If `tree' contains one or more values equivalent to `value', returns (first
value) true and (second value) either the one value or an `Equivalent-Set'
containing the values; otherwise `nil'.

# WB-SET-TREE-FIND-RANK (TREE VALUE)

Returns the rank at which `value' appears in `tree', if it does, else the rank
it would occupy if it were present. The second value is true iff the value was
found. Note that if the set contains equivalent-but-unequal elements, they all
appear at the same rank.

# WB-SET-TREE-GREATEST (TREE)

Assumes `tree' is nonempty. Returns the greatest member, or an arbitrary
greatest member if there are more than one.

# WB-SET-TREE-INTERSECT (TREE1 TREE2)

Returns the intersection of `tree1' and `tree2'. Runs in time linear in
the total sizes of the two trees.

# WB-SET-TREE-INTERSECT-RNG (TREE1 TREE2 LO HI)

Returns the intersection of `tree1' with `tree2', considering only those
members that are above `lo' and below `hi', and assuming that the root values
of `tree1' and `tree2' are in this range.

# WB-SET-TREE-JOIN (LEFT RIGHT)

Returns the union of `left' and `right' under the assumption that all values
in `left' are less than any value in `right'.

# WB-SET-TREE-LEAST (TREE)

Assumes `tree' is nonempty. Returns the least member, or an arbitrary
least member if there are more than one.

# WB-SET-TREE-LESS-MINIMUM (TREE)

Assumes `tree' is nonempty. Returns a new tree with the minimum value
or `Equivalent-Set' removed.

# WB-SET-TREE-MEMBER? (TREE VALUE)

Returns true iff `value' is a member of `tree'.

# WB-SET-TREE-MEMBER?-CFN (TREE VALUE CFN)

Returns true iff `value' is a member of `tree'.

# WB-SET-TREE-MINIMUM-VALUE (TREE)

Assumes `tree' is nonempty. Returns the minimum value. This may be an
`Equivalent-Set'.

# WB-SET-TREE-NODE-LEFT (INSTANCE)

# WB-SET-TREE-NODE-PRINT (NODE STREAM DEPTH)

Print function for `WB-Set-Tree-Node', q.v.

# WB-SET-TREE-NODE-RIGHT (INSTANCE)

# WB-SET-TREE-NODE-SIZE (INSTANCE)

# WB-SET-TREE-NODE-VALUE (INSTANCE)

# WB-SET-TREE-RANK (TREE VALUE)

Searches a set tree `tree' for `value'. Returns two values, a boolean and an
index. If `value', or a value equivalent to `value', is in `tree', the boolean
is true, and the index is the rank of the value; otherwise, the boolean is false
and the index is the rank `value' would have if it were to be added. Note that
if the set contains equivalent-but-unequal elements, the rank of each of several
such elements is guaranteed consistent only within the same tree (by `eq'), not
between equal trees.

# WB-SET-TREE-SIZE (TREE)

The number of members contained in this tree.

# WB-SET-TREE-SPLIT (TREE LO HI)

Corresponds to Adams' `split_lt' and `split_gt'. Returns a tree containing
those members of `tree' above `lo' and below `hi'.

# WB-SET-TREE-TRIM (TREE LO HI)

Corresponds to Adams' `trim' and variants. Removes any tree nodes whose
values are less than `lo' or greater than `hi'. Note, this does _not_ guarantee
that the result only contains values between `lo' and `hi'; use `-Split' for
that. This, however, doesn't cons.

# WB-SET-TREE-UNION (TREE1 TREE2)

Returns the union of `tree1' and `tree2'. Runs in time linear in the total
sizes of the two trees.

# WB-SET-TREE-UNION-RNG (TREE1 TREE2 LO HI)

Returns the union of `tree1' with `tree2', considering only those members
that are above `lo' and below `hi', and assuming that the root values of `tree1'
and `tree2' are in this range.

# WB-SET-TREE-VECTOR-UNION (VEC1 VEC2 LO HI)

Returns the union of vectors `vec1' and `vec2', restricted to those members
above `lo' and below `hi'. Creates new set tree nodes if needed, either
because the result exceeds the vector threshold size, or because one or more
pairs of equivalent members were found.

# WB-SET-TREE-WITH (TREE VALUE)

If `value' is in `tree', returns `tree'; otherwise returns `tree' with
`value' added. `value' may be an `Equivalent-Set'.

# Undocumented

# #$-reader (STREAM SUBCHAR ARG)

# #%-reader (STREAM SUBCHAR ARG)

# #[-reader (STREAM SUBCHAR ARG)

# #{-reader (STREAM SUBCHAR ARG)

# #~-reader (STREAM SUBCHAR ARG)

# 2-RELATION-FN-COMPOSE (REL FN)

# 2-RELATION-TO-WB-MAP (BR)

# 2-RELATION? (OBJECT)

# ALIST-ASSIGN (AL R V)

# ALIST-BAG-COMBINE (AL1 AL2 FN)

# ALIST-BAG-DIFFERENCE (AL1 AL2)

# ALIST-BAG-INTERSECTION (AL1 AL2)

# ALIST-BAG-PRODUCT (AL1 AL2)

# ALIST-BAG-REMOVE (AL R)

# ALIST-BAG-SIZE (AL)

# ALIST-BAG-SUM (AL1 AL2)

# ALIST-BAG-UNION (AL1 AL2)

# ALIST-REMOVE (AL R)

# AUGMENTED-MP-MATCHES? (AUGMENTED-MP TUPLE)

# BAG-FILTER (PRED B)

# BAG-FILTER-PAIRS (PRED B)

# BAG-FROM-LIST (L FROM-TYPE)

# BAG-IMAGE (FN B)

# BAG-REDUCE (FN B INITIAL-VALUE KEY INIT?)

# BASE-CHAR-P (X)

# SETFBOUNDED-SET-COMPLEMENT? (NEW-VALUE INSTANCE)

# SETFBOUNDED-SET-SET (NEW-VALUE INSTANCE)

# SETFBOUNDED-SET-UNIVERSE (NEW-VALUE INSTANCE)

# BOUNDED-SET? (OBJECT)

# COMPARE-LISTS-LEXICOGRAPHICALLY (A B)

# COMPARE-STRINGS (A B)

# SETFCOMPLEMENT-SET-COMPLEMENT (NEW-VALUE INSTANCE)

# COMPLEMENT-SET? (OBJECT)

# COPY-EQUIVALENT-BAG (INSTANCE)

# COPY-EQUIVALENT-MAP (INSTANCE)

# COPY-EQUIVALENT-SET (INSTANCE)

# COPY-MY-INTEGER (INSTANCE)

# COPY-QUERY-REGISTRY (INSTANCE)

# COPY-TUPLE-DESC (INSTANCE)

# COPY-TUPLE-KEY (INSTANCE)

# COPY-WB-BAG-TREE-NODE (INSTANCE)

# COPY-WB-MAP-TREE-NODE (INSTANCE)

# COPY-WB-SEQ-TREE-NODE (INSTANCE)

# COPY-WB-SET-TREE-NODE (INSTANCE)

# SETFDYN-TUPLE-CONTENTS (NEW-VALUE INSTANCE)

# SETFDYN-TUPLE-DESCRIPTOR (NEW-VALUE INSTANCE)

# DYN-TUPLE? (OBJECT)

# EMPTY-2-RELATION

# EMPTY-INTERVAL-SET

# EMPTY-WB-2-RELATION

# SETFEQUIVALENT-BAG-ALIST (NEW-VALUE INSTANCE)

# EQUIVALENT-BAG-DIFFERENCE (VAL1 COUNT1 VAL2 COUNT2)

# EQUIVALENT-BAG-INTERSECT (VAL1 COUNT1 VAL2 COUNT2)

# EQUIVALENT-BAG-PRODUCT (VAL1 COUNT1 VAL2 COUNT2)

# EQUIVALENT-BAG-SUBBAG? (VAL1 COUNT1 VAL2 COUNT2)

# EQUIVALENT-BAG-SUM (VAL1 COUNT1 VAL2 COUNT2)

# EQUIVALENT-BAG-UNION (VAL1 COUNT1 VAL2 COUNT2)

# EQUIVALENT-BAG? (OBJECT)

# SETFEQUIVALENT-MAP-ALIST (NEW-VALUE INSTANCE)

# EQUIVALENT-MAP-RESTRICT (KEY VAL SET-ELT)

# EQUIVALENT-MAP-RESTRICT-NOT (KEY VAL SET-ELT)

# EQUIVALENT-MAP? (OBJECT)

# EQUIVALENT-SET-COMPARE (VAL1 VAL2)

# SETFEQUIVALENT-SET-MEMBERS (NEW-VALUE INSTANCE)

# EQUIVALENT-SET? (OBJECT)

# EQV (A B &REST MORE)

# EXPAND-2-RELATION-CONSTRUCTOR-FORM (TYPE-NAME ARGS)

# EXPAND-BAG-CONSTRUCTOR-FORM (TYPE-NAME ARGS)

# EXPAND-MAP-CONSTRUCTOR-FORM (TYPE-NAME ARGS)

# EXPAND-SEQ-CONSTRUCTOR-FORM (TYPE-NAME ARGS)

# EXPAND-SET-CONSTRUCTOR-FORM (TYPE-NAME ARGS)

# EXPAND-TUPLE-CONSTRUCTOR-FORM (TYPE-NAME ARGS)

# GET-INVERSE (BR)

# GREATER-THAN? (A B)

# SETFINTERVAL-KIND (NEW-VALUE INSTANCE)

# INTERVAL-KIND-SYMBOL (LOWER-CLOSED? UPPER-CLOSED?)

# SETFINTERVAL-LOWER (NEW-VALUE INSTANCE)

# INTERVAL-LOWER-CLOSED? (IV)

# SETFINTERVAL-SET-CONTENTS (NEW-VALUE INSTANCE)

# INTERVAL-SET? (OBJECT)

# SETFINTERVAL-UPPER (NEW-VALUE INSTANCE)

# INTERVAL-UPPER-CLOSED? (IV)

# INTERVAL? (OBJECT)

# LESS-THAN? (A B)

# LIST-INSERT (S POS R)

# LIST-RELATION? (OBJECT)

# LIST-REMOVE (S POS)

# LIST-SET-ELT (S POS VAL)

# LIST-TO-WB-2-RELATION (ALIST KEY-FN VALUE-FN)

# MAKE-BOUNDED-SET-INTERNAL (UNIVERSE SET COMPLEMENT?)

# MAKE-CHAR (CODE BITS)

# MAKE-COMPLEMENT-SET (COMPLEMENT)

# MAKE-DYN-TUPLE (DESCRIPTOR CONTENTS)

# MAKE-EQUIVALENT-BAG (ALIST)

# MAKE-EQUIVALENT-MAP (ALIST)

# MAKE-EQUIVALENT-SET (MEMBERS)

# MAKE-INTERVAL (LOWER UPPER LOWER-CLOSED? UPPER-CLOSED?)

# MAKE-INTERVAL-SET (CONTENTS)

# MAKE-LOCK (&OPTIONAL NAME)

# MAKE-MY-INTEGER (VALUE)

# MAKE-QUERY-REGISTRY (ARITY INDICES KEY-INDEX)

# MAKE-RAW-INTERVAL (LOWER UPPER KIND)

# MAKE-RAW-WB-BAG-TREE-NODE (SIZE TOTAL-COUNT VALUE COUNT LEFT RIGHT)

# MAKE-RAW-WB-MAP-TREE-NODE (SIZE KEY VALUE LEFT RIGHT)

# MAKE-RAW-WB-SEQ-TREE-NODE (SIZE LEFT RIGHT)

# MAKE-RAW-WB-SET-TREE-NODE (SIZE VALUE LEFT RIGHT)

# MAKE-SEEDED-RANDOM-STATE (SEED)

# MAKE-TUPLE-DESC (KEY-SET PAIRS)

# MAKE-TUPLE-DESC-INTERNAL (KEY-SET PAIRS LOCK SERIAL-NUMBER)

# MAKE-TUPLE-KEY (NAME DEFAULT-FN NUMBER)

# MAKE-WB-2-RELATION (SIZE MAP0 MAP1)

# MAKE-WB-BAG (CONTENTS)

# MAKE-WB-BAG-TREE-ITERATOR (TREE)

# MAKE-WB-BAG-TREE-ITERATOR-INTERNAL (TREE)

# MAKE-WB-BAG-TREE-PAIR-ITERATOR (TREE)

# MAKE-WB-BAG-TREE-PAIR-ITERATOR-INTERNAL (TREE)

# MAKE-WB-LIST-RELATION (ARITY TUPLES INDICES)

# MAKE-WB-MAP (CONTENTS &OPTIONAL (DEFAULT NIL))

# MAKE-WB-MAP-TREE-ITERATOR (TREE)

# MAKE-WB-MAP-TREE-ITERATOR-INTERNAL (TREE)

# MAKE-WB-SEQ (CONTENTS &OPTIONAL (DEFAULT NIL))

# MAKE-WB-SEQ-TREE-ITERATOR (TREE)

# MAKE-WB-SEQ-TREE-ITERATOR-INTERNAL (TREE)

# MAKE-WB-SET (CONTENTS)

# MAKE-WB-SET-TREE-ITERATOR (TREE)

# MAKE-WB-SET-TREE-ITERATOR-INTERNAL (TREE)

# MAKE-WB-TREE-ITERATOR (TREE SIZE FRAME-SIZE NODES-HAVE-VALUES?)

# MAP-COMPARE (M1 M2)

# MAP-FILTER (PRED M)

# MAP-FN-COMPOSE (M FN)

# MAP-IMAGE (FN M)

# MAP-REDUCE (FN M INITIAL-VALUE KEY INIT?)

# MAP-SORT-AND-GROUP (M)

# MAP-TO-SETS-TO-WB-2-RELATION (M)

# MAP-TO-WB-2-RELATION (M)

# MY-INTEGER-P (OBJECT)

# SETFMY-INTEGER-VALUE (NEW-VALUE INSTANCE)

# PICK (FS)

# PRINT-BOUNDED-SET (BS STREAM LEVEL)

# PRINT-COMPLEMENT-SET (CS STREAM LEVEL)

# PRINT-DYN-TUPLE (TUPLE STREAM LEVEL)

# PRINT-INTERVAL (IV STREAM LEVEL)

# PRINT-INTERVAL-SET (SET STREAM LEVEL)

# PRINT-TUPLE-KEY (KEY STREAM LEVEL)

# PRINT-WB-2-RELATION (BR STREAM LEVEL)

# PRINT-WB-BAG (BAG STREAM LEVEL)

# PRINT-WB-LIST-RELATION (REL STREAM LEVEL)

# PRINT-WB-MAP (MAP STREAM LEVEL)

# PRINT-WB-SEQ (SEQ STREAM LEVEL)

# PRINT-WB-SET (SET STREAM LEVEL)

# SETFQUERY-REGISTRY-ARITY (NEW-VALUE INSTANCE)

# SETFQUERY-REGISTRY-INDICES (NEW-VALUE INSTANCE)

# SETFQUERY-REGISTRY-KEY-INDEX (NEW-VALUE INSTANCE)

# QUERY-REGISTRY-P (OBJECT)

# RANDOM-TEST (N)

# RELATION? (OBJECT)

# rereading-#[-reader (STREAM SUBCHAR ARG)

# rereading-#{-reader (STREAM SUBCHAR ARG)

# rereading-#~-reader (STREAM SUBCHAR ARG)

# RUN-TEST-SUITE (N-ITERATIONS &OPTIONAL RANDOM-SEED)

# SEQ-COMPARE (S1 S2)

# SETFSEQ-DEFAULT (NEW-VALUE INSTANCE)

# SEQ-FILTER (FN S)

# SEQ-IMAGE (FN S)

# SEQ-PARTITION (FN S)

# SEQ-POSITION (X S)

# SEQ-REDUCE (FN S INITIAL-VALUE KEY INIT? START END FROM-END?)

# SET-COMPARE (S1 S2)

# SET-FILTER (PRED S)

# SET-IMAGE (FN S)

# SET-PARTITION (PRED S)

# SET-REDUCE (FN S INITIAL-VALUE KEY INIT?)

# SET-TRANSITIVE-CLOSURE (R S)

# STRING-REMOVE-AT (STR IDX)

# STRING-SEQ-TO-SET (VEC LO HI)

# STRING-UPDATE (STR IDX CH)

# TEST-BAG-OPERATIONS (I)

# TEST-CL-GENERIC-SEQUENCE-OPS (I FS0 S0 FS1 S1)

# TEST-MAP-OPERATIONS (I A-SET)

# TEST-SEQ-OPERATIONS (I)

# TEST-SET-OPERATIONS (I)

# TEST-TUPLE-OPERATIONS (I)

# TEST-TYPE-DISPATCH-SPEED (N)

# TIME-INDEX (SEQ N)

# TIME-SEQ-ITER (SEQ N)

# SETFTUPLE-DESC-KEY-SET (NEW-VALUE INSTANCE)

# SETFTUPLE-DESC-LOCK (NEW-VALUE INSTANCE)

# SETFTUPLE-DESC-NEXT-DESC-MAP (NEW-VALUE INSTANCE)

# TUPLE-DESC-P (OBJECT)

# SETFTUPLE-DESC-PAIRS (NEW-VALUE INSTANCE)

# SETFTUPLE-DESC-REORDER-MAP-MAP (NEW-VALUE INSTANCE)

# SETFTUPLE-DESC-SERIAL-NUMBER (NEW-VALUE INSTANCE)

# TUPLE-GET-REORDER-MAP (OLD-DESC NEW-DESC)

# SETFTUPLE-KEY-DEFAULT-FN (NEW-VALUE INSTANCE)

# SETFTUPLE-KEY-NUMBER (NEW-VALUE INSTANCE)

# TUPLE-KEY? (OBJECT)

# TUPLE-LOOKUP (TUPLE KEY &OPTIONAL NO-REORDER?)

# TUPLE-MAKE-REORDER-MAP (OLD-DESC NEW-DESC)

# TUPLE-RANDOM-VALUE

# TUPLE-REORDER-KEYS (TUPLE IDX)

# TUPLE-WITH (TUPLE KEY VAL)

# VECTOR-PAIR-BAG-DIFF (PR1 PR2 LO HI)

# VECTOR-PAIR-BAG-INTERSECT (PR1 PR2 LO HI)

# VECTOR-PAIR-BAG-PRODUCT (PR1 PR2 LO HI)

# VECTOR-PAIR-BAG-SUBBAG? (PR1 PR2 LO HI)

# VECTOR-PAIR-BAG-SUM (PR1 PR2 LO HI)

# VECTOR-PAIR-BAG-UNION (PR1 PR2 LO HI)

# VECTOR-PAIR-DIFF-2 (PR1 PR2 LO HI)

# VECTOR-PAIR-INTERSECT (PR1 PR2 VAL-FN LO HI)

# VECTOR-PAIR-RESTRICT (MAP-PR SET-VEC LO HI)

# VECTOR-PAIR-RESTRICT-NOT (MAP-PR SET-VEC LO HI)

# VECTOR-PAIR-UNION (PR1 PR2 VAL-FN LO HI)

# VECTOR-REMOVE-AT (VEC IDX)

# VECTOR-SEQ-TO-SET (VEC LO HI)

# VECTOR-UPDATE-FROM-STRING (STR IDX VALUE)

# SETFWB-2-RELATION-MAP0 (NEW-VALUE INSTANCE)

# SETFWB-2-RELATION-MAP1 (NEW-VALUE INSTANCE)

# SETFWB-2-RELATION-SIZE (NEW-VALUE INSTANCE)

# WB-2-RELATION? (OBJECT)

# SETFWB-BAG-CONTENTS (NEW-VALUE INSTANCE)

# WB-BAG-TREE-COMPARE (TREE1 TREE2)

# WB-BAG-TREE-COMPARE-RNG (TREE1 BASE1 TREE2 BASE2 LO HI)

# WB-BAG-TREE-CONCAT (VALUE COUNT LEFT RIGHT)

# WB-BAG-TREE-FROM-LIST (LST)

# WB-BAG-TREE-INTERSECT (TREE1 TREE2)

# WB-BAG-TREE-ITERATOR-CANONICALIZE (ITER)

# WB-BAG-TREE-ITERATOR-DONE? (ITER)

# WB-BAG-TREE-ITERATOR-GET (ITER)

# WB-BAG-TREE-JOIN (LEFT RIGHT)

# SETFWB-BAG-TREE-NODE-COUNT (NEW-VALUE INSTANCE)

# SETFWB-BAG-TREE-NODE-LEFT (NEW-VALUE INSTANCE)

# SETFWB-BAG-TREE-NODE-RIGHT (NEW-VALUE INSTANCE)

# SETFWB-BAG-TREE-NODE-SIZE (NEW-VALUE INSTANCE)

# SETFWB-BAG-TREE-NODE-TOTAL-COUNT (NEW-VALUE INSTANCE)

# SETFWB-BAG-TREE-NODE-VALUE (NEW-VALUE INSTANCE)

# WB-BAG-TREE-NODE? (OBJECT)

# WB-BAG-TREE-PAIR-ITERATOR-CANONICALIZE (ITER)

# WB-BAG-TREE-PAIR-ITERATOR-DONE? (ITER)

# WB-BAG-TREE-PAIR-ITERATOR-GET (ITER)

# WB-BAG-TREE-PRODUCT (TREE1 TREE2)

# WB-BAG-TREE-RANK-PAIR (TREE RANK)

# WB-BAG-TREE-RANK-PAIR-INTERNAL (TREE RANK)

# WB-BAG-TREE-RANK-TRIM (TREE BASE LO HI)

# WB-BAG-TREE-SPLIT (TREE LO HI)

# WB-BAG-TREE-SUBBAG? (TREE1 TREE2)

# WB-BAG-TREE-SUBBAG?-RNG (TREE1 TREE2 LO HI)

# WB-BAG-TREE-SUM-RNG (TREE1 TREE2 LO HI)

# WB-BAG-TREE-TO-SET-TREE (TREE)

# WB-BAG-TREE-TOTAL-COUNT (TREE)

# WB-BAG-TREE-TRIM (TREE LO HI)

# WB-BAG-TREE-UNION-RNG (TREE1 TREE2 LO HI)

# WB-BAG-TREE-VECTOR-PAIR-SUM (PR1 PR2 LO HI)

# WB-BAG-TREE-VECTOR-PAIR-UNION (PR1 PR2 LO HI)

# WB-BAG-TREE-VERIFY (TREE)

# WB-BAG-TREE-VERIFY-RNG (TREE LO HI)

# WB-BAG? (OBJECT)

# SETFWB-LIST-RELATION-ARITY (NEW-VALUE INSTANCE)

# SETFWB-LIST-RELATION-INDICES (NEW-VALUE INSTANCE)

# SETFWB-LIST-RELATION-TUPLES (NEW-VALUE INSTANCE)

# WB-LIST-RELATION? (OBJECT)

# SETFWB-MAP-CONTENTS (NEW-VALUE INSTANCE)

# SETFWB-MAP-DEFAULT (NEW-VALUE INSTANCE)

# WB-MAP-FROM-CL-SEQUENCE (S KEY-FN VALUE-FN)

# WB-MAP-FROM-LIST (LIST KEY-FN VALUE-FN)

# WB-MAP-TREE-COMPARE (TREE1 TREE2 &OPTIONAL (VAL-FN #'COMPARE))

# WB-MAP-TREE-COMPARE-RNG (TREE1 BASE1 TREE2 BASE2 LO HI VAL-FN)

# WB-MAP-TREE-COMPOSE (TREE FN)

# WB-MAP-TREE-CONCAT (KEY VALUE LEFT RIGHT)

# WB-MAP-TREE-CONCAT-MAYBE (PAIR? KEY VALUE LEFT RIGHT)

# WB-MAP-TREE-DIFF-2-RNG (TREE1 TREE2 LO HI)

# WB-MAP-TREE-DOMAIN (TREE)

# WB-MAP-TREE-INTERSECT (TREE1 TREE2 VAL-FN)

# WB-MAP-TREE-INTERSECT-RNG (TREE1 TREE2 VAL-FN LO HI)

# WB-MAP-TREE-ITERATOR-CANONICALIZE (ITER)

# WB-MAP-TREE-ITERATOR-DONE? (ITER)

# WB-MAP-TREE-ITERATOR-GET (ITER)

# WB-MAP-TREE-JOIN (LEFT RIGHT)

# SETFWB-MAP-TREE-NODE-KEY (NEW-VALUE INSTANCE)

# SETFWB-MAP-TREE-NODE-LEFT (NEW-VALUE INSTANCE)

# SETFWB-MAP-TREE-NODE-RIGHT (NEW-VALUE INSTANCE)

# SETFWB-MAP-TREE-NODE-SIZE (NEW-VALUE INSTANCE)

# SETFWB-MAP-TREE-NODE-VALUE (NEW-VALUE INSTANCE)

# WB-MAP-TREE-NODE? (OBJECT)

# WB-MAP-TREE-RANK-PAIR (TREE RANK)

# WB-MAP-TREE-RANK-PAIR-INTERNAL (TREE RANK)

# WB-MAP-TREE-RANK-TRIM (TREE BASE LO HI)

# WB-MAP-TREE-RESTRICT (MAP-TREE SET-TREE)

# WB-MAP-TREE-RESTRICT-NOT (MAP-TREE SET-TREE)

# WB-MAP-TREE-RESTRICT-NOT-RNG (MAP-TREE SET-TREE LO HI)

# WB-MAP-TREE-RESTRICT-RNG (MAP-TREE SET-TREE LO HI)

# WB-MAP-TREE-SPLIT (TREE LO HI)

# WB-MAP-TREE-TRIM (TREE LO HI)

# WB-MAP-TREE-UNION (TREE1 TREE2 VAL-FN)

# WB-MAP-TREE-UNION-RNG (TREE1 TREE2 VAL-FN LO HI)

# WB-MAP-TREE-VECTOR-PAIR-UNION (PR1 PR2 VAL-FN LO HI)

# WB-MAP-TREE-VERIFY (TREE)

# WB-MAP-TREE-VERIFY-RNG (TREE LO HI)

# WB-MAP? (OBJECT)

# SETFWB-SEQ-CONTENTS (NEW-VALUE INSTANCE)

# SETFWB-SEQ-DEFAULT (NEW-VALUE INSTANCE)

# WB-SEQ-TREE-APPEND (TREE VALUE)

# WB-SEQ-TREE-BUILD-NODE (LEFT RIGHT)

# WB-SEQ-TREE-COMPARE (TREE1 TREE2)

# WB-SEQ-TREE-COMPARE-LEXICOGRAPHICALLY (TREE1 TREE2)

# WB-SEQ-TREE-COMPARE-RNG (TREE1 BASE1 TREE2 BASE2 LO HI)

# WB-SEQ-TREE-CONCAT (LEFT RIGHT)

# WB-SEQ-TREE-FROM-LIST (LST)

# WB-SEQ-TREE-FROM-VECTOR (VEC)

# WB-SEQ-TREE-INSERT (TREE IDX VALUE)

# WB-SEQ-TREE-ITERATOR-CANONICALIZE (ITER)

# WB-SEQ-TREE-ITERATOR-DONE? (ITER)

# WB-SEQ-TREE-ITERATOR-GET (ITER)

# SETFWB-SEQ-TREE-NODE-LEFT (NEW-VALUE INSTANCE)

# SETFWB-SEQ-TREE-NODE-RIGHT (NEW-VALUE INSTANCE)

# SETFWB-SEQ-TREE-NODE-SIZE (NEW-VALUE INSTANCE)

# WB-SEQ-TREE-NODE? (OBJECT)

# WB-SEQ-TREE-REMOVE (TREE IDX)

# WB-SEQ-TREE-REVERSE (TREE)

# WB-SEQ-TREE-SIZE (TREE)

# WB-SEQ-TREE-SUBSCRIPT (TREE IDX)

# WB-SEQ-TREE-SUBSEQ (TREE START END)

# WB-SEQ-TREE-TO-LIST (TREE)

# WB-SEQ-TREE-TO-SET-TREE (TREE)

# WB-SEQ-TREE-TO-STRING (TREE)

# WB-SEQ-TREE-TO-VECTOR (TREE)

# WB-SEQ-TREE-TRIM (TREE BASE LO HI)

# WB-SEQ-TREE-VERIFY (TREE)

# WB-SEQ-TREE-WITH (TREE IDX VALUE)

# WB-SEQ? (OBJECT)

# SETFWB-SET-CONTENTS (NEW-VALUE INSTANCE)

# WB-SET-TREE-COMPARE (TREE1 TREE2)

# WB-SET-TREE-COMPARE-RNG (TREE1 BASE1 TREE2 BASE2 LO HI)

# WB-SET-TREE-DISJOINT? (TREE1 TREE2)

# WB-SET-TREE-DISJOINT?-RNG (TREE1 TREE2 LO HI)

# WB-SET-TREE-FROM-CL-SEQUENCE (SEQ)

# WB-SET-TREE-FROM-LIST (LST)

# WB-SET-TREE-ITERATOR-CANONICALIZE (ITER)

# WB-SET-TREE-ITERATOR-DONE? (ITER)

# WB-SET-TREE-ITERATOR-GET (ITER)

# WB-SET-TREE-LESS (TREE VALUE)

# SETFWB-SET-TREE-NODE-LEFT (NEW-VALUE INSTANCE)

# SETFWB-SET-TREE-NODE-RIGHT (NEW-VALUE INSTANCE)

# SETFWB-SET-TREE-NODE-SIZE (NEW-VALUE INSTANCE)

# SETFWB-SET-TREE-NODE-VALUE (NEW-VALUE INSTANCE)

# WB-SET-TREE-NODE? (OBJECT)

# WB-SET-TREE-RANK-ELEMENT (TREE RANK)

# WB-SET-TREE-RANK-ELEMENT-INTERNAL (TREE RANK)

# WB-SET-TREE-RANK-TRIM (TREE BASE LO HI)

# WB-SET-TREE-SPLIT-ABOVE (TREE VALUE)

# WB-SET-TREE-SPLIT-BELOW (TREE VALUE)

# WB-SET-TREE-SUBSET? (TREE1 TREE2)

# WB-SET-TREE-SUBSET?-RNG (TREE1 TREE2 LO HI)

# WB-SET-TREE-TO-BAG-TREE (TREE)

# WB-SET-TREE-VERIFY (TREE)

# WB-SET-TREE-VERIFY-RNG (TREE LO HI)

# WB-SET? (OBJECT)

# WB-TREE-MAX-DEPTH (SIZE NODES-HAVE-VALUES?)

# WB-TREE-TRUE-MAX-DEPTH (SIZE NODES-HAVE-VALUES?)

# XCONCAT (SEQ1 SEQ2)

# XIMAGE (COLL FN)

# MACRO

# Public

# @ (FN-OR-COLLECTION &REST ARGS)

A little hack with two purposes: (1) to make it easy to make FSet maps
behave like Lisp functions in certain contexts; and (2) to somewhat lessen the
pain of writing higher-order code in a two-namespace Lisp like Common Lisp.
The idea is that you can write `(@ fn arg)', and if `fn' is a Lisp function,
it will be funcalled on the argument; otherwise `lookup' (q.v.) will be called
on `fn' and `arg'. To allow for `@' to be used in more contexts, it actually
can take any number of `args', though `lookup' always takes exactly two. Thus
you can write `(@ fn arg1 arg2 ...)' when you just want a shorter name for
`funcall'. As a matter of style, it is suggested that `@' be used only for
side-effect-free functions. Also, though this doc string has spoken only of
FSet maps, `@' can be used with any type that `lookup' works on. Can be used
with `setf', but only on collections, not functions, of course.

# ADJOINF (PLACE &REST ITEM-OR-TUPLE &ENVIRONMENT ENV)

(adjoinf coll . args) --> (setf coll (with coll . args))

# BAG (&REST ARGS)

Constructs a bag of the default implementation according to the supplied
argument subforms. Each argument subform can be an expression, whose value
will be added to the bag with multiplicity 1; or a list of the form
($ `expression'), in which case the expression must evaluate to a bag (or a
set), which is bag-summed into the result; or a list of the form
(% `expression1' `expression2') (called a "multi-arg"), which indicates that
the value of `expression1' is bag-summed into the result with multiplicity
given by the value of `expression2'. That is, the multiplicity of each member
of the result bag is the sum of its multiplicities as supplied by each of the
argument subforms.

# COMPARE-SLOTS (OBJ1 OBJ2 &REST ACCESSORS)

A handy macro for writing the bodies of `compare' methods for user classes.
Returns the result of comparing the two objects by comparing the results of
calling each of `accessors', in order, on the objects. Despite the name, an
accessor can actually be any function on the class in question; it can also
be a symbol, which will be used to access the slot via `slot-value'. For
example, if class `frob' has accessor `frob-foo' and slot `bar':
(defmethod compare ((f1 frob) (f2 frob))
(compare-slots f1 f2 #'frob-foo 'bar))
If the symbol `:eql' is supplied as the last accessor, then if the comparisons
by the other supplied accessors all return `:equal' but `obj1' and `obj2' are
not eql, this returns `:unequal'.

# DEF-TUPLE-KEY (NAME &OPTIONAL DEFAULT-FN)

Deprecated; use `define-tuple-key'.

# DEFINE-CROSS-TYPE-COMPARE-METHODS (TYPE)

Generates cross-type comparison methods for `type' against the types on
which the macro has previously been invoked. This macro is intended to be
invoked at the top level of a source file. You should make sure that calls
to this macro are always compiled in the same order; if you don't, you could
possibly get a "master type ordering out of sync" error, at which point you
should delete all your fasls, restart your Lisp session, and recompile.
However, the implementation tries very hard to prevent this.

# DEFINE-TUPLE-KEY (NAME &OPTIONAL DEFAULT-FN)

Defines a tuple key named `name' as a global lexical variable (see `deflex').
If `default-fn' is supplied, it is used to compute a value for lookups where
the tuple has no explicit pair with this key; it is called with one argument,
the tuple.

# DO-BAG ((VALUE-VAR BAG &OPTIONAL VALUE) &BODY BODY)

For each member of `bag', binds `value-var' to it and and executes `body' a
number of times equal to the member's multiplicity. When done, returns `value'.

# DO-BAG-PAIRS ((VALUE-VAR MULT-VAR BAG &OPTIONAL VALUE) &BODY BODY)

For each member of `bag', binds `value-var' and `mult-var' to the member and
its multiplicity respectively, and executes `body'. When done, returns `value'.

# DO-MAP ((KEY-VAR VALUE-VAR MAP &OPTIONAL VALUE) &BODY BODY)

For each pair of `map', binds `key-var' and `value-var' and executes `body'.
When done, returns `value'.

# DO-SEQ ((VAR SEQ &KEY (START NIL START?) (END NIL END?) (FROM-END? NIL FROM-END??) (INDEX NIL INDEX?) (VALUE NIL)) &BODY BODY)

For each element of `seq', possibly restricted by `start' and `end', and in
reverse order if `from-end?' is true, binds `var' to it and executes `body'.
If `index' is supplied, it names a variable that will be bound at each
iteration to the index of the current element of `seq'. When done, returns
`value'.

# DO-SET ((VAR SET &OPTIONAL VALUE) &BODY BODY)

For each member of `set', binds `var' to it and executes `body'. When done,
returns `value'.

# DO-TUPLE ((KEY-VAR VALUE-VAR TUPLE &OPTIONAL VALUE) &BODY BODY)

For each pair of `tuple', binds `key-var' and `value-var' and executes `body'.
When done, returns `value'.

# DYN-TUPLE (&REST ARGS)

Constructs a dyn-tuple according to the supplied argument subforms. Each
argument subform can be a list of the form (`key-expr' `value-expr'), denoting
a mapping from the value of `key-expr' to the value of `value-expr'; or a list
of the form ($ `expression'), in which case the expression must evaluate to a
tuple, denoting all its mappings. The result is constructed from the denoted
mappings in left-to-right order; so if a given key is supplied by more than one
argument subform, its associated value will be given by the rightmost such
subform.

# EXCLUDEF (PLACE &REST ITEM-OR-TUPLE &ENVIRONMENT ENV)

(excludef coll . args) --> (setf coll (less coll . args))

# INCLUDEF (PLACE &REST ITEM-OR-TUPLE &ENVIRONMENT ENV)

(includef coll . args) --> (setf coll (with coll . args))

# MAP (&REST ARGS)

Constructs a map of the default implementation according to the supplied
argument subforms. Each argument subform can be a list of the form (`key-expr'
`value-expr'), denoting a mapping from the value of `key-expr' to the value of
`value-expr'; or a list of the form ($ `expression'), in which case the
expression must evaluate to a map, denoting all its mappings; or the symbol
`:default', in which case the next argument subform is a form whose value will
become the map's default. The result is constructed from the denoted mappings
in left-to-right order; so if a given key is supplied by more than one argument
subform, its associated value will be given by the rightmost such subform.

# POP-FIRST (SEQ &ENVIRONMENT ENV)

Removes the first element from `seq' and returns it.

# POP-LAST (SEQ &ENVIRONMENT ENV)

Removes the last element from `seq' and returns it.

# PUSH-FIRST (PLACE VAL &ENVIRONMENT ENV)

(push-first seq val) --> (setf seq (with-first seq val))

# PUSH-LAST (PLACE VAL &ENVIRONMENT ENV)

(push-last seq val) --> (setf seq (with-last seq val))

# REMOVEF (PLACE &REST ITEM-OR-TUPLE &ENVIRONMENT ENV)

(removef coll . args) --> (setf coll (less coll . args))

# SEQ (&REST ARGS)

Constructs a seq of the default implementation according to the supplied
argument subforms. Each argument subform can be an expression whose value is
to appear in the sequence; or a list of the form ($ `expression'), in which
case the expression must evaluate to a sequence, all of whose values appear in
the result sequence. The order of the result sequence reflects the order of
the argument subforms.

# SET (&REST ARGS)

Constructs a set of the default implementation according to the supplied
argument subforms. Each argument subform can be an expression, whose value
will be a member of the result set; or a list of the form ($ `expression'), in
which case the expression must evaluate to a set, all of whose members become
members of the result set.

# TUPLE (&REST ARGS)

Constructs a tuple of the default implementation according to the supplied
argument subforms. Each argument subform can be a list of the form (`key-expr'
`value-expr'), denoting a mapping from the value of `key-expr' to the value of
`value-expr'; or a list of the form ($ `expression'), in which case the
expression must evaluate to a tuple, denoting all its mappings. The result is
constructed from the denoted mappings in left-to-right order; so if a given key
is supplied by more than one argument subform, its associated value will be
given by the rightmost such subform.

# WB-BAG (&REST ARGS)

Constructs a wb-bag according to the supplied argument subforms. Each
argument subform can be an expression, whose value will be added to the bag
with multiplicity 1; or a list of the form ($ `expression'), in which case the
expression must evaluate to a bag (or a set), which is bag-summed into the
result; or a list of the form (% `expression1' `expression2') (called a
"multi-arg"), which indicates that the value of `expression1' is bag-summed
into the result with multiplicity given by the value of `expression2'. That
is, the multiplicity of each member of the result bag is the sum of its
multiplicities as supplied by each of the argument subforms.

# WB-MAP (&REST ARGS)

Constructs a wb-map according to the supplied argument subforms. Each
argument subform can be a list of the form (`key-expr' `value-expr'), denoting
a mapping from the value of `key-expr' to the value of `value-expr'; or a list
of the form ($ `expression'), in which case the expression must evaluate to a
map, denoting all its mappings; or the symbol `:default', in which case the
next argument subform is a form whose value will become the map's default. The
result is constructed from the denoted mappings in left-to-right order; so if a
given key is supplied by more than one argument subform, its associated value
will be given by the rightmost such subform.

# WB-SEQ (&REST ARGS)

Constructs a wb-seq according to the supplied argument subforms. Each
argument subform can be an expression whose value is to appear in the sequence;
or a list of the form ($ `expression'), in which case the expression must
evaluate to a sequence, all of whose values appear in the result sequence. The
order of the result sequence reflects the order of the argument subforms.

# WB-SET (&REST ARGS)

Constructs a wb-set according to the supplied argument subforms. Each
argument subform can be an expression, whose value will be a member of the
result set; or a list of the form ($ `expression'), in which case the
expression must evaluate to a set, all of whose members become members of the
result set.

# Undocumented

# APPENDF (PLACE SEQ &ENVIRONMENT ENV)

# COMPOSEF (PLACE FN &ENVIRONMENT ENV)

# DO-LIST-RELATION ((TUPLE REL &OPTIONAL VALUE) &BODY BODY)

# IMAGEF (PLACE FN &ENVIRONMENT ENV)

# INTERSECTF (PLACE SET &ENVIRONMENT ENV)

# PREPENDF (PLACE SEQ &ENVIRONMENT ENV)

# UNIONF (PLACE SET &ENVIRONMENT ENV)

# Private

# 2-RELATION (&REST ARGS)

Constructs a 2-relation of the default implementation according to the supplied
argument subforms. Each argument subform can be a list of the form (`key-expr'
`value-expr'), denoting a mapping from the value of `key-expr' to the value of
`value-expr'; or a list of the form ($ `expression'), in which case the
expression must evaluate to a 2-relation, all of whose mappings will be
included in the result.

# COND (&REST CLAUSES)

A generalization of CL:COND that makes it convenient to compute a value in
the predicate expression of a clause and then use that value in the consequent.
If the predicate expression is a LET form, then the scope of the variables bound
by the LET is extended to include the consequent expressions. For example:
(cond ((let ((x (foo)))
(bar x))
(baz x)))
Here the X in (BAZ X) is the one bound to the result of (FOO).

# DO-WB-BAG-TREE-PAIRS ((VAL-VAR COUNT-VAR TREE-FORM &OPTIONAL VALUE-FORM) &BODY BODY)

Iterates over the pairs of the bag, for each one binding `val-var' to the
value and `count-var' to its member count.

# LET (CLAUSES &BODY BODY)

A generalization of CL:LET that better supports nested bindings and multiple
values. Syntax: (let (<clause>*) <body>). The <clause> syntax is more general
than for CL:LET:
<clause> ::= <symbol> ; binds to NIL
| ( <symbol> ) ; likewise
| <clause1>
<clause1> ::= ( <symbol>+ <form> ) ; binding
| ( <clause1>+ ) ; nesting
When a clause begins with more than one variable name, they are to be bound to
successive values of the form. The nesting of clauses indicates sequencing of
bindings; more deeply nested clauses may reference bindings of shallower clauses.
All bindings at a given depth are done in parallel. This allows arbitrary
combinations of parallel and sequential binding. Standard declarations at the
head of BODY are handled correctly, though nonstandard ones may not be. If two
variables of the same name are bound at different levels, any declaration
applies to the inner one.

# WB-2-RELATION (&REST ARGS)

Constructs a wb-2-relation according to the supplied argument subforms.
Each argument subform can be a list of the form (`key-expr' `value-expr'),
denoting a mapping from the value of `key-expr' to the value of `value-expr';
or a list of the form ($ `expression'), in which case the expression must
evaluate to a 2-relation, all of whose mappings will be included in the
result.

# Undocumented

# CHECK-THREE-ARGUMENTS (ARG2? OP TYPE)

# CHECK-TWO-ARGUMENTS (ARG2? OP TYPE)

# DO-2-RELATION ((KEY VAL BR &OPTIONAL VALUE) &BODY BODY)

# DO-TUPLE-INTERNAL ((KEY-VAR VALUE-VAR TUPLE-FORM &OPTIONAL VALUE-FORM) &BODY BODY)

# DO-WB-MAP-TREE-PAIRS ((KEY-VAR VALUE-VAR TREE-FORM &OPTIONAL VALUE-FORM) &BODY BODY)

# DO-WB-SEQ-TREE-MEMBERS ((VAR TREE-FORM &OPTIONAL VALUE-FORM) &BODY BODY)

# DO-WB-SEQ-TREE-MEMBERS-GEN ((VAR TREE-FORM START-FORM END-FORM FROM-END-FORM &OPTIONAL VALUE-FORM) &BODY BODY)

# DO-WB-SET-TREE-MEMBERS ((VAR TREE-FORM &OPTIONAL VALUE-FORM) &BODY BODY)

# GEN (OP &REST ARGS)

# LENGTH-NV (X)

# READ-MEMORY-BARRIER

# TUPLE-WINDOW-SIZE (NKEYS*2)

# WHILE (PRED &BODY BODY)

# WITH-LOCK ((LOCK &KEY (WAIT? T)) &BODY BODY)

# WRITE-MEMORY-BARRIER

# GENERIC-FUNCTION

# Public

# ARB (COLLECTION)

Returns an arbitrary member or pair of a set, bag, or map. Specifically,
on a nonempty set, returns two values, an arbitrary member of the set and
true; on a nonempty bag, returns an arbitrary member, its multiplicity,
and true; on a nonempty map, returns an arbitrary domain member, its
associated value, and true. On an empty set, bag, or map, returns false for
all values. Please note that "arbitrary" does not mean "randomly selected";
it simply means that the sole postcondition is that the returned value or pair
is a member of the collection.

# ARITY (REL)

Returns the arity of the relation `rel'.

# BAG-DIFFERENCE (BAG1 BAG2)

Returns a bag whose multiplicity, for any value, is its multiplicity
in `bag1' less that in `bag2', but of course not less than zero.

# BAG-PRODUCT (BAG1 BAG2)

Returns a bag whose multiplicity, for any value, is the product of
its multiplicities in the two argument bags.

# BAG-SUM (BAG1 BAG2)

Returns a bag whose multiplicity, for any value, is the sum of its
multiplicities in the two argument bags.

# COMPARE (X Y)

Returns one of `:less', `:greater', `:equal', or `:unequal' according as `x'
is less than, greater than, or equal to `y', or none of these. While the
ordering does not have to be total, it must be consistent: for two values
A and B that compare `:unequal' to each other, for any third value C, if A
compares `:less' or `:greater' to C, then B must compare to C the same way;
and no more than one of A and B can compare `:equal' to C.

# COMPARE-LEXICOGRAPHICALLY (A B)

Returns the result of a lexicographic comparison of `a' and `b', which
can be strings, vectors, lists, or seqs.

# COMPLEMENT (SET)

Returns the complement of the set.

# COMPOSE (MAP1 MAP2-OR-FN)

Returns a new map with the same domain as `map1', which maps each member
of that domain to the result of applying first `map1' to it, then applying
`map2-or-fn' to the result. `map2-or-fn' can also be a sequence, which is
treated as a map from indices to members.

# CONCAT (SEQ1 &REST SEQS)

Returns the concatenation of `seq1' with each of `seqs'.

# CONFLICTS (2-RELATION)

Returns a 2-relation containing only those pairs of `2-relation' whose domain value
is mapped to multiple range values.

# CONTAINS? (COLLECTION X)

Returns true iff the set or bag contains `x'.

# CONVERT (TO-TYPE COLLECTION &KEY FROM-TYPE (PAIR-FN #'CONS) (VALUE-FN #'CDR) (KEY-FN #'CAR) &ALLOW-OTHER-KEYS)

Converts the collection to the specified type. Some methods may
take additional keyword arguments to further specify the kind of conversion.

# COUNT (ITEM COLLECTION &KEY KEY TEST FROM-END END START TEST-NOT)

If `collection' is a Lisp sequence, this simply calls `cl:count'. On an FSet
collection, the default for `test' is `equal?'; the `:test-not' keyword is not
accepted; and the `:start', `:end', and `:from-end' keywords are accepted only
if `collection' is a seq. Also, on a map, this scans the domain.

# COUNT-IF (PRED COLLECTION &KEY KEY FROM-END END START)

If `collection' is a Lisp sequence, this simply calls `cl:count-if'. On an
FSet collection, the `:start', `:end', and `:from-end' keywords are accepted
only if `collection' is a seq. Also, on a map, this scans the domain.

# COUNT-IF-NOT (PRED COLLECTION &KEY KEY FROM-END END START)

If `collection' is a Lisp sequence, this simply calls `cl:count-if-not'.
On an FSet collection, the `:start', `:end', and `:from-end' keywords are
accepted only if `collection' is a seq. Also, on a map, this scans the domain.

# DISJOINT? (SET1 SET2)

Returns true iff `set1' and `set2' have a null intersection (without
actually constructing said intersection).

# DOMAIN (MAP)

Returns the domain of the map, that is, the set of keys mapped by the map.

# DOMAIN-CONTAINS? (COLLECTION X)

Returns true iff the domain of the map or seq contains `x'. (The domain
of a seq is the set of valid indices.)

# EMPTY? (COLLECTION)

Returns true iff the collection is empty.

# FILTER (FN COLLECTION)

Returns a new collection containing those members or pairs of `collection'
for which `fn' returns true. If `collection' is a set, bag, or seq, `fn' is
called with one argument; if a map, `fn' is called with two arguments, the key
and the value (the map-default of the result is that of `collection'). As well
as a Lisp function, `fn' can be a map, or a set (which is treated as mapping
its members to true and everything else to false).

# FILTER-PAIRS (FN COLLECTION)

Just like `filter' except that if invoked on a bag, `fn' (which must be a
Lisp function) is called with two arguments for each pair, the member and the
multiplicity.

# FIND (ITEM COLLECTION &KEY KEY TEST FROM-END END START TEST-NOT)

If `collection' is a Lisp sequence, this simply calls `cl:find'. On an FSet
collection, the default for `test' is `equal?'; the `:test-not' keyword is not
accepted; and the `:start', `:end', and `:from-end' keywords are accepted only
if `collection' is a seq. Also, on a map, this scans the domain; on success,
it returns the corresponding range element as the second value.

# FIND-IF (PRED COLLECTION &KEY KEY FROM-END END START)

If `collection' is a Lisp sequence, this simply calls `cl:find-if'. On an
FSet collection, the `:start', `:end', and `:from-end' keywords are accepted
only if `collection' is a seq. Also, on a map, this scans the domain; on
success, it returns the corresponding range element as the second value.

# FIND-IF-NOT (PRED COLLECTION &KEY KEY FROM-END END START)

If `collection' is a Lisp sequence, this simply calls `cl:find-if-not'.
On an FSet collection, the `:start', `:end', and `:from-end' keywords are
accepted only if `collection' is a seq. Also, on a map, this scans the domain;
on success, it returns the corresponding range element as the second value.

# FIRST (SEQ)

Returns the first element of `seq', i.e., element 0. This has a back-
compatibility method for lists, and adds one for CL sequences generally.

# GREATEST (COLLECTION)

On a set, returns two values: the greatest member of the set and
true; on a bag, returns three values: the greatest member of the bag, its
multiplicity, and true; on a map, also returns three values: the greatest key
of the map, its value, and true. If there is not a unique greatest member,
chooses one of the greatest members arbitrarily. Returns `nil' if the
collection is empty.

# IMAGE (FN COLLECTION)

Returns a new collection containing the result of applying `fn' to each
member of `collection', which may be a set, bag, or seq. In the bag case,
the multiplicity of each member of the result is the sum of the multiplicities
of the values that `fn' maps to it. As well as a Lisp function, `fn' can be a
map, or a set (which is treated as mapping its members to true and everything
else to false). `collection' can also be a map, in which case `fn' must be a
Lisp function of two arguments that returns two values (the map-default of the
result is that of `collection'); also see `compose'.

# INSERT (SEQ IDX VAL)

Returns a new sequence like `seq' but with `val' inserted at `idx' (the seq
is extended in either direction if needed prior to the insertion; previously
uninitialized indices are filled with the seq's default).

# INTERSECTION (SET-OR-BAG1 SET-OR-BAG2 &KEY TEST TEST-NOT)

Returns the intersection of the two sets/bags. The result is a bag
if both arguments are bags; otherwise a set. The intersection of two bags
is the bag whose multiplicity, for any value, is the minimum of its
multiplicities in the two argument bags.

# INVERSE (2-RELATION)

The inverse of a binary relation.

# ITERATOR (COLLECTION &KEY PAIRS?)

Returns an iterator for the collection. (These are stateful iterators and
are not thread-safe; if you want a pure iterator, your best bet is to `convert'
the collection to a list.) The iterator is a closure of one argument; given
`:done?', it returns true iff the iterator is exhausted; given `:more?', it
returns true iff the iterator is _not_ exhausted. Given `:get', if the iterator
is not exhausted, it returns the next element (or pair, for a map, as two values),
with the second value (third, for a map) being true, and advances one element; if
it is exhausted, it returns two `nil' values (three, for a map).

# JOIN (RELATION-A COLUMN-A RELATION-B COLUMN-B)

A relational equijoin, matching up `column-a' of `relation-a' with `column-b' of
`relation-b'. For a binary relation, the columns are named 0 (domain) and 1 (range).

# LAST (SEQ)

Returns the last element of `seq', i.e., element `(1- (size seq))'. This
has methods for CL lists and sequences that are NOT COMPATIBLE with `cl:last'.
FSet exports `lastcons' as an arguably better name for the functionality of
`cl:last'.

# LEAST (COLLECTION)

On a set, returns two values: the smallest member of the set and
true; on a bag, returns three values: the smallest member of the bag, its
multiplicity, and true; on a map, also returns three values: the smallest key
of the map, its value, and true. If there is not a unique smallest member,
chooses one of the smallest members arbitrarily. Returns `nil' if the
collection is empty.

# LESS (COLLECTION VALUE1 &OPTIONAL VALUE2)

On a set, removes `value1' from it if present, returning the updated set.
On a bag, removes `value2' occurrences of `value1' if present, returning the
updated bag; `value2' defaults to 1. On a map, removes the pair whose key is
`value1', if present, returning the updated map. On a seq, removes the element
at index `value1', if that index is in bounds, and shifts subsequent elements
down, returning the updated seq.

# LESS-FIRST (SEQ)

Returns the subsequence of `seq' from element 1 through the end.

# LESS-LAST (SEQ)

Returns the subsequence of `seq' from element 0 through the next-to-last
element.

# LOOKUP (COLLECTION KEY)

If `collection' is a map, returns the value to which `key' is mapped.
If `collection' is a seq, takes `key' as an index and returns the
corresponding member (0-origin, of course). If `collection' is a set or
bag that contains a member equal to `key', returns true and the member
as two values, else false and `nil'; this is useful for canonicalization.

# LOOKUP-INV (2-RELATION Y)

Does an inverse lookup on a binary relation.

# MAP-DIFFERENCE-2 (MAP1 MAP2)

Returns, as two values: a map containing all the pairs that are in `map1'
but not `map2', with the same default as `map1'; and one containing all the
pairs that are in `map2' but not `map1', with the same default as `map2'.

# MAP-INTERSECTION (MAP1 MAP2 &OPTIONAL VAL-FN)

Returns a map containing all the keys that are in the domains of both
`map1' and `map2', where the value for each key is the result of calling
`val-fn' on the value from `map1' and the value from `map2'. `val-fn'
defaults to simply returning its second argument, so the entries in `map2'
simply shadow those in `map1'. The default for the new map is the result
of calling `val-fn' on the defaults for the two maps (so be sure it can
take these values).

# MAP-UNION (MAP1 MAP2 &OPTIONAL VAL-FN)

Returns a map containing all the keys of `map1' and `map2', where the
value for each key contained in only one map is the value from that map, and
the value for each key contained in both maps is the result of calling
`val-fn' on the value from `map1' and the value from `map2'. `val-fn'
defaults to simply returning its second argument, so the entries in `map2'
simply shadow those in `map1'. The default for the new map is the result of
calling `val-fn' on the defaults for the two maps (so be sure it can take
these values).

# MULTIPLICITY (BAG X)

Returns the multiplicity of `x' in the bag.

# PARTITION (PRED COLLECTION)

Returns two values, (filter fn collection) and
(filter (cl:complement fn) collection).

# POSITION (ITEM COLLECTION &KEY KEY TEST START END FROM-END TEST-NOT)

If `collection' is a Lisp sequence, this simply calls `cl:position'. On an
FSet seq, the default for `test' is `equal?', and the `:test-not' keyword is
not accepted.

# POSITION-IF (PRED COLLECTION &KEY KEY START END FROM-END)

If `collection' is a Lisp sequence, this simply calls `cl:position-if'.
Also works on an FSet seq.

# POSITION-IF-NOT (PRED COLLECTION &KEY KEY START END FROM-END)

If `collection' is a Lisp sequence, this simply calls `cl:position-if-not'.
Also works on an FSet seq.

# QUERY (RELATION PATTERN METAPATTERN)

Along with the relation, takes two lists, each of length equal to the
arity, called the `pattern' and `metapattern'; returns a set of tuples
satisfying the query. For each position, if the metapattern contains `nil',
the query is not constrained by that position (the corresponding position in
the pattern is ignored); if the metapattern contains `t' or `:single', then
the result set contains only those tuples with the same value in that
position as the pattern has. The difference between `t' and `:single' has
to do with indexing. For each metapattern that is actually used, an index
is constructed if not previously present, and then is maintained
incrementally. If the metapattern has `t' in a location, the resulting
index will contain all values for that location; if it has `:single', the
resulting index will contain only those values that have actually appeared
in a query pattern with this metapattern.

# QUERY-MULTI (REL PATTERN METAPATTERN)

Like `query' (q.v.), except that `pattern' is a list of sets of values
rather than a list of values. Returns all tuples in the relation for which
each value is a member of the corresponding set in the pattern. `:single'
in the metapattern is not accepted.

# RANGE (MAP)

Returns the range of the map, that is, the set of all values to which keys
are mapped by the map.

# RANGE-CONTAINS? (COLLECTION X)

Returns true iff the range of the map or seq contains `x'. (The range
of a seq is the set of members.) Note that this requires a linear search.

# REDUCE (FN COLLECTION &KEY KEY INITIAL-VALUE FROM-END END START)

If `collection' is a Lisp sequence, this simply calls `cl:reduce' (q.v.).
On an FSet collection, the `:start', `:end', and `:from-end' keywords are
accepted only if `collection' is a seq.

# REMOVE (ITEM COLLECTION &KEY KEY TEST COUNT FROM-END END START)

If `collection' is a Lisp sequence, this simply calls `cl:remove'. On an
FSet seq, the default for `test' is `equal?', and the `:test-not' keyword is
not accepted.

# REMOVE-IF (PRED COLLECTION &KEY KEY COUNT FROM-END END START)

If `collection' is a Lisp sequence, this simply calls `cl:remove-if'.
Also works on an FSet seq; but see `filter'.

# REMOVE-IF-NOT (PRED COLLECTION &KEY KEY COUNT FROM-END END START)

If `collection' is a Lisp sequence, this simply calls `cl:remove-if-not'.
Also works on an FSet seq; but see `filter'.

# RESTRICT (MAP SET)

Returns a map containing only those pairs of `map' whose keys are
also in `set'.

# RESTRICT-NOT (MAP SET)

Returns a map containing only those pairs of `map' whose keys are
not in `set'.

# REVERSE (SEQ)

Returns `seq' in reverse order.

# SET-DIFFERENCE (SET1 SET2 &KEY TEST TEST-NOT)

Returns the set difference of set1 and set2, i.e., the set containing
every member of `set1' that is not in `set2'.

# SET-DIFFERENCE-2 (SET1 SET2)

Returns `set1 - set2' and `set2 - set1' as two values.

# SET-SIZE (BAG)

Returns the number of unique members in the bag.

# SIZE (COLLECTION)

Returns the number of members in a set, seq, or bag, or the number of
pairs in a map. The size of a bag is the sum of the multiplicities.

# SORT (SEQ PRED &KEY KEY)

Returns `seq' sorted by `pred', a function of two arguments; if `key' is
supplied, it is a function of one argument that is applied to the elements of
`seq' before they are passed to `pred'. The sort is not guaranteed to be
stable. The method for CL sequences copies the sequence first, unlike
`cl:sort'.

# SPLICE (SEQ IDX SUBSEQ)

Returns a new sequence like `seq' but with the elements of `subseq' inserted
at `idx' (the seq is extended in either direction if needed prior to the insertion;
previously uninitialized indices are filled with the seq's default).

# STABLE-SORT (SEQ PRED &KEY KEY)

Returns `seq' sorted by `pred', a function of two arguments; if `key' is
supplied, it is a function of one argument that is applied to the elements of
`seq' before they are passed to `pred'. The sort is guaranteed to be stable.
The method for CL sequences copies the sequence first, unlike `cl:stable-sort'.

# SUBBAG? (SUB SUPER)

Returns true iff `sub' is a subbag of `super', that is, for every
member of `sub', `super' contains the same value with at least the same
multiplicity.

# SUBSEQ (SEQ START &OPTIONAL END)

Returns the subsequence of `seq' from `start' (inclusive) to `end' (exclusive),
where `end' defaults to `(size seq)'.

# SUBSET? (SUB SUPER)

Returns true iff `sub' is a subset of `super'.

# SUBSTITUTE (NEWITEM OLDITEM COLLECTION &KEY KEY COUNT FROM-END END START TEST)

If `collection' is a Lisp sequence, this simply calls `cl:substitute'. On
an FSet seq, the default for `test' is `equal?', and the `:test-not' keyword
is not accepted.

# SUBSTITUTE-IF (NEWITEM PRED COLLECTION &KEY KEY COUNT FROM-END END START)

If `collection' is a Lisp sequence, this simply calls `cl:substitute-if'.
Also works on an FSet seq.

# SUBSTITUTE-IF-NOT (NEWITEM PRED COLLECTION &KEY KEY COUNT FROM-END END START)

If `collection' is a Lisp sequence, this simply calls `cl:substitute-if-not'.
Also works on an FSet seq.

# TUPLE-MERGE (TUPLE1 TUPLE2 &OPTIONAL VAL-FN)

Returns a new tuple containing all the keys of `tuple1' and `tuple2',
where the value for each key contained in only one tuple is the value from
that tuple, and the value for each key contained in both tuples is the result
of calling `val-fn' on the value from `tuple1' and the value from `tuple2'.
`val-fn' defaults to simply returning its third argument, so the entries in
`tuple2' simply shadow those in `tuple1'.

# UNION (SET-OR-BAG1 SET-OR-BAG2 &KEY TEST TEST-NOT)

Returns the union of the two sets/bags. The result is a set if both
arguments are sets; otherwise a bag. The union of two bags is a bag whose
multiplicity, for any value, is the maximum of its multiplicities in the
two argument bags.

# WITH (COLLECTION VALUE1 &OPTIONAL VALUE2)

On a set, adds `value1' to it, returning the updated set. On a bag, adds
`value2' occurrences of `value1', returning the updated bag; `value2' defaults
to 1. On a map, adds a mapping from `value1' (the key) to `value2', returning
the updated map. On a seq, replaces the element at index `value1' with
`value2', returning the updated seq (the seq is extended in either direction
if needed; previously uninitialized indices are filled with the seq's default).

# WITH-DEFAULT (COLLECTION NEW-DEFAULT)

Returns a new map or seq with the same contents as `collection' but whose
default is now `new-default'.

# WITH-FIRST (SEQ VAL)

Returns `seq' with `val' prepended, that is, `val' is element 0 of the
result, and the elements of `seq' appear starting at index 1.

# WITH-LAST (SEQ VAL)

Returns `seq' with `val' appended, that is, `val' is element `(size seq)'
of the result.

# Undocumented

# ALL-QUERIES (REG)

# FORWARD-KEY (REG FROM-KEY TO-KEY)

# LESS-QUERY (REG PATTERN METAPATTERN QUERY)

# LOOKUP-MULTI (REG SET-TUPLE)

# LOOKUP-MULTI-RESTRICTED (REG SET-TUPLE KEYS)

# LOOKUP-RESTRICTED (REG TUPLE KEY)

# SPLIT-ABOVE (S VALUE)

# SPLIT-BELOW (S VALUE)

# SPLIT-FROM (S VALUE)

# SPLIT-THROUGH (S VALUE)

# WITH-QUERY (REG PATTERN METAPATTERN QUERY)

# Private

# AT-RANK (COLLECTION RANK)

On a set, returns the element with rank `rank'; on a bag, returns
that element with its multiplicity as a second value; on a map, returns
the pair with that rank as two values. Note that if there are values/keys
that are unequal but equivalent in the collection, an arbitrary order will be
imposed on them for this purpose; but another collection that is `equal?'
but not `eq' to this one will in general order them differently.

# DEFAULT (COLLECTION)

Returns the default for the map or seq, i.e., the value returned by `lookup'
when the supplied key or index is not in the domain.

# INTERNAL-DO-BAG-PAIRS (BAG ELT-FN VALUE-FN)

Calls `elt-fn' on successive pairs of the bag (the second argument is
the multiplicity); when done, calls `value-fn' on no arguments and returns the
result(s). This is called by `do-bag' to provide for the possibility of
different bag implementations; it is not for public use. `elt-fn' and
`value-fn' must be function objects, not symbols.

# INTERNAL-DO-MAP (MAP ELT-FN VALUE-FN)

Calls `elt-fn' on successive pairs of the map (as two arguments); when done,
calls `value-fn' on no arguments and returns the result(s). This is called by
`do-map' to provide for the possibility of different map implementations; it
is not for public use. `elt-fn' and `value-fn' must be function objects, not
symbols.

# INTERNAL-DO-SEQ (SEQ ELT-FN VALUE-FN INDEX? &KEY START END FROM-END? (START 0) (END (WB-SEQ-TREE-SIZE (WB-SEQ-CONTENTS S))))

Calls `elt-fn' on successive elements of `seq', possibly restricted by
`start' and `end', and in reverse order if `from-end?' is true. When done,
calls `value-fn' on no arguments and returns the result(s). This is called
by `do-seq' to provide for the possibility of different seq implementations;
it is not for public use. `elt-fn' and `value-fn' must be function objects,
not symbols.

# INTERNAL-DO-SET (SET ELT-FN VALUE-FN)

Calls `elt-fn' on successive elements of the set; when done, calls `value-fn'
on no arguments and returns the result(s). This is called by `do-set' to provide
for the possibility of different set implementations; it is not for public use.
`elt-fn' and `value-fn' must be function objects, not symbols.

# INTERNAL-DO-TUPLE (TUPLE ELT-FN VALUE-FN)

Calls `elt-fn' on successive pairs of the tuple (as two arguments); when done,
calls `value-fn' on no arguments and returns the result(s). This is called by
`do-tuple' to provide for the possibility of different tuple implementations;
it is not for public use. `elt-fn' and `value-fn' must be function objects,
not symbols.

# RANK (COLLECTION VALUE)

If `collection' is a set or bag that contains `value', returns the rank of
`value' in the ordering defined by `compare', and a true second value. If
`collection' is a map whose domain contains `value', returns the rank of
`value' in the domain of the map, and a true second value. If `value' is not
in the collection, the second value is false, and the first value is the rank
of the least member of the collection greater than `value' (if any; otherwise
the size (for a bag, the set-size) of the collection). Note that if there are
values/keys that are unequal but equivalent to `value', an arbitrary order
will be imposed on them for this purpose; but another collection that is
`equal?' but not `eq' to this one will in general order them differently.
Also, on a bag, multiplicities are ignored for this purpose.

# TRANSITIVE-CLOSURE (2-RELATION SET)

The transitive closure of the set over the relation. The relation may
also be supplied as a function returning a set.

# Undocumented

# CARTESIAN-PRODUCT (SETS)

# INTERNAL-DO-2-RELATION (BR ELT-FN VALUE-FN)

# INTERNAL-DO-LIST-RELATION (REL ELT-FN VALUE-FN)

# LESS-INTERVAL (INTERVAL-SET LOWER UPPER LOWER-CLOSED? UPPER-CLOSED?)

# VERIFY (COLL)

# WITH-INTERVAL (INTERVAL-SET LOWER UPPER LOWER-CLOSED? UPPER-CLOSED?)

# SLOT-ACCESSOR

# Private

# Undocumented

# SERIAL-NUMBER (OBJECT)

# SETFSERIAL-NUMBER (NEW-VALUE OBJECT)

# VARIABLE

# Public

# *FSET-READTABLE*

A copy of the standard readtable with FSet reader macros installed.

# Private

# *FSET-REREADING-READTABLE*

A copy of the standard readtable with the rereading FSet reader macros
installed. This readtable can be used to read structure printed by the FSet
print functions.

# +MASTER-TYPE-ORDERING+

Keeps track of the types for which explicit cross-comparison methods have
been generated, and against which subsequent such methods will be generated.
This is a list in reverse order.

# +PACKAGE-ORIGINAL-NAME+

FSet uses this to protect itself from the effects of `rename-package',
which could otherwise change the ordering of packages, and thus of symbols,
and thus of types named by those symbols.

# +TUPLE-RANDOM-VALUE+

State for an extremely fast, low-quality generator of small numbers of
pseudorandom bits. Yep, this is about as quick-and-dirty as it gets --
we just increment this value by some small prime like 5 each time. We
don't worry about locking it, either.

# TUPLE-REORDER-SCORE-THRESHOLD

The reorder score that triggers a major reordering.

# Undocumented

# *EMPTY-WB-2-RELATION*

# *EMPTY-WB-BAG*

# *EMPTY-WB-MAP*

# *EMPTY-WB-SEQ*

# *EMPTY-WB-SET*

# *MEMORY-BARRIER-LOCK*

# *WB-TREE-MAX-STRING-LENGTH*

# *WB-TREE-MAX-VECTOR-LENGTH*

# +K0+

# +K1+

# +K2+

# +K3+

# +K4+

# +K5+

# +K6+

# +K7+

# +K8+

# +K9+

# +TUPLE-DESC-NEXT-SERIAL-NUMBER+

# +TUPLE-DESC-NEXT-SERIAL-NUMBER-LOCK+

# +TUPLE-DESCRIPTOR-MAP+

# +TUPLE-KEY-LOCK+

# +TUPLE-KEY-NAME-MAP+

# +TUPLE-KEY-SEQ+

# +WB-TREE-MAX-DEPTHS-WITH-VALUES+

# +WB-TREE-MAX-DEPTHS-WITHOUT-VALUES+

# TUPLE-KEYS

# CLASS

# Public

# BAG (&REST ARGS)

The abstract class for FSet functional bags (multisets). It is a structure
class.

# BOUNDED-SET

A "bounded set" is a subset (not necessarily proper) of a specified set,
called the "universe". (Topologically, it is a set in the discrete topology
on the universe.)

# COLLECTION

The root class of the FSet functional collections hierarchy. It is a
structure class.

# DYN-TUPLE (&REST ARGS)

A class of functional tuples represented as vectors with dynamically-
reordered key vectors. This is the default implementation of tuples in FSet.

# IDENTITY-ORDERING-MIXIN

A mixin class for classes whose instances will be used in FSet collections,
and for which the appropriate equivalence relation is identity (`eq').
This is the right choice for the vast majority of mutable classes.

# LIST-RELATION

The abstract class for FSet list relations. It is a structure class.
A list relation is a general relation (i.e. of arbitrary arity >= 2) whose
tuples are in list form.

# MAP (&REST ARGS)

The abstract class for FSet functional maps. It is a structure class.

# RELATION

The abstract class for FSet relations. It is a structure class.

# SEQ (&REST ARGS)

The abstract class for FSet functional seqs (sequences, but we use the short
name to avoid confusion with `cl:sequence'). It is a structure class.

# SET (&REST ARGS)

The abstract class for FSet functional sets. It is a structure class.

# TUPLE (&REST ARGS)

The abstract class for FSet functional tuples. It is a structure class.

# WB-BAG (&REST ARGS)

A class of functional bags (multisets) represented as weight-balanced binary
trees. This is the default implementation of bags in FSet.

# WB-LIST-RELATION

A class of functional relations of arbitrary arity >= 2, whose tuples
are in list form.

# WB-MAP (&REST ARGS)

A class of functional maps represented as weight-balanced binary trees. This is
the default implementation of maps in FSet.

# WB-SEQ (&REST ARGS)

A class of functional seqs (sequences, but we use the short name to avoid
confusion with `cl:sequence') represented as weight-balanced binary trees.
This is the default implementation of seqs in FSet.

# WB-SET (&REST ARGS)

A class of functional sets represented as weight-balanced binary trees. This is
the default implementation of sets in FSet.

# Undocumented

# QUERY-REGISTRY

# Private

# 2-RELATION (&REST ARGS)

The abstract class for FSet binary relations. It is a structure class.

# COMPLEMENT-SET

A "complement set" is the complement of an ordinary set. It's infinite, so
it can't be enumerated as is. But its complement is ordinary, of course, as is
its intersection with an ordinary set, and the difference of it and another
complement set.

# WB-2-RELATION (&REST ARGS)

A class of functional binary relations represented as pairs of weight-
balanced binary trees. This is the default implementation of binary relations
in FSet. The inverse is constructed lazily, and maintained thereafter.

# Undocumented

# EQUIVALENT-BAG

# EQUIVALENT-MAP

# EQUIVALENT-SET

# INTERVAL

# INTERVAL-SET

# MY-INTEGER

# TUPLE-DESC

# TUPLE-KEY

# WB-BAG-TREE-NODE

# WB-MAP-TREE-NODE

# WB-SEQ-TREE-NODE

# WB-SET-TREE-NODE

# CONDITION

# Private

# Undocumented

# SIMPLE-PROGRAM-ERROR

# CONSTANT

# Private

# TUPLE-KEY-NUMBER-SIZE

This limits the number of tuple-keys that can exist in a session.

# TUPLE-REORDER-FREQUENCY

Controls how often we do tuple reordering. Must be 2^n - 1 for some n.

# TUPLE-VALUE-INDEX-SIZE

This limits the number of key/value pairs in any tuple.