For compatibility reasons BinProlog has them, implemented on top of the more efficient blackboard manipulation builtins. With BinProlog 5.75 and dynamic recompilation however, some applications might be faster overall by using assert and retract, depending on the update/call ratio of dynamic predicates (you can use command line switch -r to change this). Try both compiling and reconsulting the benchmark progs/assertbm.pl to have an estimate of the speed of these operations on your machine.
This is an approximation of other Prologs assert and retract predicates. It tries to be close to Sicstus and Quintus with their semantics.
If you want maximal efficiency for highly volatile data, use directly bb_def/3, bb_set/3, bb_val/3, bb_rm They give you access to a very fast hashing table
<key1,key2> --> value,
the same that BinProlog uses internally for indexing by predicate and first argument. They are close to other Prolog's `record' family, except that they do even less.
When using dynamic predicates it is a good idea to declare them with dynamic/1 although asserts will now be accepted even without such a declaration. To define dynamic code in a file you compile, dynamic declarations are mandatory.
To activate an asserted predicate it is a good idea to alway call it with
?-metacall(Goal).
instead of
?- Goal.
However, this is not a strong requirement anymore, as an important number of users were unhappy with this restriction.
The dynamic predicates are:
assert/1 asserta/1 assertz/1 retract/1 clause/2 metacall/1 abolish/2
You can easily add others or improve them by looking to the sources in the file extra.pl.