Did you know ... | Search Documentation: |
![]() | Packs (add-ons) for SWI-Prolog |
Title: | A pure relational library for rational (fractions) arithmetic. |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 1.0.1 |
SHA1 sum: | 2e0f5b03356291b872400bb8e192c82a0eecbb48 |
Author: | Luiz Fernando https://github.com/LuizFBR |
Maintainer: | Luiz Fernando https://github.com/LuizFBR |
Packager: | Luiz Fernando https://github.com/LuizFBR |
Home page: | https://github.com/LuizFBR/relational_clpq |
Download URL: | https://github.com/LuizFBR/relational_clpq.git |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
1.0.1 | 2e0f5b03356291b872400bb8e192c82a0eecbb48 | 2 | https://github.com/LuizFBR/relational_clpq |
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:
https://www.swi-prolog.org/man/clpfd.html
Pack contains 4 files holding a total of 5.8K bytes.