The fset Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The fset Reference Manual

This is the fset Reference Manual, version 1.3.2, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:48:16 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Introduction

FSet is a functional set-theoretic collections library. Functional means that all update operations return a new collection rather than modifying an existing one in place. Set-theoretic means that collections may be nested arbitrarily with no additional programmer effort; for instance, sets may contain sets, maps may be keyed by sets, etc.

The FSet home page explains why I chose functional semantics for FSet.

To get started using FSet, check out the FSet Tutorial. Once you've gone through that, I recommend the FSet/CL page, which explains how FSet is integrated into Common Lisp.

For more details, see the FSet project page.

There might be some useful information on the FSet CLiki page.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 fset

Author

Scott L. Burson <Scott@ergy.com>

License

LLGPL

Description

A functional set-theoretic collections library. See: http://www.ergy.com/FSet.html

Version

1.3.2

Dependencies
Source

fset.asd (file)

Component

code (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 fset/Code

Parent

fset (system)

Location

Code/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 fset.asd

Location

fset.asd

Systems

fset (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 fset/Code/defs.lisp

Parent

code (module)

Location

Code/defs.lisp

Packages

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 fset/Code/port.lisp

Dependency

defs.lisp (file)

Parent

code (module)

Location

Code/port.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.4 fset/Code/order.lisp

Dependency

port.lisp (file)

Parent

code (module)

Location

Code/order.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.5 fset/Code/wb-trees.lisp

Dependency

order.lisp (file)

Parent

code (module)

Location

Code/wb-trees.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.6 fset/Code/fset.lisp

Dependency

wb-trees.lisp (file)

Parent

code (module)

Location

Code/fset.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.7 fset/Code/tuples.lisp

Dependency

fset.lisp (file)

Parent

code (module)

Location

Code/tuples.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.8 fset/Code/reader.lisp

Dependency

tuples.lisp (file)

Parent

code (module)

Location

Code/reader.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.9 fset/Code/testing.lisp

Dependency

reader.lisp (file)

Parent

code (module)

Location

Code/testing.lisp

Exported Definitions

compare (method)

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.10 fset/Code/interval.lisp

Dependency

testing.lisp (file)

Parent

code (module)

Location

Code/interval.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.11 fset/Code/relations.lisp

Dependency

interval.lisp (file)

Parent

code (module)

Location

Code/relations.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.12 fset/Code/complement-sets.lisp

Dependency

relations.lisp (file)

Parent

code (module)

Location

Code/complement-sets.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

4.1.13 fset/Code/bounded-sets.lisp

Dependency

complement-sets.lisp (file)

Parent

code (module)

Location

Code/bounded-sets.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

5.1 fset-user

Source

defs.lisp (file)

Use List

Previous: , Up: Packages   [Contents][Index]

5.2 fset

Source

defs.lisp (file)

Use List
Used By List

fset-user

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Special variables

Special Variable: *fset-readtable*

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

Package

fset

Source

reader.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Macros

Macro: 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. Also, each of ’key-expr’ and ’value-expr’ can be of the form ($ ‘expression’), in which case the expression must evaluate to a set, and the elements of the set are used individually to form pairs; for example, the result of

(2-relation (($ (set 1 2)) ($ (set ’a ’b))))

contains the pairs <1, a>, <1, b>, <2, a>, and <2, b>.

Package

fset

Source

relations.lisp (file)

Macro: @ 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.

Package

fset

Source

fset.lisp (file)

Setf Expander

(setf @) (setf expander)

Setf Expander: (setf @) COLLECTION KEY

Adds a pair to a map or updates an existing pair, or adds an element to a sequence or updates an existing element. This does NOT modify the map or sequence; it modifies the place (generalized variable) HOLDING the map or sequence (just like ‘(setf (ldb ...) ...)’). That is, the ‘collection’ subform must be ‘setf’able itself.

Package

fset

Source

fset.lisp (file)

Reader

@ (macro)

Macro: adjoinf PLACE &rest ITEM-OR-TUPLE

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

Package

fset

Source

fset.lisp (file)

Macro: appendf PLACE SEQ
Package

fset

Source

fset.lisp (file)

Macro: 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.

Package

fset

Source

reader.lisp (file)

Macro: 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’.

Package

fset

Source

order.lisp (file)

Macro: composef PLACE FN
Package

fset

Source

fset.lisp (file)

Macro: def-tuple-key NAME &optional DEFAULT-FN

Deprecated; use ‘define-tuple-key’.

Package

fset

Source

tuples.lisp (file)

Macro: 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.

Package

fset

Source

order.lisp (file)

Macro: 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.

Package

fset

Source

tuples.lisp (file)

Macro: do-2-relation (KEY VAL BR &optional VALUE) &body BODY

Enumerates all pairs of the relation ‘br’, binding them successively to ‘key’ and ‘val’ and executing ‘body’.

Package

fset

Source

relations.lisp (file)

Macro: 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’.

Package

fset

Source

fset.lisp (file)

Macro: 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’.

Package

fset

Source

fset.lisp (file)

Macro: do-list-relation (TUPLE REL &optional VALUE) &body BODY
Package

fset

Source

relations.lisp (file)

Macro: 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’.

Package

fset

Source

fset.lisp (file)

Macro: do-map-domain (KEY-VAR MAP &optional VALUE) &body BODY

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

Package

fset

Source

fset.lisp (file)

Macro: do-seq (VAR SEQ &key START END FROM-END? INDEX VALUE) &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’.

Package

fset

Source

fset.lisp (file)

Macro: do-set (VAR SET &optional VALUE) &body BODY

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

Package

fset

Source

fset.lisp (file)

Macro: 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’.

Package

fset

Source

tuples.lisp (file)

Macro: 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.

Package

fset

Source

reader.lisp (file)

Macro: excludef PLACE &rest ITEM-OR-TUPLE

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

Package

fset

Source

fset.lisp (file)

Macro: imagef PLACE FN
Package

fset

Source

fset.lisp (file)

Macro: includef PLACE &rest ITEM-OR-TUPLE

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

Package

fset

Source

fset.lisp (file)

Macro: intersectf PLACE SET
Package

fset

Source

fset.lisp (file)

Macro: 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.

Package

fset

Source

reader.lisp (file)

Macro: pop-first SEQ

Removes the first element from ‘seq’ and returns it.

Package

fset

Source

fset.lisp (file)

Macro: pop-last SEQ

Removes the last element from ‘seq’ and returns it.

Package

fset

Source

fset.lisp (file)

Macro: prependf PLACE SEQ
Package

fset

Source

fset.lisp (file)

Macro: push-first PLACE VAL

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

Package

fset

Source

fset.lisp (file)

Macro: push-last PLACE VAL

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

Package

fset

Source

fset.lisp (file)

Macro: removef PLACE &rest ITEM-OR-TUPLE

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

Package

fset

Source

fset.lisp (file)

Macro: 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.

Package

fset

Source

reader.lisp (file)

Macro: 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.

Package

fset

Source

reader.lisp (file)

Macro: 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.

Package

fset

Source

reader.lisp (file)

Macro: unionf PLACE SET
Package

fset

Source

fset.lisp (file)

Macro: 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. Also, each of ’key-expr’ and ’value-expr’ can be of the
form ($ ‘expression’), in which case the expression must evaluate to a set, and the elements of the set are used individually to form pairs; for example, the result of

(wb-2-relation (($ (set 1 2)) ($ (set ’a ’b))))

contains the pairs <1, a>, <1, b>, <2, a>, and <2, b>.

Package

fset

Source

relations.lisp (file)

Macro: 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.

Package

fset

Source

reader.lisp (file)

Macro: 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.

Package

fset

Source

reader.lisp (file)

Macro: 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.

Package

fset

Source

reader.lisp (file)

Macro: 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.

Package

fset

Source

reader.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.3 Functions

Function: bag? OBJECT
Package

fset

Source

order.lisp (file)

Function: bounded-set-contents BS
Package

fset

Source

bounded-sets.lisp (file)

Function: collection? OBJECT
Package

fset

Source

order.lisp (file)

Function: empty-2-relation ()
Package

fset

Source

relations.lisp (file)

Function: empty-bag ()

Returns an empty bag of the default implementation.

Package

fset

Source

fset.lisp (file)

Function: empty-dyn-tuple ()

Returns an empty dyn-tuple.

Package

fset

Source

tuples.lisp (file)

Function: 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.

Package

fset

Source

relations.lisp (file)

Function: empty-map &optional DEFAULT

Returns an empty map of the default implementation.

Package

fset

Source

fset.lisp (file)

Function: empty-query-registry &optional ARITY
Package

fset

Source

relations.lisp (file)

Function: empty-seq &optional DEFAULT

Returns an empty seq of the default implementation.

Package

fset

Source

fset.lisp (file)

Function: empty-set ()

Returns an empty set of the default implementation.

Package

fset

Source

fset.lisp (file)

Function: empty-tuple ()

Returns an empty tuple of the default implementation.

Package

fset

Source

tuples.lisp (file)

Function: empty-wb-2-relation ()
Package

fset

Source

relations.lisp (file)

Function: empty-wb-bag ()

Returns an empty wb-bag.

Package

fset

Source

fset.lisp (file)

Function: 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.

Package

fset

Source

relations.lisp (file)

Function: empty-wb-map &optional DEFAULT

Returns an empty wb-map.

Package

fset

Source

fset.lisp (file)

Function: empty-wb-seq ()

Returns an empty wb-seq.

Package

fset

Source

fset.lisp (file)

Function: empty-wb-set ()

Returns an empty wb-set.

Package

fset

Source

fset.lisp (file)

Function: equal? A B
Package

fset

Source

order.lisp (file)

Function: fset-setup-readtable READTABLE

Adds FSet reader macros to ‘readtable’. Returns ‘readtable’.

Package

fset

Source

reader.lisp (file)

Function: 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.

Package

fset

Source

tuples.lisp (file)

Function: head LIST

Another name for the ‘car’ operation on lists.

Package

fset

Source

fset.lisp (file)

Function: lastcons LIST

Returns the last cons of ‘list’. This is a renaming of the CL function ‘last’.

Package

fset

Source

fset.lisp (file)

Function: make-bounded-set UNIVERSE SET &optional COMPLEMENT?
Package

fset

Source

bounded-sets.lisp (file)

Function: map-default INSTANCE
Function: (setf map-default) VALUE INSTANCE
Package

fset

Source

order.lisp (file)

Function: map? OBJECT
Package

fset

Source

order.lisp (file)

Function: member? X COLLECTION

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

Package

fset

Source

fset.lisp (file)

Function: nonempty? COLLECTION

Returns true iff the collection is not empty.

Package

fset

Source

fset.lisp (file)

Function: seq? OBJECT
Package

fset

Source

order.lisp (file)

Function: set? OBJECT
Package

fset

Source

order.lisp (file)

Function: tail LIST

Another name for the ‘cdr’ operation on lists.

Package

fset

Source

fset.lisp (file)

Function: tuple-key-name INSTANCE
Function: (setf tuple-key-name) VALUE INSTANCE
Package

fset

Source

tuples.lisp (file)

Function: tuple-key? OBJECT
Package

fset

Source

tuples.lisp (file)

Function: tuple? OBJECT
Package

fset

Source

order.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.4 Generic functions

Generic Function: all-queries REG
Package

fset

Methods
Method: all-queries (REG query-registry)
Source

relations.lisp (file)

Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: arb (BS bounded-set)
Source

bounded-sets.lisp (file)

Method: arb (CS complement-set)
Source

complement-sets.lisp (file)

Method: arb (REL wb-list-relation)
Source

relations.lisp (file)

Method: arb (BR wb-2-relation)
Source

relations.lisp (file)

Method: arb (M wb-map)
Method: arb (M wb-bag)
Method: arb (S wb-set)
Generic Function: arity REL

Returns the arity of the relation ‘rel’.

Package

fset

Source

relations.lisp (file)

Methods
Method: arity (REG query-registry)
Method: arity (REL wb-list-relation)

Will return ‘nil’ if the arity is not yet specified; see ‘empty-list-relation’.

Method: arity (BR 2-relation)
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: at-rank (S wb-map) RANK
Method: at-rank (S wb-bag) RANK
Method: at-rank (S wb-set) RANK
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: bag-difference (B wb-bag) (S wb-set)
Method: bag-difference (S wb-set) (B wb-bag)
Method: bag-difference (B1 wb-bag) (B2 wb-bag)
Generic Function: bag-product BAG1 BAG2

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

Package

fset

Source

fset.lisp (file)

Methods
Method: bag-product (B wb-bag) (S wb-set)
Method: bag-product (S wb-set) (B wb-bag)
Method: bag-product (B1 wb-bag) (B2 wb-bag)
Generic Function: bag-sum BAG1 BAG2

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

Package

fset

Source

fset.lisp (file)

Methods
Method: bag-sum (B wb-bag) (S wb-set)
Method: bag-sum (S wb-set) (B wb-bag)
Method: bag-sum (B1 wb-bag) (B2 wb-bag)
Generic Function: 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.

Package

fset

Source

order.lisp (file)

Methods
Method: compare (S set) (BS bounded-set)
Source

bounded-sets.lisp (file)

Method: compare (BS bounded-set) (S set)
Source

bounded-sets.lisp (file)

Method: compare (BS1 bounded-set) (BS2 bounded-set)
Source

bounded-sets.lisp (file)

Method: compare (S set) (CS complement-set)
Source

complement-sets.lisp (file)

Method: compare (CS complement-set) (S set)
Source

complement-sets.lisp (file)

Method: compare (CS1 complement-set) (CS2 complement-set)
Source

complement-sets.lisp (file)

Method: compare (A wb-2-relation) (B wb-2-relation)
Source

relations.lisp (file)

Method: compare (A relation) (B null)
Source

relations.lisp (file)

Method: compare (A null) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B real)
Source

relations.lisp (file)

Method: compare (A real) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B character)
Source

