[m-rev.] diff: annotate library foreign_procs with trail usage information

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Dec 14 21:31:13 AEDT 2005


Estimated hours taken: 0.5
Branches: main

library/*.m:
	Annotate foreign_procs with trail usage information throughout most of
	the standard library.

	Fix an out of date comment in string.m.

	Fix some minor formatting problems.

Julien.

Index: library/array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.141
diff -u -r1.141 array.m
--- library/array.m	5 Sep 2005 07:24:09 -0000	1.141
+++ library/array.m	14 Dec 2005 07:39:34 -0000
@@ -490,7 +490,7 @@

 :- pragma foreign_proc("C",
     bounds_checks,
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 #ifdef ML_OMIT_ARRAY_BOUNDS_CHECKS
     SUCCESS_INDICATOR = MR_FALSE;
@@ -574,12 +574,11 @@
         array__init_2(Size, Item, Array)
     ).

-:- pred array__init_2(int, T, array(T)).
-:- mode array__init_2(in, in, array_uo) is det.
+:- pred array__init_2(int::in, T::in, array(T)::array_uo) is det.

 :- pragma foreign_proc("C",
     array__init_2(Size::in, Item::in, Array::array_uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     ML_alloc_array(Array, Size + 1, MR_PROC_LABEL);
     ML_init_array(Array, Size, Item);
@@ -587,7 +586,7 @@

 :- pragma foreign_proc("C",
     array__make_empty_array(Array::array_uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     ML_alloc_array(Array, 1, MR_PROC_LABEL);
     ML_init_array(Array, 0, 0);
@@ -639,14 +638,14 @@

 :- pragma foreign_proc("C",
     array__min(Array::array_ui, Min::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     /* Array not used */
     Min = 0;
 ").
 :- pragma foreign_proc("C",
     array__min(Array::in, Min::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     /* Array not used */
     Min = 0;
@@ -684,13 +683,13 @@

 :- pragma foreign_proc("C",
     array__max(Array::array_ui, Max::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Max = Array->size - 1;
 ").
 :- pragma foreign_proc("C",
     array__max(Array::in, Max::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Max = Array->size - 1;
 ").
@@ -744,13 +743,13 @@

 :- pragma foreign_proc("C",
     array__size(Array::array_ui, Max::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Max = Array->size;
 ").
 :- pragma foreign_proc("C",
     array__size(Array::in, Max::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Max = Array->size;
 ").
@@ -843,13 +842,13 @@

 :- pragma foreign_proc("C",
     array__unsafe_lookup(Array::array_ui, Index::in, Item::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Item = Array->elements[Index];
 ").
 :- pragma foreign_proc("C",
     array__unsafe_lookup(Array::in, Index::in, Item::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Item = Array->elements[Index];
 ").
@@ -894,7 +893,7 @@

 :- pragma foreign_proc("C",
     array__unsafe_set(Array0::array_di, Index::in, Item::in, Array::array_uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Array0->elements[Index] = Item; /* destructive update! */
     Array = Array0;
@@ -969,7 +968,7 @@

 :- pragma foreign_proc("C",
     array__resize(Array0::array_di, Size::in, Item::in, Array::array_uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     if ((Array0)->size == Size) {
         Array = Array0;
@@ -1084,7 +1083,7 @@

 :- pragma foreign_proc("C",
     array__shrink_2(Array0::array_di, Size::in, Array::array_uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     ML_alloc_array(Array, Size + 1, MR_PROC_LABEL);
     ML_shrink_array(Array, Array0, Size);
@@ -1148,7 +1147,7 @@

 :- pragma foreign_proc("C",
     array__copy(Array0::array_ui, Array::array_uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     ML_alloc_array(Array, Array0->size + 1, MR_PROC_LABEL);
     ML_copy_array(Array, (MR_ConstArrayPtr) Array0);
@@ -1156,7 +1155,7 @@

 :- pragma foreign_proc("C",
     array__copy(Array0::in, Array::array_uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     ML_alloc_array(Array, Array0->size + 1, MR_PROC_LABEL);
     ML_copy_array(Array, (MR_ConstArrayPtr) Array0);
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.113
diff -u -r1.113 builtin.m
--- library/builtin.m	7 Dec 2005 16:07:09 -0000	1.113
+++ library/builtin.m	14 Dec 2005 08:20:15 -0000
@@ -408,13 +408,13 @@

 :- pragma foreign_proc("C",
     cc_cast(X :: (pred(out) is cc_multi)) = (Y :: out(pred(out) is det)),
-    [will_not_call_mercury, thread_safe],
+    [will_not_call_mercury, thread_safe, will_not_modify_trail],
 "
     Y = X;
 ").
 :- pragma foreign_proc("C",
     cc_cast(X :: (pred(out) is cc_nondet)) = (Y :: out(pred(out) is semidet)),
-    [will_not_call_mercury, thread_safe],
+    [will_not_call_mercury, thread_safe, will_not_modify_trail],
 "
     Y = X;
 ").
@@ -459,7 +459,7 @@
 :- pragma foreign_proc("C",
     cc_cast_io(X :: (pred(out, di, uo) is cc_multi)) =
         (Y :: out(pred(out, di, uo) is det)),
-    [will_not_call_mercury, thread_safe],
+    [will_not_call_mercury, thread_safe, will_not_modify_trail],
 "
     Y = X;
 ").
@@ -730,7 +730,7 @@

 :- pragma foreign_proc("C",
     copy(Value::ui, Copy::uo),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "
     MR_save_transient_registers();
     Copy = MR_deep_copy(Value, (MR_TypeInfo) TypeInfo_for_T, NULL, NULL);
@@ -739,7 +739,7 @@

 :- pragma foreign_proc("C",
     copy(Value::in, Copy::uo),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "
     MR_save_transient_registers();
     Copy = MR_deep_copy(Value, (MR_TypeInfo) TypeInfo_for_T, NULL, NULL);
Index: library/char.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/char.m,v
retrieving revision 1.50
diff -u -r1.50 char.m
--- library/char.m	17 Oct 2005 11:35:16 -0000	1.50
+++ library/char.m	14 Dec 2005 09:45:02 -0000
@@ -451,14 +451,14 @@

 :- pragma foreign_proc("C",
     char__to_int(Character::in, Int::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Int = (MR_UnsignedChar) Character;
 ").

 :- pragma foreign_proc("C",
     char__to_int(Character::in, Int::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     SUCCESS_INDICATOR = ((MR_UnsignedChar) Character == Int);
 ").
Index: library/dir.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/dir.m,v
retrieving revision 1.27
diff -u -r1.27 dir.m
--- library/dir.m	23 Oct 2005 07:39:23 -0000	1.27
+++ library/dir.m	14 Dec 2005 08:28:06 -0000
@@ -892,7 +892,7 @@

 :- pragma foreign_proc("C",
     can_implement_make_directory,
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 #if defined(MR_WIN32)
     SUCCESS_INDICATOR = MR_TRUE;
@@ -926,7 +926,8 @@
 :- pragma foreign_proc("C",
     dir__make_single_directory_2(ErrorIfExists::in, DirName::in,
         Result::out, IO0::di, IO::uo),
-    [may_call_mercury, promise_pure, tabled_for_io, thread_safe, terminates],
+    [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+        terminates, will_not_modify_trail],
 "{
 #if defined(MR_WIN32)
     if (CreateDirectory(DirName, NULL)) {
@@ -1298,7 +1299,7 @@
 can_implement_dir_foldl :- semidet_fail.
 :- pragma foreign_proc("C",
     can_implement_dir_foldl,
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 #if defined(MR_HAVE_OPENDIR) && defined(MR_HAVE_READDIR) && \\
         defined(MR_HAVE_CLOSEDIR)
@@ -1334,7 +1335,8 @@

 :- pragma foreign_proc("C",
     dir__open_2(DirName::in, Result::out, IO0::di, IO::uo),
-    [may_call_mercury, promise_pure, tabled_for_io, thread_safe, terminates],
+    [may_call_mercury, promise_pure, tabled_for_io, thread_safe,
+        terminates, will_not_modify_trail],
 "{
 #if defined(MR_WIN32)
     WIN32_FIND_DATA file_data;
@@ -1502,7 +1504,8 @@

 :- pragma foreign_proc("C",
     copy_c_string(Ptr::in) = (Str::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe,
+        will_not_modify_trail],
 "
     MR_make_aligned_string_copy(Str, (char *) Ptr);
 ").
@@ -1539,7 +1542,8 @@

 :- pragma foreign_proc("C",
     dir__close_2(Dir::in, Status::out, Error::out, IO0::di, IO::uo),
-    [will_not_call_mercury, promise_pure, tabled_for_io, thread_safe],
+    [will_not_call_mercury, promise_pure, tabled_for_io, thread_safe,
+        will_not_modify_trail],
 "{
     IO = IO0;
 #if defined(MR_WIN32)
@@ -1605,7 +1609,8 @@
 :- pragma foreign_proc("C",
     dir__read_entry_2(Dir::in, Status::out, Error::out, FileName::out,
         IO0::di, IO::uo),
-    [will_not_call_mercury, promise_pure, tabled_for_io, thread_safe],
+    [will_not_call_mercury, promise_pure, tabled_for_io, thread_safe,
+        will_not_modify_trail],
 "{
 #if defined(MR_WIN32)
     WIN32_FIND_DATA file_data;
Index: library/exception.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/exception.m,v
retrieving revision 1.102
diff -u -r1.102 exception.m
--- library/exception.m	8 Dec 2005 20:38:45 -0000	1.102
+++ library/exception.m	14 Dec 2005 09:45:57 -0000
@@ -654,7 +654,7 @@

 :- impure pred make_io_state(io::uo) is det.
 :- pragma foreign_proc("C", make_io_state(_IO::uo),
-	[will_not_call_mercury, thread_safe], "").
+	[will_not_call_mercury, thread_safe, will_not_modify_trail], "").
 :- pragma foreign_proc("C#", make_io_state(_IO::uo),
 	[will_not_call_mercury, thread_safe], "").
 :- pragma foreign_proc("Java", make_io_state(_IO::uo),
Index: library/float.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/float.m,v
retrieving revision 1.64
diff -u -r1.64 float.m
--- library/float.m	17 Oct 2005 11:35:17 -0000	1.64
+++ library/float.m	14 Dec 2005 07:48:58 -0000
@@ -255,7 +255,7 @@

 :- pragma foreign_proc("C",
 	domain_checks,
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 #ifdef ML_OMIT_MATH_DOMAIN_CHECKS
 	SUCCESS_INDICATOR = MR_FALSE;
@@ -292,7 +292,7 @@

 :- pragma foreign_proc("C",
 	float(IntVal::in) = (FloatVal::out),
-	[will_not_call_mercury, promise_pure],
+	[will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
 	FloatVal = IntVal;
 ").
@@ -339,7 +339,7 @@

 :- pragma foreign_proc("C",
 	float__floor_to_int(X :: in) = (Floor :: out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	Floor = (MR_Integer) floor(X);
 ").
@@ -365,7 +365,7 @@

 :- pragma foreign_proc("C",
 	float__round_to_int(X :: in) = (Round :: out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	Round = (MR_Integer) floor(X + 0.5);
 ").
@@ -391,7 +391,7 @@

 :- pragma foreign_proc("C",
 	float__truncate_to_int(X :: in) = (Trunc :: out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	Trunc = (MR_Integer) X;
 ").
@@ -498,7 +498,7 @@
 	% non-negative, as this condition is not guaranteed by either API.
 :- pragma foreign_proc("C",
 	float__hash(F::in) = (H::out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	H = MR_hash_float(F);
 ").
@@ -532,9 +532,9 @@
 	; is_inf(Float)
 	).

-:- pragma foreign_proc(c,
+:- pragma foreign_proc("C",
 	is_nan(Flt::in),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	SUCCESS_INDICATOR = MR_is_nan(Flt);
 ").
@@ -553,9 +553,9 @@
 	succeeded = java.lang.Double.isNaN(Flt);
 ").

-:- pragma foreign_proc(c,
+:- pragma foreign_proc("C",
 	is_inf(Flt::in),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	SUCCESS_INDICATOR = MR_is_inf(Flt);
 ").
@@ -614,7 +614,7 @@

 :- pragma foreign_proc("C",
 	float__max = (Max::out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	Max = ML_FLOAT_MAX;
 ").
@@ -633,7 +633,7 @@

 :- pragma foreign_proc("C",
 	float__min = (Min::out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	Min = ML_FLOAT_MIN;
 ").
@@ -654,7 +654,7 @@

 :- pragma foreign_proc("C",
 	float__epsilon = (Eps::out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	Eps = ML_FLOAT_EPSILON;
 ").
@@ -676,7 +676,7 @@

 :- pragma foreign_proc("C",
 	float__radix = (Radix::out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	Radix = ML_FLOAT_RADIX;
 ").
@@ -694,7 +694,7 @@

 :- pragma foreign_proc("C",
 	float__mantissa_digits = (MantDig::out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	MantDig = ML_FLOAT_MANT_DIG;
 ").
@@ -710,7 +710,7 @@

 :- pragma foreign_proc("C",
 	float__min_exponent = (MinExp::out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	MinExp = ML_FLOAT_MIN_EXP;
 ").
@@ -726,7 +726,7 @@

 :- pragma foreign_proc("C",
 	float__max_exponent = (MaxExp::out),
-	[will_not_call_mercury, promise_pure, thread_safe],
+	[will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 	MaxExp = ML_FLOAT_MAX_EXP;
 ").
Index: library/int.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/int.m,v
retrieving revision 1.108
diff -u -r1.108 int.m
--- library/int.m	17 Oct 2005 11:35:17 -0000	1.108
+++ library/int.m	14 Dec 2005 07:51:18 -0000
@@ -438,7 +438,7 @@

 :- pragma foreign_proc("C",
     domain_checks,
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 #ifdef ML_OMIT_MATH_DOMAIN_CHECKS
     SUCCESS_INDICATOR = MR_FALSE;
@@ -610,7 +610,7 @@

 :- pragma foreign_proc("C",
     int__to_float(IntVal::in, FloatVal::out),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     FloatVal = IntVal;
 ").
@@ -637,7 +637,7 @@

 :- pragma foreign_proc("C",
     int__max_int(Max::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     if (sizeof(MR_Integer) == sizeof(int)) {
         Max = INT_MAX;
@@ -650,7 +650,7 @@

 :- pragma foreign_proc("C",
     int__min_int(Min::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     if (sizeof(MR_Integer) == sizeof(int)) {
         Min = INT_MIN;
@@ -663,28 +663,28 @@

 :- pragma foreign_proc("C",
     int__bits_per_int(Bits::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Bits = ML_BITS_PER_INT;
 ").

 :- pragma foreign_proc("C",
     int__quot_bits_per_int(Int::in) = (Div::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Div = Int / ML_BITS_PER_INT;
 ").

 :- pragma foreign_proc("C",
     int__times_bits_per_int(Int::in) = (Result::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Result = Int * ML_BITS_PER_INT;
 ").

 :- pragma foreign_proc("C",
     int__rem_bits_per_int(Int::in) = (Rem::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Rem = Int % ML_BITS_PER_INT;
 ").
Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.341
diff -u -r1.341 io.m
--- library/io.m	28 Nov 2005 05:41:49 -0000	1.341
+++ library/io.m	14 Dec 2005 09:45:33 -0000
@@ -3089,8 +3089,9 @@

 % Can we retrieve inode numbers on this system.
 have_file_ids :- semidet_fail.
-:- pragma foreign_proc("C", have_file_ids,
-    [promise_pure, will_not_call_mercury, thread_safe],
+:- pragma foreign_proc("C",
+    have_file_ids,
+    [promise_pure, will_not_call_mercury, thread_safe, will_not_modify_trail],
 "
 #if defined(MR_BROKEN_STAT_ST_INO) || !defined(MR_HAVE_STAT)
     /* Win32 returns junk in the st_ino field of `struct stat'. */
Index: library/library.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/library.m,v
retrieving revision 1.90
diff -u -r1.90 library.m
--- library/library.m	17 Oct 2005 11:35:18 -0000	1.90
+++ library/library.m	14 Dec 2005 08:33:15 -0000
@@ -149,7 +149,7 @@

 :- pragma foreign_proc("C",
     library__version(Version::out),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     MR_ConstString version_string =
         MR_VERSION "", configured for "" MR_FULLARCH;
Index: library/math.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/math.m,v
retrieving revision 1.51
diff -u -r1.51 math.m
--- library/math.m	17 Oct 2005 11:35:18 -0000	1.51
+++ library/math.m	14 Dec 2005 07:54:46 -0000
@@ -261,7 +261,7 @@

 :- pragma foreign_proc("C",
     domain_checks,
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
 #ifdef ML_OMIT_MATH_DOMAIN_CHECKS
     SUCCESS_INDICATOR = MR_FALSE;
@@ -294,7 +294,7 @@
     % Pythagoras' number
 :- pragma foreign_proc("C",
     math__pi = (Pi::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Pi = ML_FLOAT_PI;
 ").
@@ -320,7 +320,7 @@
     % Base of natural logarithms
 :- pragma foreign_proc("C",
     math__e = (E::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     E = ML_FLOAT_E;
 ").
@@ -345,7 +345,7 @@

 :- pragma foreign_proc("C",
     math__ceiling(Num::in) = (Ceil::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Ceil = ceil(Num);
 ").
@@ -364,7 +364,7 @@

 :- pragma foreign_proc("C",
     math__floor(Num::in) = (Floor::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Floor = floor(Num);
 ").
@@ -383,7 +383,7 @@

 :- pragma foreign_proc("C",
     math__round(Num::in) = (Rounded::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Rounded = floor(Num+0.5);
 ").
@@ -416,7 +416,7 @@

 :- pragma foreign_proc("C",
     math__sqrt_2(X::in) = (SquareRoot::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     SquareRoot = sqrt(X);
 ").
@@ -487,7 +487,7 @@

 :- pragma foreign_proc("C",
     math__pow_2(X::in, Y::in) = (Res::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Res = pow(X, Y);
 ").
@@ -508,7 +508,7 @@

 :- pragma foreign_proc("C",
     math__exp(X::in) = (Exp::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Exp = exp(X);
 ").
@@ -536,7 +536,7 @@

 :- pragma foreign_proc("C",
     math__ln_2(X::in) = (Log::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Log = log(X);
 ").
@@ -564,7 +564,7 @@

 :- pragma foreign_proc("C",
     math__log10_2(X::in) = (Log10::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Log10 = log10(X);
 ").
@@ -588,7 +588,7 @@

 :- pragma foreign_proc("C",
     math__log2_2(X::in) = (Log2::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Log2 = log(X) / ML_FLOAT_LN2;
 ").
@@ -623,7 +623,7 @@

 :- pragma foreign_proc("C",
     math__log_2(B::in, X::in) = (Log::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Log = log(X) / log(B);
 ").
@@ -638,7 +638,7 @@

 :- pragma foreign_proc("C",
     math__sin(X::in) = (Sin::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Sin = sin(X);
 ").
@@ -657,7 +657,7 @@

 :- pragma foreign_proc("C",
     math__cos(X::in) = (Cos::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Cos = cos(X);
 ").
@@ -676,7 +676,7 @@

 :- pragma foreign_proc("C",
     math__tan(X::in) = (Tan::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Tan = tan(X);
 ").
@@ -709,7 +709,7 @@

 :- pragma foreign_proc("C",
     math__asin_2(X::in) = (ASin::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     ASin = asin(X);
 ").
@@ -742,7 +742,7 @@

 :- pragma foreign_proc("C",
     math__acos_2(X::in) = (ACos::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     ACos = acos(X);
 ").
@@ -762,7 +762,7 @@

 :- pragma foreign_proc("C",
     math__atan(X::in) = (ATan::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     ATan = atan(X);
 ").
@@ -781,7 +781,7 @@

 :- pragma foreign_proc("C",
     math__atan2(Y::in, X::in) = (ATan2::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     ATan2 = atan2(Y, X);
 ").
@@ -800,7 +800,7 @@

 :- pragma foreign_proc("C",
     math__sinh(X::in) = (Sinh::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Sinh = sinh(X);
 ").
@@ -816,7 +816,7 @@

 :- pragma foreign_proc("C",
     math__cosh(X::in) = (Cosh::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Cosh = cosh(X);
 ").
@@ -832,7 +832,7 @@

 :- pragma foreign_proc("C",
     math__tanh(X::in) = (Tanh::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Tanh = tanh(X);
 ").
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.150
diff -u -r1.150 private_builtin.m
--- library/private_builtin.m	8 Dec 2005 06:14:35 -0000	1.150
+++ library/private_builtin.m	14 Dec 2005 10:08:36 -0000
@@ -171,18 +171,21 @@

 :- pred builtin_strcmp(int::out, string::in, string::in) is det.

-:- pragma foreign_proc("C", builtin_strcmp(Res::out, S1::in, S2::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+:- pragma foreign_proc("C",
+    builtin_strcmp(Res::out, S1::in, S2::in),
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Res = strcmp(S1, S2);
 ").

-:- pragma foreign_proc("C#", builtin_strcmp(Res::out, S1::in, S2::in),
+:- pragma foreign_proc("C#",
+    builtin_strcmp(Res::out, S1::in, S2::in),
     [will_not_call_mercury, promise_pure, thread_safe],
 "
     Res = System.String.Compare(S1, S2);
 ").
-:- pragma foreign_proc("Java", builtin_strcmp(Res::out, S1::in, S2::in),
+:- pragma foreign_proc("Java",
+    builtin_strcmp(Res::out, S1::in, S2::in),
     [will_not_call_mercury, promise_pure, thread_safe],
 "
     Res = S1.compareTo(S2);
@@ -549,7 +552,7 @@
 :- pragma foreign_proc("C",
     type_info_from_typeclass_info(TypeClassInfo::in, Index::in,
         TypeInfo::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     TypeInfo = MR_typeclass_info_param_type_info(TypeClassInfo, Index);
 ").
@@ -557,7 +560,7 @@
 :- pragma foreign_proc("C",
     unconstrained_type_info_from_typeclass_info(TypeClassInfo::in,
         Index::in, TypeInfo::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     TypeInfo = MR_typeclass_info_instance_tvar_type_info(TypeClassInfo, Index);
 ").
@@ -565,7 +568,7 @@
 :- pragma foreign_proc("C",
     superclass_from_typeclass_info(TypeClassInfo0::in, Index::in,
         TypeClassInfo::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     TypeClassInfo =
         MR_typeclass_info_superclass_info(TypeClassInfo0, Index);
@@ -574,7 +577,7 @@
 :- pragma foreign_proc("C",
     instance_constraint_from_typeclass_info(TypeClassInfo0::in,
         Index::in, TypeClassInfo::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     TypeClassInfo =
         MR_typeclass_info_arg_typeclass_info(TypeClassInfo0, Index);
@@ -987,7 +990,7 @@

 :- pragma foreign_proc("C",
     gc_trace(Pointer::in),
-    [will_not_call_mercury, thread_safe],
+    [will_not_call_mercury, thread_safe, will_not_modify_trail],
 "
 #ifdef MR_NATIVE_GC
     *(MR_Word *)Pointer =
@@ -1002,14 +1005,14 @@

 :- pragma foreign_proc("C",
     free_heap(Val::di),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     MR_free_heap((void *) Val);
 ").

 :- pragma foreign_proc("C",
     mark_hp(SavedHeapPointer::out),
-    [will_not_call_mercury, thread_safe],
+    [will_not_call_mercury, thread_safe, will_not_modify_trail],
 "
 #ifndef MR_CONSERVATIVE_GC
     MR_mark_hp(SavedHeapPointer);
@@ -1021,7 +1024,7 @@

 :- pragma foreign_proc("C",
     restore_hp(SavedHeapPointer::in),
-    [will_not_call_mercury, thread_safe],
+    [will_not_call_mercury, thread_safe, will_not_modify_trail],
 "
 #ifndef MR_CONSERVATIVE_GC
     MR_restore_hp(SavedHeapPointer);
@@ -1310,9 +1313,9 @@
 no_clauses(PredName) :-
     error("no clauses for " ++ PredName).

-:- pragma foreign_proc(c,
+:- pragma foreign_proc("C",
     imp,
-    [will_not_call_mercury, thread_safe],
+    [will_not_call_mercury, thread_safe, will_not_modify_trail],
 "").
 :- pragma foreign_proc(il,
     imp,
@@ -1323,9 +1326,10 @@
     [will_not_call_mercury, thread_safe],
 "").

-:- pragma foreign_proc(c,
+:- pragma foreign_proc("C",
     semip,
-    [will_not_call_mercury, thread_safe, promise_semipure],
+    [will_not_call_mercury, thread_safe, promise_semipure,
+        will_not_modify_trail],
 "").
 :- pragma foreign_proc(il,
     semip,
Index: library/sparse_bitset.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/sparse_bitset.m,v
retrieving revision 1.25
diff -u -r1.25 sparse_bitset.m
--- library/sparse_bitset.m	17 Oct 2005 11:35:20 -0000	1.25
+++ library/sparse_bitset.m	14 Dec 2005 09:50:49 -0000
@@ -1103,7 +1103,7 @@
     % better to be safe.
 :- pragma foreign_proc("C",
     make_bitset_elem(A::in, B::in) = (Pair::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
 #define ML_BITSET_TAG MR_FIRST_UNRESERVED_RAW_TAG

Index: library/store.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/store.m,v
retrieving revision 1.52
diff -u -r1.52 store.m
--- library/store.m	17 Oct 2005 11:35:21 -0000	1.52
+++ library/store.m	14 Dec 2005 09:44:04 -0000
@@ -274,7 +274,7 @@

 :- pragma foreign_proc("C",
     store__do_init(_S0::uo),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     /* TypeInfo_for_S */
 ").
@@ -308,7 +308,7 @@

 :- pragma foreign_proc("C",
     new_mutvar(Val::in, Mutvar::out, S0::di, S::uo),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     MR_offset_incr_hp_msg(Mutvar, MR_SIZE_SLOT_SIZE, MR_SIZE_SLOT_SIZE + 1,
         MR_PROC_LABEL, ""store:mutvar/2"");
@@ -319,7 +319,7 @@

 :- pragma foreign_proc("C",
     get_mutvar(Mutvar::in, Val::out, S0::di, S::uo),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     Val = * (MR_Word *) Mutvar;
     S = S0;
@@ -327,7 +327,7 @@

 :- pragma foreign_proc("C",
     set_mutvar(Mutvar::in, Val::in, S0::di, S::uo),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     * (MR_Word *) Mutvar = Val;
     S = S0;
@@ -365,7 +365,7 @@

 :- pragma foreign_proc("C",
     unsafe_new_uninitialized_mutvar(Mutvar::out, S0::di, S::uo),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     MR_offset_incr_hp_msg(Mutvar, MR_SIZE_SLOT_SIZE, MR_SIZE_SLOT_SIZE + 1,
         MR_PROC_LABEL, ""store:mutvar/2"");
@@ -469,7 +469,7 @@

 :- pragma foreign_proc("C",
     new_ref(Val::di, Ref::out, S0::di, S::uo),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     MR_offset_incr_hp_msg(Ref, MR_SIZE_SLOT_SIZE, MR_SIZE_SLOT_SIZE + 1,
         MR_PROC_LABEL, ""store:ref/2"");
@@ -498,7 +498,7 @@

 :- pragma foreign_proc("C",
     unsafe_ref_value(Ref::in, Val::uo, S0::di, S::uo),
-    [will_not_call_mercury, promise_pure],
+[will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     Val = * (MR_Word *) Ref;
     S = S0;
Index: library/string.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/string.m,v
retrieving revision 1.240
diff -u -r1.240 string.m
--- library/string.m	28 Sep 2005 18:46:54 -0000	1.240
+++ library/string.m	14 Dec 2005 09:03:34 -0000
@@ -19,7 +19,6 @@
 %-----------------------------------------------------------------------------%

 :- module string.
-
 :- interface.

 :- import_module char.
@@ -1152,7 +1151,7 @@

 :- pragma foreign_proc("C",
     string__to_char_list(Str::in, CharList::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_ConstString p = Str + strlen(Str);
     CharList = MR_list_empty_msg(MR_PROC_LABEL);
@@ -1165,7 +1164,7 @@

 :- pragma foreign_proc("C",
     string__to_char_list(Str::uo, CharList::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     /* mode (uo, in) is det */
     MR_Word char_list_ptr;
@@ -1233,7 +1232,7 @@

 :- pragma foreign_proc("C",
     string__from_rev_char_list(Chars::in, Str::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_Word list_ptr;
     MR_Word size, len;
@@ -1374,7 +1373,7 @@
     % the amount of garbage created.
 :- pragma foreign_proc("C",
     string__append_list(Strs::in) = (Str::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_Word list = Strs;
     MR_Word tmp;
@@ -1406,7 +1405,7 @@
     % garbage created.
 :- pragma foreign_proc("C",
     string__join_list(Sep::in, Strs::in) = (Str::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_Word list;
     MR_Word tmp;
@@ -1471,9 +1470,10 @@

 %-----------------------------------------------------------------------------%

-    % Note - string__hash is also defined in code/imp.h
-    % The two definitions must be kept identical.
-
+    % NOTE: string.hash is also defined as MR_hash_string in
+    %       runtime/mercury_string.h.  The two definitions must be kept
+    %       identical.
+    %
 string__hash(String, HashVal) :-
     string__length(String, Length),
     string__hash_2(String, 0, Length, 0, HashVal0),
@@ -1503,7 +1503,7 @@

 :- pragma foreign_proc("C",
     sub_string_search(WholeString::in, Pattern::in, BeginAt::in, Index::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     char *match;
     match = strstr(WholeString + BeginAt, Pattern);
@@ -1986,7 +1986,7 @@
 :- pred using_sprintf is semidet.

 :- pragma foreign_proc("C", using_sprintf,
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     SUCCESS_INDICATOR = MR_TRUE;
 ").
@@ -2063,7 +2063,7 @@

 :- pragma foreign_proc("C",
     int_length_modifer = (LengthModifier::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_make_aligned_string(LengthModifier, MR_INTEGER_LENGTH_MODIFIER);
 }").
@@ -2081,7 +2081,7 @@

 :- pragma foreign_proc("C",
     native_format_float(FormatStr::in, Val::in) = (Str::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_save_transient_hp();
     Str = MR_make_string(MR_PROC_LABEL, FormatStr, (double) Val);
@@ -2100,7 +2100,7 @@

 :- pragma foreign_proc("C",
     native_format_int(FormatStr::in, Val::in) = (Str::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_save_transient_hp();
     Str = MR_make_string(MR_PROC_LABEL, FormatStr, Val);
@@ -2119,7 +2119,7 @@

 :- pragma foreign_proc("C",
     native_format_string(FormatStr::in, Val::in) = (Str::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_save_transient_hp();
     Str = MR_make_string(MR_PROC_LABEL, FormatStr, Val);
@@ -2138,7 +2138,7 @@

 :- pragma foreign_proc("C",
     native_format_char(FormatStr::in, Val::in) = (Str::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_save_transient_hp();
     Str = MR_make_string(MR_PROC_LABEL, FormatStr, Val);
@@ -2979,7 +2979,7 @@

 :- pragma foreign_proc("C",
     string__float_to_string(Flt::in, Str::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     /*
     ** For efficiency reasons we duplicate the C implementation
@@ -3038,7 +3038,7 @@

 :- pragma foreign_proc("C",
     string__lowlevel_float_to_string(Flt::in, Str::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     /*
     ** Note any changes here will require the same changes in
@@ -3077,7 +3077,7 @@

 :- pragma foreign_proc("C",
     string__to_float(FloatString::in, FloatVal::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     /*
     ** The %c checks for any erroneous characters appearing after the float;
@@ -3167,7 +3167,7 @@
     % shouldn't be considered to be part of the string itself.
 :- pragma foreign_proc("C",
     string__contains_char(Str::in, Ch::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     SUCCESS_INDICATOR = (strchr(Str, Ch) != NULL) && Ch != '\\0';
 ").
@@ -3215,7 +3215,7 @@
 % We should consider making this routine a compiler built-in.
 :- pragma foreign_proc("C",
     string__index_check(Index::in, Length::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     /*
     ** We do not test for negative values of Index because (a) MR_Unsigned
@@ -3240,7 +3240,7 @@

 :- pragma foreign_proc("C",
     string__unsafe_index(Str::in, Index::in, Ch::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Ch = Str[Index];
 ").
@@ -3301,7 +3301,7 @@

 :- pragma foreign_proc("C",
     string__set_char(Ch::in, Index::in, Str0::in, Str::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     size_t len = strlen(Str0);
     if ((MR_Unsigned) Index >= len) {
@@ -3362,7 +3362,7 @@

 :- pragma foreign_proc("C",
     string__unsafe_set_char(Ch::in, Index::in, Str0::in, Str::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     size_t len = strlen(Str0);
     MR_allocate_aligned_string_msg(Str, len, MR_PROC_LABEL);
@@ -3410,7 +3410,7 @@

 :- pragma foreign_proc("C",
     string__length(Str::in, Length::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Length = strlen(Str);
 ").
@@ -3429,7 +3429,7 @@

 :- pragma foreign_proc("C",
     string__length(Str::ui, Length::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     Length = strlen(Str);
 ").
@@ -3478,7 +3478,7 @@

 :- pragma foreign_proc("C",
     string__append_iii(S1::in, S2::in, S3::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     size_t len_1 = strlen(S1);
     SUCCESS_INDICATOR = (
@@ -3501,7 +3501,7 @@

 :- pragma foreign_proc("C",
     string__append_ioi(S1::in, S2::uo, S3::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     size_t len_1, len_2, len_3;

@@ -3539,7 +3539,7 @@

 :- pragma foreign_proc("C",
     string__append_iio(S1::in, S2::in, S3::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     size_t len_1, len_2;
     len_1 = strlen(S1);
@@ -3584,7 +3584,7 @@

 :- pragma foreign_proc("C",
     string__append_ooi_3(S1Len::in, S3Len::in, S1::out, S2::out, S3::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_allocate_aligned_string_msg(S1, S1Len, MR_PROC_LABEL);
     MR_memcpy(S1, S3, S1Len);
@@ -3637,7 +3637,7 @@

 :- pragma foreign_proc("C",
     string__substring(Str::in, Start::in, Count::in, SubString::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_Integer  len;
     MR_Word     tmp;
@@ -3657,7 +3657,7 @@

 :- pragma foreign_proc("C",
     string__unsafe_substring(Str::in, Start::in, Count::in, SubString::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_Integer len;

@@ -3680,7 +3680,7 @@

 :- pragma foreign_proc("C",
     string__split(Str::in, Count::in, Left::uo, Right::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     MR_Integer  len;
     MR_Word     tmp;
@@ -3749,7 +3749,7 @@

 :- pragma foreign_proc("C",
     string__first_char(Str::in, First::in, Rest::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     SUCCESS_INDICATOR = (
         Str[0] == First &&
@@ -3779,7 +3779,7 @@

 :- pragma foreign_proc("C",
     string__first_char(Str::in, First::uo, Rest::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "
     First = Str[0];
     SUCCESS_INDICATOR = (First != '\\0' && strcmp(Str + 1, Rest) == 0);
@@ -3812,7 +3812,7 @@

 :- pragma foreign_proc("C",
     string__first_char(Str::in, First::in, Rest::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     if (Str[0] != First || First == '\\0') {
         SUCCESS_INDICATOR = MR_FALSE;
@@ -3857,7 +3857,7 @@

 :- pragma foreign_proc("C",
     string__first_char(Str::in, First::uo, Rest::uo),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     First = Str[0];
     if (First == '\\0') {
@@ -3902,7 +3902,7 @@

 :- pragma foreign_proc("C",
     string__first_char(Str::uo, First::in, Rest::in),
-    [will_not_call_mercury, promise_pure, thread_safe],
+    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
 "{
     size_t len = strlen(Rest) + 1;
     MR_allocate_aligned_string_msg(Str, len, MR_PROC_LABEL);
Index: library/type_desc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/type_desc.m,v
retrieving revision 1.34
diff -u -r1.34 type_desc.m
--- library/type_desc.m	5 Dec 2005 05:37:28 -0000	1.34
+++ library/type_desc.m	14 Dec 2005 09:55:28 -0000
@@ -322,7 +322,7 @@

 :- pragma foreign_proc("C",
     is_univ_pseudo_type_desc(PseudoTypeDesc::in, TypeVarNum::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "
     MR_PseudoTypeInfo   pseudo_type_info;

@@ -346,7 +346,7 @@

 :- pragma foreign_proc("C",
     is_exist_pseudo_type_desc(PseudoTypeDesc::in, TypeVarNum::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "
     MR_PseudoTypeInfo   pseudo_type_info;

@@ -368,7 +368,7 @@

 :- pragma foreign_proc("C",
     type_desc_to_pseudo_type_desc(TypeDesc::in) = (PseudoTypeDesc::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "
     PseudoTypeDesc = TypeDesc;
 ").
@@ -394,7 +394,7 @@

 :- pragma foreign_proc("C",
     type_of(_Value::unused) = (TypeInfo::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "{
     TypeInfo = TypeInfo_for_T;

@@ -546,7 +546,7 @@

 :- pragma foreign_proc("C",
     type_ctor(TypeInfo::in) = (TypeCtor::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "{
     MR_TypeCtorInfo type_ctor_info;
     MR_TypeInfo     type_info;
@@ -562,7 +562,7 @@

 :- pragma foreign_proc("C",
     pseudo_type_ctor(PseudoTypeInfo::in) = (TypeCtor::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "{
     MR_TypeCtorInfo     type_ctor_info;
     MR_PseudoTypeInfo   pseudo_type_info;
@@ -585,7 +585,7 @@

 :- pragma foreign_proc("C",
     type_ctor_and_args(TypeDesc::in, TypeCtorDesc::out, ArgTypes::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "{
     MR_TypeCtorDesc type_ctor_desc;
     MR_TypeInfo     type_info;
@@ -631,7 +631,7 @@
 :- pragma foreign_proc("C",
     pseudo_type_ctor_and_args(PseudoTypeDesc::in, TypeCtorDesc::out,
         ArgPseudoTypeInfos::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "{
     MR_TypeCtorDesc     type_ctor_desc;
     MR_PseudoTypeInfo   pseudo_type_info;
@@ -658,7 +658,7 @@
 :- pragma promise_pure(make_type/2).
 :- pragma foreign_proc("C",
     make_type(TypeCtorDesc::in, ArgTypes::in) = (TypeDesc::out),
-    [will_not_call_mercury, thread_safe],
+    [will_not_call_mercury, thread_safe, will_not_modify_trail],
 "{
     MR_TypeCtorDesc type_ctor_desc;
     MR_TypeCtorInfo type_ctor_info;
@@ -699,7 +699,7 @@

 :- pragma foreign_proc("C",
     make_type(TypeCtorDesc::out, ArgTypes::out) = (TypeDesc::in),
-    [will_not_call_mercury, thread_safe],
+    [will_not_call_mercury, thread_safe, will_not_modify_trail],
 "{
     MR_TypeCtorDesc type_ctor_desc;
     MR_TypeInfo     type_info;
@@ -716,7 +716,7 @@
 :- pragma foreign_proc("C",
     type_ctor_name_and_arity(TypeCtorDesc::in, TypeCtorModuleName::out,
         TypeCtorName::out, TypeCtorArity::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, will_not_modify_trail],
 "{
     MR_TypeCtorDesc type_ctor_desc;

@@ -773,7 +773,7 @@
     % itself. It is intended for use from C code, since Mercury code can access
     % this type_info easily enough even without this predicate.
     %
-    % XXX This code relies on the type "type_desc:type_desc" being the
+    % XXX This code relies on the type "type_desc.type_desc" being the
     % same type as the builtin type "typeinfo".
     %
 :- func get_type_info_for_type_info = type_desc__type_desc.
Index: library/version_array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/version_array.m,v
retrieving revision 1.7
diff -u -r1.7 version_array.m
--- library/version_array.m	24 May 2005 05:51:34 -0000	1.7
+++ library/version_array.m	14 Dec 2005 08:31:04 -0000
@@ -283,21 +283,21 @@

 :- pragma foreign_proc("C",
     version_array.empty = (VA::out),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     VA = ML_va_new_empty();
 ").

 :- pragma foreign_proc("C",
     version_array.new(N::in, X::in) = (VA::out),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     VA = ML_va_new(N, X);
 ").

 :- pragma foreign_proc("C",
     resize(VA0::in, N::in, X::in) = (VA::out),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     VA = ML_va_resize(VA0, N, X);
 ").
@@ -305,7 +305,7 @@
 resize(N, X, VA, resize(VA, N, X)).

 :- pragma foreign_proc("C", size(VA::in) = (N::out),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     N = ML_va_size(VA);
 ").
@@ -314,24 +314,24 @@

 :- pragma foreign_proc("C",
     get_if_in_range(VA::in, I::in, X::out),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     SUCCESS_INDICATOR = ML_va_get(VA, I, &X);
 ").

 :- pred set_if_in_range(version_array(T)::in, int::in, T::in,
-                    version_array(T)::out) is semidet.
+    version_array(T)::out) is semidet.

 :- pragma foreign_proc("C",
     set_if_in_range(VA0::in, I::in, X::in, VA::out),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     SUCCESS_INDICATOR = ML_va_set(VA0, I, X, &VA);
 ").

 :- pragma foreign_proc("C",
     unsafe_rewind(VA0::in) = (VA::out),
-    [will_not_call_mercury, promise_pure],
+    [will_not_call_mercury, promise_pure, will_not_modify_trail],
 "
     VA = ML_va_rewind(VA0);
 ").

--------------------------------------------------------------------------
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