[mercury-users] Structure reuse

Michael Day mikeday at yeslogic.com
Tue Jul 15 14:24:19 AEST 2003

> In practice, if you want to be sure that the optimization takes place
> you'll need to specify unique modes (sorry, not working yet) rather
> than relying on automagic compiler analyses.  Relying on the compiler
> to do the work will result in difficult to track down performance bugs
> where a data structure which should be single threaded actually isn't.

Right, so predicates to update the tree would use di/uo modes, and
predicates to selectively match the tree could use ui modes and still be
semidet. That would be quite good (when it works) for large examples like
this, when the programmer can state quite clearly that they want structure
reuse, and leave automatic structure reuse detection for the many little
cases which would be too time consuming to annotate by hand.

Presumably some predicates could have multiple mode definitions, to
indicate that they can operate on unique *or* ground arguments, if the
application in question required backtracking.

So... when will all this work? :)

(Perhaps I should start posting these are-we-there-yet questions to
mercury-grumbles at cs.mu.oz.au, to make it more convenient to redirect them 
to /dev/null :)


YesLogic Prince prints XML!

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