The concept of a source module is explained in ref-mod-som. For any goal, the applicable source module is determined when the goal is compiled rather than when it is executed.
A procedure that needs to refer to the source module has arguments
designated for module name expansion. These arguments are expanded
when code is consulted, compiled or asserted
by the transformation X -> M:X where M is the
name of the source module. For example, the goal
call(M:X) and the goal
is expanded into
Module name expansion is avoided if the argument to be expanded is
:/2 term. In this case it is unnecessary since the
module to be used has already been supplied by the programmer.