3

I'm trying to run the coins example given in SWI-Prolog's simplex library documentation, but I'm getting this error message:

$ rlwrap swipl coins.pl
Warning: /home/vitorferraz/junk/coins.pl:1:
Unknown message: simlpex(bounded)
Welcome to SWI-Prolog (threaded, 64 bits, version 7.6.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

1 ?- coins(S), variable_value(S, c(1), C1), variable_value(S, c(5), C5), variable_value(S, c(20), C20).
ERROR: Arithmetic: `rationalize/1' is not a function
ERROR: In:
ERROR:   [13] _5574 is rationalize(111)
ERROR:   [12] simplex:constraint_(0,[...|...]=111,state(0,[],[],[]),_5616) at /usr/local/lib/swipl-7.6.4/library/clp/simplex.pl:636
ERROR:   [10] coins(state(0,[],[],[]),_5664) at /home/vitor/coins.pl:8
ERROR:    [8] '<meta-call>'(user:(...,...)) <foreign>
ERROR:    [7] <user>
ERROR: 
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
Vitor F.M.
  • 119
  • 7

1 Answers1

4

This indicates that you have compiled SWI-Prolog without support for GMP, the GNU multiple precision arithmetic library.

You must compile SWI-Prolog with GMP to use library(simplex), since it requires support for rational numbers.

mat
  • 40,498
  • 3
  • 51
  • 78