relations.lisp (file)

Method: compare (A character) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B symbol)
Source

relations.lisp (file)

Method: compare (A symbol) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B string)
Source

relations.lisp (file)

Method: compare (A string) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B vector)
Source

relations.lisp (file)

Method: compare (A vector) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B list)
Source

relations.lisp (file)

Method: compare (A list) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B package)
Source

relations.lisp (file)

Method: compare (A package) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B pathname)
Source

relations.lisp (file)

Method: compare (A pathname) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B set)
Source

relations.lisp (file)

Method: compare (A set) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B bag)
Source

relations.lisp (file)

Method: compare (A bag) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B map)
Source

relations.lisp (file)

Method: compare (A map) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B seq)
Source

relations.lisp (file)

Method: compare (A seq) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B tuple)
Source

relations.lisp (file)

Method: compare (A tuple) (B relation)
Source

relations.lisp (file)

Method: compare (A relation) (B identity-ordering-mixin)
Source

relations.lisp (file)

Method: compare (A identity-ordering-mixin) (B relation)
Source

relations.lisp (file)

Method: compare (IV0 interval) (IV1 interval)
Source

interval.lisp (file)

Method: compare (IV interval) X
Source

interval.lisp (file)

Method: compare X (IV interval)
Source

interval.lisp (file)

Method: compare (X my-integer) (Y my-integer)
Source

testing.lisp (file)

Method: compare (TUP1 tuple) (TUP2 tuple)
Source

tuples.lisp (file)

Method: compare (X tuple-desc) (Y tuple-desc)
Source

tuples.lisp (file)

Method: compare (KEY1 tuple-key) (KEY2 tuple-key)
Source

tuples.lisp (file)

Method: compare (S1 wb-seq) (S2 wb-seq)
Source

fset.lisp (file)

Method: compare (MAP1 wb-map) (MAP2 wb-map)
Source

fset.lisp (file)

Method: compare (B1 wb-bag) (B2 wb-bag)
Source

fset.lisp (file)

Method: compare (S1 wb-set) (S2 wb-set)
Source

fset.lisp (file)

Method: compare (EQVM1 equivalent-map) (EQVM2 equivalent-map)

Returns ‘:less’ or ‘:greater’ if the domain values in ‘eqvm1’ are less than resp. greater than those in ‘eqvm2’; or EITHER ‘:equal’ or ‘:unequal’ if those in ‘eqvm1’ are equivalent to those in ‘eqvm2’.

Source

wb-trees.lisp (file)

Method: compare (EQVM equivalent-map) KEY

Returns ‘:less’ or ‘:greater’ if the domain values in ‘eqvm’ are less than resp. greater than ‘key’; or EITHER ‘:equal’ or ‘:unequal’ if ‘key’ is equivalent to any domain value in ‘eqvm’.

