SWI-Prolog 5.11.18 Reference Manual: Section F.2

## F.2 Library predicates

### F.2.1 `library(aggregate)`

aggregate/3 | Aggregate bindings in Goal according to Template.
aggregate/4 | Aggregate bindings in Goal according to Template.
aggregate_all/3 | Aggregate bindings in Goal according to Template.
aggregate_all/4 | Aggregate bindings in Goal according to Template.
foreach/2 | True if the conjunction of instances of Goal using the bindings from Generator is true.
free_variables/4 | In order to handle variables properly, we have to find all the universally quantified variables in the Generator.

### F.2.2 `library(apply)`

exclude/3 | Filter elements for which Goal fails.
include/3 | Filter elements for which Goal succeed.
maplist/2 | True if Goal can succesfully be applied on all elements of List.
maplist/3 | True if Goal can succesfully be applied to all succesive pairs of elements of List1 and List2.
maplist/4 | True if Goal can succesfully be applied to all succesive triples of elements of List1..List3.
maplist/5 | True if Goal can succesfully be applied to all succesive quadruples of elements of List1..List4.
partition/4 | Filter elements of List according to Pred.
partition/5 | Filter list according to Pred in three sets.

### F.2.3 `library(assoc)`

assoc_to_list/2 | Translate assoc into a pairs list
assoc_to_keys/2 | Translate assoc into a key list
assoc_to_values/2 | Translate assoc into a value list
empty_assoc/1 | Test/create an empty assoc
gen_assoc/3 | Non-deterministic enumeration of assoc
get_assoc/3 | Get associated value
get_assoc/5 | Get and replace associated value
list_to_assoc/2 | Translate pair list to assoc
map_assoc/2 | Test assoc values
map_assoc/3 | Map assoc values
max_assoc/3 | Max key-value of an assoc
min_assoc/3 | Min key-value of an assoc
ord_list_to_assoc/3 | Translate ordered list into an assoc
put_assoc/4 | Add association to an assoc

### F.2.4 `library(broadcast)`

broadcast/1 | Send event notification
broadcast_request/1 | Request all agents
listen/2 | Listen to event notifications
listen/3 | Listen to event notifications
unlisten/1 | Stop listening to event notifications
unlisten/2 | Stop listening to event notifications
unlisten/3 | Stop listening to event notifications
listening/3 | Who is listening to event notifications?

### F.2.5 `library(charsio)`

atom_to_chars/2 | Convert Atom into a list of character codes.
atom_to_chars/3 | Convert Atom into a difference-list of character codes.
format_to_chars/3 | Use format/2 to write to a list of character codes.
format_to_chars/3 | Use format/2 to write to a list of character codes.
number_to_chars/2 | Convert Atom into a list of character codes.
number_to_chars/3 | Convert Number into a difference-list of character codes.
open_chars_stream/2 | Open Codes as an input stream.
read_from_chars/2 | Read Codes into Term.
read_term_from_chars/3 | Read Codes into Term.
with_output_to_chars/2 | Run Goal with as once/1.
with_output_to_chars/3 | Run Goal with as once/1.
with_output_to_chars/4 | As with_output_to_chars/2, but Stream is unified with the temporary stream.
write_to_chars/2 | Codes is a list of character codes produced by write/1 on Term.
write_to_chars/3 | Codes is a difference-list of character codes produced by write/1 on Term.

### F.2.6 `library(check)`

check/0 | Program completeness and consistency
list_undefined/0 | List undefined predicates
list_autoload/0 | List predicates that require autoload
list_redefined/0 | List locally redefined predicates

### F.2.7 `library(csv)`

csv_read_file/2 | Read a CSV file into a list of rows.
csv_read_file/3 | Read a CSV file into a list of rows.
csv_write_file/2 | Write a list of Prolog terms to a CSV file.
csv_write_file/3 | Write a list of Prolog terms to a CSV file.
csv/3 | Prolog DCG to `read/write' CSV data.
csv/4 | Prolog DCG to `read/write' CSV data.

### F.2.8 `library(lists)`

