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

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Mar 7 17:29:10 AEDT 2005


On 07-Mar-2005, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> where get_trailed_global, set_trailed_global, and reset_p_table do the
> obvious thing.

I don't know what "obvious thing" you mean. Tabling is mostly used
in non-trailing grades. Duplicating trailing's functionality in other grades
would be a big juicy piece of distributed fat. In any case, I don't think
there is any need for trailing in your example.

> 	p(...) :-
> 		impure X = get_trailed_global(p_depth),
> 		impure set_trailed_global(p_depth, X + 1),
> 		...,
> 		impure set_trailed_global(p_depth, X),
> 		( if X = 0 then
> 			impure reset_p_table
> 		  else
> 		  	true
> 		).

This doesn't work. If p calls q, and some plain memo tabled predicate r
also calls q, how do we know which entries in q's table we need to reset
when the top-level call to p exits? 

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