[m-dev.] diff: change documentation of equality preds

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Feb 2 18:32:59 AEDT 2000


Since I didn't get any objections, I'll go ahead
and commit this one.  I made a few minor changes
to the wording since the diff that I posted in the
original thread ("for review: cfloat.m"), so here's
the diff for the version that I'm actually committing.

----------

Estimated hours taken: 0.5

doc/reference_manual.texi:
	Document that equality predicates can have declartions
	that are more general than pred(T::in, T::in) is semidet.

Workspace: /d-drive/home/hg/fjh/mercury
Index: doc/reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.162
diff -u -d -r1.162 reference_manual.texi
--- doc/reference_manual.texi	1999/12/13 13:30:47	1.162
+++ doc/reference_manual.texi	2000/02/02 07:30:33
@@ -2260,18 +2260,29 @@
         subset(S2, S1).
 @end example
 
-A type declaration for a type @var{T} may contain a
+A type declaration for a type @samp{foo(T1, @dots{}, TN)} may contain a
 @samp{where equality is @var{equalitypred}} specification only
 if the following conditions are satisfied:
 
 @itemize @bullet
 @item
- at var{T} must be a discriminated union type; it may not be an
-equivalence type
+The type @samp{foo(T1, @dots{}, TN)} must be a discriminated union type;
+it may not be an equivalence type
 
 @item
- at var{equalitypred} must be the name of a predicate with type
- at samp{pred(T, T)} and mode @samp{(in, in) is semidet}.
+ at var{equalitypred} must be the name of a predicate which can
+be called with two ground arguments of type @samp{pred(foo(T1, @dots{}, TN))},
+and whose determinism in that mode is @samp{semidet}.
+Typically the equality predicate would have type
+ at samp{pred(foo(T1, @dots{}, TN), foo(T1, @dots{}, TN)}
+and mode @samp{(in, in) is semidet}, but it is also legal
+for the type, mode and determinism to be more permissive:
+the type or the mode's initial insts may be more general
+(e.g. the type could be just the polymorphic type @samp{pred(T, T)})
+and the mode's final insts or the determinism may be more
+specific (e.g. the determinism could be any of @samp{det},
+ at samp{failure} or @samp{erroneous}).
+The equality predicate must also be ``pure'' (@pxref{Impurity}).
 
 @end itemize
 

-- 
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.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list