I’m using: SWI-Prolog version 10.0.2.
I want the code to: retract all dynamic predicates that are not built-in.
But what I’m getting after cleanup each time I consult a file is: ERROR: Domain error: `file_type’ expected, found `prolog’.
My code looks like this:
cleanup :- forall(dynamic_not_built_in(X),retractall(X)).
dynamic_not_built_in(X) :- predicate_property(X,dynamic),
\+predicate_property(X,built_in).
Call the above program mwe.pl, consult it and run cleanup. Then consult it again and get the ERROR above. Code like this has never given any problem in versions < 9. From 9 on I get this behaviour. I suspect cleanup now retracts too much, perhaps an essential dynamic predicate which is not a built-in. Any help is highly appreciated! Marc