Did you know ... | Search Documentation: |
![]() | Pack relational_clpq -- README.md |
A Prolog pack built on top of CLPFD that allows reasoning about the rational numbers.
To-do:
To install the relational-clpq library, type the following in the SWI-Prolog shell:
? - pack_install('relational_clpq'). true.
or, alternatively, you can install directly from this github repo:
?- pack_install('https://github.com/LuizFBR/Relational-CLPQ.git'). true.
1 ?- 10 :=: 10 . true.
The following example shows clpfd's purity (two-way relation) in action:
2 ?- (10 + X) / Y :=: Z . clpfd: #=(10+ #(X), #(_A)), clpfd: #=(#(Z)* #(Y), #(_A)) .
3 ?- 1/2 :=<: 1/2 . true ; false.
3 ?- 1/2 :=<: 1/4 . false.
Operator | Meaning |
---|---|
Expr1 :=: Expr2 | Expr1 equals Expr2 |
Expr1 :\=: Expr2 | Expr1 is not equal to Expr2 |
Expr1 :>=: Expr2 | Expr1 is greater than or equal to Expr2 |
Expr1 :=<: Expr2 | Expr1 is less than or equal to Expr2 |
Expr1 :>: Expr2 | Expr1 is greater than Expr2 |
Expr1 :<: Expr2 | Expr1 is less than Expr2 |
Import this module with
:- use_module(library(relational_clpq)).
This library depends on Markus Triskas' clpfd library: