
retract_all(+Head)

   Succeeds if all the clauses whose heads match Head are successfully removed
from the database.



Arguments
   Head                Atom, variable or compound term.

Type
   Dynamic Predicates

Description
   Retracts from the database all clauses whose heads match the argument.
   The argument must be sufficiently instantiated otherwise an error is
   signalled.  retract_all/1 never fails.  The clauses are not reasserted
   when backtracking through the call of retract_all/1.


   The functor and the arity of Head must be that of a predicate declared
   as dynamic.


   retract_all/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.




Modes and Determinism
   retract_all(+) is det

Modules
   This predicate is sensitive to its module context (tool predicate, see @/2).

Exceptions
     4 --- Head is not instantiated
     5 --- Head is not a callable term
    63 --- Procedure is not dynamic
    70 --- Procedure is undefined

Examples
   
Success:
    [eclipse]: assert(city(munich)), assert(city(london)).
    yes.
    [eclipse]: retract_all(city(_)).
    yes.
    [eclipse]: city(X).
    no (more) solution.
Error:
    retract_all(X).                  (Error 4).
    retract_all("x").                (Error 5).


   % if h/0 is defined, but not as dynamic..
    retract_all(h).                  (Error 63).

    retract_all(z/0).                (Error 70).





See Also
   dynamic / 1, asserta / 1, retract / 1
