retract
Entity: predicate

retract_in
Entity: predicate

retractall
Entity: predicate


Usage:
retract(Clause)

Retracts the first clause which is unifiable with Clause .
 
Clause  the clause to retract. 

Fails if there is no clause which is unifiable with Clause .


Usage:
retract_in(Clause)

Retracts the first clause which is unifiable with Clause both in the run-time database (like retract) and in the text file containing the running program.
 
Clause the clause to retract.

Fails if there is no clause which is unifiable with Clause.


Usage:
retractall(Clause)

Retracts all clauses which are unifiable with Clause .
 
Clause the clause to retract.

Succeeds always.


Example:

?-retract_in(test(X)), write(X), nl, !, test(Y), write(Y), nl, fail.

test(1).
test(2).
test(3).

Run this example four times (press four times F5 ).

See also:

assert
assert_in