[mercury-users] Library v2 and Typeclasses'n'Stuff

Peter Schachte schachte at cs.mu.OZ.AU
Tue Nov 9 23:16:45 AEDT 1999


On Sun, Nov 07, 1999 at 08:47:10PM +0100, Juergen Stuber wrote:
> Ralph Becket <rbeck at microsoft.com> writes:
> > However, what I think is needed is not a change to the mode system, but
> > simply the adoption of the forthcoming promise mechanism with type
> > qualification, e.g.
> > 
> > :- promise all [X:sequence(S, T)] (X = []) <=> \+ (X = [H | T]).
> 
> I guess that should be
> 
> :- promise all [X:S] (X = []) <=> \+ (X = [H | T]) <= sequence(S, T).
> 
> You can view modes as abbreviations of such formulas.
> I think that some abbreviation is needed, because for
> more than two alternatives the formulas get quite big and nasty.

They certainly do.  More importantly, though, whatever syntax is
chosen must not only state the declarative information we all agree
on, but also what the compiler is expected to do with it.  If we want
the compiler to use such declarations to improve determinism checking,
it must be very clear that the compiler is expected to consider this
information for this purpose, and not just for optimization.

I kind of like the idea of declaring the determinism of a disjunction,
since declaring it semidet means the goals are exclusive, multi means
they're exhaustive, and det means both.  It's all in one declaration.
It is also pretty suggestive that the information is to be used for
determinism checking.  I guess it's harder to decide what to do with a
declaration that a disjunction is cc_nondet or cc_multi.

-- 
Peter Schachte                     In war, the first casualty is truth.
mailto:schachte at cs.mu.OZ.AU            -- Aeschylus, ca. 475 BC 
http://www.cs.mu.oz.au/~schachte/  
PGP: finger schachte at 128.250.37.3  
--------------------------------------------------------------------------
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