I'm wondering if it is possible to define a dynamic predicate with the same name and arity as a builtin predicate inside a module. I was hoping it would be enough to hide the builtin predicates in my module using delete_import_module/2. Alas, that doesn't seem to work. For instance, I cannot create a clause for halt/1 inside module foo:
?- delete_import_module(foo, user).
true.
?- asserta(foo:halt(x)).
ERROR: No permission to modify static procedure `halt/1'
ERROR: In:
ERROR: [10] assert(foo:halt(x))
ERROR: [9] toplevel_call(user:user: ...) at /usr/lib64/swipl-8.4.1/boot/toplevel.pl:1117
It still seems to think I'm talking about system:halt/1 even though that's not even visible in foo. Why is that?