Most built-ins that access dynamic predicates work on the predicates defined in the caller module. Therefore, if the source module of a dynamic procedure is locked, but the procedure has to be modified from outside, some interface must be provided by the locked module. For instance :
:- module_interface(mod). :- global assert_in_mod/1. :- begin_module(mod). assert_in_mod(X) :- assert(X). % mod is the caller moduleThen, calling assert_in_mod(P) from any module will assert P in mod.