Transform *arbitrary terms* in a Prolog program at load

Update: I actually got what I’d really like to have :-). The full “how” is described in the other post.

Thanks for the help!