summaryrefslogtreecommitdiff
path: root/stdlib.pl
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib.pl')
-rw-r--r--stdlib.pl12
1 files changed, 9 insertions, 3 deletions
diff --git a/stdlib.pl b/stdlib.pl
index a972ae0..528781b 100644
--- a/stdlib.pl
+++ b/stdlib.pl
@@ -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]) :-