Replies: 1 comment
-
Thank you very much for your kind words, and for sharing such a nice example! Pure logical programming truly is wonderful, and I hope that it will become more widely known and more widely used in practice as time goes on. Scryer-prolog is a wonderful project, and I feel very blessed having been able to contribute to it, even if in just a tiny way. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Dear all,
today I came across a discussion about filtering even numeric elements from a list: https://swi-prolog.discourse.group/t/fully-understanding-the-intricacies-of-the-prolog-code-design-process/7552
I came up with the following relation
list_odds/2
, usinglibrary(clpz)
,library(lambda)
andlibrary(reif)
:Note the use of
(#=)/3
fromlibrary(clpz)
! This predicate was suggested by @Qqwy in triska/clpz#12, and Scryer Prolog is currently the only Prolog system that ships with it.The defined relation works correctly in all usage modes, such as the most general query:
Due to its purity, it can be used with different execution strategies, such as iterative deepening, fairly enumerating all answers:
Concrete solutions can also be computed:
Note the deterministic success!
And this is another instance of the phenomenon I mentioned in #2320: How impressive the contributions to the newest declarative constructs often are, and in many cases even by complete beginners! Even recognizing the need for such a construct is an impressive feat, even more so contributing it! Thank you a lot to you @Qqwy and to everyone who is interested in applying and improving these features! They help us all to write general and efficient Prolog code with often very short definitions!
Enjoy!
Markus
Beta Was this translation helpful? Give feedback.
All reactions