The Prolog cross-referencer located in qplib(tools) can
automatically generate module/2 declarations from its
cross-reference information. This is useful if you want to take a set
of files making up a program and make each of those files into a
module-file. See the file library('xref.doc') for more information.
Alternatively, if you have a complete Prolog program consisting of a set of
source files {file1, file2, ...}, and you wish to encapsulate it in a
single module mod, then this can be done by creating a "driver"
file of the following form:
:- module(mod, [ ... ]).
:- ensure_loaded(file1).
:- ensure_loaded(file2).
.
.
.
When a module is created in this way, none of the files in the program
{file1, file2, ...} have to
be changed.