asserta(Head) asserta((Head:-Body))
Asserts a clause as the first one for an object's dynamic predicate. If the predicate is not previously declared (using a scope directive), then a dynamic predicate declaration is added to the object (assuming that we are asserting locally or that the compiler flag dynamic_declarations
was set to allow
when the object was created or compiled).
This method may be used to assert clauses for predicates that are not declared dynamic for dynamic objects provided that the predicates are declared in this. This allows easy initialization of dynamically created objects when writing constructors.
asserta(+clause)
instantiation_error
type_error(callable, Head)
type_error(callable, Body)
permission_error(modify, private_predicate, Functor/Arity)
permission_error(modify, protected_predicate, Functor/Arity)
permission_error(modify, static_predicate, Functor/Arity)
permission_error(create, predicate_declaration, Functor/Arity)
asserta(Clause)
::asserta(Clause)
Object::asserta(Clause)
abolish/1
, assertz/1
, clause/2
, retract/1
, retractall/1
dynamic/0
, dynamic/1