diff options
Diffstat (limited to 'stdlib.pl')
-rw-r--r-- | stdlib.pl | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -10,8 +10,7 @@ once(Goal) :- repeat :- true ; repeat. -% Control structures. -true. +% Control structures. If -> Then :- If, !, Then. @@ -150,7 +149,7 @@ E1 > E2 :- E2 < E1. -% Clause retrieval and information +% Clause retrieval and information and removal clause(Head, Body) :- clause(Head, Body, Clauses), @@ -160,6 +159,13 @@ current_predicate(PI) :- current_predicate(PI, Predicates), member(PI, Predicates). +retract(Clause) :- + copy_term(Clause, ClauseCopy), + retract_one(ClauseCopy), + ( Clause = ClauseCopy + ; retract(Clause) + ). + % Basic list predicates member(X, [X|_]). member(X, [_|Tail]) :- |