The assertion predicates are used to add clauses to the database in various
ways. The relative position of the asserted clause with respect to
other clauses for the same predicate is determined by the choice among
assert/1
, asserta/1
, and assertz/1
. A database reference
that uniquely identifies the clause being asserted is established by
providing an optional second argument to any of the assertion
predicates.
assert(
:C)
assert(
:C,
-R)
assert/1
; reference R is returned
asserta(
:C)
asserta(
:C,
-R)
asserta/1
; reference R is returned
assertz(
:C)
assertz(
:C,
-R)
assertz/1
; reference R is returned
Please note:
If the term being asserted contains attributed variables
(see lib-atts) or suspended goals (see ref-sem-sec),
those attributes are not stored in the database. To retain the
attributes, you can use copy_term/3
(see ref-lte-cpt).