BAP Online Manuals : Library Reference : Library by Name : retract
Previous: repeat
Next: retractall

6.2.112. retract

retrieves and discards information from the database.

SYNOPSIS

retract(Term)

SYNTAX

retract(Term) (x)

ARGUMENTS

void(Term) (x) Term to be matched with and removed from database entries

DESCRIPTION

This is a standard PROLOG built-in. It retrieves information from the database by matching its argument with any term stored in the database. If it matches, the database entry is removed. Upon backtracking multiple solutions may occur. You may invoke indefinite loops by using a retract(X), ..., assertz(X),fail. construct.
Different from standard prolog you may use this with an uninstantiated variable to remove all entries.

EXAMPLE

asserta(hello),
asserta(world),
retract(X),
	write(X),nl,
	fail.

ERRORS

No runtime errors.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

asserta , assertz , retractall ,

clause , database ,

listing


BAP Online Manuals : Library Reference : Library by Name : retract
Previous: repeat
Next: retractall