通过 shell 文件运行 Prolog Sicstus
我一直在尝试通过 shell 脚本运行一个文件并将其输出写入该文件。
该脚本非常简单:
/usr/local/sicstus4.1.1/bin/sicstus -l run --goal "runh('examples/calls_matlab.pl', S),halt." > “/Users/Andrew/Dropbox/IP/modellingphase/rules.txt”
但是,当我运行此命令时,它失败并出现以下错误: sicstus(24883,0x7fff70916ca0) malloc: * 对象 0x10082b408 错误: 已释放对象的校验和不正确 - 对象可能在释放后被修改。 * 在 malloc_error_break 中设置断点进行调试
另一方面,如果我从目标中删除“halt”,一切都很好,但 Sicstus 仍在运行。
有没有办法退出 sicstus,而不必通过我的 shell 脚本引发上述错误?
我很感激你的时间。
安德烈亚斯
I've been trying to run a file through a shell script and write its output into that file.
The script is very simple:
/usr/local/sicstus4.1.1/bin/sicstus -l run --goal "runh('examples/calls_matlab.pl', S), halt." > "/Users/Andrew/Dropbox/IP/modelling phase/rules.txt"
However, when I run this, it fails with the following error:
sicstus(24883,0x7fff70916ca0) malloc: * error for object 0x10082b408: incorrect checksum for freed object - object was probably modified after being freed.
* set a breakpoint in malloc_error_break to debug
On the other hand, if I remove "halt" from the goal, everything's fine, but Sicstus is still running.
Is there a way to exit sicstus, without having to incur the error above through my shell script?
I appreciate your time.
Andreas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果运行脚本并使用
/dev/null
重定向输入管道会怎样?并删除停止选项。/usr/local/sicstus4.1.1/bin/sicstus -l run --goal "runh('examples/calls_matlab.pl', S)." > “/Users/Andrew/Dropbox/IP/modellingphase/rules.txt”< /dev/null
我所做的是
sicstus -l my_file.pl --goal "test_strategy(10,random,random)。" < /dev/null
其中
test_strategy
是我的谓词,它返回到 shell。干杯,
担
What if you run your script and redirect the input pipe with
/dev/null
? And remove the halt option./usr/local/sicstus4.1.1/bin/sicstus -l run --goal "runh('examples/calls_matlab.pl', S)." > "/Users/Andrew/Dropbox/IP/modelling phase/rules.txt" < /dev/null
What I did was
sicstus -l my_file.pl --goal "test_strategy(10,random,random)." < /dev/null
where
test_strategy
is my predicate which returns to shell.Cheers,
Dan