我有点困惑。 我想使用split_string函数,可以看到here。 但我只是不知道如何导入或使用此功能。我的PC上已经有这个pl文件吗?我只能在C:\ Program Files \ swipl \ library \ dialect \ ciao中找到strings.pl但我没有包含split_string函数。
我很确定这很简单,但我无法理解。
谢谢!
答案 0 :(得分:3)
您可能需要安装"开发版本" SWI-Prolog(主要版本7),如果你还没有。在Windows和MacOS上,这只是意味着获得正确的binaries。对于Linux,您可以添加PPA(在同一页面上)或build from source,这是足够直接的。
然后,您将获得以下内容:(注意带有版本号的横幅)
$ swipl
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.1.25)
Copyright (c) 1990-2014 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
?- split_string("a.b.c", ".", "", L).
L = ["a", "b", "c"].
您不应该明确导入任何内容。
这能解决您的问题吗?