[mercury-users] Assoc-List: keys ground & values unique

Kral Stefan skral at mips.complang.tuwien.ac.at
Wed Sep 28 19:48:45 AEST 2005


Hi Ralph.

Thanks for your reply!

I think that the ability to express a uniqueness property is
a big plus in the mode system of Mercury. Reuse issues are
important in all other languages as well, but in Mercury
the compiler can actually check the properties I specify
(so programs using uniqueness are more likely to be correct).

The "application" I have in mind is an expression evaluator
for the gmpint library we are currently building. The evaluator
should support a limited amount of memoization, so I want to
manage a register file "list(int,gmpint)". The gmpints should
be unique so that I can immediately reuse them, which can 
make a big performance difference with GMP.

Also thanks for your shared_unique_{pair/alist} example. 
I will try that immediately... can't wait to get rid of
all these unsafe_promise_unique calls.

Our soon to be released Mercury-GMP binding (for arbitrary 
prec. ints and arbitrary prec. floats), will include benchmarks
showing the performance gain possible with reuse.

And finally some good news: Whenever intermediate values are 
passed as arguments (and not stored anywhere else, which is 
quite often the case), reuse is really easy and straightforward. 

Best regards,
Stefan.

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