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

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


On 25-Jan-2000, Mark Anthony BROWN <dougl at cs.mu.OZ.AU> wrote:
> Peter Ross writes:
> > 
> > :- pred take(int::in, list(int)::in_list_skel, list(int)::out) is semidet.
> > 
> > :- check admissibility take(N, L, _) => ( N =< length(L) ).
> 
> I think this should be a mode error---L is not bound sufficiently
> to be passed to length.  So I don't see this as a problem with
> your method.

The trouble with that approach, I think, is that it doesn't
seem to work so well for multi-moded predicates.

Does anyone have a realistic example of a multi-moded predicate
for which you want admissibility constraints or preconditions?
I think there probably are some, but off-hand I'm having
difficulty coming up with realistic examples.

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