I am trying to run the Delayed column generation example as provided by Markus Triska,
‘camels.pl’ may have been tested with Scryer Prolog 0.9.0 but when running swipl 8.5.7-41, I can’t even compile camel.pl.(The old source code I have mentions that it was tested against swipl 7.3.11)
It seems that several new librarys should be loaded
:- use_module(library(clpz)).
:- use_module(library(format)).
:- use_module(library(dcgs)).
:- use_module(library(between)).
What else has changed?
Is ‘Scryer’ a new Prolog? Is it possible to add the missing library’s to swipl (if so, how)?
It is not so much adding the libraries to SWI-Prolog as it is converting the example to SWI-Prolog. While I have not seen the code you note, by looking at the name of the libraries I would not be surprised if many of the needed predicates are already loaded and available with SWI-Prolog when started. Granted some tweaking may need to be done to the predicates (probably can be via wrappers or maybe a dialect) and adding the missing functionality if needed.
The one thing that might cause the entire thing to fail is something in library(clpz) which can not be easily updated/ported. SWI-Prolog has library(clpfd) but as it notes
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Optimisation uses destructive assignment to save the computed
extremum over backtracking. Failure is used to get rid of copies of
attributed variables that are created in intermediate steps. At
least that's the intention - it currently doesn't work in SWI:
%?- X in 0..3, call_residue_vars(labeling([min(X)], [X]), Vs).
%@ X = 0,
%@ Vs = [_G6174, _G6177],
%@ _G6174 in 0..3
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
I would not take that to mean it can not run on SWI-Prolog as the note is about an optimization. I would dig deeper, maybe an earlier version before the optimisation.
library(clpz) is Markus’ follow up of library(clpfd). That resulted from a dispute about adding the SICStus attributed variable interface to SWI-Prolog next to the hProlog dynamic attributed variable interface it has now. That interface is pretty complicated and although @logicmoo and I tried to get it implemented we eventually reverted the changes due to stability and performance issues while I’ve still not seen a convincing argument why that interface is needed. So, alas, clpz will probably never run on SWI-Prolog.
The other libraries all seem to be built-in functionality, so you can simply remove the import. If the thing really needs clpz you are out of luck