Source

wb-trees.lisp (file)

Method: compare KEY (EQVM equivalent-map)

Returns ‘:less’ or ‘:greater’ if ‘key’ is less than resp. greater than the domain values in ‘eqvm’; or EITHER ‘:equal’ or ‘:unequal’ if ‘x’ is equivalent to any domain value in ‘eqvm’.

Source

wb-trees.lisp (file)

Method: compare (EQVS1 equivalent-bag) (EQVS2 equivalent-bag)

Returns ‘:less’ or ‘:greater’ if the values in ‘eqvs1’ are less than resp. greater than those in ‘eqvs2’; returns EITHER ‘:equal’ or ‘:unequal’ if those in ‘eqvs1’ are equivalent to those in ‘eqvs2’.

Source

wb-trees.lisp (file)

Method: compare (EQVS equivalent-bag) X

Returns ‘:less’ or ‘:greater’ if the values in ‘eqvs’ are less than resp. greater than ‘x’; or EITHER ‘:equal’ or ‘:unequal’ if ‘x’ is equivalent to any value in ‘eqvs’.

Source

wb-trees.lisp (file)

Method: compare X (EQVS equivalent-bag)

Returns ‘:less’ or ‘:greater’ if ‘x’ is less than resp. greater than the values in ‘eqvs’; or EITHER ‘:equal’ or ‘:unequal’ if ‘x’ is equivalent to any value in ‘eqvs’.

Source

wb-trees.lisp (file)

Method: compare (EQVS1 equivalent-set) (EQVS2 equivalent-set)

Returns ‘:less’ or ‘:greater’ if the values in ‘eqvs1’ are less than resp. greater than those in ‘eqvs2’; returns EITHER ‘:equal’ or ‘:unequal’ if those in ‘eqvs1’ are equivalent to those in ‘eqvs2’.

Source

wb-trees.lisp (file)

Method: compare (EQVS equivalent-set) X

Returns ‘:less’ or ‘:greater’ if the values in ‘eqvs’ are less than resp. greater than ‘x’; or EITHER ‘:equal’ or ‘:unequal’ if ‘x’ is equivalent to any value in ‘eqvs’.

Source

wb-trees.lisp (file)

Method: compare X (EQVS equivalent-set)

Returns ‘:less’ or ‘:greater’ if ‘x’ is less than resp. greater than the values in ‘eqvs’; or EITHER ‘:equal’ or ‘:unequal’ if ‘x’ is equivalent to any value in ‘eqvs’.

Source

wb-trees.lisp (file)

Method: compare (A pathname) (B pathname)
Method: compare (A package) (B package)
Method: compare (A list) (B list)
Method: compare (A vector) (B vector)
Method: compare (A string) (B string)
Method: compare (A symbol) (B symbol)
Method: compare (A character) (B character)
Method: compare (A real) (B real)
Method: compare (A null) (B null)
Method: compare (A identity-ordering-mixin) (B null)
Method: compare (A null) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B real)
Method: compare (A real) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B character)
Method: compare (A character) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B symbol)
Method: compare (A symbol) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B string)
Method: compare (A string) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B vector)
Method: compare (A vector) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B list)
Method: compare (A list) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B package)
Method: compare (A package) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B pathname)
Method: compare (A pathname) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B set)
Method: compare (A set) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B bag)
Method: compare (A bag) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B map)
Method: compare (A map) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B seq)
Method: compare (A seq) (B identity-ordering-mixin)
Method: compare (A identity-ordering-mixin) (B tuple)
Method: compare (A tuple) (B identity-ordering-mixin)
Method: compare (A tuple) (B null)
Method: compare (A null) (B tuple)
Method: compare (A tuple) (B real)
Method: compare (A real) (B tuple)
Method: compare (A tuple) (B character)
Method: compare (A character) (B tuple)
Method: compare (A tuple) (B symbol)
Method: compare (A symbol) (B tuple)
Method: compare (A tuple) (B string)
Method: compare (A string) (B tuple)
Method: compare (A tuple) (B vector)
Method: compare (A vector) (B tuple)
Method: compare (A tuple) (B list)
Method: compare (A list) (B tuple)
Method: compare (A tuple) (B package)
Method: compare (A package) (B tuple)
Method: compare (A tuple) (B pathname)
Method: compare (A pathname) (B tuple)
Method: compare (A tuple) (B set)
Method: compare (A set) (B tuple)
Method: compare (A tuple) (B bag)
Method: compare (A bag) (B tuple)
Method: compare (A tuple) (B map)
Method: compare (A map) (B tuple)
Method: compare (A tuple) (B seq)
Method: compare (A seq) (B tuple)
Method: compare (A seq) (B null)
Method: compare (A null) (B seq)
Method: compare (A seq) (B real)
Method: compare (A real) (B seq)
Method: compare (A seq) (B character)
Method: compare (A character) (B seq)
Method: compare (A seq) (B symbol)
Method: compare (A symbol) (B seq)
Method: compare (A seq) (B string)
Method: compare (A string) (B seq)
Method: compare (A seq) (B vector)
Method: compare (A vector) (B seq)
Method: compare (A seq) (B list)
Method: compare (A list) (B seq)
Method: compare (A seq) (B package)
Method: compare (A package) (B seq)
Method: compare (A seq) (B pathname)
Method: compare (A pathname) (B seq)
Method: compare (A seq) (B set)
Method: compare (A set) (B seq)
Method: compare (A seq) (B bag)
Method: compare (A bag) (B seq)
Method: compare (A seq) (B map)
Method: compare (A map) (B seq)
Method: compare (A map) (B null)
Method: compare (A null) (B map)
Method: compare (A map) (B real)
Method: compare (A real) (B map)
Method: compare (A map) (B character)
Method: compare (A character) (B map)
Method: compare (A map) (B symbol)
Method: compare (A symbol) (B map)
Method: compare (A map) (B string)
Method: compare (A string) (B map)
Method: compare (A map) (B vector)
Method: compare (A vector) (B map)
Method: compare (A map) (B list)
Method: compare (A list) (B map)
Method: compare (A map) (B package)
Method: compare (A package) (B map)
Method: compare (A map) (B pathname)
Method: compare (A pathname) (B map)
Method: compare (A map) (B set)
Method: compare (A set) (B map)
Method: compare (A map) (B bag)
Method: compare (A bag) (B map)
Method: compare (A bag) (B null)
Method: compare (A null) (B bag)
Method: compare (A bag) (B real)
Method: compare (A real) (B bag)
Method: compare (A bag) (B character)
Method: compare (A character) (B bag)
Method: compare (A bag) (B symbol)
Method: compare (A symbol) (B bag)
Method: compare (A bag) (B string)
Method: compare (A string) (B bag)
Method: compare (A bag) (B vector)
Method: compare (A vector) (B bag)
Method: compare (A bag) (B list)
Method: compare (A list) (B bag)
Method: compare (A bag) (B package)
Method: compare (A package) (B bag)
Method: compare (A bag) (B pathname)
Method: compare (A pathname) (B bag)
Method: compare (A bag) (B set)
Method: compare (A set) (B bag)
Method: compare (A set) (B null)
Method: compare (A null) (B set)
Method: compare (A set) (B real)
Method: compare (A real) (B set)
Method: compare (A set) (B character)
Method: compare (A character) (B set)
Method: compare (A set) (B symbol)
Method: compare (A symbol) (B set)
Method: compare (A set) (B string)
Method: compare (A string) (B set)
Method: compare (A set) (B vector)
Method: compare (A vector) (B set)
Method: compare (A set) (B list)
Method: compare (A list) (B set)
Method: compare (A set) (B package)
Method: compare (A package) (B set)
Method: compare (A set) (B pathname)
Method: compare (A pathname) (B set)
Method: compare (A pathname) (B null)
Method: compare (A null) (B pathname)
Method: compare (A pathname) (B real)
Method: compare (A real) (B pathname)
Method: compare (A pathname) (B character)
Method: compare (A character) (B pathname)
Method: compare (A pathname) (B symbol)
Method: compare (A symbol) (B pathname)
Method: compare (A pathname) (B string)
Method: compare (A string) (B pathname)
Method: compare (A pathname) (B vector)
Method: compare (A vector) (B pathname)
Method: compare (A pathname) (B list)
Method: compare (A list) (B pathname)
Method: compare (A pathname) (B package)
Method: compare (A package) (B pathname)
Method: compare (A package) (B null)
Method: compare (A null) (B package)
Method: compare (A package) (B real)
Method: compare (A real) (B package)
Method: compare (A package) (B character)
Method: compare (A character) (B package)
Method: compare (A package) (B symbol)
Method: compare (A symbol) (B package)
Method: compare (A package) (B string)
Method: compare (A string) (B package)
Method: compare (A package) (B vector)
Method: compare (A vector) (B package)
Method: compare (A package) (B list)
Method: compare (A list) (B package)
Method: compare (A list) (B null)
Method: compare (A null) (B list)
Method: compare (A list) (B real)
Method: compare (A real) (B list)
Method: compare (A list) (B character)
Method: compare (A character) (B list)
Method: compare (A list) (B symbol)
Method: compare (A symbol) (B list)
Method: compare (A list) (B string)
Method: compare (A string) (B list)
Method: compare (A list) (B vector)
Method: compare (A vector) (B list)
Method: compare (A vector) (B null)
Method: compare (A null) (B vector)
Method: compare (A vector) (B real)
Method: compare (A real) (B vector)
Method: compare (A vector) (B character)
Method: compare (A character) (B vector)
Method: compare (A vector) (B symbol)
Method: compare (A symbol) (B vector)
Method: compare (A vector) (B string)
Method: compare (A string) (B vector)
Method: compare (A string) (B null)
Method: compare (A null) (B string)
Method: compare (A string) (B real)
Method: compare (A real) (B string)
Method: compare (A string) (B character)
Method: compare (A character) (B string)
Method: compare (A string) (B symbol)
Method: compare (A symbol) (B string)
Method: compare (A symbol) (B null)
Method: compare (A null) (B symbol)
Method: compare (A symbol) (B real)
Method: compare (A real) (B symbol)
Method: compare (A symbol) (B character)
Method: compare (A character) (B symbol)
Method: compare (A character) (B null)
Method: compare (A null) (B character)
Method: compare (A character) (B real)
Method: compare (A real) (B character)
Method: compare (A real) (B null)
Method: compare (A null) (B real)
Method: compare A B
Method: compare (OBJ1 identity-ordering-mixin) (OBJ2 identity-ordering-mixin)
Generic Function: compare-lexicographically A B

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

