[m-dev.] for review: rewrite of termination analysis (part 1)

Zoltan Somogyi zs at cs.mu.oz.au
Mon Dec 22 18:24:38 AEDT 1997


Fergus wrote:
> > :- type termination_error
> ...
> >       ;       no_eqns
> 
> Please document the meaning of `no_eqns'.

You are right, I half missed that. Cut it in one place and forgot to paste
it here.

> > term_errors__description(inf_call(CallerPPId, CalleePPId),
> > 		Single, Module, Pieces, no) :-
> > 	(
> > 		Single = yes(PPId),
> > 		require(unify(PPId, CallerPPId), "caller outside this SCC"),
> 
> I think you should spell out "SCC".

This is an internal compiler abort message. Users should never see this;
if they do, having SCC spelt out for them will not really help them understand
this.

> (Ditto in several other places.)

After your previous review, I spelt out SCC or found alternate text for every
occurrence of "SCC" in messages that users are expected to see. All the
remaining ones are in abort messages.

> > term_errors__description(imported_pred, _, _, Pieces, no) :-
> > 	Pieces = ["It", "contains", "one", "or", "more",
> > 		"predicates", "and/or", "functions",
> > 		"imported", "from", "another", "module."].
> 
> Should that be
> 
>  	Pieces = ["It", "contains", "one", "or", "more",
> 		"calls", "to", "predicates", "and/or", "functions",
> 	        ^^^^^^^^^^^^^^
>  		"imported", "from", "another", "module."].

No, the original message is correct.

> s/"in"/"In"/

Done.

> As I noted previously, this duplicates code in hlds_out__write_pred_id.
> I think you should at least include a comment in both places saying
> that if you change one part then you will need to change the other.

Done.

> > :- pred term_errors__describe_one_call_site(pair(pred_proc_id,
> > 	term__context)::in, module_info::in, string::out) is det.
> > 
> > term_errors__describe_one_call_site(PPId - Context, Module, Piece) :-
> > 	term_errors__describe_one_proc_name(PPId, Module, ProcName),
> > 	Context = term__context(FileName, LineNumber),
> > 	string__int_to_string(LineNumber, LineNumberPart),
> > 	string__append_list([
> > 		ProcName,
> > 		" at ",
> > 		FileName,
> > 		":",
> > 		LineNumberPart
> > 		], Piece).
> 
> Term contexts should always be printed in the left-hand margin,
> so that tools like `emacs' and `error' can parse them.

Not in this case. We want to describe the cycle in a way that will not cause
error to scatter the various components of the one error message describing
the cycle over the entire program. If it did, the result would not be
intelligible, especially if some call sites participate in several cycles.

> s/any/an/
> s/sey/set/
> s/were/is/ (or perhaps s/were/was/)

Done.

> The comment above is wrong, I think: type_info should not be called size 0.

Although there are arguments why type_infos could be called size 0, I removed
the comment.

Zoltan.



More information about the developers mailing list