append/2 | Concatenate a list of lists.
append/3 | List1AndList2 is the concatination of List1 and List2.
delete/3 | Is true when Lis1, with all occurences of Elem deleted results in List2.
flatten/2 | Is true it List2 is a non nested version of List1.
intersection/3 | True if Set3 unifies with the intersection of Set1 and Set2.
is_set/1 | True if Set is a proper list without duplicates.
last/2 | Succeeds if `Last' unifies with the last element of `List'.
list_to_set/2 | True when Set has the same element as List in the same order.
max_list/2 | True if Max is the largest number in List.
member/2 | True if Elem is a member of List.
min_list/2 | True if Min is the largest number in List.
nextto/3 | True of Y follows X in List.
nth0/3 | True if Elem is the Index'th element of List.
nth1/3 | Is true when Elem is the Index'th element of List.
numlist/3 | List is a list [Low, Low+1, ... High].
permutation/2 | permutation(Xs, Ys) is true when Xs is a permutation of Ys.
prefix/2 | True iff Part is a leading substring of Whole.
reverse/2 | Is true when the elements of List2 are in reverse order compared to List1.
select/3 | Is true when List1, with Elem removed results in List2.
select/4 | Is true when select(X, XList) and select(Y, YList) are true, X and Y appear in the same locations of their respective lists and same_length(XList, YList) is true.
selectchk/3 | Semi-deterministic removal of first element in List that unifies Elem.
selectchk/4 | Semi-deterministic version of select/4.
subset/2 | True if all elements of SubSet belong to Set as well.
subtract/3 | Delete all elements from `Set' that occur in `Delete' (a set) and unify the result with `Result'.
sumlist/2 | Sum is the result of adding all numbers in List.
union/3 | True if Set3 unifies with the union of Set1 and Set2.

### F.2.9 `library(option)`

merge_options/3 | Merge two option lists.
meta_options/3 | Perform meta-expansion on options that are module-sensitive.
option/2 | Get an option from a OptionList.
option/3 | Get an option from a OptionList.
select_option/3 | Get and remove option from an option list.
select_option/4 | Get and remove option with default value.

### F.2.10 `library(ordsets)`

ord_empty/1 | Test empty ordered set
list_to_ord_set/2 | Create ordered set
ord_add_element/3 | Add element to ordered set
ord_del_element/3 | Delete element from ordered set
ord_intersect/2 | Test non-empty intersection
ord_intersection/3 | Compute intersection
ord_disjoint/2 | Test empty intersection
ord_subtract/3 | Delete set from set
ord_union/3 | Union of two ordered sets
ord_union/4 | Union and difference of two ordered sets
ord_subset/2 | Test subset
ord_memberchk/2 | Deterministically test membership

### F.2.11 `library(prologxref)`

prolog:called_by/2 | (hook) Extend cross-referencer
xref_built_in/1 | Examine defined built-ins
xref_called/3 | Examine called predicates
xref_clean/1 | Remove analysis of source
xref_current_source/1 | Examine cross-referenced sources
xref_defined/3 | Examine defined predicates
xref_exported/2 | Examine exported predicates
xref_module/2 | Module defined by source
xref_source/1 | Cross-reference analysis of source

### F.2.12 `library(pairs)`

group_pairs_by_key/2 | Group values with the same key.
map_list_to_pairs/3 | Create a key-value list by mapping each element of List.
pairs_keys/2 | Remove the values from a list of Key-Value pairs.
pairs_keys_values/3 | True if Keys holds the keys of Pairs and Values the values.
pairs_values/2 | Remove the keys from a list of Key-Value pairs.
transpose_pairs/2 | Swap Key-Value to Value-Key and sort the result on Value (the new key) using keysort/2.

### F.2.13 `library(pio)`

#### F.2.13.1 `library(pure_input)`

phrase_from_file/2 | Process the content of File using the DCG rule Grammar.
phrase_from_file/3 | As phrase_from_file/2, providing additional Options.
stream_to_lazy_list/2 | Create a lazy list representing the character codes in Stream.

### F.2.14 `library(readutil)`

read_line_to_codes/2 | Read line from a stream
read_line_to_codes/3 | Read line from a stream
read_stream_to_codes/2 | Read contents of stream
read_stream_to_codes/3 | Read contents of stream
read_file_to_codes/3 | Read contents of file
read_file_to_terms/3 | Read contents of file to Prolog terms

### F.2.15 `library(record)`

record/1 | Define named fields in a term

### F.2.16 `library(registry)`

This library is only available on Windows systems.

registry_get_key/2 | Get principal value of key
registry_get_key/3 | Get associated value of key
registry_set_key/2 | Set principal value of key
registry_set_key/3 | Set associated value of key
registry_delete_key/1 | Remove a key
shell_register_file_type/4 | Register a file-type
shell_register_dde/6 | Register DDE action
shell_register_prolog/1 | Register Prolog

### F.2.17 `library(ugraphs)`

vertices_edges_to_ugraph/3 | Create unweighted graph
vertices/2 | Find vertices in graph
edges/2 | Find edges in graph
add_vertices/3 | Add vertices to graph
del_vertices/3 | Delete vertices from graph
add_edges/3 | Add edges to graph
del_edges/3 | Delete edges from graph
transpose/2 | Invert the direction of all edges
neighbors/3 | Find neighbors of vertice
neighbours/3 | Find neighbors of vertice
complement/2 | Inverse presense of edges
compose/3 |
top_sort/2 | Sort graph topologically
top_sort/3 | Sort graph topologically
transitive_closure/2 | Create transitive closure of graph
reachable/3 | Find all reachable vertices
ugraph_union/3 | Union of two graphs

### F.2.18 `library(url)`

