A.3 library( assoc ): Association lists

Authors: Richard A. O'Keefe, L.Damas, V.S.Costa and Markus Triska

Elements of an association list have 2 components: A (unique) key and a value. Keys should be ground, values need not be. An association list can be used to fetch elements via their keys and to enumerate its elements in ascending order of their keys. The library(assoc) module uses AVL trees to implement association lists. This makes inserting, changing and fetching a single element an O(log(N)) (where N denotes the number of elements in the list) expected time (and worst-case time) operation.

assoc_to_list(+Assoc, -List)
List is a list of Key-Value pairs corresponding to the associations in Assoc in ascending order of keys.
assoc_to_keys(+Assoc, -List)
List is a list of Keys corresponding to the associations in Assoc in ascending order.
assoc_to_values(+Assoc, -List)
List is a list of Values corresponding to the associations in Assoc in ascending order of the keys they are associated to.
empty_assoc(-Assoc)
Assoc is un
chr_leash(+Spec)
Define the set of CHR ports on which the CHR tracer asks for user intervention (i.e. stops). Spec is either a list of ports as defined in section 7.4.1 or a predefined `alias'. Defined aliases are: full to stop at all ports, none or off to never stop, and default to stop at the call, exit, fail, wake and apply ports. See also leash/1.
chr_show_store(+Mod)
Prints all suspended constraints of module Mod to the standard output. This predicate is automatically called by the SWI-Prolog top-level at the end of each query for every CHR module currently loaded. The Prolog flag chr_toplevel_show_store controls whether the top-level shows the constraint stores. The value true enables it. Any other value disables it.
find_chr_constraint(-Constraint)
Returns a constraint in the constraint store. Via backtracking, all constraints in the store can be enumerated.

./usr/lib/swi-prolog/doc/Manual/license.html0000644000000000000000000002157111042605010017657 0ustar rootroot SWI-Prolog 5.6.58 Reference Manual