[mercury-users] Newbie problem. :)

Thomas Conway conway at cs.mu.OZ.AU
Fri Jun 18 12:45:57 AEST 1999


On Fri, Jun 18, 1999 at 11:22:22AM EST, Richard A. O'Keefe wrote:
	[deletia]
> is that in the version with the negative rule, the crucial information
> is written *SOMEWHERE*, while in the present state of affairs it is
> written *NOWHERE*.  

It is also different in that when you use the ->; you are nailing down
the oder in which p and q will be attempted, whereas using the mutual
exclusion rules, the compiler may (for example based on profiling info)
cause p and q to be attempted in either order.

I agree with you entirely that declaring a property of the specification
is good, especially if it means the compiler can do something sensible
(like not require you to include the error case in the chain of ->;s,
or not require you to introduce a gazillion artificial variables in
said chain). What I'm worried about is the case where you made a mistake
and either your declaration or your code is wrong.

Actually, the more I think about it, the more I am convinced that declaring
a property of the specification (like mutual exclusion) is a good idea,
since otherwise it gets left in the comments (where it frequently goes
out of date, and is only useful to people who read - a rare species),
or is not documented at all.

	[deletia]
> But a "debugging" version
> 
>     (   p(X), r(X) ->
> 	( q(X) -> REPORT NEGATIVE RULE ERROR; true), ...
>     ;   q(X), ...
>     )
> 
> is also possible.

If people write code with such errors, but don't have debugging switched
on, with one compiler it may work (so they don't notice and fix the errors),
but not with another, or simply work at some optimization levels, but
not at others (the only *safe* optimization level being the debugging
level).

This strikes me as a bit like DEC-10 Prolog mode declarations -
the terms `prescriptive' and `descriptive' are coming to mind.

-- 
 Thomas Conway )O+     Every sword has two edges.
     Mercurian            <conway at cs.mu.oz.au>
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list