[m-rev.] diff: allow "pragma memo" to specify how to table each argument

Ian MacLarty maclarty at cs.mu.OZ.AU
Sun Aug 14 14:01:45 AEST 2005


On Sun, 14 Aug 2005, Zoltan Somogyi wrote:

> This is what we talked about at the HAL meeting about ten days ago.
> I'll address any comments after commit.
>
> Zoltan.
>
> Add a new tabling method, one which specifies how each argument should
> be treated, like this:
>
>     :- pragma memo(p(in, in, in, out), [value, addr, promise_implied, output]).

...

> +We also support two faster variants of @samp{pragma memo}
> +that may be applicable in some circumstances.
> +The implementation of @samp{pragma memo}
> +looks up the value of each input argument in the call table,
> +and thus requires time proportional to
> +the number of function symbols in the input arguments
> +to look up the current call in the call table.
> +The @samp{pragma fast_loose_memo} variant
> +looks up only the address of each input argument in the call table,
> +which means that the time required
> +to look up the current call in the call table
> +is linear only in the number of input arguments.
> +The tradeoff is that @samp{fast_loose_memo} does not recognize
> +calls as duplicates if they involve input arguments that are logically equal
> +but are stored at different locations in memory.
> +The following declarations call for this variable of tabling.

s/variable/variant/

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