Package

fset

Source

order.lisp (file)

Methods
Method: compare-lexicographically (S1 wb-seq) (S2 wb-seq)
Source

fset.lisp (file)

Method: compare-lexicographically (A vector) (B vector)
Method: compare-lexicographically (A list) (B list)
Method: compare-lexicographically (A string) (B string)
Generic Function: complement SET

Returns the complement of the set.

Package

fset

Source

complement-sets.lisp (file)

Methods
Method: complement (BS bounded-set)
Source

bounded-sets.lisp (file)

Method: complement (CS complement-set)
Method: complement (S set)
Method: complement (X function)
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: compose (REL1 wb-2-relation) (REL2 wb-2-relation)
Source

relations.lisp (file)

Method: compose (REL wb-2-relation) (FN seq)
Source

relations.lisp (file)

Method: compose (REL wb-2-relation) (FN map)
Source

relations.lisp (file)

Method: compose (REL wb-2-relation) (FN symbol)
Source

relations.lisp (file)

Method: compose (REL wb-2-relation) (FN function)
Source

relations.lisp (file)

Method: compose (M wb-map) (S seq)
Method: compose (M wb-map) (FN symbol)
Method: compose (M wb-map) (FN function)
Method: compose (MAP1 map) (MAP2 wb-map)
Generic Function: concat SEQ1 &rest SEQS

Returns the concatenation of ‘seq1’ with each of ‘seqs’.

Package

fset

Source

fset.lisp (file)

Methods
Method: concat (S1 seq) &rest SEQS
Method: concat (A list) &rest SEQS
Generic Function: conflicts 2-RELATION

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

Package

fset

Source

relations.lisp (file)

Methods
Method: conflicts (BR wb-2-relation)
Generic Function: contains? COLLECTION X &optional Y

Returns true iff the set or bag contains ‘x’, or the map or relation contains the pair <x, y>.

Package

fset

Source

fset.lisp (file)

Methods
Method: contains? (BS bounded-set) X &optional ARG2
Source

bounded-sets.lisp (file)

Method: contains? (CS complement-set) X &optional Y
Source

complement-sets.lisp (file)

Method: contains? (REL wb-list-relation) TUPLE &optional ARG2
Source

relations.lisp (file)

Method: contains? (BR wb-2-relation) X &optional Y
Source

relations.lisp (file)

Method: contains? (M wb-map) X &optional Y
Method: contains? (B wb-bag) X &optional Y
Method: contains? (S wb-set) X &optional Y
Generic Function: convert TO-TYPE COLLECTION &key KEY-FN VALUE-FN FROM-TYPE PAIR-FN &allow-other-keys

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

Package

fset

Source

fset.lisp (file)

Methods
Method: convert (TO-TYPE (eql wb-set)) (BS bounded-set) &key
Source

bounded-sets.lisp (file)

Method: convert (TO-TYPE (eql map-to-sets)) (BR wb-2-relation) &key

This conversion returns a map mapping each domain value to the set of corresponding range values.

Source

relations.lisp (file)

Method: convert (TO-TYPE (eql wb-map)) (BR wb-2-relation) &key

This conversion requires the relation to be functional, and returns a map representing the function; that is, the relation must map each domain value to a single range value, and the returned map maps that domain value to that range value.

Source

relations.lisp (file)

Method: convert (TO-TYPE (eql map)) (BR wb-2-relation) &key

This conversion requires the relation to be functional, and returns a map representing the function; that is, the relation must map each domain value to a single range value, and the returned map maps that domain value to that range value.

Source

relations.lisp (file)

Method: convert (TO-TYPE (eql wb-2-relation)) (S seq) &key KEY-FN VALUE-FN
Source

relations.lisp (file)

Method: convert (TO-TYPE (eql 2-relation)) (S seq) &key KEY-FN VALUE-FN
Source

relations.lisp (file)

Method: convert (TO-TYPE (eql wb-2-relation)) (ALIST list) &key KEY-FN VALUE-FN
Source

relations.lisp (file)

Method: convert (TO-TYPE (eql 2-relation)) (ALIST list) &key KEY-FN VALUE-FN
Source

relations.lisp (file)

Method: convert (TO-TYPE (eql wb-2-relation)) (M map) &key FROM-TYPE

If ‘from-type’ is the symbol ‘map-to-sets’, the range elements must all be sets, and the result pairs each domain element with each member of the corresponding range set. Otherwise, the result pairs each domain element with the corresponding range element directly.

Source

relations.lisp (file)

Method: convert (TO-TYPE (eql 2-relation)) (M map) &key FROM-TYPE

If ‘from-type’ is the symbol ‘map-to-sets’, the range elements must all be sets, and the result pairs each domain element with each member of the corresponding range set. Otherwise, the result pairs each domain element with the corresponding range element directly.

Source

relations.lisp (file)

Method: convert (TO-TYPE (eql set)) (BR 2-relation) &key PAIR-FN
Source

relations.lisp (file)

Method: convert (TO-TYPE (eql wb-2-relation)) (BR wb-2-relation) &key
Source

relations.lisp (file)

Method: convert (TO-TYPE (eql 2-relation)) (BR 2-relation) &key
Source

relations.lisp (file)

Method: convert (TO-TYPE (eql list)) (TUP tuple) &key PAIR-FN
Source

tuples.lisp (file)

Method: convert (TO-TYPE (eql map)) (TUP tuple) &key
Source

tuples.lisp (file)

