ADDED: CLP(ℤ), Constraint Logic Programming over Integers

library(clpz) implements declarative integer arithmetic.

The most important predicates for reasoning about integers are:

    (#=)/2    equality
    (#\=)/2   disequality
    (#<)/2    less than
    (#>)/2    greater than
    (#=<)/2   less than or equal to
    (#>=)/2   greater than or equal to

In addition, the library provides several global constraints, such as
all_distinct/1 and global_cardinality/2, and reification predicates
that reflect the truth values of constraints into integer variables.

Enumeration predicates such label/1 and labeling/2 can be used to
search for solutions over finite domains.

Almost all Prolog programs also reason about integers. Therefore, I
recommend to add this library to your .scryerrc configuration file so
that declarative integer arithmetic is available in all your programs.

More information about CLP(ℤ):

    https://www.metalevel.at/prolog/clpz

Enjoy!
This commit is contained in:
Markus Triska
2020-04-04 23:35:39 +02:00
parent 560298655b
commit 8b1df2e9ca
2 changed files with 7627 additions and 0 deletions

View File

@@ -246,6 +246,11 @@ The modules that ship with Scryer&nbsp;Prolog are also called
* [`reif`](src/prolog/lib/reif.pl) * [`reif`](src/prolog/lib/reif.pl)
providing `if_/3`, `tfilter/3` and related predicates providing `if_/3`, `tfilter/3` and related predicates
as described in *Indexing&nbsp;dif/2*. as described in *Indexing&nbsp;dif/2*.
* [`clpz`](src/prolog/lib/clpz.pl)
CLP(): Constraint Logic Programming over Integers,
providing declarative integer arithmetic via `(#=)/2`, `(#\=)/2`,
`(#>=)/2` etc., and various global constraints and
enumeration predicates for solving combinatorial tasks.
* [`pairs`](src/prolog/lib/pairs.pl) * [`pairs`](src/prolog/lib/pairs.pl)
By convention, *pairs* are Prolog terms with By convention, *pairs* are Prolog terms with
principal&nbsp;functor `(-)/2`, written as `Key-Value`. principal&nbsp;functor `(-)/2`, written as `Key-Value`.

7622
src/prolog/lib/clpz.pl Normal file

File diff suppressed because it is too large Load Diff