A The SWI-Prolog library

This chapter documents the SWI-Prolog library. As SWI-Prolog provides auto-loading, there is little difference between library predicates and built-in predicates. Part of the library is therefore documented in the rest of the manual. Library predicates differ from built-in predicates in the following ways:

The documentation of the library has just started. Material from the standard packages should be moved here, some material from other parts of the manual should be moved too and various libraries are not documented at all.


Section Index


A.1 library(aggregate): Aggregation operators on backtrackable predicates
A.2 library(apply): Apply predicates on a list
A.3 library(assoc): Association lists
A.3.1 Introduction
A.3.2 Creating association lists
A.3.3 Querying association lists
A.3.4 Modifying association lists
A.3.5 Conversion predicates
A.3.6 Reasoning about association lists and their elements
A.4 library(broadcast): Broadcast and receive event notifications
A.5 library(charsio): I/O on Lists of Character Codes
A.6 library(check): Consistency checking
A.7 library(clpb): CLP(B): Constraint Logic Programming over Boolean Variables
A.7.1 Introduction
A.7.2 Boolean expressions
A.7.3 Interface predicates
A.7.4 Examples
A.7.5 Obtaining BDDs
A.7.6 Enabling monotonic CLP(B)
A.7.7 Example: Pigeons
A.7.8 Example: Boolean circuit
A.7.9 Acknowledgments
A.7.10 CLP(B) predicate index
A.8 library(clpfd): CLP(FD): Constraint Logic Programming over Finite Domains
A.8.1 Introduction
A.8.2 Arithmetic constraints
A.8.3 Declarative integer arithmetic
A.8.4 Example: Factorial relation
A.8.5 Combinatorial constraints
A.8.6 Domains
A.8.7 Example: Sudoku
A.8.8 Residual goals
A.8.9 Core relations and search
A.8.10 Example: Eight queens puzzle
A.8.11 Optimisation
A.8.12 Reification
A.8.13 Enabling monotonic CLP(FD)
A.8.14 Custom constraints
A.8.15 Applications
A.8.16 Acknowledgments
A.8.17 CLP(FD) predicate index
A.8.17.1 Arithmetic constraints
A.8.17.2 Membership constraints
A.8.17.3 Enumeration predicates
A.8.17.4 Global constraints
A.8.17.5 Reification predicates
A.8.17.6 Reflection predicates
A.8.18 Closing and opening words about CLP(FD)
A.9 library(clpqr): Constraint Logic Programming over Rationals and Reals
A.9.1 Solver predicates
A.9.2 Syntax of the predicate arguments
A.9.3 Use of unification
A.9.4 Non-linear constraints
A.9.5 Status and known problems
A.10 library(csv): Process CSV (Comma-Separated Values) data
A.11 library(debug): Print debug messages and test assertions
A.12 library(error): Error generating support
A.13 library(gensym): Generate unique identifiers
A.14 library(iostream): Utilities to deal with streams
A.15 library(lists): List Manipulation
A.16 library(main): Provide entry point for scripts
A.17 library(nb_set): Non-backtrackable set
A.18 library(www_browser): Activating your Web-browser
A.19 library(option): Option list processing
A.20 library(optparse): command line parsing
A.20.1 Notes and tips
A.21 library(ordsets): Ordered set manipulation
A.22 library(pairs): Operations on key-value lists
A.23 library(persistency): Provide persistent dynamic predicates
A.24 library(pio): Pure I/O
A.24.1 library(pure_input): Pure Input from files and streams
A.25 library(predicate_options): Declare option-processing of predicates
A.25.1 The strength and weakness of predicate options
A.25.2 Options as arguments or environment?
A.25.3 Improving on the current situation
A.25.3.1 Options as types
A.25.3.2 Reflective access to options
A.26 library(prolog_pack): A package manager for Prolog
A.27 library(prolog_xref): Cross-reference data collection library
A.27.1 Extending the library
A.28 library(quasi_quotations): Define Quasi Quotation syntax
A.29 library(random): Random numbers
A.30 library(readutil): Reading lines, streams and files
A.31 library(record): Access named fields in a term
A.32 library(registry): Manipulating the Windows registry
A.33 library(simplex): Solve linear programming problems
A.33.1 Introduction
A.33.2 Delayed column generation
A.33.3 Solving LPs with special structure
A.33.4 Examples
A.33.4.1 Example 1
A.33.4.2 Example 2
A.33.4.3 Example 3
A.34 library(solution_sequences): Modify solution sequences
A.35 library(tabling): Tabled execution (SLG)
A.35.1 Example 1: using tabling for memoizing
A.35.2 Example 2: avoiding non-termination
A.35.3 Mode directed tabling
A.35.1 Tabling predicate reference
A.35.1.1 About the tabling implementation
A.35.1.2 Status of tabling
A.36 library(thread_pool): Resource bounded thread management
A.37 library(ugraphs): Unweighted Graphs
A.38 library(url): Analysing and constructing URL
A.39 library(varnumbers): Utilities for numbered terms
A.40 library(yall): Lambda expressions