Method: convert (TO-TYPE (eql wb-seq)) (M map) &key PAIR-FN
Method: convert (TO-TYPE (eql wb-seq)) (B bag) &key
Method: convert (TO-TYPE (eql wb-set)) (S wb-seq) &key
Method: convert (TO-TYPE (eql set)) (S wb-seq) &key
Method: convert (TO-TYPE (eql wb-seq)) (S set) &key
Method: convert (TO-TYPE (eql seq)) (S set) &key
Method: convert (TO-TYPE (eql list)) (S wb-seq) &key
Method: convert (TO-TYPE (eql wb-seq)) (L list) &key
Method: convert (TO-TYPE (eql seq)) (L list) &key
Method: convert (TO-TYPE (eql string)) (S wb-seq) &key
Method: convert (TO-TYPE (eql vector)) (S wb-seq) &key
Method: convert (TO-TYPE (eql wb-seq)) (VEC vector) &key
Method: convert (TO-TYPE (eql seq)) (VEC vector) &key
Method: convert (TO-TYPE (eql wb-seq)) (S wb-seq) &key
Method: convert (TO-TYPE (eql seq)) (S seq) &key
Method: convert (TO-TYPE (eql hash-table)) (M map) &rest MAKE-HASH-TABLE-ARGS &key &allow-other-keys
Method: convert (TO-TYPE (eql wb-map)) (HT hash-table) &key
Method: convert (TO-TYPE (eql map)) (HT hash-table) &key
Method: convert (TO-TYPE (eql wb-map)) (B bag) &key
Method: convert (TO-TYPE (eql map)) (B bag) &key
Method: convert (TO-TYPE (eql wb-map)) (S sequence) &key KEY-FN VALUE-FN
Method: convert (TO-TYPE (eql map)) (S sequence) &key KEY-FN VALUE-FN
Method: convert (TO-TYPE (eql wb-map)) (LIST list) &key KEY-FN VALUE-FN
Method: convert (TO-TYPE (eql map)) (LIST list) &key KEY-FN VALUE-FN
Method: convert (TO-TYPE (eql set)) (M map) &key PAIR-FN
Method: convert (TO-TYPE (eql vector)) (M map) &key PAIR-FN
Method: convert (TO-TYPE (eql seq)) (M map) &key PAIR-FN
Method: convert (TO-TYPE (eql list)) (M map) &key PAIR-FN
Method: convert (TO-TYPE (eql wb-map)) (M wb-map) &key
Method: convert (TO-TYPE (eql map)) (M map) &key
Method: convert (TO-TYPE (eql wb-bag)) (S sequence) &key
Method: convert (TO-TYPE (eql bag)) (S sequence) &key
Method: convert (TO-TYPE (eql wb-bag)) (L list) &key FROM-TYPE

If ‘from-type’ is the symbol ‘alist’, treats the operand as an alist where the cdr of each pair (which must be a positive integer) is the member count for the car. Otherwise the operand is treated as a simple list of members, some of which may be repeated.

Method: convert (TO-TYPE (eql bag)) (L list) &key FROM-TYPE

If ‘from-type’ is the symbol ‘alist’, treats the operand as an alist where the cdr of each pair (which must be a positive integer) is the member count for the car. Otherwise the operand is treated as a simple list of members, some of which may be repeated.

Method: convert (TO-TYPE (eql alist)) (B bag) &key
Method: convert (TO-TYPE (eql vector)) (B bag) &key
Method: convert (TO-TYPE (eql seq)) (B bag) &key
Method: convert (TO-TYPE (eql list)) (B bag) &key
Method: convert (TO-TYPE (eql wb-set)) (B wb-bag) &key
Method: convert (TO-TYPE (eql set)) (B wb-bag) &key
Method: convert (TO-TYPE (eql wb-bag)) (B wb-bag) &key
Method: convert (TO-TYPE (eql bag)) (B bag) &key
Method: convert (TO-TYPE (eql wb-set)) (S sequence) &key
Method: convert (TO-TYPE (eql set)) (S sequence) &key
Method: convert (TO-TYPE (eql wb-set)) (L list) &key
Method: convert (TO-TYPE (eql set)) (L list) &key
Method: convert (TO-TYPE (eql vector)) (S set) &key
Method: convert (TO-TYPE (eql list)) (S set) &key
Method: convert (TO-TYPE (eql wb-bag)) (S wb-set) &key
Method: convert (TO-TYPE (eql bag)) (S wb-set) &key
Method: convert (TO-TYPE (eql wb-set)) (S wb-set) &key
Method: convert (TO-TYPE (eql set)) (S set) &key
Method: convert (TO-TYPE (eql vector)) (V vector) &key
Method: convert (TO-TYPE (eql list)) (LS list) &key
Generic Function: count ITEM COLLECTION &key KEY TEST START END FROM-END 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: count ITEM (S seq) &key KEY TEST START END FROM-END
Method: count ITEM (M map) &key KEY TEST
Method: count ITEM (B bag) &key KEY TEST
Method: count ITEM (S set) &key KEY TEST
Method: count ITEM (S sequence) &rest KEYWORD-ARGS &key KEY TEST TEST-NOT START END FROM-END
Generic Function: count-if PRED COLLECTION &key KEY START END FROM-END

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.

Package

fset

Source

fset.lisp (file)

Methods
Method: count-if PRED (S seq) &key KEY START END FROM-END
Method: count-if PRED (M map) &key KEY
Method: count-if PRED (B bag) &key KEY
Method: count-if PRED (S set) &key KEY
Method: count-if PRED (S sequence) &rest KEYWORD-ARGS &key KEY START END FROM-END
Generic Function: count-if-not PRED COLLECTION &key KEY START END FROM-END

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.

Package

fset

Source

fset.lisp (file)

Methods
Method: count-if-not PRED (S seq) &key KEY START END FROM-END
Method: count-if-not PRED (M map) &key KEY
Method: count-if-not PRED (S bag) &key KEY
Method: count-if-not PRED (S set) &key KEY
Method: count-if-not PRED (S sequence) &rest KEYWORD-ARGS &key KEY START END FROM-END
Generic Function: disjoint? SET1 SET2

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

Package

fset

Source

fset.lisp (file)

Methods
Method: disjoint? (BS1 bounded-set) (BS2 bounded-set)
Source

bounded-sets.lisp (file)

Method: disjoint? (S set) (CS complement-set)
Source

complement-sets.lisp (file)

Method: disjoint? (CS complement-set) (S set)
Source

complement-sets.lisp (file)

Method: disjoint? (CS1 complement-set) (CS2 complement-set)
Source

complement-sets.lisp (file)

Method: disjoint? (S1 wb-set) (S2 wb-set)
Generic Function: domain MAP

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

Package

fset

Source

fset.lisp (file)

Methods
Method: domain (BR wb-2-relation)
Source

relations.lisp (file)

Method: domain (TUP dyn-tuple)
Source

tuples.lisp (file)

Method: domain (S wb-seq)
Method: domain (M wb-map)
Generic Function: 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.)

Package

fset

Source

fset.lisp (file)

Methods
Method: domain-contains? (S seq) X
Method: domain-contains? (M wb-map) X
Generic Function: empty? COLLECTION

Returns true iff the collection is empty.

Package

fset

Source

fset.lisp (file)

Methods
Method: empty? (BS bounded-set)
Source

bounded-sets.lisp (file)

Method: empty? (REL wb-list-relation)
Source

relations.lisp (file)

Method: empty? (BR wb-2-relation)
Source

relations.lisp (file)

Method: empty? (S interval-set)
Source

interval.lisp (file)

Method: empty? (S sequence)
Method: empty? (L list)
Method: empty? (S wb-seq)
Method: empty? (M wb-map)
Method: empty? (B wb-bag)
Method: empty? (S wb-set)
Generic Function: 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).

Package

fset

Source

fset.lisp (file)

Methods
Method: filter (FN bag) (S seq)
Method: filter (FN set) (S seq)
Method: filter (FN map) (S seq)
Method: filter (FN symbol) (S seq)
Method: filter (FN function) (S seq)
Method: filter (PRED symbol) (M map)
Method: filter (PRED function) (M map)
Method: filter (PRED bag) (B bag)
Method: filter (PRED set) (B bag)
Method: filter (PRED map) (B bag)
Method: filter (PRED symbol) (B bag)
Method: filter (PRED function) (B bag)
Method: filter (PRED bag) (S set)
Method: filter (PRED set) (S set)
Method: filter (PRED map) (S set)
Method: filter (PRED symbol) (S set)
Method: filter (PRED function) (S set)
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: filter-pairs (PRED symbol) (B bag)
Method: filter-pairs (PRED function) (B bag)
Method: filter-pairs FN COLLECTION
Generic Function: find ITEM COLLECTION &key KEY TEST START END FROM-END 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: find ITEM (S seq) &key KEY TEST START END FROM-END
Method: find ITEM (M map) &key KEY TEST
Method: find ITEM (B bag) &key KEY TEST
Method: find ITEM (S set) &key KEY TEST
Method: find ITEM (S sequence) &rest KEYWORD-ARGS &key KEY TEST TEST-NOT START END FROM-END
Generic Function: find-if PRED COLLECTION &key KEY START END FROM-END

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.

