Failed to load a library with logtalk_load using logtalk 3.0.0.1

102 Views Asked by At

I use SWI Prolog as a backed compiler(v 6.6.1). After installing logtalk 3.0.0.1 I started getting error when

logtalk_load(library(types_loader), [source_data(on), report(on)]).

% [ c:/users/dizqj373/documents/logtalk/library/termp.lgt loaded ] ! Domain error: value alias/2 is not in domain directive ! in directive :- alias(termp,[variables/2 as vars/2]) ! in file c:/users/dizqj373/documents/logtalk/library/term.lgt between lines 36-37 Warning: [Thread 2] c:/users/dizqj373/documents/logtalk/library/lgt_tmp/types_loader.pl:5: Initialization goal failed % [ c:/users/dizqj373/documents/logtalk/library/types_loader.lgt loaded ] true.

Could you help me and guide a little bit what could be wrong? thanks!

1

There are 1 best solutions below

0
On

The alias/2 directive was introduced in Logtalk 3, deprecating the less readable alias/3 directive used in Logtalk 2.x. The error you posted would be expected if you try to compile and load the Logtalk 3 library using the Logtalk 2.x compiler, which would not recognize the new alias/2 directive.

If you have just updated from Logtalk 2.x to Logtalk 3, make sure you're indeed using the new version compiler. Check that the current value of the LOGTALKHOME environment variable points to the Logtalk 3 installation folder and not to an old Logtalk 2.x folder. After starting Logtalk, you can also check the version that you're using with the query:

| ?- current_logtalk_flag(version_data, Version).

This flag was also introduced in Logtalk 3. If you can an error that the flag is not recognized, then you most likely are loading the old Logtalk 2.x version.