[mercury-users] Newbie problem. :)

Richard A. O'Keefe ok at atlas.otago.ac.nz
Fri Jun 18 15:40:12 AEST 1999


	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.
	
Right.  Let the compiler do the work!

	What I'm worried about is the case where you made a mistake
	and either your declaration or your code is wrong.
	
What has me completely baffled is why this is suddenly such a huge
worry for negative Horn clauses, while nobody seems to worry that
*exactly* the same situation exists in positive Horn clauses.

Why is
    :- max(X, Y, Z), Z < X.
    :- max(X, Y, Z), Z < Y.

    max(X, Y, Z) :- (X < Y -> Z = X ; Z = Y).

such a horrifying problem?  Why is it somehow worse than just

    max(X, Y, Z) :- (X < Y -> Z = X ; Z = Y).

?  (A real mistake I've made in the past.)

	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 applies to *other* errors as well, that can easily occur in
positive rules.  Once again, I have to ask "why is it WORSE for
negative rules than for positive rules?"

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