«Проблема», с которой я столкнулся, заключается в том, что если я использую систему модулей SWI-Prolog, определяя модули и использую их в других модулях, если импортированный модуль изменяет SWI-Prolog, он не принимает его во внимание при загрузке , импортирующего модуль. Например:Обновить импортированные модули
% file topmod.pl
:- module(topmod, [thetop/0]).
:- use_module(bottommod).
thetop :-
thebottom(S),
format('This is the top~nAnd this is ~w~n', [S]).
% file bottommod.pl
:- module(bottommod, [thebottom/1]).
thebottom('the bottom').
Если я теперь загрузить их:
?- [thetop].
% bottommod compiled into bottommod 0.00 sec, 2 clauses
% topmod compiled into topmod 0.00 sec, 6 clauses
true.
?- thetop.
This is the top
And this is the bottom
true.
Если я теперь изменяем файл:
% file bottommod.pl changes
- thebottom('the bottom').
+ thebottom('the foobar').
?- [thetop].
% topmod compiled into topmod 0.00 sec, 1 clauses
true.
?- thetop.
This is the top
And this is the bottom
true.
?- module(bottommod).
true.
?- listing.
thebottom('the bottom').
true.
Как мне заставить Пролог проконсультироваться все импортированные модули и модули, которые они импортируют, за исключением использования consult
?
ярлык Ctrl + C + M ... – CapelliC
Лучше уточнить, где этот ярлык имеет смысл. –