file_name_to_url/2 | Translate between a filename and a file:`//` URL.
global_url/3 | Translate a possibly relative URL into an absolute one.
http_location/2 | Construct or analyze an HTTP location.
is_absolute_url/1 | True if URL is an absolute URL.
parse_url/2 | Construct or analyse a URL.
parse_url/3 | Similar to parse_url/2 for relative URLs.
parse_url_search/2 | Construct or analyze an HTTP search specification.
set_url_encoding/2 | Query and set the encoding for URLs.
url_iri/2 | Convert between a URL, encoding in US-ASCII and an IRI.
www_form_encode/2 | En/Decode between native value and application/x-www-form-encoded.

### F.2.19 `library(www_browser)`

www_open_url/1 | Open a web-page in a browser

### F.2.20 `library(clp/clpfd)`

#/\/2 | P and Q hold.
#</2 | X is less than Y.
#<==/2 | Q implies P.
#<==>/2 | P and Q are equivalent.
#=/2 | X equals Y.
#=</2 | X is less than or equal to Y.
#==>/2 | P implies Q.
#>/2 | X is greater than Y.
#>=/2 | X is greater than or equal to Y.
#\/1 | The reifiable constraint Q does _not_ hold.
#\//2 | P or Q holds.
#\=/2 | X is not Y.
all_different/1 | Vars are pairwise distinct.
all_distinct/1 | Like all_different/1, with stronger propagation.
automaton/3 | Equivalent to automaton(_, _, Signature, Nodes, Arcs, [], [], _), a common use case of automaton/8.
automaton/8 | True if the finite automaton induced by Nodes and Arcs (extended with Counters) accepts Signature.
chain/2 | Zs is a list of finite domain variables that are a chain with respect to the partial order Relation, in the order they appear in the list.
circuit/1 | True if the list Vs of finite domain variables induces a Hamiltonian circuit, where the k-th element of Vs denotes the successor of node k.
element/3 | The N-th element of the list of finite domain variables Vs is V.
fd_dom/2 | Dom is the current domain (see in/2) of Var.
fd_inf/2 | Inf is the infimum of the current domain of Var.
fd_size/2 | Size is the number of elements of the current domain of Var, or the atom *sup* if the domain is unbounded.
fd_sup/2 | Sup is the supremum of the current domain of Var.
fd_var/1 | True iff Var is a CLP(FD) variable.
global_cardinality/2 | Equivalent to global_cardinality(Vs, Pairs, []).
global_cardinality/3 | Vs is a list of finite domain variables, Pairs is a list of Key-Num pairs, where Key is an integer and Num is a finite domain variable.
in/2 | Var is an element of Domain.
indomain/1 | Bind Var to all feasible values of its domain on backtracking.
ins/2 | The variables in the list Vars are elements of Domain.
label/1 | Equivalent to labeling([], Vars).
labeling/2 | Labeling means systematically trying out values for the finite domain variables Vars until all of them are ground.
lex_chain/1 | Lists are lexicographically non-decreasing.
scalar_product/4 | Cs is a list of integers, Vs is a list of variables and integers.
serialized/2 | Constrain a set of intervals to a non-overlapping sequence.
sum/3 | The sum of elements of the list Vars is in relation Rel to Expr, where Rel is #=, #`\`=, #<, #>, `#=<` or #>=.
transpose/2 | Transpose a list of lists of the same length.
tuples_in/2 | Relation must be a list of lists of integers.
zcompare/3 | Analogous to compare/3, with finite domain variables A and B.

### F.2.21 `library(clpqr)`

entailed/1 | Check if constraint is entailed
inf/2 | Find the infimum of an expression
sup/2 | Find the supremum of an expression
minimize/1 | Minimizes an expression
maximize/1 | Maximizes an expression
bb_inf/3 | Infimum of expression for mixed-integer problems
bb_inf/4 | Infimum of expression for mixed-integer problems
bb_inf/5 | Infimum of expression for mixed-integer problems
dump/3 | Dump constraints on variables

### F.2.22 `library(clp/simplex)`

assignment/2 | Solve assignment problem
constraint/3 | Add linear constraint to state
constraint/4 | Add named linear constraint to state
constraint_add/4 | Extend a named constraint
gen_state/1 | Create empty linear program
maximize/3 | Maximize objective function in to linear constraints
minimize/3 | Minimize objective function in to linear constraints
objective/2 | Fetch value of objective function
shadow_price/3 | Fetch shadow price in solved state
transportation/4 | Solve transportation problem
variable_value/3 | Fetch value of variable in solved state

### F.2.23 `library(thread_pool)`

current_thread_pool/1 | True if Name refers to a defined thread pool.
thread_create_in_pool/4 | Create a thread in Pool.
thread_pool_create/3 | Create a pool of threads.
thread_pool_destroy/1 | Destroy the thread pool named Name.
thread_pool_property/2 | True if Property is a property of thread pool Name.