built-in method
abolish/1
Description
abolish(Predicate)
Abolishes a runtime declared object dynamic predicate or an object local dynamic predicate. Only predicates that are dynamically declared at runtime (using a call to the asserta/1 or assertz/1 built-in methods) can be abolished.
When the predicate indicator is declared in a uses/2 or use_module/2 directive, the predicate is abolished in the referenced object or module. When the backend Prolog compiler supports a module system, the predicate argument can also be module qualified.
Modes and number of proofs
abolish(@predicate_indicator) - one
Errors
Predicate
is a variable:instantiation_error
Functor
is a variable:instantiation_error
Arity
is a variable:instantiation_error
Predicate
is neither a variable nor a valid predicate indicator:type_error(predicate_indicator, Predicate)
Functor
is neither a variable nor an atom:type_error(atom, Functor)
Arity
is neither a variable nor an integer:type_error(integer, Arity)
Predicate
is statically declared:permission_error(modify, predicate_declaration, Name/Arity)
Predicate
is a private predicate:permission_error(modify, private_predicate, Name/Arity)
Predicate
is a protected predicate:permission_error(modify, protected_predicate, Name/Arity)
Predicate
is a static predicate:permission_error(modify, static_predicate, Name/Arity)
Predicate
is not declared for the object receiving the message:existence_error(predicate_declaration, Name/Arity)
Examples
To abolish a local dynamic predicate or a dynamic predicate in this:
abolish(Predicate)
To abolish a public or protected dynamic predicate in self:
::abolish(Predicate)
To abolish a public dynamic predicate in an explicit object:
Object::abolish(Predicate)
See also
asserta/1, assertz/1, clause/2, retract/1, retractall/1 dynamic/0, dynamic/1, uses/2, use_module/2