E.4 Library predicates

E.4.1 library(aggregate)

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

E.4.2 library(apply)

exclude/3Filter elements for which Goal fails.
include/3Filter elements for which Goal succeed.
partition/4Filter elements of List according to Pred.
partition/5Filter list according to Pred in three sets.

E.4.3 library(assoc)

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

E.4.4 library(broadcast)

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

E.4.5 library(check)

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

E.4.6 library(lists)

append/2Concatenate a list of lists
append/3Concatenate lists
delete/3Delete all matching members from a list
flatten/2Transform nested list into flat list
intersection/3Set intersection
is_set/1Type check for a set
list_to_set/2Remove duplicates
max_list/2Largest number in a list
member/2Element is member of a list
min_list/2Smallest number in a list
nextto/3Y follows X in List
nth0/3N-th element of a list (0-based)
nth1/3N-th element of a list (1-based)
numlist/3Create list of integers in interval
permutation/2Test/generate permutations of a list
reverse/2Inverse the order of the elements in a list
select/3Select element of a list
subset/2Check subset relation for unordered sets
subtract/3Delete elements that do not satisfy condition
sumlist/2Add all numbers in a list
union/3Union of two sets

E.4.7 library(option)

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

E.4.8 library(ordsets)

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

E.4.9 library(prologxref)

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

E.4.10 library(pairs)

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

E.4.11 library(pio)

E.4.11.1 library(pure_input)

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

E.4.12 library(readutil)

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

E.4.13 library(record)

record/1Define named fields in a term

E.4.14 library(registry)

This library is only available on Windows systems.

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

E.4.15 library(ugraphs)

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

E.4.16 library(url)

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

E.4.17 library(www_browser)

www_open_url/1Open a web-page in a browser

E.4.18 library(clp/clp_distinct)

all_distinct/1Demand distinct values
vars_in/2Declare domain of variable as set
vars_in/3Declare domain of variable as interval

E.4.19 library(clp/clpfd)

#/\/2P and Q hold.
#</2X is less than Y.
#<==/2Q implies P.
#<==>/2P and Q are equivalent.
#=/2X equals Y.
#=</2X is less than or equal to Y.
#==>/2P implies Q.
#>/2X is greater than Y.
#>=/2X is greater than or equal to Y.
#\/1The reifiable constraint Q does _not_ hold.
#\//2P or Q holds.
#\=/2X is not Y.
all_different/1Vars are pairwise distinct.
all_distinct/1Like all_different/1, with stronger propagation.
fd_dom/2Dom is the current domain (see in/2) of Var.
fd_inf/2Inf is the infimum of the current domain of Var.
fd_size/2Size is the number of elements of the current domain of Var, or the atom *sup* if the domain is unbounded.
fd_sup/2Sup is the supremum of the current domain of Var.
fd_var/1True iff Var is a CLP(FD) variable.
in/2Var is an element of Domain.
indomain/1Bind Var to all feasible values of its domain on backtracking.
ins/2The variables in the list Vars are elements of Domain.
label/1Equivalent to labeling([], Vars).
labeling/2Labeling means systematically trying out values for the finite domain variables Vars until all of them are ground.
lex_chain/1Lists are lexicographically non-decreasing.
serialized/2Constrain a set of intervals to a non-overlapping sequence.
sum/3The sum of elements of the list Vars is in relation Rel to Expr.
tuples_in/2Relation must be a ground list of lists of integers.

E.4.20 library(clpqr)

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

E.4.21 library(clp/simplex)

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