SICStus Prolog has a hook for expanding the target: goal_expansion/6 , which is called both at compile time and at run time during metacalling. These challenges incur some run-time overheads that slow down metacaling. The purpose of my expansion is only optimization. Thus, semantically, goals and extended goals are equivalent.
How to disconnect such calls at runtime?
(It seems that I would have to cancel goal_expansion/6 , which looks a little rude to me, and also makes it difficult to recompile easily ).
false source share