[ Dynamic Predicates | Reference Manual | Alphabetic Index ]
Removes from the database all clauses whose heads match Head
- Atom, variable or compound term.
Retracts from the database all clauses whose heads match the argument.
The argument must be sufficiently instantiated otherwise an error is
signalled. retractall/1 never fails. The clauses are not reasserted
when backtracking through the call of retractall/1.
The functor and the arity of Head must be that of a predicate declared
as dynamic (or implicitly declared as dynamic by asserting).
retractall/1 satisfies the logical update semantics. Using it to
retract all the clauses of a predicate will not, in any way, affect
previous calls to the predicate, i.e. they will still see all the clauses
that existed at call time.
Modes and Determinism
This predicate is sensitive to its module context (tool predicate, see @/2).
- (4) instantiation fault
- Head is not instantiated
- (5) type error
- Head is not a callable term
- (63) procedure not dynamic
- Procedure is not dynamic
- (70) accessing an undefined dynamic procedure
- Procedure is undefined
[eclipse]: assert(city(munich)), assert(city(london)).
no (more) solution.
retractall(X). (Error 4).
retractall("x"). (Error 5).
% if h/0 is defined, but not as dynamic..
retractall(h). (Error 63).
retractall(z/0). (Error 70).
dynamic / 1, assert / 1, retract / 1