[m-dev.] Tabling [1/3]

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Mar 10 16:44:17 AEDT 1998


On 10-Mar-1998, Andrew Bromage <bromage at cs.mu.OZ.AU> wrote:
> G'day.
> 
> Oliver Hutchison wrote:
> 
> > > > compiler/modes.m:
> > > > 	Make sure that all procedures with non normal evaluation have 
> > > > 	no unique/partially instantiated modes. Produce error messages 
> > > > 	if they do.
> 
> [...]
> 
> > Does it make sense to memo a predicate with unique modes?
> 
> It could make sense to memo a predicate with a 'ui' mode.
> 
> <<
> :- pred array_rtc(array(T) :: array_ui, T :: in, T :: out) is multi.
> 
> array_rtc(Array, From, From).
> array_rtc(Array, From, To) :-
> 	array__semidet_lookup(Array, From, Mid),
> 	array_rtc(Array, Mid, To).
> >>

The problem with this is that if this is memoed, then the first call
will keep a reference to the array in the table, so the array won't
be unique anymore.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list