[m-dev.] syntax for pre and post conditions

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jan 26 00:07:43 AEDT 2000


On 25-Jan-2000, Mark Anthony BROWN <dougl at cs.mu.OZ.AU> wrote:
> Peter Ross writes:
> > 
> In general, when a call terminates with an exception, the "correct thing"
> is to ask the user about the correctness of that exception.  The possible
> answers are:
> 
> i)	The exception is correct.  This could happen, for example,
> 	if the exception is meant to be caught higher up in the
> 	execution tree.
> ii)	The call is inadmissible (meaning that the exception is
> 	irrelevant).  This means that the error is in the caller.
> iii)	The exception is unexpected.  This means that the error is
> 	in the predicate called.
> 
> If the declarative debugger treats your proposed exceptions no
> differently to other exceptions, then everything should work fine.

Yes, but can't it do better than that?
If a precondition fails, can't you assume that the correct
answer is (ii) the call is inadmissible?

And if a postcondition fails, can't you at least rule out (i),
and only ask the user whether the cause is (ii) or (iii)?

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