[m-rev.] for review: bt_array.m: fix copy&paste doc error

Peter Moulder Peter.Moulder at infotech.monash.edu.au
Sat Aug 16 15:41:00 AEST 2003


(Using a doc-only patch for my first use of submit_patch.)

It happens that bt_array has a canonical representation (i.e. if A1,A2
have same bounds and same to_list result, and each has been constructed
using bt_array preds/funcs rather than using introspection or the like
(foreign code, io__read), then A1 and A2 have the same representation);
in which case `iff' is correct.  I could s/is true iff/=>/, which would
cover both the introspection etc. case and also the case that I've made
a mistake in the analysis that bt_array has a canonical representation.

pjm.


Estimated hours taken: 0.2

library/bt_array.m:
	Fix copy&paste doc error.  At the same time, switch from imperative
	to declarative comment.


Index: library/bt_array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/bt_array.m,v
retrieving revision 1.11
diff -d -u -r1.11 bt_array.m
--- library/bt_array.m	26 May 2003 09:00:29 -0000	1.11
+++ library/bt_array.m	16 Aug 2003 05:06:49 -0000
@@ -15,7 +15,7 @@
 % (`bt_array' is supposed to stand for either "binary tree array"
 % or "backtrackable array".)
 
-% Implementation obscurity: This implementation is biassed towards larger
+% Implementation obscurity: This implementation is biased towards larger
 % indices.  The access/update time for a bt_array of size N with index I
 % is actually O(log(N-I)).  The reason for this is so that the resize
 % operations can be optimised for a (possibly very) common case, and to
@@ -33,15 +33,15 @@
 
 %-----------------------------------------------------------------------------%
 
-	% bt_array__init(Low, Array) creates a bt_array of size zero
-	% starting at index Low.
+	% bt_array__make_empty_array(Low, Array) is true iff Array is a
+	% bt_array of size zero starting at index Low.
 :- pred bt_array__make_empty_array(int, bt_array(T)).
 :- mode bt_array__make_empty_array(in, out) is det.
 
 :- func bt_array__make_empty_array(int) = bt_array(T).
 
-	% bt_array__init creates a bt_array with bounds from Low to High,
-	% with each element initialized to Init.
+	% bt_array__init(Low, High, Init, Array) is true iff Array is a
+	% bt_array with bounds from Low to High whose elements each equal Init.
 :- pred bt_array__init(int, int, T, bt_array(T)).
 :- mode bt_array__init(in, in, in, out) is det. % want a bt_array_skeleton?
 
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list