Consulting a file multiple times

See SWI-Prolog -- Reloading files, active code and threads

And yes, SWI-Prolog keeps track of where clauses come from, i.e., the file and line number. If the file is included, it also keeps track of the (nested) include locations.

consult/1 is the same as traditional reconsult/1 if the file is already loaded.

You can query all this stuff using clause_property/2, predicate_property/2, source_file_property/2 and module_property/2. See also clause_info/5 from library(prolog_clause)

1 Like