[m-dev.] Tdiff: termination analysis (BIG!)

Fergus Henderson fjh at cs.mu.oz.au
Mon Apr 14 20:18:58 AEST 1997


Another installment...

Christopher Rodd SPEIRS, you wrote:
> 
> compiler/trans_opt.m:
> 	Contains predicates for reading and writing transient_optimization
> 	files.

> %-----------------------------------------------------------------------------%
> % Copyright (C) 1996 University of Melbourne.
> % This file may only be copied under the terms of the GNU General
> % Public License - see the file COPYING in the Mercury distribution.
> %-----------------------------------------------------------------------------%

Should be Copyright (C) 1997
		           ^

Please check this for all the new files you've added.

> % file: trans_opt.m
> % main author: crs
> %
> % This module writes out the interface for transitive intermodule optimization.
> % The .trans_opt file includes:
> %	- pragma opt_terminates declarations for all exported preds
> % All these items should be module qualified.
> % Constructors should be explicitly type qualified.
> %
> % This module also contains predicates to read in the .trans_opt files.

This would be a good spot to put some general documentation about what
transitive intermodule optimization is and how it works.

> trans_opt__write_optfile(Module) -->
> 	{ module_info_name(Module, ModuleName) },
> 	% XXX this should be .trans_opt.tmp, and it should be compared
> 	% at the end of making the .trans_opt.tmp 
> 	{ string__append(ModuleName, ".trans_opt", OptName) },
> 	io__open_output(OptName, Result),

It would be nice if you could fix that XXX.

> :- pred read_optimization_interfaces(list(module_name), item_list,
> 	item_list, bool, bool, io__state, io__state).
> :- mode read_optimization_interfaces(in, in, out, in, out, di, uo) is det.

Could you please rename this to
	read_transitive_optimization_interfaces
or
	read_transopt_files
?

> 	maybe_write_string(VeryVerbose,
> 			"% Reading optimization interface for module"),

Please insert `transitive' in the message here.

> % termination.m
> % Main author: crs.
> %
> % This termination analysis is based on the algorithm given by Gerhard Groeger
> % and Lutz Plumer in their paper "Handling of Mutual Recursion in Automatic 
> % Termination Proofs for Logic Programs"  which was printed in JICSLP '92
> % pages 336 - 350.

Please expand the `JICSLP' acronym

	...  which was printed in JICSLP '92 (the proceedings of the
	Joint International Conference and Symposium on Logic Programming 1992)
	pages 336 - 350.

Everyone at Melbourne Uni will know what JICSLP means, but you never know
who will read this code...

> % this provides an initialised termination.
> :- pred termination__init(termination).
> :- mode termination__init(out) is det.

Please change the comment to

	% this provides an initialised termination structure.

> % this prints out the used_ards structure

s/ard/arg/

> termination__pass(Module0, Module) -->
> 	globals__io_lookup_bool_option(verbose, Verbose),
> 	maybe_write_string(Verbose, "% Checking Termination .....\n"),

s/T/t/
s/ ...../.../

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list