Package

fset

Source

fset.lisp (file)

Methods
Method: find-if PRED (S seq) &key KEY START END FROM-END
Method: find-if PRED (M map) &key KEY
Method: find-if PRED (B bag) &key KEY
Method: find-if PRED (S set) &key KEY
Method: find-if PRED (S sequence) &rest KEYWORD-ARGS &key KEY START END FROM-END
Generic Function: find-if-not PRED COLLECTION &key KEY START END FROM-END

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.

Package

fset

Source

fset.lisp (file)

Methods
Method: find-if-not PRED (S seq) &key KEY START END FROM-END
Method: find-if-not PRED (M map) &key KEY
Method: find-if-not PRED (B bag) &key KEY
Method: find-if-not PRED (S set) &key KEY
Method: find-if-not PRED (S sequence) &rest KEYWORD-ARGS &key KEY START END FROM-END
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: first (S wb-seq)
Method: first (S sequence)
Method: first (S list)
Generic Function: forward-key REG FROM-KEY TO-KEY
Package

fset

Methods
Method: forward-key (REG query-registry) FROM-KEY TO-KEY

Returns a new query-registry in which all queries whose patterns used ‘from-key’ (in an instantiated position) now use ‘to-key’ in that position instead.

Source

relations.lisp (file)

Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: greatest (BR wb-2-relation)
Source

relations.lisp (file)

Method: greatest (M wb-map)
Method: greatest (M wb-bag)
Method: greatest (S wb-set)
Generic Function: 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’.

Package

fset

Source

fset.lisp (file)

Methods
Method: image (KEY tuple-key) (S seq)
Source

tuples.lisp (file)

Method: image (KEY tuple-key) (S set)
Source

tuples.lisp (file)

Method: image (FN bag) (S seq)
Method: image (FN set) (S seq)
Method: image (FN map) (S seq)
Method: image (FN symbol) (S seq)
Method: image (FN function) (S seq)
Method: image (FN symbol) (M map)
Method: image (FN function) (M map)
Method: image (FN bag) (B bag)
Method: image (FN set) (B bag)
Method: image (FN map) (B bag)
Method: image (FN symbol) (B bag)
Method: image (FN function) (B bag)
Method: image (FN bag) (S set)
Method: image (FN set) (S set)
Method: image (FN map) (S set)
Method: image (FN symbol) (S set)
Method: image (FN function) (S set)
Method: image (FN set) (L list)
Method: image (FN map) (L list)
Method: image (FN symbol) (L list)
Method: image (FN function) (L list)
Generic Function: 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).

Package

fset

Source

fset.lisp (file)

Methods
Method: insert (S wb-seq) IDX VAL
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: intersection (BS1 bounded-set) (BS2 bounded-set) &key
Source

bounded-sets.lisp (file)

Method: intersection (S set) (CS complement-set) &key
Source

complement-sets.lisp (file)

Method: intersection (CS complement-set) (S set) &key
Source

complement-sets.lisp (file)

Method: intersection (CS1 complement-set) (CS2 complement-set) &key
Source

complement-sets.lisp (file)

Method: intersection (BR1 wb-2-relation) (BR2 wb-2-relation) &key
Source

relations.lisp (file)

Method: intersection (S0 interval-set) (S1 interval-set) &key
Source

interval.lisp (file)

Method: intersection (B wb-bag) (S wb-set) &key
Method: intersection (S wb-set) (B wb-bag) &key
Method: intersection (S1 wb-bag) (S2 wb-bag) &key
Method: intersection (S1 wb-set) (S2 wb-set) &key
Method: intersection (LS1 list) (LS2 list) &rest KEYWORD-ARGS &key TEST TEST-NOT
Generic Function: inverse 2-RELATION

The inverse of a binary relation.

Package

fset

Source

relations.lisp (file)

Methods
Method: inverse (BR wb-2-relation)
Generic Function: 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).

Package

fset

Source

fset.lisp (file)

Methods
Method: iterator (REL wb-2-relation) &key
Source

relations.lisp (file)

Method: iterator (S wb-seq) &key
Method: iterator (M wb-map) &key
Method: iterator (B wb-bag) &key PAIRS?
Method: iterator (S wb-set) &key
Method: iterator (SEQ sequence) &key
Method: iterator (STR string) &key
Method: iterator (VEC vector) &key
Method: iterator (LS list) &key
Generic Function: 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).

Package

fset

Source

relations.lisp (file)

Methods
Method: join (BRA wb-2-relation) COLA (BRB wb-2-relation) COLB
Generic Function: 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’.

Package

fset

Source

fset.lisp (file)

Methods
Method: last (S wb-seq)
Method: last (S sequence)
Method: last (S list)
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: least (BR wb-2-relation)
Source

relations.lisp (file)

Method: least (M wb-map)
Method: least (B wb-bag)
Method: least (S wb-set)
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: less (BS1 bounded-set) X &optional ARG2
Source

bounded-sets.lisp (file)

Method: less (CS complement-set) X &optional ARG2
Source

complement-sets.lisp (file)

Method: less (REL wb-list-relation) TUPLE &optional ARG2
Source

relations.lisp (file)

Method: less (BR wb-2-relation) X &optional Y
Source

relations.lisp (file)

Method: less (S interval-set) (IV interval) &optional ARG2
Source

interval.lisp (file)

Method: less (S wb-seq) IDX &optional ARG2
Method: less (M wb-map) KEY &optional ARG2
Method: less (B wb-bag) VALUE &optional MULTIPLICITY
Method: less (S wb-set) VALUE &optional ARG2
Generic Function: less-first SEQ

Returns the subsequence of ‘seq’ from element 1 through the end.

Package

fset

Source

fset.lisp (file)

Methods
Method: less-first (S wb-seq)
Generic Function: less-last SEQ

Returns the subsequence of ‘seq’ from element 0 through the next-to-last element.

Package

fset

Source

fset.lisp (file)

Methods
Method: less-last (S wb-seq)
Generic Function: less-query REG PATTERN METAPATTERN QUERY
Package

fset

Methods
Method: less-query (REG query-registry) (PATTERN list) (METAPATTERN list) QUERY
Source

relations.lisp (file)

Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Setf Expander

(setf lookup) (setf expander)

Methods
Method: lookup (REG query-registry) TUPLE

Returns all queries in ‘reg’ whose patterns match ‘tuple’.

Source

relations.lisp (file)

Method: lookup (BR wb-2-relation) X

Returns the set of values that the relation pairs ‘x’ with.

Source

relations.lisp (file)

Method: lookup (TUPLE tuple) (KEY tuple-key)
Source

tuples.lisp (file)

Method: lookup (S sequence) (IDX integer)
Method: lookup (S wb-seq) KEY
Method: lookup (M wb-map) KEY
Method: lookup (B wb-bag) X
Method: lookup (S wb-set) KEY
Setf Expander: (setf lookup) COLLECTION KEY

Adds a pair to a map or updates an existing pair, or adds an element to a sequence or updates an existing element. This does NOT modify the map or sequence; it modifies the place (generalized variable) HOLDING the map or sequence (just like ‘(setf (ldb ...) ...)’). That is, the ‘collection’ subform must be ‘setf’able itself.

Package

fset

Source

fset.lisp (file)

Reader

lookup (generic function)

Generic Function: lookup-inv 2-RELATION Y

Does an inverse lookup on a binary relation.

Package

fset

Source

relations.lisp (file)

Methods
Method: lookup-inv (BR wb-2-relation) Y
Generic Function: lookup-multi REG SET-TUPLE
Package

fset

Methods
Method: lookup-multi (REG query-registry) SET-TUPLE

Here ‘set-tuple’ contains a set of values in each position. Returns all queries in ‘reg’ whose patterns match any member of the cartesian product of the sets.

Source

relations.lisp (file)

Generic Function: lookup-multi-restricted REG SET-TUPLE KEYS
Package

fset

Methods
Method: lookup-multi-restricted (REG query-registry) SET-TUPLE KEYS

Here ‘set-tuple’ contains a set of values in each position. Returns all queries in ‘reg’ whose patterns match any member of the cartesian product of the sets and which use a member of ‘keys’ in their patterns.

Source

relations.lisp (file)

