Wrong name, really.
use_module/1 is the wrong name for this functionality - it should be use_module_file/1 -- because it takes the name of a file, not the name of a module (unlike in Java, there is no convention regarding the mapping of a module name to a module file name -- nor a convention for a module hierarchy for that matter).
You can actually just "consult" the module
On the command line one should use
But you can also write
This will actually consult the file
clpfd.pl and reload the module. It's a bit quick and dirty.
Inside the program
If your program needs some extras from a module but you are unsure whether the module exists (because it hasn't been compiled, for example):
From the module
prolog_pack.pl, to make sure an "URL scheme2 is acceptable:
download_scheme(http). download_scheme(https) :- catch(use_module(library(http/http_ssl_plugin)), E, (print_message(warning, E), fail)).
You can load predicates of module A into module B "from outside"
Maybe this applies only to pengine applications,
This comes from Adding application logic to a Pengine server. It is described as "importing the module
semweb/rdf_db into the module
:- pengine_application(genealogist). :- use_module(genealogist:'/apps/genealogist/genealogist.pl').
See this discussion for the special case of what sort-of looks like a cross-module "interface" call in SWI-Prolog (a situation that should be common? apparently not)
This would be helped if there were a predicte `my_module(?M)
unifiying M` with the name of the module in which the instruction resides.