This primitive is usually used a directive in the source code of the module to be locked.
A module locked with lock_pass/1 can be unlocked using unlock/2, and giving the same pass-string that was used in locking. The pass-string can be changed by calling lock_pass/1 again from within the module.
% After compiling the following code: :- module(m). :- export pub/0. pub :- writeln(pub). priv :- writeln(priv). :- lock_pass("secret"). ?- module(m). trying to access a locked module in module(m) ?- call(pub) @ m. pub yes. ?- call(priv) @ m. trying to access a locked module in priv ?- assert(foo) @ m. trying to access a locked module in assert_(foo, m) ?- unlock(m, "secret"). yes. ?- call(priv) @ m. priv yes. ?- assert(foo) @ m. yes.