Dynamic predicates (not source preserving)

Author(s): The Ciao Development Team.

This module implements the assert/retract family of predicates to manipulate dynamic predicates.

This module does not preserve the original source definition of dynamic predicates. That is, clause/2 may obtain the asserted clauses in lower-level expanded form rather than in the original shape. Use dynamic_clauses if you need consulting the original form.

The defined predicates (see dynamic_rt) allow modification of the program as it is actually running. Clauses can be added to the program (asserted) or removed from the program (retracted). For these predicates, the argument which corresponds to the clause head must be instantiated to an atom or a compound term. The argument corresponding to the clause must be instantiated either to a term Head :- Body or, if the body part is empty, to Head. An empty body part is represented as true.

Note that using this library is very detrimental to global analysis, and that for most uses the predicates listed in Fast/concurrent update of facts suffice.

Usage and interface