[m-rev.] for review: fix termination analysis bug

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Oct 3 12:27:12 AEST 2003


On 03-Oct-2003, Julien Fischer <juliensf at students.cs.mu.OZ.AU> wrote:
> 
> Fix a bug that caused the termination analyser to abort when using
> the `num-data-elems' norm whilst analysing code that (de)constructs
> existentially typed data types.
> 
> compiler/term_util.m:
> 	When building the weight table add any type_infos to the list
> 	of non-recursive arguments otherwise term_util.functor_norm/9 will
> 	throw an exception when processing an existentially typed data item.
> 	When calculating the weight do not add arguments that correspond
> 	to type_info related variables.

Hmm... my intuition is that termination analysis probably ought to take
the sizes of type_info variables into account, otherwise it won't be
able to infer termination of any procedure which recursively
deconstructs types, e.g. io__write_univ.

So I'm not sure that this is the best fix in the long term.
But it does at least look like an improvement on the status quo.

I suggest adding an XXX comment about the above point.
Otherwise, this looks fine.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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