我正在使用swi prolog,只是安装了logtalk 当我用一些示例项目调用logtalk_load时,它总是返回false。
% library(win_menu) compiled into win_menu 0.00 sec, 29 clauses
% C:\Logtalk/configs/swi.pl compiled 0.02 sec, 1,539 clauses
% C:\Logtalk\users\kikijiki/libpaths/libpaths.pl compiled 0.02 sec, 108 clauses
% C:\Logtalk/integration/logtalk_comp_swi.pl compiled 0.11 sec, 2,626 clauses
% c:/logtalk/users/kikijiki/settings.pl compiled 0.00 sec, 3 clauses
Logtalk 2.44.1
Copyright (c) 1998-2012 Paulo Moura
Default lint compilation flags:
unknown: warning, misspelt: warning, lgtredef: warning, plredef: silent
portability: silent, missing_directives: warning
singletons: warning, underscore_variables: singletons
Default documenting compilation flags:
xmldocs: on, xmlspec: dtd, xmlsref: local, xslfile: lgtxml.xsl
Default directories compiler flags:
altdirs: on, tmpdir: lgt_tmp/, xmldir: xml_docs/
Default optional features compiler flags:
complements: deny, dynamic_declarations: deny
context_switching_calls: allow, events: deny
Other default compilation flags:
startup_message: flags, report: on
code_prefix: $, hook: (none defined)
optimize: off, source_data: on, debug: on
clean: on, smart_compilation: off, reload: always
Back-end Prolog compiler and loader flags:
prolog_compiler: []
prolog_loader: []
Read-only compilation flags (back-end Prolog compiler features):
prolog_dialect: swi, break_predicate: supported, modules: supported
threads: supported, encoding_directive: full, tabling: unsupported
coinduction: supported
Loaded settings file found on directory c:/Logtalk/users/kikijiki.
% C:\Logtalk/configs/swihooks.pl compiled 0.02 sec, 212 clauses
% library(quintus) compiled into quintus 0.00 sec, 54 clauses
% library(pce) loaded into pce 0.02 sec, 778 clauses
% C:\Logtalk/configs/xpcehooks.pl compiled 0.02 sec, 785 clauses
% c:\Logtalk\integration\logtalk_swi.pl compiled 0.17 sec, 5,302 clauses
% c:/users/kikijiki/appdata/roaming/swi-prolog/pl.ini compiled 0.17 sec, 5,305 clauses
XPCE 6.6.66, July 2009 for Win32: NT,2000,XP
Copyright (C) 1993-2009 University of Amsterdam.
XPCE comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
The host-language is SWI-Prolog version 6.2.6
For HELP on prolog, please type help. or apropos(topic).
on xpce, please type manpce.
1 ?- logtalk_load('c:/logtalk/examples/people/loader').
% <<< loading source file c:/logtalk/examples/people/loader.lgt...
% >>> compiling source file c:/logtalk/examples/people/loader.lgt in debug mode...
false.
我做错了什么?
答案 0 :(得分:1)
将来请使用Logtalk官方支持渠道寻求帮助。你会得到及时的回复。
Logtalk 2.44.1不支持logtalk_compile/1-2
和logtalk_load/1-2
谓词中的完整或相对(当前目录中的文件除外)文件路径(请参阅这些谓词的参考手册)。在上面的例子中,要加载“people”编程示例,请键入:
?- logtalk_load(people(loader)).
或:
?- {people(loader)}.
这称为(在Logtalk文档中)“库符号”(它也是在Prolog中找到的符号)。有关详细信息,请参阅“examples / people”文件夹中的“NOTES.txt”和“SCRIPT.txt”(所有示例都包含这两个包含有用信息的文件)。
顺便说一句,Logtalk 3中提供了对相对和完整源文件路径的支持。