[mercury-users] Status of unique modes in Mercury?

Ralph Becket rafe at csse.unimelb.edu.au
Fri Jul 4 13:29:19 AEST 2008

Edsko de Vries, Thursday,  3 July 2008:
> What exactly are the issues? Why are arrays not unique objects? And in
> what way does the compiler "not yet properly understand unique modes"?

The general problem is that
(a) uniqueness is a hard thing to analyse and
(b) the current implementation of the mode analyser is very complex and
(c) none of the developers currently has the time to address the issue.

The specific problems are that the compiler has trouble (i.e., can
reject correct programs) with ui modes (i.e., unique inputs that aren't
affected by the call) and nested uniqueness.  The compiler can, however,
handle di/uo arguments fine, which is why IO is safe.

The former is an issue for things like array.size while the latter is a
problem for arrays of arrays.

We do have a workable analysis sketched out, but just don't have the
resources to fix this particular problem at the moment.

-- Ralph
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au

More information about the users mailing list