Go to the first, previous, next, last section, table of contents.


Dynamic predicates

Version: 1.5#118 (2000/4/19, 18:13:43 CEST)

Version of last change: 0.5#30 (1998/6/30, 14:23:37 MET DST)

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

The predicates defined in this module 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.

Usage and interface (dynamic)

Documentation on exports (dynamic)

PREDICATE: asserta/1:

Meta-predicate with arguments: asserta(clause).

Usage: asserta(+Clause)

PREDICATE: asserta/2:

Meta-predicate with arguments: asserta(clause,?).

Usage: asserta(+Clause,-(Ref))

PREDICATE: assertz/1:

Meta-predicate with arguments: assertz(clause).

Usage: assertz(+Clause)

PREDICATE: assertz/2:

Meta-predicate with arguments: assertz(clause,?).

Usage: assertz(+Clause,-(Ref))

PREDICATE: assert/1:

Meta-predicate with arguments: assert(clause).

Usage: assert(+Clause)

PREDICATE: assert/2:

Meta-predicate with arguments: assert(clause,?).

Usage: assert(+Clause,-(Ref))

PREDICATE: retract/1:

Meta-predicate with arguments: retract(clause).

Usage: retract(+Clause)

PREDICATE: retractall/1:

Meta-predicate with arguments: retractall(fact).

Usage: retractall(+Head)

PREDICATE: abolish/1:

Meta-predicate with arguments: abolish(spec).

Usage: abolish(+Spec)

PREDICATE: clause/2:

Meta-predicate with arguments: clause(fact,?).

Usage: clause(+Head,?(Body))

PREDICATE: clause/3:

clause(Head,Body,Ref)

Like clause(Head,Body), plus the clause is uniquely identified by Ref.

Meta-predicate with arguments: clause(fact,?,?).

Usage 1: clause(+Head,?(Body),?(Ref))

Usage 2: clause(?(Head),?(Body),+Ref)

PREDICATE: current_predicate/1:

Usage: current_predicate(?(Spec))

PREDICATE: dynamic/1:

No further documentation available for this predicate.

PREDICATE: data/1:

No further documentation available for this predicate.

PREDICATE: wellformed_body/3:

wellformed_body(BodyIn,Env,BodyOut)

BodyIn is a well-formed clause body. BodyOut is its counterpart with no single-variable meta-goals (i.e., with call(X) for X). Env denotes if global cuts are admissible in BodyIn (+ if they are, - if they are not).

Documentation on multifiles (dynamic)

PREDICATE: do_on_abolish/1:

do_on_abolish(Head)

A hook predicate which will be called when the definition of the predicate of Head is abolished.

The predicate is multifile.


Go to the first, previous, next, last section, table of contents.