Generic Function: lookup-restricted REG TUPLE KEY
Package

fset

Methods
Method: lookup-restricted (REG query-registry) TUPLE KEY

Returns all queries in ‘reg’ whose patterns match ‘tuple’ and which use ‘key’ (in an instantiated position) in their patterns.

Source

relations.lisp (file)

Generic Function: 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’.

Package

fset

Source

fset.lisp (file)

Methods
Method: map-difference-2 (MAP1 wb-map) (MAP2 wb-map)
Generic Function: 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).

Package

fset

Source

fset.lisp (file)

Methods
Method: map-intersection (MAP1 wb-map) (MAP2 wb-map) &optional VAL-FN
Generic Function: 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).

Package

fset

Source

fset.lisp (file)

Methods
Method: map-union (MAP1 wb-map) (MAP2 wb-map) &optional VAL-FN
Generic Function: multiplicity BAG X

Returns the multiplicity of ‘x’ in the bag.

Package

fset

Source

fset.lisp (file)

Methods
Method: multiplicity (S set) X
Method: multiplicity (B wb-bag) X
Generic Function: partition PRED COLLECTION

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

Package

fset

Source

fset.lisp (file)

Methods
Method: partition (FN bag) (S seq)
Method: partition (FN set) (S seq)
Method: partition (FN map) (S seq)
Method: partition (FN symbol) (S seq)
Method: partition (FN function) (S seq)
Method: partition (PRED map) (S set)
Method: partition (PRED symbol) (S set)
Method: partition (PRED function) (S set)
Method: partition (PRED function) (LS list)
Method: partition (PRED symbol) (LS list)
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: position ITEM (S seq) &key KEY TEST START END FROM-END
Method: position ITEM (S sequence) &rest KEYWORD-ARGS &key KEY TEST TEST-NOT START END FROM-END
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: position-if PRED (S seq) &key KEY START END FROM-END
Method: position-if PRED (S sequence) &rest KEYWORD-ARGS &key KEY START END FROM-END
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: position-if-not PRED (S seq) &key KEY START END FROM-END
Method: position-if-not PRED (S sequence) &rest KEYWORD-ARGS &key KEY START END FROM-END
Generic Function: query RELATION PATTERN METAPATTERN

Along with the relation, takes two lists, of equal length less than
or 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.

Package

fset

Source

relations.lisp (file)

Methods
Method: query (REL wb-list-relation) (PATTERN list) (METAPATTERN list)
Generic Function: 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.

Package

fset

Source

relations.lisp (file)

Methods
Method: query-multi (REL wb-list-relation) (PATTERN list) (METAPATTERN list)
Generic Function: range MAP

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

Package

fset

Source

fset.lisp (file)

Methods
Method: range (BR wb-2-relation)
Source

relations.lisp (file)

Method: range (S wb-seq)
Method: range (M map)
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: range-contains? (S seq) X
Method: range-contains? (M wb-map) X
Generic Function: 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 greatest member of the collection less than ‘value’ (if any; otherwise -1). 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: rank (S wb-map) X
Method: rank (S wb-bag) X
Method: rank (S wb-set) X
Generic Function: reduce FN COLLECTION &key KEY INITIAL-VALUE START END FROM-END

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.

Package

fset

Source

fset.lisp (file)

Methods
Method: reduce (FN symbol) (S seq) &key KEY INITIAL-VALUE START END FROM-END
Method: reduce (FN function) (S seq) &key KEY INITIAL-VALUE START END FROM-END
Method: reduce (FN symbol) (M map) &key KEY INITIAL-VALUE
Method: reduce (FN function) (M map) &key KEY INITIAL-VALUE
Method: reduce (FN symbol) (B bag) &key KEY INITIAL-VALUE
Method: reduce (FN function) (B bag) &key KEY INITIAL-VALUE
Method: reduce (FN symbol) (S set) &key KEY INITIAL-VALUE
Method: reduce (FN function) (S set) &key KEY INITIAL-VALUE
Method: reduce FN (S sequence) &rest KEYWORD-ARGS &key KEY INITIAL-VALUE START END FROM-END
Generic Function: remove ITEM COLLECTION &key KEY TEST START END FROM-END COUNT

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.

Package

fset

Source

fset.lisp (file)

Methods
Method: remove ITEM (S seq) &key KEY TEST START END FROM-END COUNT
Method: remove ITEM (S sequence) &rest KEYWORD-ARGS &key KEY TEST START END FROM-END COUNT
Generic Function: remove-if PRED COLLECTION &key KEY START END FROM-END COUNT

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

Package

fset

Source

fset.lisp (file)

Methods
Method: remove-if PRED (S seq) &key KEY START END FROM-END COUNT
Method: remove-if PRED (S sequence) &rest KEYWORD-ARGS &key KEY START END FROM-END COUNT
Generic Function: remove-if-not PRED COLLECTION &key KEY START END FROM-END COUNT

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

Package

fset

Source

fset.lisp (file)

Methods
Method: remove-if-not PRED (S seq) &key KEY START END FROM-END COUNT
Method: remove-if-not PRED (S sequence) &rest KEYWORD-ARGS &key KEY START END FROM-END COUNT
Generic Function: restrict MAP SET

Returns a map containing only those pairs of ‘map’ whose keys are also in ‘set’.

Package

fset

Source

fset.lisp (file)

Methods
Method: restrict (TUP tuple) (S set)
Source

tuples.lisp (file)

Method: restrict (M wb-map) (S wb-set)
Generic Function: restrict-not MAP SET

Returns a map containing only those pairs of ‘map’ whose keys are not in ‘set’.

Package

fset

Source

fset.lisp (file)

Methods
Method: restrict-not (TUP tuple) (S set)
Source

tuples.lisp (file)

Method: restrict-not (M wb-map) (S wb-set)
Generic Function: reverse SEQ

Returns ‘seq’ in reverse order.

Package

fset

Source

fset.lisp (file)

Methods
Method: reverse (S wb-seq)
Method: reverse (S sequence)
Generic Function: 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’.

Package

fset

Source

fset.lisp (file)

Methods
Method: set-difference (BS1 bounded-set) (BS2 bounded-set) &key
Source

bounded-sets.lisp (file)

Method: set-difference (S set) (CS complement-set) &key
Source

complement-sets.lisp (file)

Method: set-difference (CS complement-set) (S set) &key
Source

complement-sets.lisp (file)

Method: set-difference (CS1 complement-set) (CS2 complement-set) &key
Source

complement-sets.lisp (file)

Method: set-difference (S0 interval-set) (S1 interval-set) &key
Source

interval.lisp (file)

Method: set-difference (S1 wb-set) (S2 wb-set) &key
Method: set-difference (LS1 list) (LS2 list) &rest KEYWORD-ARGS &key TEST TEST-NOT
Generic Function: set-difference-2 SET1 SET2

Returns ‘set1 - set2’ and ‘set2 - set1’ as two values.

Package

fset

Source

fset.lisp (file)

Methods
Method: set-difference-2 (S1 wb-set) (S2 wb-set)
Generic Function: set-size BAG

Returns the number of unique members in the bag.

Package

fset

Source

fset.lisp (file)

Methods
Method: set-size (B wb-bag)
Method: set-size (S wb-set)
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: size (BS bounded-set)
Source

bounded-sets.lisp (file)

Method: size (CS complement-set)
Source

complement-sets.lisp (file)

Method: size (REL wb-list-relation)
Source

relations.lisp (file)

Method: size (BR wb-2-relation)
Source

relations.lisp (file)

Method: size (S interval-set)

The number of intervals in the set.

Source

interval.lisp (file)

Method: size (S sequence)
Method: size (S wb-seq)
Method: size (M wb-map)
Method: size (B wb-bag)
Method: size (S wb-set)
Generic Function: 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’.

Package

fset

Source

fset.lisp (file)

Methods
Method: sort (S wb-seq) PRED &key KEY
Method: sort (S set) PRED &key KEY
Method: sort (S sequence) PRED &key KEY
Generic Function: 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).

Package

fset

Source

fset.lisp (file)

Methods
Method: splice (S wb-seq) IDX SUBSEQ
Generic Function: split-above S VALUE
Package

fset

Methods
Method: split-above (S wb-set) VALUE
Source

fset.lisp (file)

Generic Function: split-below S VALUE
Package

fset

Methods
Method: split-below (S wb-set) VALUE
Source

