【问题标题】:how to find declaration of a predicate in the modules which lie in other directories如何在位于其他目录的模块中找到谓词的声明
【发布时间】:2012-07-05 06:08:30
【问题描述】:

对于 Prolog 插件,例如 SICStus spiderproDTPDT,eclipse 编辑器中的“查找声明”无法在位于不同目录的模块中找到谓词定义。

例如,

$HOME/dirA/A.pl:
    :- module(database,[]).
    ...
    set_dbaccess(Options) :-
      (db_done ->
           true
           ; 
    ...

$HOME/dirB/B.pl:
    ...
    fd(From,To,OrigOptions) :-
       database:set_dbaccess(OrigOptions),
    ...

B.pl 顶部没有模块database 的导入语句。所以上述所有插件都找不到模块database和谓词set_dbaccess的定义。当然,符号database, set_dbaccess 上的 F3 操作也会失败。

有什么方法可以解决这个问题吗?

【问题讨论】:

    标签: plugins prolog declaration predicate sicstus-prolog


    【解决方案1】:

    我不太确定你到底想要什么,但我猜 你可以让一个文件说 pred_files 包含 :-dynamic pred1/2, pred2/3, ... 和 每次您需要在另一个 .pl 文件中使用谓词时,您都可以使用 :-ensure_loaded(pred_files)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-29
      • 2018-03-18
      • 1970-01-01
      • 1970-01-01
      • 2021-02-26
      • 2020-09-22
      • 1970-01-01
      • 2013-08-26
      相关资源
      最近更新 更多