Estimated hours taken: 35
Modify termination analysis to use a linear inequation solver
written in Mercury rather than invoking an external 3rd party one.
compiler/term_pass1.m:
Remove all the code for writing out the system of equations,
invoking the solver and parsing the output.
Add code to convert the system of equations into the format
expected by the solver, and call the solver.
compiler/term_errors.m:
the 'lpsolve_failed' constructor goes from arity 1 to arity 0.
modify the output of error messages accordingly.
compiler/lp.m:
NEW file. Contains the linear inequation solver based on
the standard simplex method.
Estimated hours taken: 500
Add termination analysis to the compiler. The termination analysis
annotates each procinfo structure with termination information stating
whether each procedure is guaranteed to terminate.
Add transitive intermodule optimization to the compiler. Transitive
intermodule optimization uses .trans_opt files to store optimization
information. The difference between .trans_opt files and .opt files is
that .trans_opt files may depend on other .trans_opt files, whereas .opt
files may only depend on a .m file.
compiler/termination.m:
New file. The main module which controls the termination
analysis.
compiler/term_pass1.m:
New file. This file implements the first pass of the
termination analysis which attempts to derive relationships
between the relative sizes of variables. This information is
used by term_pass2.m
compiler/term_pass2.m:
New file. The second pass of the termination analysis attempts
to prove that each predicate or function in the program is
guaranteed to terminate.
compiler/term_util.m:
New file. Contains utilities which are used in various stages
of the termination analysis.
compiler/term_errors.m:
New file. Contains predicates for printing out error messages
produced by termination analysis.
compiler/trans_opt.m:
New file. This module contains predicates for both reading in
and writing .trans_opt files.
compiler/globals.m:
compiler/handle_options.m:
compiler/options.m:
Various modifications to handle the new options. Some of the
new options imply other options, and the `--termination-norm'
option is a string option which needs processing.
compiler/hlds_goal.m:
Added a comment that the list(uni_mode) subfield of construct,
and the unify_mode subfield of unify are not necessarily valid
when the unification applies to higher order terms.
compiler/hlds_out.m:
Added code to output termination information, as well as code to
print out the new markers.
compiler/hlds_pred.m:
Added the termination subfield to the proc_info structure and
added code to support it. Also added support for the new
markers.
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
compiler/module_qual.m:
compiler/modules.m:
compiler/prog_io_pragma.m:
Added support for the new pragmas, `termination_info',
`teminates', `check_termination' and `does_not_terminate'.
compiler/prog_data.m:
Added the new pragmas to the pragma_type. Also reformatted the
type declarations to conform with the coding specifications.
compiler/prog_io.m:
Reformatted some code and comments.
compiler/mercury_compiler.m:
Added code to call the termination analyser and to call the
predicate which creates .trans_opt files.
doc/reference_manual.texi:
Documented the termination analysis and the new pragmas.
doc/user_guide.texi:
Documented the new options.