Until rational numbers become first class citizens in SICStus Prolog, rational arithmetics has to be emulated. Because of the emulation it is too expensive to support arithmetics with automatic coercion between all sorts of numbers, like you find it in CommonLisp, for example.
You must choose whether you want to operate in the field of Q (Rationals) or R (Reals):
| ?- use_module(library(clpq)). or | ?- use_module(library(clpr)).
You can also load both modules, but the exported
predicates listed below will name clash
(see ref-mod-ncl). You can avoid the interactive resolution dialog
if the importation is skipped, e.g. via:
|• CLPQR Notational Conventions:||Notational Conventions|
|• CLPQR Solver Predicates:||Solver Predicates|
|• CLPQR Unification:||Unification|
|• CLPQR Feedback:||Feedback and Bindings|