1
votes

I have been given a large old collection of program files I'd like to use with a 7.2 Swi-prolog setup under 64-bit Linux. Most of these report a

import/1: No permission to import clpfd:transpose/2 into user (already imported from ugraphs)

error, a result of naming collision resulting from the current version introducing the new behaviour of loading ugraphs by default and choosing it over the module the user actually specifies, far as I can tell.

I would like Prolog to prefer the explicitly used modules over the defaults. Failing that, I would like to customise this list of modules loaded by default.

Other answers have suggested excluding the desired predicate from use_module, but then using it with explicit namespaces. This isn't macro-able due to specifics of the files (transpose is sometimes used in ugraphs context, the name of a predicate described in-file or as part of text output and comments). I would rather avoid going down this path if at all possible.

1

1 Answers

0
votes

The SWI-Prolog autoload flag is set to true by default. not enough detail in your post but you can try to set it to false. That will prevent autoloading of any module. I.e. any used module will need to be loaded explicitly. This will provide you with full control of which modules are loaded by most likely will require to write (or update) a loader file for your application.