2

I wrote this code in SWI-Prolog using the clpfd module but when porting to YAP I found that the cumulative/2 predicate is unavailable according to the error message given in the shell. So, I tried to look online for clpfd documentation but found almost nothing.

>  EXISTENCE ERROR- procedure cumulative/2 is undefined, called from
> context  prolog:$command/4
>                  Goal was user:cumulative([task(_D543,5,_D539,6,_131120),task(_D535,5,_D531,6,_131128),task(_D527,6,_D523,8,_131136),task(_D519,10,_D515,4,_131144),task(_D511,3,_D507,5,_131152),task(_D503,5,_D499,5,_131160),task(_D495,4,_D491,5,_131168),task(_D487,1,_D483,7,_131176)],[limit(15)])

The module clpfd somehow imported without error.

Paulo Moura
  • 18,373
  • 3
  • 23
  • 33
M.K
  • 179
  • 1
  • 2
  • 10
  • 2
    Download the [most recent](https://github.com/SWI-Prolog/swipl-devel/blob/master/library/clp/clpfd.pl) version of `library(clpfd)` of SWI. It should run work with YAP, too. – false Feb 22 '15 at 16:38
  • But then won't I have to consult the clpfd file every time I need to use it ?. Is there another way ?. Anyway, thanks. – M.K Feb 22 '15 at 17:01
  • 2
    There is a file `clpfd.pl` already in YAP replace it by the new version. And then you always have to say: `:- use_module(library(clpfd)).` Same in SICStus and SWI. – false Feb 22 '15 at 18:29

0 Answers0