I’m using as reference SWI-Prolog version 8.1.13, commit 3e2939d8767c221421b578a4a5e7904964907be6
I admit to being a pretty early-stage beginner in Prolog - maybe 10 hours practice. So, I may have missed something obvious to a more advanced user. However, please consider the following.
I’d like to load SWI Prolog’s CLP libraries in a different implementation of Prolog, if possible. (This is my ultimate goal, but not strictly the question I’m asking here. If you can definitively answer yea/nay/how on my goal, though, that’d obviate by question, anyway.) Looking at clpfd.pl, there’s a lot of code, leading me to hope that it was all defined in pure Prolog, and not just stubs calling C code or something. However, after fiddling with the code for a while, I noticed the following oddity in clpfd.pl:
X #= Y :- clpfd_equal(X, Y).
clpfd_equal(X, Y) :- clpfd_equal_(X, Y), reinforce(X).
Note that clpfd_equal
is defined in terms of clpfd_equal_
. I can find nowhere that clpfd_equal_
is defined, either in the Prolog libraries, or in the C source of SWI Prolog. My next best guess is that the trailing _
has a syntactic meaning, or that somehow it’s programmatically generated in the C source without clpfd_equal_
being explicitly written out anywhere. Would anybody happen to know? Thanks!