[m-rev.] diff: allow memo tables to be reset

Ian MacLarty maclarty at cs.mu.OZ.AU
Mon Mar 7 17:50:31 AEDT 2005


Zoltan Somogyi wrote:
> On 07-Mar-2005, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> 
>>:- pragma memo_transient(p/n, [q1/m1, q2/m2, ..., qk/mk]).
>>
>>Which says that the memo tables for q1, q2 etc. should be reset when a 
>>top level call to p/n finishes.  The programmer might only want certain 
>>memo tables to be reset (e.g. for predicates that are unlikely to be 
>>called with the same input for a different call to p).  The compiler 
>>might check that q1, q2 etc can be reached from p and give an error if 
>>they can't.
> 
> 
> But the compiler should also check that q1, q2 etc *can't* be reached
> *without* going through p, and that is impossible if those predicates
> are in another module, which they can be.
> 

Good point, though normally I'd suspect q1, q2 etc would be part of the 
implementation details of p and so be in the same module and private to 
that module.  I think the pragma might still be useful under these 
restrictions.

Ian.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list