diff: set.m: document set__remove_least/3

Fergus Henderson fjh at hydra.cs.mu.oz.au
Sun Nov 2 19:50:01 AEDT 1997


library/set.m:
	Document set__remove_least/3.

Index: set.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/set.m,v
retrieving revision 1.46
diff -u -u -r1.46 set.m
--- set.m	1997/07/27 15:07:10	1.46
+++ set.m	1997/11/02 08:47:33
@@ -121,7 +121,7 @@
 :- pred set__remove(set(T), T, set(T)).
 :- mode set__remove(in, in, out) is semidet.
 
-	% `set__remove_list(Set0, Xs, Set)' is true iff Xs does not
+	% `set__remove_list(Set0, Xs, Set)' is true iff `Xs' does not
 	% contain any duplicates, `Set0' contains every member of `Xs',
 	% and `Set' is the relative complement of `Set0' and the set
 	% containing only the members of `Xs'.
@@ -129,14 +129,20 @@
 :- pred set__remove_list(set(T), list(T), set(T)).
 :- mode set__remove_list(in, in, out) is semidet.
 
+	% `set__remove_least(Set0, Elem, Set)' is true iff
+	% `Set0' is not empty, `Elem' is the smallest element in `Set0'
+	% (with elements ordered using the standard ordering given
+	% by compare/3), and `Set' is the set containing all the
+	% elements of `Set0' except `Elem'.
+
 :- pred set__remove_least(set(T), T, set(T)).
 :- mode set__remove_least(in, out, out) is semidet.
 
 	% `set_union(SetA, SetB, Set)' is true iff `Set' is the union of
 	% `SetA' and `SetB'.  If the sets are known to be of different
 	% sizes, then for efficiency make `SetA' the larger of the two.
-	% (The current implementation, using sorted lists with duplicates
-	% removed is not sensitive to the ordering of the input arguments
+	% (The current implementation using sorted lists with duplicates
+	% removed is not sensitive to the ordering of the input arguments,
 	% but other set implementations may be, so observing this convention
 	% will make it less likely that you will encounter problems if
 	% the implementation is changed.)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list