Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SWI Prolog:当“时,不允许加载源”;“非模块文件”;已加载到某些模块中)_Prolog_Swi Prolog - Fatal编程技术网

SWI Prolog:当“时,不允许加载源”;“非模块文件”;已加载到某些模块中)

SWI Prolog:当“时,不允许加载源”;“非模块文件”;已加载到某些模块中),prolog,swi-prolog,Prolog,Swi Prolog,此错误可能是的重复 由于这个问题还没有完全回答,我决定把我的问题贴在这里 有一些使用:compile(Filename)子句动态加载的文件,我怀疑这可能是错误的原因 ➜ chill git:(master) ✗ swipl --traditional

此错误可能是的重复

由于这个问题还没有完全回答,我决定把我的问题贴在这里

有一些使用
:compile(Filename)
子句动态加载的文件,我怀疑这可能是错误的原因

➜  chill git:(master) ✗ swipl --traditional                                                                                                                                              [18/06/20| 8:54AM]
Welcome to SWI-Prolog (threaded, 64 bits, version 7.6.4)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- expects_dialect(sicstus).
true.
?- consult('chill-test.pl').
true.  
?- set_prolog_flag(double_quotes, chars).
true.
?- run_trials('orig-db', 'raw250-split1.pl', 'orig-db-evaluate', 25, 200, 'raw250-res1.out').
Reading Split File: raw250-split1.pl
Specializing with 25 top-level examples
Beginning Example Analysis
Attempting Example 1 ....
<omitted output>    
BEGINING INDUCTION: 1 5
    ERROR: No permission to load source `'/home/vimos/git/SP/mooney/chill/orig-db.i'' (Non-module file already loaded into module test; trying to load into thetheory)
    ERROR: In:
    ERROR:   [36] throw(error(permission_error(load,source,'/home/vimos/git/SP/mooney/chill/orig-db.i'),context(...,'Non-module file already loaded into module test; trying to load into thetheory')))
    ERROR:   [34] '$assert_load_context_module'('/home/vimos/git/SP/mooney/chill/orig-db.i',thetheory,[expand(false),...]) at /usr/lib/swi-prolog/boot/init.pl:2439
    ERROR:   [33] '$mt_do_load'(<clause>(0x559a46329ea0),'orig-db.i','/home/vimos/git/SP/mooney/chill/orig-db.i',thetheory,[expand(false),...]) at /usr/lib/swi-prolog/boot/init.pl:2069
    ERROR:   [32] setup_call_catcher_cleanup(system:with_mutex('$load_file',...),system:'$mt_do_load'(<clause>(0x559a46329ea0),'orig-db.i','/home/vimos/git/SP/mooney/chill/orig-db.i',thetheory,...),_142002,system:'$mt_end_load'(<clause>(0x559a46329ea0))) at /usr/lib/swi-prolog/boot/init.pl:443
    ERROR:   [21] make_theory('orig-db.i',op/2,_142072) at /home/vimos/git/SP/mooney/chill/spchillin-nr.pl:966
    ERROR:   [20] top_induction('orig-db.i',[op(...,_142120)],[op(...,_142132),...|...],_142108) at /home/vimos/git/SP/mooney/chill/spchillin-nr.pl:129
    ERROR:   [19] chill_lib:cpu_time(user:top_induction('orig-db.i',...,...,_142186),_142170) at /home/vimos/git/SP/mooney/chill/chill_lib.pl:136
    ERROR:   [18] induce_control_definition('orig-db.i',[op(...,_142230)],[op(...,_142242),...|...],_142216,_142218) at /home/vimos/git/SP/mooney/chill/chill.pl:109
    ERROR:   [17] add_each_optimization(cxit([...|...]),'orig-db.i',fail,[(... :- ...),...],[],_142282,_142284) at /home/vimos/git/SP/mooney/chill/chill.pl:85
    ERROR:   [14] add_rules_for_targets([tr(...,function,fail)],'orig-db.i',[... - ...,...|...],[],[],_142346,_142348) at /home/vimos/git/SP/mooney/chill/chill.pl:79
    ERROR:   [12] chill_lib:cpu_time(user:create_optimized_rules(...,'orig-db.i',_142426,_142428),_142412) at /home/vimos/git/SP/mooney/chill/chill_lib.pl:136
    ERROR:   [11] chill_specialize('orig-db','<garbage_collected>','orig-db.i','orig-db-opt.pl') at /home/vimos/git/SP/mooney/chill/chill.pl:11
    ERROR:    [9] run_trials_loop(25,'orig-db',225,200,[[...],...|...],[ti(...,...,...),...|...],'raw250-res1.out') at /home/vimos/git/SP/mooney/chill/chill-test.pl:188
    ERROR:    [7] <user>
    ERROR: 
    ERROR: Note: some frames are missing due to last-call optimization.
    ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
    ^  Exception: (32) setup_call_catcher_cleanup(system:with_mutex('$load_file', '$mt_start_load'('/home/vimos/git/SP/mooney/chill/orig-db.i', <clause>(0x559a46329ea0), [expand(false), expand(true)])), system:'$mt_do_load'(<clause>(0x559a46329ea0), 'orig-db.i', '/home/vimos/git/SP/mooney/chill/orig-db.i', thetheory, [expand(false), expand(true)]), _142584, system:'$mt_end_load'(<clause>(0x559a46329ea0))) ? creep
    ^  Call: (34) call(system:'$mt_end_load'(<clause>(0x559a46329ea0))) ? creep
    ^  Exit: (34) call(system:'$mt_end_load'(<clause>(0x559a46329ea0))) ? creep
更换
确保加载的
reconsult
不会解决
Swi Prolog
中的错误

我需要一些提示来理解这个错误,这是不是
Swi-Prolog
的实现问题

如果您想尝试,可以从下面的ftp url找到代码

谢谢你的帮助


我正在尝试将以前的代码迁移到
SWI Prolog
,它是用
SICStus 3#3:Thu Sep 12 09:54:27 CDT 1996
或更早版本 雷蒙德·穆尼。
带有此标记的所有问题都与此任务相关。我是prolog新手,欢迎提供帮助和建议

这是一个记录在案的SWI Prolog当前限制,与它的make机制有关。一种可能的解决方法是复制
原始db.i
文件。这样,两个模块,
test
theory
,将加载不同的文件。

很高兴知道这一点!我搜索了他们的网站,可能没有使用正确的关键字。非常感谢。见脚注47。
➜  chill git:(master) ✗ yap                                                      [18/06/20| 9:21AM]
% Restoring file /usr/lib/Yap/startup.yss
YAP 6.2.2 (x86_64-linux): Sat Sep 17 13:59:03 UTC 2016
   ?- consult('chill-test.pl').
yes
   ?- run_trials('orig-db', 'raw250-split1.pl', 'orig-db-evaluate', 25, 200, 'raw250-res1.out').
<omitted output>
BEGINING INDUCTION: 1 5
 % reconsulting /home/vimos/git/SP/mooney/chill/orig-db.i...
 % reconsulted /home/vimos/git/SP/mooney/chill/orig-db.i in module thetheory, 0 msec 1344 bytes
Induction Time: 0.00

op(ps([traverse(pvar(1),freevar):[],const(pvar(1),riverid(mississippi)):[mississippi],answer(pvar(0),state(pvar(0))):[which,through]],[run,?]),G9) :-
   db_lib:coref_vars(traverse,2,2,answer,2,1,ps([traverse(pvar(1),freevar):[],const(pvar(1),riverid(mississippi)):[mississippi],answer(pvar(0),state(pvar(0))):[which,through]],[run,?]),G9).
op(A,B) :-
   introduce(density(_,_),[density],A,B).
op(A,B) :-
   db_lib:coref_vars(density,2,1,state,1,1,A,B).
op(A,B) :-
   db_lib:coref_vars(density,2,2,smallest,2,1,A,B).
op(A,B) :-
   db_lib:lift_conj(state,1,smallest,2,2,A,B).
op(A,B) :-
   db_lib:drop_conj(density,2,smallest,2,2,A,B).