1

我正在使用 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.

我究竟做错了什么?

4

1 回答 1

1

以后请使用官方 Logtalk 支持渠道寻求帮助。你会在那里得到及时的回复。

Logtalk 2.44.1 不支持logtalk_compile/1-2andlogtalk_load/1-2谓词中的完整或相对(当前目录中的文件除外)文件路径(请参阅有关这些谓词的参考手册)。在上述情况下,要加载“人员”编程示例,请键入:

?- logtalk_load(people(loader)).

或者:

?- {people(loader)}.

这被称为(在 Logtalk 文档中)“库符号”(它的符号也在 Prolog 中找到)。有关详细信息,请参阅“examples/people”文件夹中的“NOTES.txt”和“SCRIPT.txt”(所有示例都包含这两个文件以及有用的信息)。

顺便说一句,Logtalk 3 中提供了对相对和完整源文件路径的支持。

于 2013-04-01T13:30:31.390 回答