retract/1
Deletes the first matching clause from a predicate
retract(Clause) -(i)
Compatibility: LPA Win-Prolog, Swindon Prolog, most other Prologs.
Remarks: This deletes the first matching Clause from a predicate, in exactly the same way as LPA Win-Prolog's retract/1. In most other Prologs (e.g. LPA Win-Prolog), any predicates that can be retracted must have been previously declared "dynamic". However, in G.I.S. Prolog, all predicates are (effectively) "dynamic". The given Clause can be partially or fully instantiated, although as a minimum its head must include the predicate name, and any arguments must be fully enumerated: attempts are made to unify Clause with successive program clauses, and if a match is found, the clause in question is deleted. On backtracking, attempts are made to find and delete further matching clauses. When no (more) matching clauses are found, the call fails.
See also: