All the built-in predicates reside in the prolog module. The exported built-in predicates are automatically imported into each new module as it is created. The user module is the default module where all user defined predicates go if there is no module specification. Thus the system may be used without the user being aware of the module system at all. When there is no explicit module specification, all goals appearing in files refer to the source module .
Goals issued at the top level refer to the type-in module.
The source module of a file is either the module specified in a module declaration or, for non module files, the type-in module. Modules A module may be defined by putting a module declaration first in a source file. When the file is loaded, all predicates in the file go to the stated module and the predicates of the PublicPredicateList are exported. When a module declaration is processed, all existing predicates in the module are erased before the new ones are loaded. A file which contains a module declaration is henceforth called a module file .