Define parts of a predicate across several modules
问题 I'm trying to write a predicate move/3 which handles several kinds of terms, each kind of which is defined in a separate file. I'm trying to use modules for this, because the files contain other predicates which should be namespaced appropriately. So, I've created a module cat.prolog with contents: :- module(cat, [move/3]). :- multifile(move/3). move(cat(C), P, cat(C2)) :- ... Similarly for dog.prolog . And main.prolog with: :- use_module(['cat.prolog'], [move/3]). :- use_module(['dog.prolog'