[m-rev.] diff: fix termination pragmas

Julien Fischer juliensf at students.cs.mu.OZ.AU
Wed Jun 25 15:55:57 AEST 2003


On Tue, 24 Jun 2003, Simon Taylor wrote:

> You should also remove the entry in the BUGS file.
>
Done.

> > Index: compiler/error_util.m
> > ===================================================================
> > RCS file: /home/mercury1/repository/mercury/compiler/error_util.m,v
> > retrieving revision 1.22
> > diff -u -r1.22 error_util.m
> > --- compiler/error_util.m	26 May 2003 08:59:53 -0000	1.22
> > +++ compiler/error_util.m	20 Jun 2003 03:24:32 -0000
> > @@ -91,6 +91,9 @@
> >  :- pred error_util__describe_one_pred_name(module_info::in, pred_id::in,
> >  	string::out) is det.
> >
> > +:- pred error_util__describe_several_pred_names(module_info::in,
> > +	list(pred_id)::in, list(format_component)::out) is det.
> > +
> >  :- pred error_util__describe_one_proc_name(module_info::in, pred_proc_id::in,
> >  	string::out) is det.
> >
> > @@ -458,6 +461,10 @@
> >  			"'"], Piece)
> >  	).
> >
> > +error_util__describe_several_pred_names(Module, PredId, Pieces) :-
> > +	list__map(error_util__describe_one_pred_name(Module), PredId, Pieces0),
> > +	error_util__list_to_pieces(Pieces0, Pieces).
> > +
> >  error_util__describe_one_proc_name(Module, proc(PredId, ProcId), Piece) :-
> >  	error_util__describe_one_pred_name(Module, PredId, PredPiece),
> >  	proc_id_to_int(ProcId, ProcIdInt),
>
> The code here is pretty simple, and is only called once.
> I'd suggest just putting it inline.
>
I'd prefer not to - it's also called by the equivalent place in the
new termination analyser.


> > @@ -471,6 +478,8 @@
> >  error_util__describe_several_proc_names(Module, PPIds, Pieces) :-
> >  	list__map(error_util__describe_one_proc_name(Module), PPIds, Pieces0),
> >  	error_util__list_to_pieces(Pieces0, Pieces).
> > +
> > +
> >
> >  error_util__describe_one_call_site(Module, PPId - Context, Piece) :-
> >  	error_util__describe_one_proc_name(Module, PPId, ProcName),
>
> Undo the whitespace change.
>
Done.

> > Index: doc/reference_manual.texi
> > ===================================================================
> > RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
> > retrieving revision 1.275
> > diff -u -r1.275 reference_manual.texi
> > --- doc/reference_manual.texi	19 May 2003 14:24:31 -0000	1.275
> > +++ doc/reference_manual.texi	19 Jun 2003 07:23:22 -0000
> > @@ -8331,7 +8331,9 @@
> >  or function is guaranteed to terminate for any input.  This is useful
> >  when the compiler cannot prove termination of some predicates or
> >  functions which are in turn preventing the compiler from proving
> > -termination of other predicates or functions.
> > +termination of other predicates or functions.  This declaration
> > +effects not only the predicate specified but also
> > +any other predicates that are mutually recursive with it.
>
> s/effects/affects/
>
> > @@ -8340,7 +8342,8 @@
> >  This declaration may be used to inform the compiler that this predicate
> >  does not necessarily terminate.  This is useful for procedures defined
> >  using the C interface, which the compiler assumes to terminate by
> > -default.
> > +default.  This declaration effects not only the predicate specified
> > +but also any other predicates that are mutually recursive with it.
>
> Here too.
>
Done.

interdiff follows:

diff -u compiler/error_util.m compiler/error_util.m
--- compiler/error_util.m	20 Jun 2003 03:24:32 -0000
+++ compiler/error_util.m	25 Jun 2003 04:40:21 -0000
@@ -480,6 +480,4 @@
 	error_util__list_to_pieces(Pieces0, Pieces).

-
-
 error_util__describe_one_call_site(Module, PPId - Context, Piece) :-
 	error_util__describe_one_proc_name(Module, PPId, ProcName),
diff -u doc/reference_manual.texi doc/reference_manual.texi
--- doc/reference_manual.texi	19 Jun 2003 07:23:22 -0000
+++ doc/reference_manual.texi	25 Jun 2003 05:42:45 -0000
@@ -8332,7 +8332,7 @@
 when the compiler cannot prove termination of some predicates or
 functions which are in turn preventing the compiler from proving
 termination of other predicates or functions.  This declaration
-effects not only the predicate specified but also
+affects not only the predicate specified but also
 any other predicates that are mutually recursive with it.

 @example
@@ -8342,7 +8342,7 @@
 This declaration may be used to inform the compiler that this predicate
 does not necessarily terminate.  This is useful for procedures defined
 using the C interface, which the compiler assumes to terminate by
-default.  This declaration effects not only the predicate specified
+default.  This declaration affects not only the predicate specified
 but also any other predicates that are mutually recursive with it.

 @example
only in patch2:
--- BUGS	22 Nov 2002 19:14:28 -0000	1.16
+++ BUGS	25 Jun 2003 04:28:02 -0000
@@ -185,14 +185,6 @@

 -----------------------------------------------------------------------------

-Subject: `:- pragma does_not_terminate'
-Date: Wed, 9 Jun 1999 16:29:09 +1000 (EST)
-
-`:- pragma does_not_terminate' declarations do not work.
-The compiler's termination analysis seems to ignore them.
-
------------------------------------------------------------------------------
-
 Date: Wed, 1 Dec 1999 22:52:57 +1100
 Subject: compiler infinite loop for cyclic type classes

--------------------------------------------------------------------------
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