gpt4 book ai didi

prolog - 尝试运行 SWI Prolog Simplex 示例时出错

转载 作者:行者123 更新时间:2023-12-01 12:12:51 26 4
gpt4 key购买 nike

我正在尝试运行 SWI-Prolog 的单纯形库文档中给出的硬币示例,但我收到此错误消息:

$ 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.

最佳答案

这表明您编译的 SWI-Prolog 不支持 GMP,GNU 多精度算术库。

必须使用 GMP 编译 SWI-Prolog 以使用library(simplex),因为它需要支持有理数

关于prolog - 尝试运行 SWI Prolog Simplex 示例时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50452849/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com