fset.lisp (file)

Generic Function: split-from S VALUE
Package

fset

Methods
Method: split-from (S wb-set) VALUE
Source

fset.lisp (file)

Generic Function: split-through S VALUE
Package

fset

Methods
Method: split-through (S wb-set) VALUE
Source

fset.lisp (file)

Generic Function: 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’.

Package

fset

Source

fset.lisp (file)

Methods
Method: stable-sort (S wb-seq) PRED &key KEY
Method: stable-sort (S set) PRED &key KEY
Method: stable-sort (S sequence) PRED &key KEY
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: subbag? (B wb-bag) (S wb-set)
Method: subbag? (S wb-set) (B wb-bag)
Method: subbag? (B1 wb-bag) (B2 wb-bag)
Generic Function: subseq SEQ START &optional END

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

Package

fset

Source

fset.lisp (file)

Methods
Method: subseq (S wb-seq) START &optional END
Method: subseq (S sequence) START &optional END
Generic Function: subset? SUB SUPER

Returns true iff ‘sub’ is a subset of ‘super’.

Package

fset

Source

fset.lisp (file)

Methods
Method: subset? (BS1 bounded-set) (BS2 bounded-set)
Source

bounded-sets.lisp (file)

Method: subset? (S set) (CS complement-set)
Source

complement-sets.lisp (file)

Method: subset? (CS complement-set) (S set)
Source

complement-sets.lisp (file)

Method: subset? (CS1 complement-set) (CS2 complement-set)
Source

complement-sets.lisp (file)

Method: subset? (S1 wb-set) (S2 wb-set)
Generic Function: substitute NEWITEM OLDITEM COLLECTION &key KEY TEST START END FROM-END COUNT

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.

Package

fset

Source

fset.lisp (file)

Methods
Method: substitute NEWITEM OLDITEM (S seq) &key KEY TEST START END FROM-END COUNT
Method: substitute NEWITEM OLDITEM (S sequence) &rest KEYWORD-ARGS &key KEY TEST START END FROM-END COUNT
Generic Function: substitute-if NEWITEM PRED COLLECTION &key KEY START END FROM-END COUNT

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

Package

fset

Source

fset.lisp (file)

Methods
Method: substitute-if NEWITEM PRED (S seq) &key KEY START END FROM-END COUNT
Method: substitute-if NEWITEM PRED (S sequence) &rest KEYWORD-ARGS &key KEY START END FROM-END COUNT
Generic Function: substitute-if-not NEWITEM PRED COLLECTION &key KEY START END FROM-END COUNT

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

Package

fset

Source

fset.lisp (file)

Methods
Method: substitute-if-not NEWITEM PRED (S seq) &key KEY START END FROM-END COUNT
Method: substitute-if-not NEWITEM PRED (S sequence) &rest KEYWORD-ARGS &key KEY START END FROM-END COUNT
Generic Function: 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’.

Package

fset

Source

tuples.lisp (file)

Methods
Method: tuple-merge (TUP1 tuple) (TUP2 tuple) &optional VAL-FN
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: union (BS1 bounded-set) (BS2 bounded-set) &key
Source

bounded-sets.lisp (file)

Method: union (S set) (CS complement-set) &key
Source

complement-sets.lisp (file)

Method: union (CS complement-set) (S set) &key
Source

complement-sets.lisp (file)

Method: union (CS1 complement-set) (CS2 complement-set) &key
Source

complement-sets.lisp (file)

Method: union (BR1 wb-2-relation) (BR2 wb-2-relation) &key
Source

relations.lisp (file)

Method: union (S0 interval-set) (S1 interval-set) &key
Source

interval.lisp (file)

Method: union (B wb-bag) (S wb-set) &key
Method: union (S wb-set) (B wb-bag) &key
Method: union (B1 wb-bag) (B2 wb-bag) &key
Method: union (S1 wb-set) (S2 wb-set) &key
Method: union (LS1 list) (LS2 list) &rest KEYWORD-ARGS &key TEST TEST-NOT
Generic Function: 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).

Package

fset

Source

fset.lisp (file)

Methods
Method: with (BS1 bounded-set) X &optional ARG2
Source

bounded-sets.lisp (file)

Method: with (CS complement-set) X &optional ARG2
Source

complement-sets.lisp (file)

Method: with (REL wb-list-relation) TUPLE &optional ARG2
Source

relations.lisp (file)

Method: with (BR wb-2-relation) X &optional Y
Source

relations.lisp (file)

Method: with (S interval-set) (IV interval) &optional ARG2
Source

interval.lisp (file)

Method: with (TUPLE tuple) (KEY tuple-key) &optional VALUE
Source

tuples.lisp (file)

Method: with (S wb-seq) IDX &optional VAL
Method: with (M wb-map) KEY &optional VALUE
Method: with (B wb-bag) VALUE &optional MULTIPLICITY
Method: with (S wb-set) VALUE &optional ARG2
Generic Function: with-default COLLECTION NEW-DEFAULT

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

Package

fset

Source

fset.lisp (file)

Methods
Method: with-default (S wb-seq) NEW-DEFAULT
Method: with-default (M wb-map) NEW-DEFAULT
Generic Function: 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.

Package

fset

Source

fset.lisp (file)

Methods
Method: with-first (S wb-seq) VAL
Generic Function: with-last SEQ VAL

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

Package

fset

Source

fset.lisp (file)

Methods
Method: with-last (S wb-seq) VAL
Generic Function: with-query REG PATTERN METAPATTERN QUERY &optional ARITY
Package

fset

Methods
Method: with-query (REG query-registry) (PATTERN list) (METAPATTERN list) QUERY &optional ARITY
Source

relations.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.5 Structures

Structure: 2-relation ()

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

Package

fset

Source

relations.lisp (file)

Direct superclasses

relation (structure)

Direct subclasses

wb-2-relation (structure)

Direct methods
Structure: bag ()

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

Package

fset

Source

order.lisp (file)

Direct superclasses

collection (structure)

Direct subclasses

wb-bag (structure)

Direct methods
Structure: 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.)

Package

fset

Source

bounded-sets.lisp (file)

Direct superclasses

set (structure)

Direct methods
Direct slots
Slot: universe
Readers

bounded-set-universe (function)

Writers

(setf bounded-set-universe) (function)

Slot: set
Readers

bounded-set-set (function)

Writers

(setf bounded-set-set) (function)

Slot: complement?
Readers

bounded-set-complement? (function)

Writers

(setf bounded-set-complement?) (function)

Structure: collection ()

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

Package

fset

Source

order.lisp (file)

Direct superclasses

structure-object (structure)

Direct subclasses
Structure: dyn-tuple ()

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

Package

fset

Source

tuples.lisp (file)

Direct superclasses

tuple (structure)

Direct methods
  • domain (method)
  • print-object (method)
Direct slots
Slot: descriptor
Readers

dyn-tuple-descriptor (function)

Writers

(setf dyn-tuple-descriptor) (function)

Slot: contents
Readers

dyn-tuple-contents (function)

Writers

(setf dyn-tuple-contents) (function)

Structure: 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.

Package

fset

Source

relations.lisp (file)

Direct superclasses

relation (structure)

Direct subclasses

wb-list-relation (structure)

Structure: map ()

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

Package

fset

Source

order.lisp (file)

Direct superclasses

collection (structure)

Direct subclasses

wb-map (structure)

Direct methods
Direct slots
Slot: default
Readers

map-default (function)

Writers

(setf map-default) (function)

Structure: query-registry ()
Package

fset

Source

relations.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods
Direct slots
Slot: arity
Readers

query-registry-arity (function)

Writers

(setf query-registry-arity) (function)

Slot: indices
Readers

query-registry-indices (function)

Writers

(setf query-registry-indices) (function)

Slot: key-index
Readers

query-registry-key-index (function)

Writers

(setf query-registry-key-index) (function)

Structure: relation ()

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

Package

fset

Source

relations.lisp (file)

Direct superclasses

collection (structure)

Direct subclasses
Direct methods
Structure: seq ()

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.

Package

fset

Source

order.lisp (file)

Direct superclasses

collection (structure)

Direct subclasses

wb-seq (structure)

Direct methods
Direct slots
Slot: default
Readers

seq-default (function)

Writers

(setf seq-default) (function)

Structure: set ()

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

Package

fset

Source

order.lisp (file)

Direct superclasses