I want to retract fact, but I have not direct access to the name of fact. To get anything from this fact I'd use following code:
facts.pl file:
:- dynamic fact/2.
fact(a, b).
fact(b, e).
fact(a, c).
fact(e, d).
fact(c, d).
fact(d, f).
fact(d, g).
solution.pl file:
someProcedure(StructureName) :-
call(StructureName, a, X).
Now how could I retract that dynamic fact from memory in solution.pl?
I've tried something like:
deleteProcedure(StructName, A, B) :-
retract(call(StructName, A, B)).
But I get error:
ERROR: retract/1: No permission to modify static procedure `call/3'
ERROR: Defined at /usr/lib/swi-prolog/boot/init.pl:217