[m-rev.] for post-commit review: fix goal_form.m XXX

Zoltan Somogyi zs at csse.unimelb.edu.au
Tue Aug 1 10:41:54 AEST 2006


On 31-Jul-2006, Peter Moulder <Peter.Moulder at infotech.monash.edu.au> wrote:
> Minor point: the can_loop/can_throw functions do not do a complete
> analysis; sometimes they return `yes' when a deeper analysis would show
> that in fact the goal cannot loop/throw.

That is inherent in pretty much all program analyses.

> Thus, they ought to be called
> may_loop/may_throw, consistent with usage in Mercury documentation (and
> the naming of the other external preds/funcs of that module, I believe).
> 
> At the least, it would be good for the documentation comments in the
> interface section to clarify this (e.g. say `may' rather than `can').

If you wish to improve the documentation, go ahead, but I don't think
"may" vs "can" implies the distinction you think it does. It certainly
doesn't to me.

> Although not very important, addressing it may help someone in the
> future debugging a problem because they wrongly assume that can_foo will
> return `no' (because the person knows that the goal cannot foo).

Anyone who knows what they are doing knows that pretty much any nontrivial
program analysis is going to be inexact.

 It may
> also act as a hint that improving this analysis may be one option if
> callers perform badly (i.e. get "don't know" answers more often than the
> programmer would expect/want).

At the moment, you cannot get "don't know" answers. If the analysis doesn't
know, it returns the conservative answer (i.e. can loop or can throw).

> the line-by-line diffs make it difficult to
> see how the behaviour of external procs has changed.

That's why that information was in the log message.

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list