[m-users.] problem with unique modes

Matthias Güdemann matthias.guedemann at googlemail.com
Fri Jul 10 22:07:57 AEST 2015


Hi,

>> I'd like to understand the problem with nested unique modes. When
>> reading through the archives, this was a recurring topic and Ralph
>> Becket mentioned that
>> 
>> "We do have a workable analysis sketched out, but just don't have the
>> resources to fix this particular problem at the moment."
>> 
>> Is this information available somewhere?

> David Overton's thesis is a good source of information, and is
> possibly what Ralph was referring to. It's available on the papers
> page.

I read the paper "Constraint-based mode analysis of Mercury" (David
Overton, Zoltan Somogyi and Peter Stuckey. PPDP'02, Pittsburgh) and some
relevant parts of David Overton's thesis. Unfortunately, unique modes
are explicitely not treated, it is mainly concerned with partially
instantiated data-structures.

If I understood correctly, then this is not supported in the compiler,
therefore this is currently not used in the mode analysis.

What I found about unique modes is this thread:
http://www.mercurylang.org/list-archives/developers/2003-January/012983.html 

As I am using the FFI with stateful objects encapsulated in Mercury data
types, I am interested in nested unique modes. Using
unsafe_promise_unique/2 works, but having the compiler doing the checks
would be nice.

Best regards,
Matthias



More information about the users mailing list