retracts from the database the clauses which are unifiable with the argument.
retract/1 retracts the first clause from the database which is unifiable with Clause .
If Clause is an atom or compound term whose principal functor is
different from ':-'/2 then Clause is the head and 'true' is the body
of the clause.
If Clause is a compound term whose principal functor is
':-'/2 then the left side (1st argument) of ':-' is the head
and the right side (2nd argument) the body
of the clause.
Clause atom or compound term
Assume that the database contains the clauses:
colour(blue).
colour(yellow).
colour(blue,yellow,green).
add(X,Y,Z) :- Z is X+Y.
f(a).
f(a) :- b.
| retract(f(a)). | Succeeds. The database contains now the clauses:
colour(blue). colour(yellow) :- true. colour(blue,yellow) :- green. add(X,Y,Z) :- Z is X+Y. f(a) :- b. |
This predicate is part of the ISO-Prolog Standard.
| scroll to top |
|