5 ms·
I've really liked Prolog during university, but I've never used a constraint solver embedded in Prolog. Do you know of any non commercial Prolog system with thi
by alserio 5y ago
I've really liked Prolog during university, but I've never used a constraint solver embedded in Prolog. Do you know of any non commercial Prolog system with this kind of integration to play with? I remember using SWIProlog at the time
- triska 5y agoGNU Prolog has one of the fastest constraint solvers over finite domains (i.e., small integers), and its constraints are available out of the box, without loading any library. For example: $ gprolog GNU Prolog 1.4.5 (64 bits) Compiled Mar 24 2020, 20:46:07 with gcc By Daniel Diaz Copyright (C) 1999-2020 Daniel Diaz | ?- X #> 3. X = _#2(4..268435455) yes GNU Prolog 1.5.0 was recently released, and the source repository is now available at: https://github.com/didoudiaz/gprolog https://github.com/didoudiaz/gprolog GNU Prolog is a nice Prolog system for learning Prolog, also because it is currently the only free system that correctly handles all syntactic ISO conformity tests collected at: https://www.complang.tuwien.ac.at/ulrich/iso-prolog/conformity_testing https://www.complang.tuwien.ac.at/ulrich/iso-prolog/conformi... This means that GNU Prolog can be reliably used to learn what is valid Prolog syntax and what is not.
- alserio 5y agoThanks!
- jjgreen 5y agoSWI is still going strong, the main git repo looks to be consistently merging 3-4 PRs a month.
- oldsecondhand 5y agoSWI Prolog also comes with constraint solvers. It has CLP(B) (booleans), CLP(FD)(finite domain), CLP(Q,R) (rationals and reals) and CHR (constraint handling rules). These come as standard libraries, no additional installation needed. If you want to get started, I recommend starting with CLP(FD) as that has a lot of tutorials and is highly compatible between Prolog implementations.
- alserio 5y agoNice. Thank you