[m-rev.] diff: delete unused imports

Zoltan Somogyi zs at csse.unimelb.edu.au
Thu Dec 30 22:16:26 AEDT 2010


Make the system compile with --warn-unused-imports.

browser/*.m:
library/*.m:
compiler/*.m:
	Remove unnecesary imports as flagged by --warn-unused-imports.

	In some files, do some minor cleanup along the way.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/extra
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/extra
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops/doc
cvs diff: Diffing boehm_gc/libatomic_ops/src
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/armcc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops/tests
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/m4
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
Index: browser/browse.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/browse.m,v
retrieving revision 1.77
diff -u -b -r1.77 browse.m
--- browser/browse.m	16 Jun 2010 01:29:05 -0000	1.77
+++ browser/browse.m	30 Dec 2010 08:24:38 -0000
@@ -172,7 +172,6 @@
 :- implementation.
 
 :- import_module mdb.parse.
-:- import_module mdb.util.
 :- import_module mdb.frame.
 :- import_module mdb.sized_pretty.
 
Index: browser/declarative_tree.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/declarative_tree.m,v
retrieving revision 1.63
diff -u -b -r1.63 declarative_tree.m
--- browser/declarative_tree.m	20 Dec 2010 07:47:23 -0000	1.63
+++ browser/declarative_tree.m	30 Dec 2010 08:24:57 -0000
@@ -49,7 +49,6 @@
 :- pred trace_implicit_tree_info(wrap(S)::in, edt_node(R)::in,
     implicit_tree_info::out) is semidet <= annotated_trace(S, R).
 
-
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
 
@@ -64,7 +63,6 @@
 
 :- import_module assoc_list.
 :- import_module bool.
-:- import_module cord.
 :- import_module deconstruct.
 :- import_module exception.
 :- import_module int.
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/add_heap_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_heap_ops.m,v
retrieving revision 1.45
diff -u -b -r1.45 add_heap_ops.m
--- compiler/add_heap_ops.m	15 Dec 2010 06:29:27 -0000	1.45
+++ compiler/add_heap_ops.m	30 Dec 2010 06:33:22 -0000
@@ -51,14 +51,10 @@
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.builtin_lib_types.
 :- import_module parse_tree.prog_data.
-:- import_module parse_tree.prog_type.
 
-:- import_module assoc_list.
-:- import_module bool.
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module term.
 :- import_module varset.
Index: compiler/add_pragma.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_pragma.m,v
retrieving revision 1.107
diff -u -b -r1.107 add_pragma.m
--- compiler/add_pragma.m	15 Dec 2010 06:29:27 -0000	1.107
+++ compiler/add_pragma.m	30 Dec 2010 06:33:22 -0000
@@ -126,7 +126,6 @@
 :- import_module backend_libs.foreign.
 :- import_module backend_libs.rtti.
 :- import_module check_hlds.mode_util.
-:- import_module check_hlds.type_util.
 :- import_module hlds.code_model.
 :- import_module hlds.hlds_args.
 :- import_module hlds.hlds_data.
Index: compiler/add_trail_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_trail_ops.m,v
retrieving revision 1.56
diff -u -b -r1.56 add_trail_ops.m
--- compiler/add_trail_ops.m	15 Dec 2010 06:29:27 -0000	1.56
+++ compiler/add_trail_ops.m	30 Dec 2010 06:33:22 -0000
@@ -80,9 +80,7 @@
 :- import_module parse_tree.builtin_lib_types.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_mode.
-:- import_module parse_tree.prog_type.
 
-:- import_module assoc_list.
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
Index: compiler/add_type.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_type.m,v
retrieving revision 1.39
diff -u -b -r1.39 add_type.m
--- compiler/add_type.m	15 Dec 2010 06:29:27 -0000	1.39
+++ compiler/add_type.m	30 Dec 2010 06:33:22 -0000
@@ -60,19 +60,15 @@
 :- import_module hlds.make_hlds.make_hlds_error.
 :- import_module hlds.make_hlds.make_hlds_passes.
 :- import_module hlds.make_tags.
-:- import_module hlds.hlds_code_util.
 :- import_module hlds.hlds_out.
-:- import_module hlds.hlds_out.hlds_out_goal.
 :- import_module hlds.hlds_out.hlds_out_util.
 :- import_module libs.globals.
 :- import_module libs.options.
 :- import_module parse_tree.module_qual.
 :- import_module parse_tree.prog_type.
-:- import_module parse_tree.prog_util.
 
 :- import_module int.
 :- import_module map.
-:- import_module multi_map.
 :- import_module pair.
 :- import_module require.
 :- import_module string.
Index: compiler/basic_block.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/basic_block.m,v
retrieving revision 1.35
diff -u -b -r1.35 basic_block.m
--- compiler/basic_block.m	15 Dec 2010 06:29:28 -0000	1.35
+++ compiler/basic_block.m	30 Dec 2010 06:33:22 -0000
@@ -34,27 +34,23 @@
 
 :- type block_info
     --->    block_info(
-                starting_label      :: label,
                                     % The label starting the block.
+                starting_label      :: label,
 
-                label_instr         :: instruction,
                                     % The instruction containing the label.
+                label_instr         :: instruction,
 
+                % The code of the block without the initial label.
                 later_instrs        :: list(instruction),
-                                    % The code of the block without the initial
-                                    % label.
 
+                % Does the previous block (if any) fall through to this block?
                 fallen_into         :: bool,
-                                    % Does the previous block (if any)
-                                    % fall through to this block?
 
+                % The labels we can jump to (not falling through).
                 jump_dests          :: list(label),
-                                    % The labels we can jump to
-                                    % (not falling through).
 
+                % The label we fall through to (if there is one).
                 fall_dest           :: maybe(label)
-                                    % The label we fall through to
-                                    % (if there is one).
             ).
 
     % create_basic_blocks(ProcInstrs, Comments, ProcLabel, !C, NewLabels,
@@ -101,7 +97,6 @@
 
 :- import_module ll_backend.opt_util.
 
-:- import_module pair.
 :- import_module require.
 :- import_module svmap.
 :- import_module svset.
Index: compiler/build_mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/build_mode_constraints.m,v
retrieving revision 1.38
diff -u -b -r1.38 build_mode_constraints.m
--- compiler/build_mode_constraints.m	20 Dec 2010 07:47:27 -0000	1.38
+++ compiler/build_mode_constraints.m	30 Dec 2010 06:33:22 -0000
@@ -195,12 +195,10 @@
 :- import_module hlds.hlds_desc.
 
 :- import_module bool.
-:- import_module cord.
 :- import_module io.
 :- import_module map.
 :- import_module maybe.
 :- import_module multi_map.
-:- import_module pair.
 :- import_module require.
 :- import_module string.
 :- import_module svbimap.
@@ -213,19 +211,17 @@
 
 :- type conj_constraints_info
     --->    conj_constraints_info(
+                % Keys are program variables local to the conjunction.
+                % They are mapped to constraint variables representing
+                % the proposition that they are produced at each conjunct,
+                % but only for conjuncts they appear in/are nonlocal to.
                 locals_positions    ::  conjunct_production_map,
-                    % Keys are program variables local to the
-                    % conjunction. They are mapped to constraint
-                    % variables representing the proposition that they
-                    % are produced at each conjunct, but only for
-                    % conjuncts they appear in/are nonlocal to.
 
+                % Keys are program variables nonlocal to the conjunction.
+                % They are mapped to constraint variables representing
+                % the proposition that they are produced at each conjunct,
+                % but only for conjuncts they appear in/are nonlocal to.
                 nonlocals_positions ::  conjunct_production_map
-                    % Keys are program variables nonlocal to the
-                    % conjunction. They are mapped to constraint
-                    % variables representing the proposition that they
-                    % are produced at each conjunct, but only for
-                    % conjuncts they appear in/are nonlocal to.
             ).
 
     % Map from program variables to corresponding constraint variables.
Index: compiler/check_typeclass.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/check_typeclass.m,v
retrieving revision 1.130
diff -u -b -r1.130 check_typeclass.m
--- compiler/check_typeclass.m	15 Dec 2010 06:29:29 -0000	1.130
+++ compiler/check_typeclass.m	30 Dec 2010 06:33:22 -0000
@@ -123,7 +123,6 @@
 :- import_module parse_tree.prog_type_subst.
 :- import_module parse_tree.prog_util.
 
-:- import_module assoc_list.
 :- import_module bool.
 :- import_module int.
 :- import_module map.
Index: compiler/code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_gen.m,v
retrieving revision 1.181
diff -u -b -r1.181 code_gen.m
--- compiler/code_gen.m	15 Dec 2010 06:29:30 -0000	1.181
+++ compiler/code_gen.m	30 Dec 2010 06:33:23 -0000
@@ -63,7 +63,6 @@
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module string.
Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.380
diff -u -b -r1.380 code_info.m
--- compiler/code_info.m	20 Dec 2010 07:47:28 -0000	1.380
+++ compiler/code_info.m	30 Dec 2010 06:33:23 -0000
@@ -67,7 +67,6 @@
 :- import_module backend_libs.builtin_ops.
 :- import_module backend_libs.proc_label.
 :- import_module hlds.arg_info.
-:- import_module hlds.hlds_code_util.
 :- import_module hlds.hlds_desc.
 :- import_module hlds.hlds_rtti.
 :- import_module libs.options.
Index: compiler/code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_util.m,v
retrieving revision 1.187
diff -u -b -r1.187 code_util.m
--- compiler/code_util.m	15 Dec 2010 06:29:30 -0000	1.187
+++ compiler/code_util.m	30 Dec 2010 06:33:23 -0000
@@ -94,7 +94,6 @@
 
 :- import_module backend_libs.builtin_ops.
 :- import_module backend_libs.proc_label.
-:- import_module backend_libs.rtti.
 :- import_module hlds.code_model.
 
 :- import_module int.
Index: compiler/commit_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/commit_gen.m,v
retrieving revision 1.22
diff -u -b -r1.22 commit_gen.m
--- compiler/commit_gen.m	15 Dec 2010 06:29:31 -0000	1.22
+++ compiler/commit_gen.m	30 Dec 2010 06:33:23 -0000
@@ -38,11 +38,8 @@
 :- import_module ll_backend.code_gen.
 
 :- import_module cord.
-:- import_module list.
 :- import_module maybe.
 :- import_module require.
-:- import_module pair.
-:- import_module string.
 
 %---------------------------------------------------------------------------%
 
Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.162
diff -u -b -r1.162 compile_target_code.m
--- compiler/compile_target_code.m	15 Dec 2010 06:29:31 -0000	1.162
+++ compiler/compile_target_code.m	30 Dec 2010 06:33:23 -0000
@@ -232,20 +232,15 @@
 
 :- implementation.
 
-:- import_module hlds.
-
-:- import_module hlds.passes_aux.
 :- import_module libs.globals.
 :- import_module libs.handle_options.
 :- import_module libs.options.
-:- import_module libs.timestamp.
 :- import_module libs.trace_params.
 :- import_module parse_tree.error_util.
 :- import_module parse_tree.file_names.
 :- import_module parse_tree.module_cmds.
 :- import_module parse_tree.write_deps_file.
 :- import_module parse_tree.prog_foreign.
-:- import_module parse_tree.prog_out.
 
 :- import_module dir.
 :- import_module getopt_io.
Index: compiler/compiler_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/compiler_util.m,v
retrieving revision 1.7
diff -u -b -r1.7 compiler_util.m
--- compiler/compiler_util.m	15 Dec 2010 06:29:31 -0000	1.7
+++ compiler/compiler_util.m	30 Dec 2010 06:33:23 -0000
@@ -46,9 +46,6 @@
 :- import_module libs.options.
 
 :- import_module bool.
-:- import_module list.
-:- import_module require.
-:- import_module string.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/complexity.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/complexity.m,v
retrieving revision 1.38
diff -u -b -r1.38 complexity.m
--- compiler/complexity.m	15 Dec 2010 06:29:31 -0000	1.38
+++ compiler/complexity.m	30 Dec 2010 06:33:23 -0000
@@ -70,7 +70,6 @@
 :- import_module libs.options.
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.builtin_lib_types.
-:- import_module parse_tree.error_util.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_mode.
 :- import_module parse_tree.prog_out.
Index: compiler/const_prop.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/const_prop.m,v
retrieving revision 1.46
diff -u -b -r1.46 const_prop.m
--- compiler/const_prop.m	23 Dec 2008 01:37:30 -0000	1.46
+++ compiler/const_prop.m	30 Dec 2010 06:33:23 -0000
@@ -50,11 +50,9 @@
 :- implementation.
 
 :- import_module hlds.hlds_goal.
-:- import_module hlds.hlds_pred.
 :- import_module hlds.instmap.
 :- import_module libs.globals.
 :- import_module libs.options.
-:- import_module mdbcomp.prim_data.
 :- import_module parse_tree.prog_data.
 
 :- import_module bool.
Index: compiler/constraint.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/constraint.m,v
retrieving revision 1.96
diff -u -b -r1.96 constraint.m
--- compiler/constraint.m	29 Dec 2010 04:52:17 -0000	1.96
+++ compiler/constraint.m	30 Dec 2010 06:33:23 -0000
@@ -52,7 +52,6 @@
 
 :- import_module check_hlds.inst_match.
 :- import_module hlds.goal_form.
-:- import_module hlds.goal_util.
 :- import_module libs.globals.
 :- import_module libs.options.
 
Index: compiler/cse_detection.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/cse_detection.m,v
retrieving revision 1.128
diff -u -b -r1.128 cse_detection.m
--- compiler/cse_detection.m	15 Dec 2010 06:29:32 -0000	1.128
+++ compiler/cse_detection.m	30 Dec 2010 06:33:23 -0000
@@ -39,7 +39,6 @@
 :- import_module check_hlds.switch_detection.
 :- import_module check_hlds.switch_detection.
 :- import_module check_hlds.type_util.
-:- import_module hlds.goal_util.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_out.
 :- import_module hlds.hlds_out.hlds_out_util.
@@ -57,11 +56,9 @@
 
 :- import_module assoc_list.
 :- import_module bool.
-:- import_module int.
 :- import_module io.
 :- import_module list.
 :- import_module map.
-:- import_module maybe.
 :- import_module pair.
 :- import_module require.
 :- import_module set.
Index: compiler/dead_proc_elim.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dead_proc_elim.m,v
retrieving revision 1.137
diff -u -b -r1.137 dead_proc_elim.m
--- compiler/dead_proc_elim.m	15 Dec 2010 06:29:32 -0000	1.137
+++ compiler/dead_proc_elim.m	30 Dec 2010 06:33:23 -0000
@@ -93,7 +93,6 @@
 :- import_module int.
 :- import_module io.
 :- import_module maybe.
-:- import_module pair.
 :- import_module queue.
 :- import_module require.
 :- import_module set_tree234.
Index: compiler/deep_profiling.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deep_profiling.m,v
retrieving revision 1.106
diff -u -b -r1.106 deep_profiling.m
--- compiler/deep_profiling.m	20 Dec 2010 07:47:29 -0000	1.106
+++ compiler/deep_profiling.m	30 Dec 2010 06:33:23 -0000
@@ -50,19 +50,15 @@
 
 :- implementation.
 
-:- import_module backend_libs.rtti.
 :- import_module check_hlds.mode_util.
-:- import_module check_hlds.type_util.
 :- import_module hlds.code_model.
 :- import_module hlds.goal_path.
 :- import_module hlds.goal_util.
-:- import_module hlds.hlds_data.
 :- import_module hlds.hlds_out.
 :- import_module hlds.hlds_out.hlds_out_util.
 :- import_module hlds.hlds_rtti.
 :- import_module hlds.instmap.
 :- import_module hlds.pred_table.
-:- import_module libs.compiler_util.
 :- import_module libs.file_util.
 :- import_module libs.globals.
 :- import_module libs.options.
Index: compiler/deforest.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deforest.m,v
retrieving revision 1.96
diff -u -b -r1.96 deforest.m
--- compiler/deforest.m	15 Dec 2010 06:29:32 -0000	1.96
+++ compiler/deforest.m	30 Dec 2010 06:33:23 -0000
@@ -66,7 +66,6 @@
 :- import_module parse_tree.error_util.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_type_subst.
-:- import_module parse_tree.prog_util.
 :- import_module transform_hlds.dependency_graph.
 :- import_module transform_hlds.inlining.
 :- import_module transform_hlds.pd_cost.
Index: compiler/delay_construct.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/delay_construct.m,v
retrieving revision 1.31
diff -u -b -r1.31 delay_construct.m
--- compiler/delay_construct.m	15 Dec 2010 06:29:33 -0000	1.31
+++ compiler/delay_construct.m	30 Dec 2010 06:33:23 -0000
@@ -45,13 +45,10 @@
 :- import_module hlds.hlds_rtti.
 :- import_module hlds.instmap.
 :- import_module hlds.passes_aux.
-:- import_module libs.globals.
 :- import_module parse_tree.prog_data.
 
 :- import_module bool.
-:- import_module io.
 :- import_module list.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 
Index: compiler/delay_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/delay_info.m,v
retrieving revision 1.32
diff -u -b -r1.32 delay_info.m
--- compiler/delay_info.m	15 Dec 2010 06:29:33 -0000	1.32
+++ compiler/delay_info.m	30 Dec 2010 06:33:23 -0000
@@ -94,7 +94,6 @@
 
 :- import_module int.
 :- import_module map.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module stack.
Index: compiler/delay_partial_inst.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/delay_partial_inst.m,v
retrieving revision 1.17
diff -u -b -r1.17 delay_partial_inst.m
--- compiler/delay_partial_inst.m	15 Dec 2010 06:29:33 -0000	1.17
+++ compiler/delay_partial_inst.m	30 Dec 2010 06:33:23 -0000
@@ -136,13 +136,10 @@
 :- import_module parse_tree.prog_data.
 
 :- import_module bool.
-:- import_module int.
-:- import_module io.
 :- import_module map.
 :- import_module maybe.
 :- import_module pair.
 :- import_module require.
-:- import_module set.
 :- import_module string.
 :- import_module svmap.
 
Index: compiler/delay_slot.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/delay_slot.m,v
retrieving revision 1.20
diff -u -b -r1.20 delay_slot.m
--- compiler/delay_slot.m	6 Jan 2007 09:23:29 -0000	1.20
+++ compiler/delay_slot.m	30 Dec 2010 06:33:23 -0000
@@ -64,7 +64,6 @@
 
 :- implementation.
 
-:- import_module pair.
 :- import_module string.
 
 %-----------------------------------------------------------------------------%
Index: compiler/dense_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dense_switch.m,v
retrieving revision 1.74
diff -u -b -r1.74 dense_switch.m
--- compiler/dense_switch.m	15 Dec 2010 06:29:33 -0000	1.74
+++ compiler/dense_switch.m	30 Dec 2010 06:33:23 -0000
@@ -60,7 +60,6 @@
 :- import_module hlds.hlds_out.hlds_out_goal.
 :- import_module ll_backend.code_gen.
 :- import_module ll_backend.trace_gen.
-:- import_module parse_tree.prog_type.
 
 :- import_module assoc_list.
 :- import_module cord.
Index: compiler/dep_par_conj.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dep_par_conj.m,v
retrieving revision 1.45
diff -u -b -r1.45 dep_par_conj.m
--- compiler/dep_par_conj.m	15 Dec 2010 06:29:33 -0000	1.45
+++ compiler/dep_par_conj.m	30 Dec 2010 06:33:23 -0000
@@ -156,7 +156,6 @@
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.builtin_lib_types.
 :- import_module parse_tree.prog_mode.
-:- import_module parse_tree.prog_type.
 :- import_module parse_tree.prog_util.
 :- import_module transform_hlds.dependency_graph.
 
Index: compiler/deps_map.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deps_map.m,v
retrieving revision 1.2
diff -u -b -r1.2 deps_map.m
--- compiler/deps_map.m	14 Aug 2009 20:37:46 -0000	1.2
+++ compiler/deps_map.m	30 Dec 2010 06:33:23 -0000
@@ -90,13 +90,10 @@
 :- import_module parse_tree.read_modules.
 
 :- import_module assoc_list.
-:- import_module bool.
-:- import_module dir.
 :- import_module list.
 :- import_module pair.
 :- import_module set.
 :- import_module svmap.
-:- import_module term.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/det_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/det_analysis.m,v
retrieving revision 1.226
diff -u -b -r1.226 det_analysis.m
--- compiler/det_analysis.m	29 Dec 2010 04:52:17 -0000	1.226
+++ compiler/det_analysis.m	30 Dec 2010 06:33:23 -0000
@@ -116,7 +116,6 @@
 :- import_module hlds.goal_util.
 :- import_module hlds.hlds_error_util.
 :- import_module hlds.hlds_out.
-:- import_module hlds.hlds_out.hlds_out_goal.
 :- import_module hlds.hlds_out.hlds_out_util.
 :- import_module hlds.pred_table.
 :- import_module libs.
Index: compiler/disj_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/disj_gen.m,v
retrieving revision 1.115
diff -u -b -r1.115 disj_gen.m
--- compiler/disj_gen.m	15 Dec 2010 06:29:33 -0000	1.115
+++ compiler/disj_gen.m	30 Dec 2010 06:33:23 -0000
@@ -44,7 +44,6 @@
 :- import_module libs.options.
 :- import_module ll_backend.code_gen.
 :- import_module ll_backend.continuation_info.
-:- import_module ll_backend.exprn_aux.
 :- import_module ll_backend.global_data.
 :- import_module ll_backend.lookup_util.
 :- import_module ll_backend.trace_gen.
@@ -55,7 +54,6 @@
 :- import_module int.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module term.
Index: compiler/distance_granularity.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/distance_granularity.m,v
retrieving revision 1.12
diff -u -b -r1.12 distance_granularity.m
--- compiler/distance_granularity.m	30 Jul 2010 05:16:10 -0000	1.12
+++ compiler/distance_granularity.m	30 Dec 2010 06:33:23 -0000
@@ -150,34 +150,28 @@
 :- import_module hlds.pred_table.
 :- import_module hlds.quantification.
 :- import_module hlds.instmap.
-:- import_module libs.compiler_util.
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.builtin_lib_types.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_mode.
-:- import_module parse_tree.prog_type.
 :- import_module parse_tree.prog_util.
-:- import_module transform_hlds.implicit_parallelism.
 
 :- import_module bool.
 :- import_module int.
-:- import_module io.
 :- import_module list.
 :- import_module pair.
-:- import_module map.
 :- import_module maybe.
 :- import_module require.
 :- import_module string.
 :- import_module set.
 :- import_module term.
-:- import_module varset.
 
 %-----------------------------------------------------------------------------%
-
-    % This section contains predicates which apply the first part of the
-    % transformation i.e. creating the specialized version of the
-    % original predicate.
-
+%
+% This section contains predicates which apply the first part of the
+% transformation, i.e. creating the specialized version of the
+% original predicate.
+%
 
 control_distance_granularity(!ModuleInfo, Distance) :-
     module_info_get_valid_predids(PredIds, !ModuleInfo),
@@ -830,12 +824,12 @@
 granularity_prefix = "DistanceGranularityFor".
 
 %-----------------------------------------------------------------------------%
-
-    % This section contains predicates that make the granularity control
-    % transparent to the original procedure's callers by replacing the recursive
-    % calls in the body of the original procedure with calls to the specialized
-    % version.
-
+%
+% This section contains predicates that make the granularity control
+% transparent to the original procedure's callers by replacing the recursive
+% calls in the body of the original procedure with calls to the specialized
+% version.
+%
 
     % Update the recursive calls in each procedure in the list so that the
     % pred_id called is the one of the specialized procedure.
Index: compiler/dupelim.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dupelim.m,v
retrieving revision 1.95
diff -u -b -r1.95 dupelim.m
--- compiler/dupelim.m	15 Dec 2010 06:29:34 -0000	1.95
+++ compiler/dupelim.m	30 Dec 2010 06:33:23 -0000
@@ -67,7 +67,6 @@
 :- import_module bool.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module svmap.
Index: compiler/elds_to_erlang.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/elds_to_erlang.m,v
retrieving revision 1.37
diff -u -b -r1.37 elds_to_erlang.m
--- compiler/elds_to_erlang.m	15 Dec 2010 06:29:34 -0000	1.37
+++ compiler/elds_to_erlang.m	30 Dec 2010 06:33:23 -0000
@@ -55,7 +55,6 @@
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_foreign.
 :- import_module parse_tree.prog_type.
-:- import_module parse_tree.prog_util.
 
 :- import_module bool.
 :- import_module char.
Index: compiler/equiv_type_hlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/equiv_type_hlds.m,v
retrieving revision 1.62
diff -u -b -r1.62 equiv_type_hlds.m
--- compiler/equiv_type_hlds.m	15 Dec 2010 06:29:34 -0000	1.62
+++ compiler/equiv_type_hlds.m	30 Dec 2010 06:33:23 -0000
@@ -34,7 +34,6 @@
 :- import_module check_hlds.mode_util.
 :- import_module check_hlds.polymorphism.
 :- import_module check_hlds.type_util.
-:- import_module hlds.goal_util.
 :- import_module hlds.hlds_data.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_pred.
Index: compiler/erl_code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/erl_code_util.m,v
retrieving revision 1.20
diff -u -b -r1.20 erl_code_util.m
--- compiler/erl_code_util.m	15 Dec 2010 06:29:34 -0000	1.20
+++ compiler/erl_code_util.m	30 Dec 2010 06:33:23 -0000
@@ -207,14 +207,12 @@
 
 :- implementation.
 
-:- import_module check_hlds.inst_match.
 :- import_module check_hlds.mode_util.
 :- import_module check_hlds.type_util.
 :- import_module hlds.goal_util.
 
 :- import_module int.
 :- import_module map.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module svset.
Index: compiler/erl_rtti.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/erl_rtti.m,v
retrieving revision 1.22
diff -u -b -r1.22 erl_rtti.m
--- compiler/erl_rtti.m	15 Dec 2010 06:29:34 -0000	1.22
+++ compiler/erl_rtti.m	30 Dec 2010 06:33:23 -0000
@@ -51,15 +51,12 @@
 :- import_module hlds.hlds_rtti.
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.prog_data.
-:- import_module parse_tree.prog_util.
 
 :- import_module bool.
 :- import_module deconstruct.
-:- import_module exception.
 :- import_module int.
 :- import_module maybe.
 :- import_module require.
-:- import_module string.
 :- import_module svvarset.
 :- import_module univ.
 :- import_module varset.
@@ -388,7 +385,6 @@
 
 %-----------------------------------------------------------------------------%
 
-    %
     % Generate a representation of a type_info.
     % The generated type_info will always be local to the module.
     %
@@ -458,7 +454,6 @@
 
 %-----------------------------------------------------------------------------%
 
-    %
     % Generate a representation of a pseudo_type_info.
     % The generated pseudo_type_info will always be local to the module.
     %
Index: compiler/erl_unify_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/erl_unify_gen.m,v
retrieving revision 1.16
diff -u -b -r1.16 erl_unify_gen.m
--- compiler/erl_unify_gen.m	15 Dec 2010 06:29:34 -0000	1.16
+++ compiler/erl_unify_gen.m	30 Dec 2010 06:33:23 -0000
@@ -85,15 +85,11 @@
 :- import_module hlds.hlds_pred.
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.prog_data.
-:- import_module parse_tree.prog_util.
 
 :- import_module int.
 :- import_module list.
-:- import_module map.
 :- import_module pair.
 :- import_module require.
-:- import_module set.
-:- import_module string.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/exprn_aux.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/exprn_aux.m,v
retrieving revision 1.90
diff -u -b -r1.90 exprn_aux.m
--- compiler/exprn_aux.m	30 Oct 2009 03:33:13 -0000	1.90
+++ compiler/exprn_aux.m	30 Dec 2010 06:54:22 -0000
@@ -98,11 +98,6 @@
 
 :- implementation.
 
-:- import_module libs.compiler_util.
-:- import_module libs.globals.
-:- import_module libs.options.
-
-:- import_module getopt_io.
 :- import_module int.
 :- import_module maybe.
 :- import_module pair.
@@ -114,11 +109,19 @@
 % is constant as far as the C compiler is concerned -- specifically,
 % determine whether it can be used as the initializer of a C static constant.
 
-const_is_constant(llconst_true, _, yes).
-const_is_constant(llconst_false, _, yes).
-const_is_constant(llconst_int(_), _, yes).
-const_is_constant(llconst_foreign(_, _), _, yes).
-const_is_constant(llconst_float(_), ExprnOpts, IsConst) :-
+const_is_constant(Const, ExprnOpts, IsConst) :-
+    (
+        ( Const = llconst_true
+        ; Const = llconst_false
+        ; Const = llconst_int(_)
+        ; Const = llconst_foreign(_, _)
+        ; Const = llconst_string(_)
+        ; Const = llconst_multi_string(_)
+        ; Const = llconst_data_addr(_, _)
+        ),
+        IsConst = yes
+    ;
+        Const = llconst_float(_),
     SGFloats = ExprnOpts ^ static_ground_floats,
     (
         SGFloats = have_static_ground_floats,
@@ -126,18 +129,20 @@
     ;
         SGFloats = do_not_have_static_ground_floats,
         IsConst = no
+        )
+    ;
+        Const = llconst_code_addr(CodeAddr),
+        addr_is_constant(CodeAddr, ExprnOpts, IsConst)
     ).
-const_is_constant(llconst_string(_), _, yes).
-const_is_constant(llconst_multi_string(_), _, yes).
-const_is_constant(llconst_code_addr(CodeAddr), ExprnOpts, IsConst) :-
-    addr_is_constant(CodeAddr, ExprnOpts, IsConst).
-const_is_constant(llconst_data_addr(_, _), _, yes).
 
 :- pred addr_is_constant(code_addr::in, exprn_opts::in, bool::out) is det.
 
-addr_is_constant(code_label(Label), ExprnOpts, IsConst) :-
-    label_is_constant(Label, ExprnOpts, IsConst).
-addr_is_constant(code_imported_proc(_), ExprnOpts, IsConst) :-
+addr_is_constant(CodeAddr, ExprnOpts, IsConst) :-
+    (
+        CodeAddr = code_label(Label),
+        label_is_constant(Label, ExprnOpts, IsConst)
+    ;
+        CodeAddr = code_imported_proc(_),
     StaticCodeAddrs = ExprnOpts ^ static_code_addresses,
     (
         StaticCodeAddrs = have_static_code_addresses,
@@ -145,16 +150,20 @@
     ;
         StaticCodeAddrs = do_not_have_static_code_addresses,
         IsConst = no
+        )
+    ;
+        ( CodeAddr = code_succip
+        ; CodeAddr = do_succeed(_)
+        ; CodeAddr = do_redo
+        ; CodeAddr = do_fail
+        ; CodeAddr = do_trace_redo_fail_shallow
+        ; CodeAddr = do_trace_redo_fail_deep
+        ; CodeAddr = do_call_closure(_)
+        ; CodeAddr = do_call_class_method(_)
+        ; CodeAddr = do_not_reached
+        ),
+        IsConst = no
     ).
-addr_is_constant(code_succip, _, no).
-addr_is_constant(do_succeed(_), _, no).
-addr_is_constant(do_redo, _, no).
-addr_is_constant(do_fail, _, no).
-addr_is_constant(do_trace_redo_fail_shallow, _, no).
-addr_is_constant(do_trace_redo_fail_deep, _, no).
-addr_is_constant(do_call_closure(_), _, no).
-addr_is_constant(do_call_class_method(_), _, no).
-addr_is_constant(do_not_reached, _, no).
 
 :- pred label_is_constant(label::in, exprn_opts::in, bool::out) is det.
 
Index: compiler/fact_table.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/fact_table.m,v
retrieving revision 1.90
diff -u -b -r1.90 fact_table.m
--- compiler/fact_table.m	15 Dec 2010 06:29:35 -0000	1.90
+++ compiler/fact_table.m	30 Dec 2010 06:33:23 -0000
@@ -101,7 +101,6 @@
 :- import_module check_hlds.mode_util.
 :- import_module hlds.arg_info.
 :- import_module hlds.code_model.
-:- import_module hlds.passes_aux.
 :- import_module libs.file_util.
 :- import_module libs.globals.
 :- import_module libs.options.
@@ -114,7 +113,6 @@
 :- import_module parse_tree.module_cmds.
 :- import_module parse_tree.prog_foreign.
 :- import_module parse_tree.prog_out.
-:- import_module parse_tree.prog_util.
 
 :- import_module assoc_list.
 :- import_module bool.
Index: compiler/file_names.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/file_names.m,v
retrieving revision 1.13
diff -u -b -r1.13 file_names.m
--- compiler/file_names.m	15 Dec 2010 06:29:35 -0000	1.13
+++ compiler/file_names.m	30 Dec 2010 06:33:23 -0000
@@ -138,7 +138,6 @@
 :- import_module libs.options.
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.java_names.
-:- import_module parse_tree.prog_util.
 :- import_module parse_tree.source_file_map.
 
 :- import_module bool.
Index: compiler/file_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/file_util.m,v
retrieving revision 1.5
diff -u -b -r1.5 file_util.m
--- compiler/file_util.m	20 Dec 2010 04:59:53 -0000	1.5
+++ compiler/file_util.m	30 Dec 2010 06:33:23 -0000
@@ -109,11 +109,9 @@
 
 :- implementation.
 
-:- import_module libs.compiler_util.
 :- import_module libs.handle_options.
 :- import_module libs.options.
 
-:- import_module char.
 :- import_module dir.
 :- import_module string.
 
Index: compiler/follow_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/follow_code.m,v
retrieving revision 1.99
diff -u -b -r1.99 follow_code.m
--- compiler/follow_code.m	15 Dec 2010 06:29:35 -0000	1.99
+++ compiler/follow_code.m	30 Dec 2010 06:33:23 -0000
@@ -57,7 +57,6 @@
 
 :- import_module bool.
 :- import_module list.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 
Index: compiler/foreign.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/foreign.m,v
retrieving revision 1.86
diff -u -b -r1.86 foreign.m
--- compiler/foreign.m	15 Dec 2010 06:29:35 -0000	1.86
+++ compiler/foreign.m	30 Dec 2010 06:33:23 -0000
@@ -154,7 +154,6 @@
 :- import_module hlds.code_model.
 :- import_module hlds.hlds_data.
 :- import_module hlds.hlds_module.
-:- import_module hlds.hlds_out.
 :- import_module hlds.hlds_pred.
 :- import_module libs.
 :- import_module libs.globals.
@@ -166,12 +165,10 @@
 :- import_module assoc_list.
 :- import_module int.
 :- import_module list.
-:- import_module map.
 :- import_module pair.
 :- import_module require.
 :- import_module string.
 :- import_module term.
-:- import_module varset.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/format_call.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/format_call.m,v
retrieving revision 1.22
diff -u -b -r1.22 format_call.m
--- compiler/format_call.m	20 Dec 2010 07:47:30 -0000	1.22
+++ compiler/format_call.m	30 Dec 2010 06:33:23 -0000
@@ -142,14 +142,11 @@
 :- import_module hlds.instmap.
 :- import_module hlds.pred_table.
 :- import_module libs.
-:- import_module libs.compiler_util.
 :- import_module libs.globals.
 :- import_module libs.options.
 :- import_module mdbcomp.program_representation.
 :- import_module parse_tree.builtin_lib_types.
-:- import_module parse_tree.prog_mode.
 
-:- import_module assoc_list.
 :- import_module bool.
 :- import_module char.
 :- import_module counter.
Index: compiler/frameopt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/frameopt.m,v
retrieving revision 1.120
diff -u -b -r1.120 frameopt.m
--- compiler/frameopt.m	15 Dec 2010 06:29:35 -0000	1.120
+++ compiler/frameopt.m	30 Dec 2010 06:33:23 -0000
@@ -154,7 +154,6 @@
 
 :- implementation.
 
-:- import_module libs.options.
 :- import_module ll_backend.opt_debug.
 :- import_module ll_backend.opt_util.
 :- import_module parse_tree.prog_data.
Index: compiler/global_data.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/global_data.m,v
retrieving revision 1.43
diff -u -b -r1.43 global_data.m
--- compiler/global_data.m	30 Oct 2009 03:33:13 -0000	1.43
+++ compiler/global_data.m	30 Dec 2010 06:33:23 -0000
@@ -133,7 +133,6 @@
 
 :- implementation.
 
-:- import_module libs.compiler_util.
 :- import_module ll_backend.layout.
 
 :- import_module bimap.
Index: compiler/globals.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/globals.m,v
retrieving revision 1.98
diff -u -b -r1.98 globals.m
--- compiler/globals.m	22 Dec 2010 02:51:35 -0000	1.98
+++ compiler/globals.m	30 Dec 2010 06:33:23 -0000
@@ -324,7 +324,6 @@
 :- import_module int.
 :- import_module require.
 :- import_module string.
-:- import_module univ.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/goal_form.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_form.m,v
retrieving revision 1.50
diff -u -b -r1.50 goal_form.m
--- compiler/goal_form.m	15 Dec 2010 06:29:36 -0000	1.50
+++ compiler/goal_form.m	30 Dec 2010 06:33:23 -0000
@@ -193,7 +193,6 @@
 :- import_module int.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 
 %-----------------------------------------------------------------------------%
Index: compiler/goal_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_util.m,v
retrieving revision 1.177
diff -u -b -r1.177 goal_util.m
--- compiler/goal_util.m	29 Dec 2010 04:52:17 -0000	1.177
+++ compiler/goal_util.m	30 Dec 2010 06:33:23 -0000
@@ -442,7 +442,6 @@
 :- import_module check_hlds.inst_match.
 :- import_module check_hlds.type_util.
 :- import_module hlds.goal_form.
-:- import_module hlds.hlds_llds.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_mode.
 :- import_module parse_tree.prog_type.
Index: compiler/granularity.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/granularity.m,v
retrieving revision 1.19
diff -u -b -r1.19 granularity.m
--- compiler/granularity.m	15 Dec 2010 06:29:36 -0000	1.19
+++ compiler/granularity.m	30 Dec 2010 06:33:23 -0000
@@ -32,7 +32,6 @@
 :- import_module hlds.pred_table.
 :- import_module hlds.quantification.
 :- import_module libs.globals.
-:- import_module libs.options.
 :- import_module transform_hlds.dependency_graph.
 :- import_module mdbcomp.
 :- import_module mdbcomp.prim_data.
@@ -42,7 +41,6 @@
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module string.
 
Index: compiler/headvar_names.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/headvar_names.m,v
retrieving revision 1.7
diff -u -b -r1.7 headvar_names.m
--- compiler/headvar_names.m	15 Dec 2010 06:29:36 -0000	1.7
+++ compiler/headvar_names.m	30 Dec 2010 06:33:23 -0000
@@ -35,7 +35,6 @@
 :- import_module hlds.hlds_args.
 :- import_module hlds.hlds_clauses.
 :- import_module hlds.hlds_goal.
-:- import_module hlds.goal_util.
 :- import_module libs.options.
 :- import_module parse_tree.prog_data.
 
Index: compiler/hhf.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hhf.m,v
retrieving revision 1.40
diff -u -b -r1.40 hhf.m
--- compiler/hhf.m	15 Dec 2010 06:29:36 -0000	1.40
+++ compiler/hhf.m	30 Dec 2010 06:33:23 -0000
@@ -43,12 +43,10 @@
 
 :- import_module check_hlds.type_util.
 :- import_module hlds.goal_util.
-:- import_module hlds.hlds_args.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.passes_aux.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_type.
-:- import_module parse_tree.prog_util.
 :- import_module mdbcomp.prim_data.
 
 :- import_module list.
Index: compiler/hlds_args.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_args.m,v
retrieving revision 1.5
diff -u -b -r1.5 hlds_args.m
--- compiler/hlds_args.m	15 Dec 2010 06:29:37 -0000	1.5
+++ compiler/hlds_args.m	30 Dec 2010 07:17:08 -0000
@@ -219,13 +219,11 @@
 
 :- implementation.
 
-:- import_module parse_tree.prog_util.
 :- import_module parse_tree.prog_type.  
     % Required for apply_partial_map_to_list.
     % XXX That should really live in a different module.
 
 :- import_module require.
-:- import_module string.
 
 %-----------------------------------------------------------------------------%
 
@@ -233,47 +231,47 @@
     %
 :- type proc_arg_vector(T)
     --->    proc_arg_vector(
-                pav_instance_type_infos :: list(T),
                 % Type_infos for the unconstrained type variables in an
                 % instance declaration in the order which they first appear
                 % in the instance arguments.  For procedures that are not
-                % class methods this will always be the empty list.
+                % class methods, this will always be the empty list.
+                pav_instance_type_infos         :: list(T),
                
-                pav_instance_typeclass_infos :: list(T),
                 % Typeclass_infos for the class constraints on an instance
                 % declaration, in the order in which they appear in the
-                % declaration.  For procedures that are not class methods
+                % declaration. For procedures that are not class methods,
                 % this will always be the empty list.
+                pav_instance_typeclass_infos    :: list(T),
                 
-                pav_univ_type_infos :: list(T),
                 % Type_infos for unconstrained universally quantified type
                 % variables, in the order in which they first appear in the
                 % argument types.
+                pav_univ_type_infos             :: list(T),
                 
-                pav_exist_type_infos :: list(T),
                 % Type_infos for unconstrained existentially quantified type
                 % variables, in the order that the type variables first
                 % appear in the argument types.
+                pav_exist_type_infos            :: list(T),
                 
-                pav_univ_typeclass_infos :: list(T),
                 % Typeclass_infos for universally quantified constraints
                 % in the order in which the constraints appear in the class
                 % context.
+                pav_univ_typeclass_infos        :: list(T),
                 
-                pav_exist_typeclass_infos :: list(T),
                 % Typeclass_infos for existentially quantified constraints
                 % in the order in which the constraints appear in the class
                 % context.
+                pav_exist_typeclass_infos       :: list(T),
                 
-                pav_user_args :: list(T),
                 % The original procedure arguments.
                 % XXX Plus at the moment any arguments that may be
                 % introduced by transformations performed by the compiler.
                 % Eventually these should be separated out.
+                pav_user_args                   :: list(T),
                 
+                % For predicates this field is no; for functions
+                % it corresponds to the function's return value.
                 pav_maybe_ret_value :: maybe(T)
-                % For predicates this field is no; for functions it
-                % corresponds to the function's return value.
             ).
 
 %-----------------------------------------------------------------------------%
@@ -303,21 +301,21 @@
 proc_arg_vector_get_maybe_ret_value(V)          = V ^ pav_maybe_ret_value.
 
 proc_arg_vector_set_instance_type_infos(ITI, !V) :-
-    !:V = !.V ^ pav_instance_type_infos := ITI.
+    !V ^ pav_instance_type_infos := ITI.
 proc_arg_vector_set_instance_typeclass_infos(ITCI, !V) :-
-    !:V = !.V ^ pav_instance_typeclass_infos := ITCI.
+    !V ^ pav_instance_typeclass_infos := ITCI.
 proc_arg_vector_set_univ_type_infos(UTI, !V) :-
-    !:V = !.V ^ pav_univ_type_infos := UTI.
+    !V ^ pav_univ_type_infos := UTI.
 proc_arg_vector_set_exist_type_infos(ETI, !V) :-
-    !:V = !.V ^ pav_exist_type_infos := ETI.
+    !V ^ pav_exist_type_infos := ETI.
 proc_arg_vector_set_univ_typeclass_infos(UTCI, !V) :-
-    !:V = !.V ^ pav_univ_typeclass_infos := UTCI.
+    !V ^ pav_univ_typeclass_infos := UTCI.
 proc_arg_vector_set_exist_typeclass_infos(ETCI, !V) :-
-    !:V = !.V ^ pav_exist_typeclass_infos := ETCI.
+    !V ^ pav_exist_typeclass_infos := ETCI.
 proc_arg_vector_set_user_args(UA, !V) :-
-    !:V = !.V ^ pav_user_args := UA.
+    !V ^ pav_user_args := UA.
 proc_arg_vector_set_maybe_ret_value(RV, !V) :-
-    !:V = !.V ^ pav_maybe_ret_value := RV.
+    !V ^ pav_maybe_ret_value := RV.
 
 %-----------------------------------------------------------------------------%
 
@@ -405,8 +403,7 @@
         MaybeRetValue = yes(FuncRetVal)
     ;
         MaybeRetValue = no,
-        unexpected(this_file, "Call to arg_vector_to_func_args/3 " ++
-            "with predicate.")
+        unexpected($module, $pred, "predicate")
     ).
 
 %-----------------------------------------------------------------------------%
@@ -477,8 +474,7 @@
     ->
         MaybeRetValC = no 
     ;
-        unexpected(this_file, "proc_arg_vector_map_corresponding/4: " ++ 
-            "mismatched proc_arg_vectors")
+        unexpected($module, $pred, "mismatched proc_arg_vectors")
     ),
     C = proc_arg_vector(ITIC, ITCIC, UTIC, ETIC, UTCIC, ETCIC, ArgsC,
         MaybeRetValC).
@@ -523,8 +519,7 @@
     -> 
         MaybeRetValC = no
     ;
-        unexpected(this_file, "proc_arg_vector_map_corresponding_foldl2/8: "
-            ++ "mismatched proc_arg_vectors")
+        unexpected($module, $pred, "mismatched proc_arg_vectors")
     ),
     C = proc_arg_vector(ITIC, ITCIC, UTIC, ETIC, UTCIC, ETCIC, ArgsC,
         MaybeRetValC).
@@ -552,8 +547,7 @@
     -> 
         true
     ;
-        unexpected(this_file, "proc_arg_vector_fold3_corresponding/9: "
-            ++ "mismatched proc_arg_vectors")
+        unexpected($module, $pred, "mismatched proc_arg_vectors")
     ).
 
 proc_arg_vector_foldl2_corresponding3(P, A, B, C, !Acc1, !Acc2) :-
@@ -583,8 +577,7 @@
     -> 
         true
     ;
-        unexpected(this_file, "proc_arg_vector_foldl2_corresponding3/8 "
-            ++ "mismatched proc_arg_vectors")
+        unexpected($module, $pred, "mismatched proc_arg_vectors")
     ).
 
 proc_arg_vector_foldl3_corresponding3(P, A, B, C, !Acc1, !Acc2, !Acc3) :-
@@ -614,8 +607,7 @@
     -> 
         true
     ;
-        unexpected(this_file, "proc_arg_vector_foldl3_corresponding3/10 "
-            ++ "mismatched proc_arg_vectors")
+        unexpected($module, $pred, "mismatched proc_arg_vectors")
     ).
 
 proc_arg_vector_foldl4_corresponding3(P, A, B, C, !Acc1, !Acc2, !Acc3,
@@ -653,8 +645,7 @@
     -> 
         true
     ;
-        unexpected(this_file, "proc_arg_vector_foldl4_corresponding3/12 "
-            ++ "mismatched proc_arg_vectors")
+        unexpected($module, $pred, "mismatched proc_arg_vectors")
     ).
 
 %-----------------------------------------------------------------------------%
@@ -690,11 +681,5 @@
     proc_arg_vector_to_list(V).
 
 %-----------------------------------------------------------------------------%
-
-:- func this_file = string.
-
-this_file = "hlds_args.m".
-
-%-----------------------------------------------------------------------------%
 :- end_module hlds.hlds_args.
 %-----------------------------------------------------------------------------%
Index: compiler/hlds_code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_code_util.m,v
retrieving revision 1.42
diff -u -b -r1.42 hlds_code_util.m
--- compiler/hlds_code_util.m	15 Dec 2010 06:29:37 -0000	1.42
+++ compiler/hlds_code_util.m	30 Dec 2010 06:33:23 -0000
@@ -46,14 +46,10 @@
 :- implementation.
 
 :- import_module check_hlds.mode_util.
-:- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_pred.
-:- import_module libs.globals.
-:- import_module libs.options.
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.prog_type.
 
-:- import_module bool.
 :- import_module char.
 :- import_module map.
 :- import_module require.
@@ -78,7 +74,7 @@
         Tag = string_tag(String)
     ;
         ConsId = impl_defined_const(_),
-        unexpected(this_file, "cons_id_to_tag: implementation_defined_const")
+        unexpected($module, $pred, "implementation_defined_const")
     ;
         ConsId = closure_cons(ShroudedPredProcId, EvalMethod),
         proc(PredId, ProcId) = unshroud_pred_proc_id(ShroudedPredProcId),
@@ -127,7 +123,7 @@
             ; TypeBody = hlds_solver_type(_, _)
             ; TypeBody = hlds_abstract_type(_)
             ),
-            unexpected(this_file, "cons_id_to_tag: type is not d.u. type")
+            unexpected($module, $pred, "type is not d.u. type")
         )
     ).
 
@@ -149,7 +145,7 @@
         string.int_to_string(TypeArity, TypeArityString),
         String = TypeNameString ++ "__arity" ++ TypeArityString ++ "__"
     ;
-        unexpected(this_file, "type_to_string: invalid type")
+        unexpected($module, $pred, "invalid type")
     ).
 
 %----------------------------------------------------------------------------%
@@ -174,11 +170,5 @@
     is_valid_mutable_inst_2(ModuleInfo, Inst, Expansions).
 
 %----------------------------------------------------------------------------%
-
-:- func this_file = string.
-
-this_file = "hlds_code_util.m".
-
-%----------------------------------------------------------------------------%
 :- end_module hlds_code_util.
 %----------------------------------------------------------------------------%
Index: compiler/hlds_data.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_data.m,v
retrieving revision 1.130
diff -u -b -r1.130 hlds_data.m
--- compiler/hlds_data.m	20 Dec 2010 07:47:31 -0000	1.130
+++ compiler/hlds_data.m	30 Dec 2010 06:33:23 -0000
@@ -35,9 +35,7 @@
 
 :- import_module check_hlds.type_util.
 :- import_module parse_tree.prog_type_subst.
-:- import_module parse_tree.prog_util.
 
-:- import_module cord.
 :- import_module int.
 :- import_module multi_map.
 :- import_module require.
@@ -481,8 +479,6 @@
 
 :- implementation.
 
-:- import_module string.
-
 project_tagged_cons_id_tag(TaggedConsId) = Tag :-
     TaggedConsId = tagged_cons_id(_, Tag).
 
Index: compiler/hlds_desc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_desc.m,v
retrieving revision 1.6
diff -u -b -r1.6 hlds_desc.m
--- compiler/hlds_desc.m	29 Dec 2010 04:52:17 -0000	1.6
+++ compiler/hlds_desc.m	30 Dec 2010 06:33:23 -0000
@@ -54,7 +54,6 @@
 :- import_module hlds.hlds_out.hlds_out_util.
 :- import_module hlds.hlds_pred.
 :- import_module mdbcomp.prim_data.
-:- import_module parse_tree.error_util.
 :- import_module parse_tree.mercury_to_mercury.
 :- import_module parse_tree.prog_out.
 
Index: compiler/hlds_goal.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_goal.m,v
retrieving revision 1.219
diff -u -b -r1.219 hlds_goal.m
--- compiler/hlds_goal.m	29 Dec 2010 04:52:17 -0000	1.219
+++ compiler/hlds_goal.m	30 Dec 2010 06:33:23 -0000
@@ -1803,13 +1803,10 @@
 
 :- import_module parse_tree.builtin_lib_types.
 :- import_module parse_tree.prog_mode.
-:- import_module parse_tree.prog_type.
 
 :- import_module assoc_list.
-:- import_module cord.
 :- import_module map.
 :- import_module require.
-:- import_module string.
 :- import_module svmap.
 :- import_module svvarset.
 :- import_module varset.
Index: compiler/hlds_llds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_llds.m,v
retrieving revision 1.24
diff -u -b -r1.24 hlds_llds.m
--- compiler/hlds_llds.m	15 Dec 2010 06:29:38 -0000	1.24
+++ compiler/hlds_llds.m	30 Dec 2010 06:33:23 -0000
@@ -277,8 +277,6 @@
 
 :- implementation.
 
-:- import_module hlds.goal_util.
-
 :- import_module assoc_list.
 :- import_module list.
 :- import_module pair.
Index: compiler/hlds_module.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_module.m,v
retrieving revision 1.167
diff -u -b -r1.167 hlds_module.m
--- compiler/hlds_module.m	15 Dec 2010 06:29:38 -0000	1.167
+++ compiler/hlds_module.m	30 Dec 2010 06:33:23 -0000
@@ -47,19 +47,6 @@
 :- import_module pair.
 :- import_module set.
 
-:- implementation.
-
-:- import_module libs.options.
-:- import_module transform_hlds.mmc_analysis.
-:- import_module parse_tree.modules.
-
-:- import_module int.
-:- import_module string.
-
-%-----------------------------------------------------------------------------%
-
-:- interface.
-
 :- type module_info.
 
 :- type foreign_code_info
@@ -661,13 +648,17 @@
 
 :- implementation.
 
+:- import_module libs.options.
 :- import_module parse_tree.file_names.
 :- import_module parse_tree.module_imports.
 :- import_module parse_tree.prog_util.
+:- import_module transform_hlds.mmc_analysis.
 
 :- import_module assoc_list.
 :- import_module counter.
+:- import_module int.
 :- import_module require.
+:- import_module string.
 
 :- pred module_info_get_lambdas_per_context(module_info::in,
     map(prog_context, counter)::out) is det.
Index: compiler/ilasm.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ilasm.m,v
retrieving revision 1.56
diff -u -b -r1.56 ilasm.m
--- compiler/ilasm.m	15 Dec 2010 06:29:39 -0000	1.56
+++ compiler/ilasm.m	30 Dec 2010 06:33:23 -0000
@@ -346,7 +346,6 @@
 :- import_module libs.options.
 
 :- import_module char.
-:- import_module getopt_io.
 :- import_module int.
 :- import_module pair.
 :- import_module pprint.
Index: compiler/implicit_parallelism.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/implicit_parallelism.m,v
retrieving revision 1.26
diff -u -b -r1.26 implicit_parallelism.m
--- compiler/implicit_parallelism.m	21 Dec 2010 12:01:33 -0000	1.26
+++ compiler/implicit_parallelism.m	30 Dec 2010 07:14:56 -0000
@@ -38,7 +38,6 @@
 
 :- implementation.
 
-:- import_module check_hlds.inst_match.
 :- import_module check_hlds.mode_util.
 :- import_module hlds.goal_util.
 :- import_module hlds.hlds_goal.
@@ -46,7 +45,6 @@
 :- import_module hlds.instmap.
 :- import_module hlds.pred_table.
 :- import_module hlds.quantification.
-:- import_module libs.compiler_util.
 :- import_module libs.globals.
 :- import_module libs.options.
 :- import_module ll_backend.
@@ -62,7 +60,6 @@
 
 :- import_module assoc_list.
 :- import_module bool.
-:- import_module char.
 :- import_module counter.
 :- import_module int.
 :- import_module list.
@@ -149,11 +146,11 @@
     ;
         map.lookup(SourceFileMap, ModuleName, ModuleFilename),
         Context = context(ModuleFilename, 1),
-        Peices = [words("Implicit parallelism was requested but the"),
+        Pieces = [words("Implicit parallelism was requested but the"),
             words("feedback file does not the candidate parallel"),
             words("conjunctions feedback information.")],
         Specs = [error_spec(severity_error, phase_auto_parallelism,
-            [simple_msg(Context, [always(Peices)])])]
+            [simple_msg(Context, [always(Pieces)])])]
     ).
 
     % Information retrieved from the feedback system to be used for
@@ -163,9 +160,9 @@
     --->    parallelism_info(
                 pi_parameters           :: candidate_par_conjunctions_params,
 
-                pi_cpc_map              :: module_candidate_par_conjs_map
                     % A map of candidate parallel conjunctions in this module
                     % indexed by their procedure.
+                pi_cpc_map              :: module_candidate_par_conjs_map
             ).
 
 :- type intra_module_proc_label
@@ -206,7 +203,7 @@
 make_module_candidate_par_conjs_map(ModuleName,
         CandidateParConjsAssocList0, CandidateParConjsMap) :-
     ModuleNameStr = sym_name_to_string(ModuleName),
-    filter_map(cpc_proc_is_in_module(ModuleNameStr),
+    list.filter_map(cpc_proc_is_in_module(ModuleNameStr),
         CandidateParConjsAssocList0, CandidateParConjsAssocList),
     CandidateParConjsMap = map.from_assoc_list(CandidateParConjsAssocList).
 
@@ -299,9 +296,9 @@
             % parallelisations even as the goal tree changes. In particular,
             % insert deeper parallelisations before shallower ones, and later
             % ones before earlier ones.
-            sort_and_remove_dups(compare_candidate_par_conjunctions,
+            list.sort_and_remove_dups(compare_candidate_par_conjunctions,
                 CPCs0, CPCs),
-            foldl3(
+            list.foldl3(
                 maybe_parallelise_goal(PredInfo, ProgRepInfo, VarTable,
                     Instmap),
                 CPCs, Goal0, Goal, !IntroducedParallelism, !Specs),
@@ -420,7 +417,7 @@
     ModuleName = pred_info_module(PredInfo),
     PredName = pred_info_name(PredInfo),
     Arity = pred_info_orig_arity(PredInfo),
-    Peices = [words("In"), p_or_f(PredOrFunc),
+    Pieces = [words("In"), p_or_f(PredOrFunc),
         sym_name_and_arity(qualified(ModuleName, PredName) / Arity),
         suffix(":"), nl,
         words("Warning: could not auto-parallelise"), quote(GoalPath),
@@ -429,7 +426,7 @@
     % XXX Make this a warning or error if the user wants compilation to
     % abort.
     Spec = error_spec(severity_informational, phase_auto_parallelism,
-        [simple_msg(Context, [always(Peices)])]).
+        [simple_msg(Context, [always(Pieces)])]).
 
 :- func report_already_parallelised(pred_info) = error_spec.
 
@@ -439,14 +436,14 @@
     ModuleName = pred_info_module(PredInfo),
     PredName = pred_info_name(PredInfo),
     Arity = pred_info_orig_arity(PredInfo),
-    Peices = [words("In"), p_or_f(PredOrFunc),
+    Pieces = [words("In"), p_or_f(PredOrFunc),
         sym_name_and_arity(qualified(ModuleName, PredName) / Arity),
         suffix(":"), nl,
         words("Warning: this procedure contains explicit parallel"),
         words("conjunctions, it will not be automatically parallelised.")],
     pred_info_get_context(PredInfo, Context),
     Spec = error_spec(severity_warning, phase_auto_parallelism,
-        [simple_msg(Context, [always(Peices)])]).
+        [simple_msg(Context, [always(Pieces)])]).
 
 :- pred maybe_parallelise_conj(prog_rep_info::in, var_table::in,
     candidate_par_conjunction::in, instmap::in, hlds_goal::in,
@@ -464,10 +461,10 @@
         find_first_goal(FirstGoalRep, Conjs1, ProgRepInfo, VarTable, Instmap0,
             found_first_goal(GoalsBefore, FirstGoal, OtherGoals))
     ->
-        GoalsBeforeInstDeltas = map(
+        GoalsBeforeInstDeltas = list.map(
             (func(G) = goal_info_get_instmap_delta(G ^ hlds_goal_info)),
             GoalsBefore),
-        foldl(apply_instmap_delta_sv, GoalsBeforeInstDeltas,
+        list.foldl(apply_instmap_delta_sv, GoalsBeforeInstDeltas,
             Instmap0, Instmap),
         build_par_conjunction(ProgRepInfo, VarTable, Instmap,
             [FirstGoal | OtherGoals], CPC, MaybeParConjunction),
@@ -503,7 +500,8 @@
         ->
             FirstGoal = FirstGoalPrime
         ;
-            error(this_file ++ "Candidate parallel conjunction is empty")
+            unexpected($module, $pred,
+                "candidate parallel conjunction is empty")
         )
     ).
 
@@ -654,53 +652,61 @@
 :- pred pard_goal_match_hlds_goal(prog_rep_info::in, var_table::in,
     instmap::in, pard_goal::in, hlds_goal::in) is semidet.
 
-pard_goal_match_hlds_goal(ProgRepInfo, VarTable, Instmap, GoalRep1, Goal) :-
-    goal_to_goal_rep(ProgRepInfo, Instmap, Goal, GoalRep2),
-    goal_reps_match(VarTable, GoalRep1, GoalRep2).
+pard_goal_match_hlds_goal(ProgRepInfo, VarTable, Instmap, GoalRepA, GoalB) :-
+    goal_to_goal_rep(ProgRepInfo, Instmap, GoalB, GoalRepB),
+    goal_reps_match(VarTable, GoalRepA, GoalRepB).
 
 :- pred goal_reps_match(var_table::in, goal_rep(A)::in, goal_rep(B)::in)
     is semidet.
 
-goal_reps_match(VarTable, goal_rep(GoalExpr1, Detism, _),
-        goal_rep(GoalExpr2, Detism, _)) :-
-    goal_expr_reps_match(VarTable, GoalExpr1, GoalExpr2).
-
-:- pred goal_expr_reps_match(var_table::in, goal_expr_rep(A)::in,
-    goal_expr_rep(B)::in) is semidet.
-
-goal_expr_reps_match(VarTable, conj_rep(Conjs1), conj_rep(Conjs2)) :-
-    zip_all_true(goal_reps_match(VarTable), Conjs1, Conjs2).
-goal_expr_reps_match(VarTable, disj_rep(Disjs1), disj_rep(Disjs2)) :-
-    zip_all_true(goal_reps_match(VarTable), Disjs1, Disjs2).
-goal_expr_reps_match(VarTable, switch_rep(VarRep1, CanFail, Cases1),
-        switch_rep(VarRep2, CanFail, Cases2)) :-
-    % Note that cases can appear in a different order and goals would still be
-    % equivalent.  We don't handle this.
-    var_reps_match(VarTable, VarRep1, VarRep2),
-    zip_all_true(case_reps_match(VarTable), Cases1, Cases2).
-goal_expr_reps_match(VarTable, ite_rep(Cond1, Then1, Else1),
-        ite_rep(Cond2, Then2, Else2)) :-
-    goal_reps_match(VarTable, Cond1, Cond2),
-    goal_reps_match(VarTable, Then1, Then2),
-    goal_reps_match(VarTable, Else1, Else2).
-goal_expr_reps_match(VarTable, negation_rep(SubGoal1),
-        negation_rep(SubGoal2)) :-
-    goal_reps_match(VarTable, SubGoal1, SubGoal2).
-goal_expr_reps_match(VarTable, scope_rep(SubGoal1, MaybeCut),
-        scope_rep(SubGoal2, MaybeCut)) :-
-    goal_reps_match(VarTable, SubGoal1, SubGoal2).
-goal_expr_reps_match(VarTable, atomic_goal_rep(_, _, _, AtomicGoal1),
-        atomic_goal_rep(_, _, _, AtomicGoal2)) :-
-    % We don't compare names and file numbers, a trivial change made by the
-    % user could change the line number dramatically without changing how the
-    % program should be parallelised.
-    %
-    % Vars are not matched here either, we only consider the vars within the
-    % atomic_goal_rep structures.
-    atomic_goal_reps_match(VarTable, AtomicGoal1, AtomicGoal2).
+goal_reps_match(VarTable, GoalA, GoalB) :-
+    GoalA = goal_rep(GoalRepA, Detism, _),
+    GoalB = goal_rep(GoalRepB, Detism, _),
+    (
+        GoalRepA = conj_rep(ConjsA),
+        GoalRepB = conj_rep(ConjsB),
+        zip_all_true(goal_reps_match(VarTable), ConjsA, ConjsB)
+    ;
+        GoalRepA = disj_rep(DisjsA),
+        GoalRepB = disj_rep(DisjsB),
+        zip_all_true(goal_reps_match(VarTable), DisjsA, DisjsB)
+    ;
+        GoalRepA = switch_rep(VarRepA, CanFail, CasesA),
+        GoalRepB = switch_rep(VarRepB, CanFail, CasesB),
+        var_reps_match(VarTable, VarRepA, VarRepB),
+        % Note that GoalRepA and GoalRepB could be equivalent
+        % even they contained the same cases but a different order.
+        list.sort(CasesA, SortedCasesA),
+        list.sort(CasesB, SortedCasesB),
+        zip_all_true(case_reps_match(VarTable), SortedCasesA, SortedCasesB)
+    ;
+        GoalRepA = ite_rep(CondA, ThenA, ElseA),
+        GoalRepB = ite_rep(CondB, ThenB, ElseB),
+        goal_reps_match(VarTable, CondA, CondB),
+        goal_reps_match(VarTable, ThenA, ThenB),
+        goal_reps_match(VarTable, ElseA, ElseB)
+    ;
+        GoalRepA = negation_rep(SubGoalA),
+        GoalRepB = negation_rep(SubGoalB),
+        goal_reps_match(VarTable, SubGoalA, SubGoalB)
+    ;
+        GoalRepA = scope_rep(SubGoalA, MaybeCut),
+        GoalRepB = scope_rep(SubGoalB, MaybeCut),
+        goal_reps_match(VarTable, SubGoalA, SubGoalB)
+    ;
+        GoalRepA = atomic_goal_rep(_, _, _, AtomicGoalA),
+        GoalRepB = atomic_goal_rep(_, _, _, AtomicGoalB),
+        % We don't compare names and file numbers, since trivial changes
+        % to e.g. comments could change line numbers dramatically without
+        % changing how the program should be parallelised.
+        %
+        % Vars are not matched here either, we only consider the vars
+        % within the atomic_goal_rep structures.
+        atomic_goal_reps_match(VarTable, AtomicGoalA, AtomicGoalB)
+    ).
 
-:- pred atomic_goal_reps_match(var_table::in, atomic_goal_rep::in,
-    atomic_goal_rep::in) is semidet.
+:- pred atomic_goal_reps_match(var_table::in,
+    atomic_goal_rep::in, atomic_goal_rep::in) is semidet.
 
 atomic_goal_reps_match(VarTable, AtomicRepA, AtomicRepB) :-
     (
@@ -762,9 +768,10 @@
 :- pred case_reps_match(var_table::in, case_rep(A)::in, case_rep(B)::in)
     is semidet.
 
-case_reps_match(VarTable, case_rep(ConsId, OtherConsIds, GoalRep1),
-        case_rep(ConsId, OtherConsIds, GoalRep2)) :-
-    goal_reps_match(VarTable, GoalRep1, GoalRep2).
+case_reps_match(VarTable, CaseRepA, CaseRepB) :-
+    CaseRepA = case_rep(ConsId, OtherConsIds, GoalRepA),
+    CaseRepB = case_rep(ConsId, OtherConsIds, GoalRepB),
+    goal_reps_match(VarTable, GoalRepA, GoalRepB).
 
 :- pred var_reps_match(var_table::in, var_rep::in, var_rep::in) is semidet.
 
@@ -772,13 +779,13 @@
     ( search_var_name(VarTable, VarA, _) ->
         % Variables named by the programmer _must_ match, we expect to find
         % them in the var table, and that they would be identical.  (Since one
-        % of the variables will be built using it's name and the var table
+        % of the variables will be built using its name and the var table
         % constructed when converting the original code to byte code).
         VarA = VarB
     ;
-        % Unamed variables match implicitly.  They will usually be identical be
-        % we allow this to be releaxed so that the program may change a little
-        % after being profiled but before being parallelised.
+        % Unnamed variables match implicitly. They will usually be identical,
+        % but we do not REQUIRE them to be identical, to allow the program
+        % to change a little after being profiled but before being parallelised.
         true
     ).
 
Index: compiler/intermod.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.255
diff -u -b -r1.255 intermod.m
--- compiler/intermod.m	15 Dec 2010 06:29:40 -0000	1.255
+++ compiler/intermod.m	30 Dec 2010 06:33:23 -0000
@@ -106,7 +106,6 @@
 :- import_module hlds.hlds_data.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_out.
-:- import_module hlds.hlds_out.hlds_out_goal.
 :- import_module hlds.hlds_out.hlds_out_module.
 :- import_module hlds.hlds_out.hlds_out_pred.
 :- import_module hlds.hlds_out.hlds_out_util.
@@ -129,7 +128,6 @@
 
 :- import_module assoc_list.
 :- import_module cord.
-:- import_module getopt_io.
 :- import_module int.
 :- import_module map.
 :- import_module maybe.
Index: compiler/interval.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/interval.m,v
retrieving revision 1.45
diff -u -b -r1.45 interval.m
--- compiler/interval.m	29 Dec 2010 04:52:17 -0000	1.45
+++ compiler/interval.m	30 Dec 2010 06:33:23 -0000
@@ -189,7 +189,6 @@
 :- import_module check_hlds.mode_util.
 :- import_module hlds.arg_info.
 :- import_module hlds.code_model.
-:- import_module hlds.goal_util.
 :- import_module hlds.hlds_llds.
 :- import_module hlds.instmap.
 :- import_module ll_backend.
Index: compiler/ite_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ite_gen.m,v
retrieving revision 1.110
diff -u -b -r1.110 ite_gen.m
--- compiler/ite_gen.m	15 Dec 2010 06:29:40 -0000	1.110
+++ compiler/ite_gen.m	30 Dec 2010 06:33:23 -0000
@@ -62,7 +62,6 @@
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module string.
Index: compiler/java_names.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/java_names.m,v
retrieving revision 1.5
diff -u -b -r1.5 java_names.m
--- compiler/java_names.m	16 Sep 2010 00:39:03 -0000	1.5
+++ compiler/java_names.m	30 Dec 2010 06:33:23 -0000
@@ -86,7 +86,6 @@
 
 :- implementation.
 
-:- import_module parse_tree.file_names.
 :- import_module parse_tree.prog_foreign.   % for name_mangle
 
 :- import_module char.
Index: compiler/labelopt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/labelopt.m,v
retrieving revision 1.36
diff -u -b -r1.36 labelopt.m
--- compiler/labelopt.m	6 Jan 2007 09:23:37 -0000	1.36
+++ compiler/labelopt.m	30 Dec 2010 06:33:23 -0000
@@ -47,7 +47,6 @@
 :- import_module ll_backend.opt_util.
 
 :- import_module maybe.
-:- import_module pair.
 :- import_module svset.
 
 %-----------------------------------------------------------------------------%
Index: compiler/layout_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.112
diff -u -b -r1.112 layout_out.m
--- compiler/layout_out.m	20 Dec 2010 07:47:32 -0000	1.112
+++ compiler/layout_out.m	30 Dec 2010 06:33:23 -0000
@@ -172,7 +172,6 @@
 :- import_module backend_libs.c_util.
 :- import_module backend_libs.name_mangle.
 :- import_module backend_libs.proc_label.
-:- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_rtti.
 :- import_module hlds.special_pred.
 :- import_module libs.trace_params.
Index: compiler/live_vars.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/live_vars.m,v
retrieving revision 1.142
diff -u -b -r1.142 live_vars.m
--- compiler/live_vars.m	15 Dec 2010 06:29:41 -0000	1.142
+++ compiler/live_vars.m	30 Dec 2010 06:33:23 -0000
@@ -69,7 +69,6 @@
 
 :- import_module list.
 :- import_module map.
-:- import_module pair.
 :- import_module require.
 
 %-----------------------------------------------------------------------------%
Index: compiler/livemap.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/livemap.m,v
retrieving revision 1.94
diff -u -b -r1.94 livemap.m
--- compiler/livemap.m	15 Dec 2010 06:29:41 -0000	1.94
+++ compiler/livemap.m	30 Dec 2010 06:33:23 -0000
@@ -44,7 +44,6 @@
 :- import_module parse_tree.prog_data.
 
 :- import_module bool.
-:- import_module pair.
 :- import_module require.
 :- import_module string.
 :- import_module svset.
Index: compiler/liveness.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/liveness.m,v
retrieving revision 1.177
diff -u -b -r1.177 liveness.m
--- compiler/liveness.m	20 Dec 2010 07:47:33 -0000	1.177
+++ compiler/liveness.m	30 Dec 2010 06:33:23 -0000
@@ -214,7 +214,6 @@
 :- import_module string.
 :- import_module svset.
 :- import_module term.
-:- import_module unit.
 :- import_module varset.
 
 %-----------------------------------------------------------------------------%
Index: compiler/llds_out_file.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out_file.m,v
retrieving revision 1.2
diff -u -b -r1.2 llds_out_file.m
--- compiler/llds_out_file.m	15 Dec 2010 06:29:42 -0000	1.2
+++ compiler/llds_out_file.m	30 Dec 2010 07:00:14 -0000
@@ -87,7 +87,6 @@
 :- import_module parse_tree.prog_foreign.
 :- import_module parse_tree.prog_out.
 
-:- import_module assoc_list.
 :- import_module int.
 :- import_module library.   % for the version number.
 :- import_module list.
Index: compiler/llds_to_x86_64.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_to_x86_64.m,v
retrieving revision 1.16
diff -u -b -r1.16 llds_to_x86_64.m
--- compiler/llds_to_x86_64.m	15 Dec 2010 06:29:42 -0000	1.16
+++ compiler/llds_to_x86_64.m	30 Dec 2010 06:33:23 -0000
@@ -53,11 +53,8 @@
 :- import_module ll_backend.llds_out.llds_out_code_addr.
 :- import_module ll_backend.x86_64_out.
 :- import_module ll_backend.x86_64_regs.
-:- import_module mdbcomp.prim_data.
 
 :- import_module bool.
-:- import_module int.
-:- import_module io.
 :- import_module maybe.
 :- import_module require.
 :- import_module set.
Index: compiler/llds_to_x86_64_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_to_x86_64_out.m,v
retrieving revision 1.2
diff -u -b -r1.2 llds_to_x86_64_out.m
--- compiler/llds_to_x86_64_out.m	8 Feb 2007 01:02:52 -0000	1.2
+++ compiler/llds_to_x86_64_out.m	30 Dec 2010 06:33:23 -0000
@@ -32,7 +32,6 @@
 
 :- implementation. 
 
-:- import_module ll_backend.llds_to_x86_64.
 :- import_module ll_backend.x86_64_out.
 
 %-----------------------------------------------------------------------------%
Index: compiler/lookup_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/lookup_switch.m,v
retrieving revision 1.88
diff -u -b -r1.88 lookup_switch.m
--- compiler/lookup_switch.m	15 Dec 2010 06:29:42 -0000	1.88
+++ compiler/lookup_switch.m	30 Dec 2010 07:04:11 -0000
@@ -167,13 +167,11 @@
 :- implementation.
 
 :- import_module backend_libs.builtin_ops.
-:- import_module check_hlds.type_util.
 :- import_module hlds.code_model.
 :- import_module hlds.goal_form.
 :- import_module libs.globals.
 :- import_module libs.options.
 :- import_module ll_backend.continuation_info.
-:- import_module ll_backend.dense_switch.
 :- import_module ll_backend.global_data.
 :- import_module ll_backend.lookup_util.
 
Index: compiler/lookup_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/lookup_util.m,v
retrieving revision 1.14
diff -u -b -r1.14 lookup_util.m
--- compiler/lookup_util.m	15 Dec 2010 06:29:42 -0000	1.14
+++ compiler/lookup_util.m	30 Dec 2010 07:04:19 -0000
@@ -82,7 +82,6 @@
 :- import_module hlds.code_model.
 :- import_module hlds.hlds_module.
 :- import_module hlds.instmap.
-:- import_module libs.globals.
 :- import_module ll_backend.code_gen.
 :- import_module ll_backend.exprn_aux.
 
@@ -90,7 +89,6 @@
 :- import_module cord.
 :- import_module int.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 
 figure_out_output_vars(CI, GoalInfo, OutVars) :-
Index: compiler/loop_inv.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/loop_inv.m,v
retrieving revision 1.56
diff -u -b -r1.56 loop_inv.m
--- compiler/loop_inv.m	15 Dec 2010 06:29:42 -0000	1.56
+++ compiler/loop_inv.m	30 Dec 2010 06:36:54 -0000
@@ -130,7 +130,6 @@
 :- import_module parse_tree.prog_util.
 
 :- import_module assoc_list.
-:- import_module bool.
 :- import_module cord.
 :- import_module list.
 :- import_module maybe.
Index: compiler/make.dependencies.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make.dependencies.m,v
retrieving revision 1.58
diff -u -b -r1.58 make.dependencies.m
--- compiler/make.dependencies.m	16 Sep 2010 00:39:03 -0000	1.58
+++ compiler/make.dependencies.m	30 Dec 2010 07:11:01 -0000
@@ -172,10 +172,7 @@
 :- implementation.
 
 :- import_module parse_tree.file_names.
-:- import_module parse_tree.modules.
 :- import_module parse_tree.prog_data.
-:- import_module transform_hlds.
-:- import_module transform_hlds.mmc_analysis.
 
 :- import_module assoc_list.
 :- import_module dir.
Index: compiler/make.program_target.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make.program_target.m,v
retrieving revision 1.109
diff -u -b -r1.109 make.program_target.m
--- compiler/make.program_target.m	15 Dec 2010 06:29:43 -0000	1.109
+++ compiler/make.program_target.m	30 Dec 2010 07:11:11 -0000
@@ -46,7 +46,6 @@
 :- import_module parse_tree.module_cmds.
 :- import_module parse_tree.modules.
 :- import_module parse_tree.prog_foreign.
-:- import_module parse_tree.prog_io.
 :- import_module parse_tree.prog_item.
 :- import_module parse_tree.prog_out.
 :- import_module transform_hlds.
Index: compiler/make.util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make.util.m,v
retrieving revision 1.82
diff -u -b -r1.82 make.util.m
--- compiler/make.util.m	15 Dec 2010 06:29:43 -0000	1.82
+++ compiler/make.util.m	30 Dec 2010 07:11:39 -0000
@@ -346,15 +346,10 @@
 :- import_module bool.
 :- import_module char.
 :- import_module dir.
-:- import_module exception.
 :- import_module getopt_io.
 :- import_module maybe.
 :- import_module require.
 :- import_module set.
-:- import_module thread.
-:- import_module thread.channel.
-:- import_module unit.
-:- import_module univ.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/mercury_compile_llds_back_end.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile_llds_back_end.m,v
retrieving revision 1.10
diff -u -b -r1.10 mercury_compile_llds_back_end.m
--- compiler/mercury_compile_llds_back_end.m	20 Dec 2010 07:47:34 -0000	1.10
+++ compiler/mercury_compile_llds_back_end.m	30 Dec 2010 07:12:22 -0000
@@ -52,7 +52,6 @@
 :- import_module backend_libs.type_ctor_info.
 :- import_module check_hlds.simplify.
 :- import_module hlds.arg_info.
-:- import_module hlds.goal_path.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_out.
 :- import_module hlds.hlds_out.hlds_out_util.
@@ -61,12 +60,10 @@
 :- import_module libs.file_util.
 :- import_module libs.globals.
 :- import_module libs.options.
-:- import_module libs.trace_params.
 :- import_module ll_backend.continuation_info.
 :- import_module ll_backend.dupproc.
 :- import_module ll_backend.follow_code.
 :- import_module ll_backend.global_data.
-:- import_module ll_backend.layout.
 :- import_module ll_backend.liveness.
 :- import_module ll_backend.llds_out.
 :- import_module ll_backend.llds_out.llds_out_file.
Index: compiler/mercury_compile_middle_passes.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile_middle_passes.m,v
retrieving revision 1.10
diff -u -b -r1.10 mercury_compile_middle_passes.m
--- compiler/mercury_compile_middle_passes.m	20 Dec 2010 07:47:34 -0000	1.10
+++ compiler/mercury_compile_middle_passes.m	30 Dec 2010 07:12:34 -0000
@@ -45,7 +45,6 @@
 :- import_module backend_libs.type_ctor_info.
 :- import_module bytecode_backend.bytecode.
 :- import_module bytecode_backend.bytecode_gen.
-:- import_module check_hlds.det_analysis.
 :- import_module hlds.hlds_module.
 :- import_module libs.file_util.
 :- import_module libs.globals.
Index: compiler/mercury_compile_mlds_back_end.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile_mlds_back_end.m,v
retrieving revision 1.6
diff -u -b -r1.6 mercury_compile_mlds_back_end.m
--- compiler/mercury_compile_mlds_back_end.m	15 Dec 2010 06:29:45 -0000	1.6
+++ compiler/mercury_compile_mlds_back_end.m	30 Dec 2010 07:12:42 -0000
@@ -57,7 +57,6 @@
 :- import_module backend_libs.base_typeclass_info.
 :- import_module backend_libs.type_class_info.
 :- import_module backend_libs.type_ctor_info.
-:- import_module hlds.arg_info.
 :- import_module hlds.mark_static_terms.            % HLDS -> HLDS
 :- import_module libs.file_util.
 :- import_module libs.globals.
Index: compiler/middle_rec.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/middle_rec.m,v
retrieving revision 1.140
diff -u -b -r1.140 middle_rec.m
--- compiler/middle_rec.m	15 Dec 2010 06:29:46 -0000	1.140
+++ compiler/middle_rec.m	30 Dec 2010 07:04:44 -0000
@@ -32,11 +32,9 @@
 
 :- import_module backend_libs.builtin_ops.
 :- import_module hlds.code_model.
-:- import_module hlds.hlds_data.
 :- import_module hlds.hlds_llds.
 :- import_module ll_backend.code_gen.
 :- import_module ll_backend.code_util.
-:- import_module ll_backend.llds_out.
 :- import_module ll_backend.opt_util.
 :- import_module ll_backend.proc_gen.
 :- import_module ll_backend.unify_gen.
@@ -48,7 +46,6 @@
 :- import_module int.
 :- import_module list.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module string.
Index: compiler/ml_closure_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_closure_gen.m,v
retrieving revision 1.65
diff -u -b -r1.65 ml_closure_gen.m
--- compiler/ml_closure_gen.m	15 Dec 2010 06:29:46 -0000	1.65
+++ compiler/ml_closure_gen.m	30 Dec 2010 07:16:32 -0000
@@ -101,9 +101,7 @@
 :- import_module pair.
 :- import_module require.
 :- import_module set.
-:- import_module set_tree234.
 :- import_module string.
-:- import_module svmap.
 :- import_module term.
 
 %-----------------------------------------------------------------------------%
Index: compiler/mmc_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mmc_analysis.m,v
retrieving revision 1.29
diff -u -b -r1.29 mmc_analysis.m
--- compiler/mmc_analysis.m	15 Dec 2010 06:29:50 -0000	1.29
+++ compiler/mmc_analysis.m	30 Dec 2010 06:37:11 -0000
@@ -48,8 +48,6 @@
 :- import_module libs.globals.
 :- import_module libs.options.
 :- import_module parse_tree.file_names.
-:- import_module parse_tree.prog_data.
-:- import_module parse_tree.prog_io.
 :- import_module transform_hlds.ctgc.
 :- import_module transform_hlds.ctgc.structure_sharing.
 :- import_module transform_hlds.ctgc.structure_sharing.analysis.
@@ -60,11 +58,9 @@
 :- import_module transform_hlds.trailing_analysis.
 :- import_module transform_hlds.unused_args.
 
-:- import_module bool.
 :- import_module list.
 :- import_module maybe.
 :- import_module require.
-:- import_module string.
 :- import_module io.
 :- import_module unit.
 
Index: compiler/mode_constraint_robdd.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_constraint_robdd.m,v
retrieving revision 1.16
diff -u -b -r1.16 mode_constraint_robdd.m
--- compiler/mode_constraint_robdd.m	20 Dec 2010 07:47:34 -0000	1.16
+++ compiler/mode_constraint_robdd.m	30 Dec 2010 06:33:24 -0000
@@ -154,14 +154,12 @@
 
 :- implementation.
 
-:- import_module hlds.hlds_goal.
 % :- import_module mode_robdd.tfeir.
 :- import_module mode_robdd.tfeirn.
 % :- import_module mode_robdd.check.
 
 :- import_module bimap.
 :- import_module bool.
-:- import_module cord.
 :- import_module list.
 :- import_module map.
 :- import_module require.
Index: compiler/mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_constraints.m,v
retrieving revision 1.57
diff -u -b -r1.57 mode_constraints.m
--- compiler/mode_constraints.m	20 Dec 2010 07:47:35 -0000	1.57
+++ compiler/mode_constraints.m	30 Dec 2010 06:33:24 -0000
@@ -65,7 +65,6 @@
 :- import_module libs.globals.
 :- import_module libs.options.
 :- import_module mdbcomp.
-:- import_module mdbcomp.prim_data.
 :- import_module mdbcomp.program_representation.
 :- import_module mode_robdd.
 % :- import_module mode_robdd.check.
@@ -73,14 +72,12 @@
 :- import_module mode_robdd.tfeirn.
 :- import_module parse_tree.
 :- import_module parse_tree.file_names.
-:- import_module parse_tree.modules.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_mode.
 :- import_module transform_hlds.dependency_graph.
 
 :- import_module assoc_list.
 :- import_module bool.
-:- import_module cord.
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
Index: compiler/mode_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_info.m,v
retrieving revision 1.101
diff -u -b -r1.101 mode_info.m
--- compiler/mode_info.m	15 Dec 2010 06:29:50 -0000	1.101
+++ compiler/mode_info.m	30 Dec 2010 06:33:24 -0000
@@ -334,7 +334,6 @@
 
 :- import_module check_hlds.delay_info.
 :- import_module check_hlds.mode_errors.
-:- import_module hlds.hlds_clauses.
 :- import_module libs.
 :- import_module libs.globals.
 :- import_module libs.options.
@@ -343,7 +342,6 @@
 :- import_module map.
 :- import_module pair.
 :- import_module require.
-:- import_module string.
 :- import_module svbag.
 :- import_module term.
 :- import_module varset.
Index: compiler/modecheck_call.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modecheck_call.m,v
retrieving revision 1.87
diff -u -b -r1.87 modecheck_call.m
--- compiler/modecheck_call.m	15 Dec 2010 06:29:51 -0000	1.87
+++ compiler/modecheck_call.m	30 Dec 2010 06:33:24 -0000
@@ -85,7 +85,6 @@
 :- import_module check_hlds.mode_info.
 :- import_module check_hlds.mode_util.
 :- import_module check_hlds.modecheck_util.
-:- import_module check_hlds.modes.
 :- import_module check_hlds.unify_proc.
 :- import_module hlds.instmap.
 :- import_module parse_tree.prog_data.
Index: compiler/modecheck_conj.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modecheck_conj.m,v
retrieving revision 1.2
diff -u -b -r1.2 modecheck_conj.m
--- compiler/modecheck_conj.m	15 Dec 2010 06:29:51 -0000	1.2
+++ compiler/modecheck_conj.m	30 Dec 2010 06:33:24 -0000
@@ -30,7 +30,6 @@
 :- implementation.
 
 :- import_module check_hlds.delay_info.
-:- import_module check_hlds.delay_partial_inst.
 :- import_module check_hlds.mode_debug.
 :- import_module check_hlds.mode_errors.
 :- import_module check_hlds.mode_util.
Index: compiler/opt_debug.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/opt_debug.m,v
retrieving revision 1.216
diff -u -b -r1.216 opt_debug.m
--- compiler/opt_debug.m	12 Nov 2010 02:22:00 -0000	1.216
+++ compiler/opt_debug.m	30 Dec 2010 07:04:53 -0000
@@ -146,8 +146,6 @@
 :- import_module hlds.hlds_pred.
 :- import_module hlds.hlds_rtti.
 :- import_module hlds.special_pred.
-:- import_module libs.globals.
-:- import_module libs.options.
 :- import_module ll_backend.llds_out.
 :- import_module ll_backend.llds_out.llds_out_code_addr.
 :- import_module parse_tree.prog_data.
Index: compiler/opt_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/opt_util.m,v
retrieving revision 1.172
diff -u -b -r1.172 opt_util.m
--- compiler/opt_util.m	15 Dec 2010 06:29:53 -0000	1.172
+++ compiler/opt_util.m	30 Dec 2010 07:05:00 -0000
@@ -327,7 +327,6 @@
 :- import_module parse_tree.prog_data.
 
 :- import_module int.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module string.
Index: compiler/options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.683
diff -u -b -r1.683 options.m
--- compiler/options.m	22 Dec 2010 02:51:35 -0000	1.683
+++ compiler/options.m	30 Dec 2010 06:33:24 -0000
@@ -101,6 +101,7 @@
     ;       inhibit_accumulator_warnings
     ;       halt_at_warn
     ;       halt_at_syntax_errors
+    ;       halt_at_auto_parallel_failure
     ;       warn_singleton_vars
     ;       warn_overlapping_scopes
     ;       warn_det_decls_too_lax
@@ -1034,6 +1035,7 @@
     inhibit_accumulator_warnings        -   bool(no),
     halt_at_warn                        -   bool(no),
     halt_at_syntax_errors               -   bool(no),
+    halt_at_auto_parallel_failure       -   bool(no),
 
     % IMPORTANT NOTE:
     % if you add any new warning options, or if you change the default
@@ -1878,6 +1880,7 @@
 long_option("inhibit-accumulator-warnings", inhibit_accumulator_warnings).
 long_option("halt-at-warn",             halt_at_warn).
 long_option("halt-at-syntax-errors",    halt_at_syntax_errors).
+long_option("halt-at-auto-parallel-failure", halt_at_auto_parallel_failure).
 long_option("warn-singleton-variables", warn_singleton_vars).
 long_option("warn-overlapping-scopes",  warn_overlapping_scopes).
 long_option("warn-det-decls-too-lax",   warn_det_decls_too_lax).
@@ -3344,6 +3347,9 @@
         "\tThis option causes the compiler to halt immediately",
         "\tafter syntax checking and not do any semantic checking",
         "\tif it finds any syntax errors in the program.",
+%       "--halt-at-auto-parallel-failure",
+%       "\tThis option causes the compiler to halt if it cannot perform",
+%       "\tan auto-parallelization requested by a feedback file.",
         "--inhibit-accumulator-warnings",
         "\tDon't warn about argument order rearrangement caused",
         "\tby --introduce-accumulators.",
Index: compiler/options_file.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/options_file.m,v
retrieving revision 1.55
diff -u -b -r1.55 options_file.m
--- compiler/options_file.m	15 Dec 2010 06:29:54 -0000	1.55
+++ compiler/options_file.m	30 Dec 2010 07:11:45 -0000
@@ -81,7 +81,6 @@
 :- import_module libs.globals.
 :- import_module libs.options.
 :- import_module parse_tree.error_util.
-:- import_module parse_tree.prog_io.
 
 :- import_module assoc_list.
 :- import_module bool.
Index: compiler/par_conj_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/par_conj_gen.m,v
retrieving revision 1.41
diff -u -b -r1.41 par_conj_gen.m
--- compiler/par_conj_gen.m	15 Dec 2010 06:29:54 -0000	1.41
+++ compiler/par_conj_gen.m	30 Dec 2010 07:05:10 -0000
@@ -105,7 +105,6 @@
 :- implementation.
 
 :- import_module check_hlds.mode_util.
-:- import_module hlds.hlds_data.
 :- import_module hlds.hlds_llds.
 :- import_module hlds.hlds_module.
 :- import_module hlds.instmap.
@@ -122,7 +121,6 @@
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module unit.
Index: compiler/pd_cost.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_cost.m,v
retrieving revision 1.38
diff -u -b -r1.38 pd_cost.m
--- compiler/pd_cost.m	15 Dec 2010 06:29:54 -0000	1.38
+++ compiler/pd_cost.m	30 Dec 2010 06:37:18 -0000
@@ -46,7 +46,6 @@
 
 :- import_module int.
 :- import_module list.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 
Index: compiler/pd_debug.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_debug.m,v
retrieving revision 1.27
diff -u -b -r1.27 pd_debug.m
--- compiler/pd_debug.m	4 Nov 2009 03:44:50 -0000	1.27
+++ compiler/pd_debug.m	30 Dec 2010 06:37:25 -0000
@@ -71,7 +71,6 @@
 :- import_module parse_tree.mercury_to_mercury.
 :- import_module parse_tree.prog_out.
 
-:- import_module pair.
 :- import_module set.
 
 %-----------------------------------------------------------------------------%
Index: compiler/pd_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_info.m,v
retrieving revision 1.42
diff -u -b -r1.42 pd_info.m
--- compiler/pd_info.m	15 Dec 2010 06:29:54 -0000	1.42
+++ compiler/pd_info.m	30 Dec 2010 06:39:42 -0000
@@ -127,7 +127,6 @@
 
 :- import_module bool.
 :- import_module int.
-:- import_module io.
 :- import_module require.
 :- import_module term.
 
@@ -161,7 +160,7 @@
         MaybeUnfoldInfo = yes(UnfoldInfo)
     ;
         MaybeUnfoldInfo = no,
-        unexpected(this_file, "pd_info_get_unfold_info: unfold_info not set.")
+        unexpected($module, $pred, "unfold_info not set")
     ).
 pd_info_get_goal_version_index(PDInfo, PDInfo ^ pdi_goal_version_index).
 pd_info_get_versions(PDInfo, PDInfo ^ pdi_versions).
@@ -261,10 +260,12 @@
 :- type pd_branch_info(T)
     --->    pd_branch_info(
                 branch_info_map(T),
-                set(T),     % variables for which we want
-                            % extra left context
-                set(T)      % outputs for which we have no
-                            % extra information
+
+                % variables for which we want extra left context
+                set(T),
+
+                % outputs for which we have no extra information
+                set(T)
             ).
 
     % Vars for which there is extra information at the end
@@ -424,10 +425,12 @@
                 mv_is_exact         :: version_is_exact,
                 mv_ppid             :: pred_proc_id,
                 mv_version          :: version_info,
-                mv_renaming         :: map(prog_var, prog_var),
+
                                     % renaming of the version info
-                mv_tsubst           :: tsubst
+                mv_renaming         :: map(prog_var, prog_var),
+
                                     % var types substitution
+                mv_tsubst           :: tsubst
             ).
 
 :- type version_is_exact
@@ -436,25 +439,32 @@
 
 :- type version_info
     --->    version_info(
-                version_orig_goal   :: hlds_goal,
                                     % goal before unfolding.
-                version_deforest_calls  :: list(pred_proc_id),
+                version_orig_goal   :: hlds_goal,
+
                                     % calls being deforested.
-                version_arg_vars    :: list(prog_var),
+                version_deforest_calls  :: list(pred_proc_id),
+
                                     % arguments.
-                version_arg_types   :: list(mer_type),
+                version_arg_vars    :: list(prog_var),
+
                                     % argument types.
-                version_init_insts  :: instmap,
+                version_arg_types   :: list(mer_type),
+
                                     % initial insts of the nonlocals.
-                version_orig_cost   :: int,
+                version_init_insts  :: instmap,
+
                                     % cost of the original goal.
-                version_cost_improv :: int,
+                version_orig_cost   :: int,
+
                                     % improvement in cost.
-                version_parents     :: set(pred_proc_id),
+                version_cost_improv :: int,
+
                                     % parent versions.
+                version_parents     :: set(pred_proc_id),
+
+                % the version which was generalised to produce this version.
                 version_source      :: maybe(pred_proc_id)
-                                    % the version which was generalised
-                                    % to produce this version.
             ).
 
 %-----------------------------------------------------------------------------%
@@ -729,9 +739,3 @@
     pd_info_set_module_info(ModuleInfo, !PDInfo).
 
 %-----------------------------------------------------------------------------%
-
-:- func this_file = string.
-
-this_file = "pd_info.m".
-
-%-----------------------------------------------------------------------------%
Index: compiler/pd_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_util.m,v
retrieving revision 1.78
diff -u -b -r1.78 pd_util.m
--- compiler/pd_util.m	15 Dec 2010 06:29:54 -0000	1.78
+++ compiler/pd_util.m	30 Dec 2010 06:39:55 -0000
@@ -173,7 +173,6 @@
 
 :- import_module assoc_list.
 :- import_module int.
-:- import_module io.
 :- import_module pair.
 :- import_module require.
 :- import_module set.
Index: compiler/peephole.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/peephole.m,v
retrieving revision 1.103
diff -u -b -r1.103 peephole.m
--- compiler/peephole.m	10 Sep 2010 04:02:27 -0000	1.103
+++ compiler/peephole.m	30 Dec 2010 07:05:26 -0000
@@ -35,7 +35,6 @@
 :- implementation.
 
 :- import_module backend_libs.builtin_ops.
-:- import_module libs.compiler_util.
 :- import_module ll_backend.opt_util.
 
 :- import_module int.
@@ -715,11 +714,5 @@
     ).
 
 %-----------------------------------------------------------------------------%
-
-:- func this_file = string.
-
-this_file = "peephole.m".
-
-%-----------------------------------------------------------------------------%
 :- end_module peephole.
 %-----------------------------------------------------------------------------%
Index: compiler/pragma_c_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pragma_c_gen.m,v
retrieving revision 1.118
diff -u -b -r1.118 pragma_c_gen.m
--- compiler/pragma_c_gen.m	16 Sep 2010 00:39:06 -0000	1.118
+++ compiler/pragma_c_gen.m	30 Dec 2010 07:05:53 -0000
@@ -66,20 +66,16 @@
 :- import_module hlds.hlds_module.
 :- import_module hlds.hlds_pred.
 :- import_module hlds.instmap.
-:- import_module libs.compiler_util.
 :- import_module libs.globals.
-:- import_module libs.options.
 :- import_module ll_backend.code_util.
 :- import_module ll_backend.llds_out.
 :- import_module ll_backend.llds_out.llds_out_code_addr.
-:- import_module ll_backend.trace_gen.
 :- import_module parse_tree.prog_foreign.
 :- import_module parse_tree.prog_type.
 
 :- import_module bool.
 :- import_module cord.
 :- import_module int.
-:- import_module map.
 :- import_module pair.
 :- import_module require.
 :- import_module set.
Index: compiler/proc_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/proc_gen.m,v
retrieving revision 1.41
diff -u -b -r1.41 proc_gen.m
--- compiler/proc_gen.m	20 Dec 2010 07:47:36 -0000	1.41
+++ compiler/proc_gen.m	30 Dec 2010 07:06:12 -0000
@@ -73,7 +73,6 @@
 
 :- import_module backend_libs.builtin_ops.
 :- import_module backend_libs.proc_label.
-:- import_module backend_libs.rtti.
 :- import_module hlds.code_model.
 :- import_module hlds.goal_path.
 :- import_module hlds.goal_util.
@@ -93,9 +92,7 @@
 :- import_module ll_backend.code_util.
 :- import_module ll_backend.continuation_info.
 :- import_module ll_backend.layout.
-:- import_module ll_backend.llds_out.
 :- import_module ll_backend.middle_rec.
-:- import_module ll_backend.pragma_c_gen.
 :- import_module ll_backend.stack_layout.
 :- import_module ll_backend.trace_gen.
 :- import_module mdbcomp.prim_data.
Index: compiler/proc_label.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/proc_label.m,v
retrieving revision 1.26
diff -u -b -r1.26 proc_label.m
--- compiler/proc_label.m	15 Dec 2010 06:29:56 -0000	1.26
+++ compiler/proc_label.m	30 Dec 2010 06:33:24 -0000
@@ -46,7 +46,6 @@
 
 :- implementation.
 
-:- import_module backend_libs.rtti.
 :- import_module parse_tree.prog_type.
 
 :- import_module bool.
Index: compiler/prog_rep.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_rep.m,v
retrieving revision 1.71
diff -u -b -r1.71 prog_rep.m
--- compiler/prog_rep.m	15 Dec 2010 06:29:58 -0000	1.71
+++ compiler/prog_rep.m	30 Dec 2010 07:06:20 -0000
@@ -83,7 +83,6 @@
 :- import_module check_hlds.inst_match.
 :- import_module check_hlds.mode_util.
 :- import_module hlds.code_model.
-:- import_module hlds.hlds_data.
 :- import_module hlds.hlds_pred.
 :- import_module mdbcomp.
 :- import_module mdbcomp.prim_data.
Index: compiler/rbmm.add_rbmm_goal_infos.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.add_rbmm_goal_infos.m,v
retrieving revision 1.11
diff -u -b -r1.11 rbmm.add_rbmm_goal_infos.m
--- compiler/rbmm.add_rbmm_goal_infos.m	20 Dec 2010 07:47:36 -0000	1.11
+++ compiler/rbmm.add_rbmm_goal_infos.m	30 Dec 2010 06:40:13 -0000
@@ -58,7 +58,6 @@
 
 :- import_module check_hlds.
 :- import_module check_hlds.type_util.
-:- import_module hlds.goal_path.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_pred.
 :- import_module libs.
@@ -69,7 +68,6 @@
 :- import_module parse_tree.
 :- import_module parse_tree.builtin_lib_types.
 :- import_module parse_tree.prog_data.
-:- import_module parse_tree.prog_type.
 :- import_module transform_hlds.rbmm.points_to_graph.
 :- import_module transform_hlds.smm_common.
 
Index: compiler/rbmm.condition_renaming.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.condition_renaming.m,v
retrieving revision 1.14
diff -u -b -r1.14 rbmm.condition_renaming.m
--- compiler/rbmm.condition_renaming.m	20 Dec 2010 07:47:36 -0000	1.14
+++ compiler/rbmm.condition_renaming.m	30 Dec 2010 07:15:08 -0000
@@ -49,7 +49,6 @@
 
 :- import_module map.
 :- import_module set.
-:- import_module string.
 
 %-----------------------------------------------------------------------------%
 
@@ -142,12 +141,12 @@
 :- import_module transform_hlds.rbmm.points_to_graph.
 :- import_module transform_hlds.smm_common.
 
-:- import_module cord.
 :- import_module int.
 :- import_module list.
 :- import_module pair.
 :- import_module require.
 :- import_module set.
+:- import_module string.
 :- import_module svmap.
 :- import_module svset.
 
@@ -324,8 +323,7 @@
 collect_non_local_and_in_cond_regions_expr(_, _, _, _, _, shorthand(_),
         !NonLocalRegionProc, !InCondRegionsProc) :-
     % These should have been expanded out by now.
-    unexpected(this_file, "collect_non_local_and_in_cond_regions_expr: "
-        ++ "shorthand not handled").
+    unexpected($module, $pred, "shorthand").
 
 :- pred collect_non_local_and_in_cond_regions_case(rpt_graph::in,
     pp_region_set_table::in, pp_region_set_table::in,
@@ -418,8 +416,7 @@
         ( RenameAnnotation = create_region(_)
         ; RenameAnnotation = remove_region(_)
         ),
-        unexpected(this_file, "renaming_annotation_to_regions: "
-            ++ "annotation is not assignment")
+        unexpected($module, $pred, "annotation is not assignment")
     ;
         RenameAnnotation = rename_region(RightRegion, LeftRegion),
         svset.insert(LeftRegion, !LeftRegions),
@@ -550,9 +547,7 @@
         ; Expr = generic_call(_, _, _, _)
         ; Expr = shorthand(_)
         ),
-        unexpected(this_file,
-            "collect_non_local_regions_in_ite_compound_goal: "
-            ++ "encountered atomic or unsupported goal")
+        unexpected($module, $pred, "atomic or unsupported goal")
     ).
 
 :- pred collect_non_local_regions_in_ite_case(rpt_graph::in,
@@ -731,9 +726,7 @@
         ; Expr = generic_call(_, _, _, _)
         ; Expr = shorthand(_)
         ),
-        unexpected(this_file,
-            "collect_regions_created_in_condition_compound_goal: "
-            ++ "encountered atomic or unsupported goal")
+        unexpected($module, $pred, "atomic or unsupported goal")
     ).
 
 :- pred collect_regions_created_in_condition_case(rpt_graph::in,
@@ -869,7 +862,7 @@
             Else, !IteRenamingProc)
     ;
         GoalExpr = shorthand(_),
-        unexpected(this_file, "collect_ite_renaming_goal: shorthand")
+        unexpected($module, $pred, "shorthand")
     ).
 
 :- pred collect_ite_renaming_case(goal_path_regions_table::in, rpt_graph::in,
@@ -982,9 +975,7 @@
         ; Expr = generic_call(_, _, _, _)
         ; Expr = shorthand(_)
         ),
-        unexpected(this_file,
-            "collect_ite_renaming_in_condition_compound_goal: "
-            ++ "encountered atomic or unsupported goal")
+        unexpected($module, $pred, "atomic or unsupported goal")
     ).
 
 :- pred collect_ite_renaming_in_condition_case(goal_path_regions_table::in,
@@ -1068,8 +1059,8 @@
     PathToCond = rgp(RevPathToCondSteps),
     (
         RevPathToCondSteps = [LastStep | RevInitialSteps],
-        expect(unify(LastStep, step_ite_cond), this_file,
-            "collect_ite_annotation_region_names: not step_ite_cond"),
+        expect(unify(LastStep, step_ite_cond), $module,
+            $pred ++ ": not step_ite_cond"),
         PathToThen = rgp([step_ite_then | RevInitialSteps]),
         get_closest_condition_in_goal_path(PathToCond, _, 0, HowMany),
         list.foldl2(
@@ -1078,8 +1069,7 @@
             ExecPaths, !IteRenamingProc, !IteAnnotationProc)
     ;
         RevPathToCondSteps = [],
-        unexpected(this_file,
-            "collect_ite_annotation_region_set: empty path to condition.")
+        unexpected($module, $pred, "empty path to condition.")
     ).
 
 :- pred collect_ite_annotation_exec_path(rpt_graph::in, reverse_goal_path::in,
@@ -1162,8 +1152,7 @@
                 RenameTo = list.det_last(RenameToList),
                 make_renaming_instruction(CurrentName, RenameTo, Annotation)
             ;
-                unexpected(this_file,
-                    "introduce_reverse_renaming: more than one renaming")
+                unexpected($module, $pred, "more than one renaming")
             )
         ;
             make_renaming_instruction(CurrentName, RegName, Annotation)
@@ -1175,9 +1164,3 @@
     record_annotation(ProgPoint, Annotation, !IteAnnotationProc).
 
 %-----------------------------------------------------------------------------%
-
-:- func this_file = string.
-
-this_file = "rbmm.condition_renaming.m".
-
-%-----------------------------------------------------------------------------%
Index: compiler/rbmm.execution_path.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.execution_path.m,v
retrieving revision 1.13
diff -u -b -r1.13 rbmm.execution_path.m
--- compiler/rbmm.execution_path.m	20 Dec 2010 07:47:37 -0000	1.13
+++ compiler/rbmm.execution_path.m	30 Dec 2010 06:43:21 -0000
@@ -31,7 +31,6 @@
 :- implementation.
 
 :- import_module hlds.goal_path.
-:- import_module hlds.hlds_data.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_pred.
 :- import_module parse_tree.
Index: compiler/rbmm.interproc_region_lifetime.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.interproc_region_lifetime.m,v
retrieving revision 1.7
diff -u -b -r1.7 rbmm.interproc_region_lifetime.m
--- compiler/rbmm.interproc_region_lifetime.m	20 Dec 2010 07:47:37 -0000	1.7
+++ compiler/rbmm.interproc_region_lifetime.m	30 Dec 2010 06:43:58 -0000
@@ -60,20 +60,14 @@
 
 :- import_module check_hlds.
 :- import_module check_hlds.type_util.
-:- import_module hlds.arg_info.
-:- import_module hlds.goal_path.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_pred.
 :- import_module parse_tree.
-:- import_module parse_tree.mercury_to_mercury.
-:- import_module parse_tree.prog_data.
-:- import_module parse_tree.prog_type.
 :- import_module transform_hlds.dependency_graph.
 :- import_module transform_hlds.rbmm.points_to_graph.
 :- import_module transform_hlds.smm_common.
 
 :- import_module assoc_list.
-:- import_module bool.
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
@@ -81,11 +75,8 @@
 :- import_module require.
 :- import_module set.
 :- import_module solutions.
-:- import_module string.
 :- import_module svmap.
 :- import_module svset.
-:- import_module term.
-:- import_module varset.
 
 %-----------------------------------------------------------------------------%
 %
Index: compiler/rbmm.live_region_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.live_region_analysis.m,v
retrieving revision 1.7
diff -u -b -r1.7 rbmm.live_region_analysis.m
--- compiler/rbmm.live_region_analysis.m	20 Dec 2010 07:47:37 -0000	1.7
+++ compiler/rbmm.live_region_analysis.m	30 Dec 2010 06:45:07 -0000
@@ -39,30 +39,18 @@
 
 :- implementation.
 
-:- import_module check_hlds.
-:- import_module check_hlds.type_util.
-:- import_module hlds.arg_info.
-:- import_module hlds.goal_path.
-:- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_pred.
 :- import_module parse_tree.
-:- import_module parse_tree.mercury_to_mercury.
 :- import_module parse_tree.prog_data.
 :- import_module transform_hlds.rbmm.points_to_graph.
 :- import_module transform_hlds.smm_common.
 
-:- import_module assoc_list.
-:- import_module bool.
 :- import_module list.
 :- import_module map.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
-:- import_module string.
 :- import_module svmap.
-:- import_module svset.
 :- import_module term.
-:- import_module varset.
 
 %----------------------------------------------------------------------------%
 %
@@ -202,8 +190,7 @@
                 ProcVoidVar, map.init, ProcVoidVarRegion),
             svmap.set(PPId, ProcVoidVarRegion, !VoidVarRegionTable)
         ;
-            unexpected(this_file,
-                "live_region_analysis_proc: rpta_info must exist")
+            unexpected($module, $pred, "rpta_info must exist")
         )
     ).
 
@@ -246,9 +233,3 @@
     ).
 
 %----------------------------------------------------------------------------%
-
-:- func this_file = string.
-
-this_file = "rbmm.live_region_analysis.m".
-
-%----------------------------------------------------------------------------%
Index: compiler/rbmm.live_variable_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.live_variable_analysis.m,v
retrieving revision 1.6
diff -u -b -r1.6 rbmm.live_variable_analysis.m
--- compiler/rbmm.live_variable_analysis.m	20 Dec 2010 07:47:37 -0000	1.6
+++ compiler/rbmm.live_variable_analysis.m	30 Dec 2010 06:45:32 -0000
@@ -31,10 +31,6 @@
 
 :- implementation.
 
-:- import_module check_hlds.
-:- import_module check_hlds.type_util.
-:- import_module hlds.arg_info.
-:- import_module hlds.goal_path.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_pred.
 :- import_module parse_tree.
@@ -51,7 +47,6 @@
 :- import_module set.
 :- import_module string.
 :- import_module svmap.
-:- import_module svset.
 :- import_module term.
 :- import_module varset.
 
Index: compiler/rbmm.points_to_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.points_to_analysis.m,v
retrieving revision 1.16
diff -u -b -r1.16 rbmm.points_to_analysis.m
--- compiler/rbmm.points_to_analysis.m	20 Dec 2010 07:47:37 -0000	1.16
+++ compiler/rbmm.points_to_analysis.m	30 Dec 2010 06:45:39 -0000
@@ -48,7 +48,6 @@
 :- implementation.
 
 :- import_module hlds.goal_path.
-:- import_module hlds.hlds_data.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_pred.
 :- import_module parse_tree.
Index: compiler/rbmm.points_to_graph.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.points_to_graph.m,v
retrieving revision 1.6
diff -u -b -r1.6 rbmm.points_to_graph.m
--- compiler/rbmm.points_to_graph.m	15 Dec 2010 06:30:00 -0000	1.6
+++ compiler/rbmm.points_to_graph.m	30 Dec 2010 06:46:05 -0000
@@ -22,11 +22,9 @@
 :- import_module parse_tree.prog_data.
 
 :- import_module bool.
-:- import_module int.
 :- import_module list.
 :- import_module map.
 :- import_module set.
-:- import_module string.
 
 %-----------------------------------------------------------------------------%
 % The region points-to graph.
Index: compiler/rbmm.points_to_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.points_to_info.m,v
retrieving revision 1.5
diff -u -b -r1.5 rbmm.points_to_info.m
--- compiler/rbmm.points_to_info.m	28 Nov 2009 01:58:01 -0000	1.5
+++ compiler/rbmm.points_to_info.m	30 Dec 2010 06:46:27 -0000
@@ -66,20 +66,15 @@
 
 :- implementation.
 
-:- import_module check_hlds.
-:- import_module check_hlds.type_util.
 :- import_module hlds.hlds_module.
 :- import_module parse_tree.
 :- import_module parse_tree.prog_data.
 
-:- import_module assoc_list.
 :- import_module bool.
 :- import_module int.
 :- import_module list.
 :- import_module set.
-:- import_module std_util.
 :- import_module string.
-:- import_module varset.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/rbmm.region_arguments.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.region_arguments.m,v
retrieving revision 1.5
diff -u -b -r1.5 rbmm.region_arguments.m
--- compiler/rbmm.region_arguments.m	20 Dec 2010 07:47:37 -0000	1.5
+++ compiler/rbmm.region_arguments.m	30 Dec 2010 06:46:34 -0000
@@ -78,7 +78,6 @@
 :- import_module bool.
 :- import_module require.
 :- import_module set.
-:- import_module string.
 :- import_module svmap.
 
 record_region_arguments(ModuleInfo, RptaInfoTable, ConstantRTable,
Index: compiler/rbmm.region_instruction.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.region_instruction.m,v
retrieving revision 1.11
diff -u -b -r1.11 rbmm.region_instruction.m
--- compiler/rbmm.region_instruction.m	20 Dec 2010 07:47:37 -0000	1.11
+++ compiler/rbmm.region_instruction.m	30 Dec 2010 06:55:25 -0000
@@ -26,7 +26,6 @@
 
 :- import_module list.
 :- import_module map.
-:- import_module string.
 
 :- type region_instr_table
     ==      map(pred_proc_id, region_instr_proc).
@@ -108,20 +107,15 @@
 
 :- implementation.
 
-:- import_module hlds.goal_path.
-:- import_module hlds.hlds_data.
 :- import_module hlds.hlds_goal.
-:- import_module hlds.hlds_llds.
 :- import_module transform_hlds.rbmm.points_to_graph.
 
-:- import_module bool.
 :- import_module pair.
 :- import_module require.
 :- import_module set.
+:- import_module string.
 :- import_module svmap.
 :- import_module svset.
-:- import_module term.
-:- import_module varset.
 
 introduce_region_instructions(ModuleInfo, RptaInfoTable, ExecPathTable,
         LRBeforeTable, LRAfterTable, VoidVarRegionTable, BornRTable,
Index: compiler/rbmm.region_resurrection_renaming.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.region_resurrection_renaming.m,v
retrieving revision 1.8
diff -u -b -r1.8 rbmm.region_resurrection_renaming.m
--- compiler/rbmm.region_resurrection_renaming.m	15 Dec 2010 06:30:00 -0000	1.8
+++ compiler/rbmm.region_resurrection_renaming.m	30 Dec 2010 06:55:41 -0000
@@ -32,7 +32,6 @@
 :- import_module list.
 :- import_module map.
 :- import_module multi_map.
-:- import_module string.
 
 %-----------------------------------------------------------------------------%
 
@@ -155,12 +154,11 @@
 :- import_module transform_hlds.rbmm.points_to_graph.
 
 :- import_module assoc_list.
-:- import_module bool.
 :- import_module counter.
-:- import_module int.
 :- import_module pair.
 :- import_module require.
 :- import_module set.
+:- import_module string.
 :- import_module svmap.
 :- import_module svset.
 
Index: compiler/rbmm.region_transformation.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rbmm.region_transformation.m,v
retrieving revision 1.15
diff -u -b -r1.15 rbmm.region_transformation.m
--- compiler/rbmm.region_transformation.m	20 Dec 2010 07:47:37 -0000	1.15
+++ compiler/rbmm.region_transformation.m	30 Dec 2010 07:15:27 -0000
@@ -33,7 +33,6 @@
 :- import_module transform_hlds.rbmm.region_resurrection_renaming.
 
 :- import_module map.
-:- import_module string.
 
 %-----------------------------------------------------------------------------%
 
@@ -78,7 +77,6 @@
 :- import_module check_hlds.type_util.
 :- import_module hlds.goal_path.
 :- import_module hlds.goal_util.
-:- import_module hlds.hlds_data.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.instmap.
 :- import_module hlds.pred_table.
@@ -86,16 +84,15 @@
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.builtin_lib_types.
 :- import_module parse_tree.prog_mode.
-:- import_module parse_tree.prog_type.
 :- import_module transform_hlds.rbmm.points_to_graph.
 :- import_module transform_hlds.smm_common.
 
-:- import_module bool.
 :- import_module int.
 :- import_module list.
 :- import_module pair.
 :- import_module require.
 :- import_module set.
+:- import_module string.
 :- import_module svmap.
 :- import_module svvarset.
 :- import_module term.
Index: compiler/reassign.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/reassign.m,v
retrieving revision 1.31
diff -u -b -r1.31 reassign.m
--- compiler/reassign.m	15 Dec 2010 06:30:00 -0000	1.31
+++ compiler/reassign.m	30 Dec 2010 07:06:24 -0000
@@ -115,7 +115,6 @@
 
 :- import_module int.
 :- import_module map.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module svmap.
Index: compiler/rtti.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti.m,v
retrieving revision 1.95
diff -u -b -r1.95 rtti.m
--- compiler/rtti.m	15 Dec 2010 06:30:01 -0000	1.95
+++ compiler/rtti.m	30 Dec 2010 06:33:24 -0000
@@ -956,18 +956,14 @@
 :- implementation.
 
 :- import_module backend_libs.name_mangle.
-:- import_module check_hlds.        % needed for type_util, mode_util
-:- import_module check_hlds.mode_util.
 :- import_module hlds.hlds_data.
 :- import_module parse_tree.prog_foreign.
 :- import_module parse_tree.prog_type.
 
 :- import_module int.
-:- import_module pair.
 :- import_module require.
 :- import_module string.
 :- import_module table_builtin.
-:- import_module varset.
 
 %----------------------------------------------------------------------------%
 
Index: compiler/rtti_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti_out.m,v
retrieving revision 1.83
diff -u -b -r1.83 rtti_out.m
--- compiler/rtti_out.m	15 Dec 2010 06:30:01 -0000	1.83
+++ compiler/rtti_out.m	30 Dec 2010 07:06:39 -0000
@@ -114,7 +114,6 @@
 :- import_module ll_backend.llds_out.llds_out_code_addr.
 :- import_module ll_backend.llds_out.llds_out_data.
 :- import_module ll_backend.llds_out.llds_out_file.
-:- import_module ll_backend.llds_out.llds_out_instr.
 :- import_module parse_tree.prog_foreign.
 
 :- import_module assoc_list.
Index: compiler/saved_vars.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/saved_vars.m,v
retrieving revision 1.87
diff -u -b -r1.87 saved_vars.m
--- compiler/saved_vars.m	29 Dec 2010 04:52:19 -0000	1.87
+++ compiler/saved_vars.m	30 Dec 2010 07:06:47 -0000
@@ -42,7 +42,6 @@
 
 :- import_module check_hlds.mode_util.
 :- import_module check_hlds.polymorphism.
-:- import_module hlds.goal_util.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_out.
 :- import_module hlds.hlds_out.hlds_out_goal.
Index: compiler/size_prof.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/size_prof.m,v
retrieving revision 1.66
diff -u -b -r1.66 size_prof.m
--- compiler/size_prof.m	15 Dec 2010 06:30:02 -0000	1.66
+++ compiler/size_prof.m	30 Dec 2010 06:49:43 -0000
@@ -110,17 +110,12 @@
 :- import_module check_hlds.simplify.
 :- import_module check_hlds.type_util.
 :- import_module hlds.goal_util.
-:- import_module hlds.hlds_data.
 :- import_module hlds.hlds_goal.
-:- import_module hlds.hlds_out.
-:- import_module hlds.hlds_out.hlds_out_util.
 :- import_module hlds.hlds_rtti.
 :- import_module hlds.instmap.
 :- import_module hlds.passes_aux.
 :- import_module hlds.pred_table.
 :- import_module hlds.quantification.
-:- import_module libs.globals.
-:- import_module libs.options.
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.builtin_lib_types.
 :- import_module parse_tree.prog_data.
@@ -130,7 +125,6 @@
 :- import_module assoc_list.
 :- import_module bool.
 :- import_module int.
-:- import_module io.
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
@@ -318,16 +312,16 @@
         % We don't want to save type_ctor_info variables across calls,
         % because saving/restoring them is more expensive than defining
         % them again.
-        !:Info = !.Info ^ spi_type_ctor_map := map.init,
-        !:Info = !.Info ^ spi_rev_type_ctor_map := map.init,
+        !Info ^ spi_type_ctor_map := map.init,
+        !Info ^ spi_rev_type_ctor_map := map.init,
         GoalExpr = GoalExpr0
     ;
         GoalExpr0 = generic_call(_, _, _, _),
         % We don't want to save type_ctor_info variables across calls,
         % because saving/restoring them is more expensive than defining
         % them again.
-        !:Info = !.Info ^ spi_type_ctor_map := map.init,
-        !:Info = !.Info ^ spi_rev_type_ctor_map := map.init,
+        !Info ^ spi_type_ctor_map := map.init,
+        !Info ^ spi_rev_type_ctor_map := map.init,
         GoalExpr = GoalExpr0
     ;
         GoalExpr0 = call_foreign_proc(_, _, _, _, _, _, _),
@@ -350,12 +344,12 @@
             KnownSizeMap0 = !.Info ^ spi_known_size_map,
             size_prof_process_par_conj(Goals0, Goals, !Info,
                 TargetTypeInfoMap0, TypeInfoMap0, TypeCtorMap0, KnownSizeMap0),
-            !:Info = !.Info ^ spi_target_type_info_map := TargetTypeInfoMap0,
-            !:Info = !.Info ^ spi_type_info_map := TypeInfoMap0,
-            !:Info = !.Info ^ spi_rev_type_info_map := RevTypeInfoMap0,
-            !:Info = !.Info ^ spi_type_ctor_map := map.init,
-            !:Info = !.Info ^ spi_rev_type_ctor_map := map.init,
-            !:Info = !.Info ^ spi_known_size_map := KnownSizeMap0
+            !Info ^ spi_target_type_info_map := TargetTypeInfoMap0,
+            !Info ^ spi_type_info_map := TypeInfoMap0,
+            !Info ^ spi_rev_type_info_map := RevTypeInfoMap0,
+            !Info ^ spi_type_ctor_map := map.init,
+            !Info ^ spi_rev_type_ctor_map := map.init,
+            !Info ^ spi_known_size_map := KnownSizeMap0
         ),
         GoalExpr = conj(ConjType, Goals)
     ;
@@ -373,12 +367,12 @@
                 TypeInfoMap0, RevTypeInfoMap0,
                 TypeCtorMap0, RevTypeCtorMap0,
                 TypeInfoMap, KnownSizeMap0, KnownSizeMap),
-            !:Info = !.Info ^ spi_type_info_map := TypeInfoMap,
+            !Info ^ spi_type_info_map := TypeInfoMap,
             % The rev_type_info_map field is updated by
             % the call to update_rev_maps below.
-            !:Info = !.Info ^ spi_type_ctor_map := map.init,
-            !:Info = !.Info ^ spi_rev_type_ctor_map := map.init,
-            !:Info = !.Info ^ spi_known_size_map := KnownSizeMap,
+            !Info ^ spi_type_ctor_map := map.init,
+            !Info ^ spi_rev_type_ctor_map := map.init,
+            !Info ^ spi_known_size_map := KnownSizeMap,
             Cases = [First | Later]
         ;
             Cases0 = [],
@@ -402,20 +396,20 @@
                 TypeInfoMap0, RevTypeInfoMap0,
                 TypeCtorMap0, RevTypeCtorMap0,
                 TypeInfoMap, KnownSizeMap0, KnownSizeMap),
-            !:Info = !.Info ^ spi_type_info_map := TypeInfoMap,
+            !Info ^ spi_type_info_map := TypeInfoMap,
             % The rev_type_info_map field is updated by
             % the call to update_rev_maps below.
-            !:Info = !.Info ^ spi_type_ctor_map := map.init,
-            !:Info = !.Info ^ spi_rev_type_ctor_map := map.init,
-            !:Info = !.Info ^ spi_known_size_map := KnownSizeMap,
+            !Info ^ spi_type_ctor_map := map.init,
+            !Info ^ spi_rev_type_ctor_map := map.init,
+            !Info ^ spi_known_size_map := KnownSizeMap,
             Disjuncts = [First | Later]
         ;
             Disjuncts0 = [],
             % An empty disj represents `fail'.
-            !:Info = !.Info ^ spi_type_info_map := map.init,
-            !:Info = !.Info ^ spi_rev_type_ctor_map := map.init,
-            !:Info = !.Info ^ spi_type_info_map := map.init,
-            !:Info = !.Info ^ spi_rev_type_ctor_map := map.init,
+            !Info ^ spi_type_info_map := map.init,
+            !Info ^ spi_rev_type_ctor_map := map.init,
+            !Info ^ spi_type_info_map := map.init,
+            !Info ^ spi_rev_type_ctor_map := map.init,
             Disjuncts = []
         ),
         update_rev_maps(!Info),
@@ -430,9 +424,9 @@
         RevTypeCtorMap0 = !.Info ^ spi_rev_type_ctor_map,
         KnownSizeMap0 = !.Info ^ spi_known_size_map,
 
-        !:Info = !.Info ^ spi_target_type_info_map := map.init,
+        !Info ^ spi_target_type_info_map := map.init,
         size_prof_process_goal(Cond0, Cond, !Info),
-        !:Info = !.Info ^ spi_target_type_info_map := TargetTypeInfoMap0,
+        !Info ^ spi_target_type_info_map := TargetTypeInfoMap0,
         size_prof_process_goal(Then0, Then, !Info),
         TargetTypeInfoMapThen = !.Info ^ spi_target_type_info_map,
         TypeInfoMapThen = !.Info ^ spi_type_info_map,
@@ -440,21 +434,21 @@
 
         map.union(select_first, TargetTypeInfoMapThen,
             TargetTypeInfoMap0, ElseTargetTypeInfoMap),
-        !:Info = !.Info ^ spi_target_type_info_map := ElseTargetTypeInfoMap,
-        !:Info = !.Info ^ spi_type_info_map := TypeInfoMap0,
-        !:Info = !.Info ^ spi_rev_type_info_map := RevTypeInfoMap0,
-        !:Info = !.Info ^ spi_type_ctor_map := TypeCtorMap0,
-        !:Info = !.Info ^ spi_rev_type_ctor_map := RevTypeCtorMap0,
-        !:Info = !.Info ^ spi_known_size_map := KnownSizeMap0,
+        !Info ^ spi_target_type_info_map := ElseTargetTypeInfoMap,
+        !Info ^ spi_type_info_map := TypeInfoMap0,
+        !Info ^ spi_rev_type_info_map := RevTypeInfoMap0,
+        !Info ^ spi_type_ctor_map := TypeCtorMap0,
+        !Info ^ spi_rev_type_ctor_map := RevTypeCtorMap0,
+        !Info ^ spi_known_size_map := KnownSizeMap0,
         size_prof_process_goal(Else0, Else, !Info),
         TypeInfoMapElse = !.Info ^ spi_type_info_map,
         KnownSizeMapElse = !.Info ^ spi_known_size_map,
 
         TypeInfoMap = map.common_subset(TypeInfoMapThen, TypeInfoMapElse),
         KnownSizeMap = map.common_subset(KnownSizeMapThen, KnownSizeMapElse),
-        !:Info = !.Info ^ spi_type_info_map := TypeInfoMap,
-        !:Info = !.Info ^ spi_type_ctor_map := map.init,
-        !:Info = !.Info ^ spi_known_size_map := KnownSizeMap,
+        !Info ^ spi_type_info_map := TypeInfoMap,
+        !Info ^ spi_type_ctor_map := map.init,
+        !Info ^ spi_known_size_map := KnownSizeMap,
         update_rev_maps(!Info),
         update_target_map(!Info),
         GoalExpr = if_then_else(Quant, Cond, Then, Else)
@@ -470,12 +464,12 @@
         % Variables constructed in negated goals are not available after the
         % negated goal fails and the negation succeeds. The sizes we learn
         % in NegGoal0 don't apply after NegGoal0 fails.
-        !:Info = !.Info ^ spi_target_type_info_map := TargetTypeInfoMap0,
-        !:Info = !.Info ^ spi_type_info_map := TypeInfoMap0,
-        !:Info = !.Info ^ spi_rev_type_info_map := RevTypeInfoMap0,
-        !:Info = !.Info ^ spi_type_ctor_map := TypeCtorMap0,
-        !:Info = !.Info ^ spi_rev_type_ctor_map := RevTypeCtorMap0,
-        !:Info = !.Info ^ spi_known_size_map := KnownSizeMap0,
+        !Info ^ spi_target_type_info_map := TargetTypeInfoMap0,
+        !Info ^ spi_type_info_map := TypeInfoMap0,
+        !Info ^ spi_rev_type_info_map := RevTypeInfoMap0,
+        !Info ^ spi_type_ctor_map := TypeCtorMap0,
+        !Info ^ spi_rev_type_ctor_map := RevTypeCtorMap0,
+        !Info ^ spi_known_size_map := KnownSizeMap0,
         GoalExpr = negation(NegGoal)
     ;
         GoalExpr0 = scope(Reason0, SubGoal0),
@@ -523,10 +517,10 @@
 size_prof_process_par_conj([], [], !Info, _, _, _, _).
 size_prof_process_par_conj([Goal0 | Goals0], [Goal | Goals], !Info,
         TargetTypeInfoMap0, TypeInfoMap0, TypeCtorMap0, KnownSizeMap0) :-
-    !:Info = !.Info ^ spi_target_type_info_map := TargetTypeInfoMap0,
-    !:Info = !.Info ^ spi_type_info_map := TypeInfoMap0,
-    !:Info = !.Info ^ spi_type_ctor_map := TypeCtorMap0,
-    !:Info = !.Info ^ spi_known_size_map := KnownSizeMap0,
+    !Info ^ spi_target_type_info_map := TargetTypeInfoMap0,
+    !Info ^ spi_type_info_map := TypeInfoMap0,
+    !Info ^ spi_type_ctor_map := TypeCtorMap0,
+    !Info ^ spi_known_size_map := KnownSizeMap0,
     size_prof_process_goal(Goal0, Goal, !Info),
     size_prof_process_par_conj(Goals0, Goals, !Info,
         TargetTypeInfoMap0, TypeInfoMap0, TypeCtorMap0, KnownSizeMap0).
@@ -542,11 +536,11 @@
 size_prof_process_disj(First0, First, Later0, Later, !Info, TargetTypeInfoMap,
         TypeInfoMap0, RevTypeInfoMap0, TypeCtorMap0, RevTypeCtorMap0,
         TypeInfoMap, KnownSizeMap0, KnownSizeMap) :-
-    !:Info = !.Info ^ spi_type_info_map := TypeInfoMap0,
-    !:Info = !.Info ^ spi_rev_type_info_map := RevTypeInfoMap0,
-    !:Info = !.Info ^ spi_type_ctor_map := TypeCtorMap0,
-    !:Info = !.Info ^ spi_rev_type_ctor_map := RevTypeCtorMap0,
-    !:Info = !.Info ^ spi_known_size_map := KnownSizeMap0,
+    !Info ^ spi_type_info_map := TypeInfoMap0,
+    !Info ^ spi_rev_type_info_map := RevTypeInfoMap0,
+    !Info ^ spi_type_ctor_map := TypeCtorMap0,
+    !Info ^ spi_rev_type_ctor_map := RevTypeCtorMap0,
+    !Info ^ spi_known_size_map := KnownSizeMap0,
     size_prof_process_goal(First0, First, !Info),
     TypeInfoMapFirst = !.Info ^ spi_type_info_map,
     KnownSizeMapFirst = !.Info ^ spi_known_size_map,
@@ -554,7 +548,7 @@
         Later0 = [Head0 | Tail0],
         map.union(select_first, TypeInfoMapFirst,
             TargetTypeInfoMap, LaterTargetTypeInfoMap),
-        !:Info = !.Info ^ spi_target_type_info_map := LaterTargetTypeInfoMap,
+        !Info ^ spi_target_type_info_map := LaterTargetTypeInfoMap,
         size_prof_process_disj(Head0, Head, Tail0, Tail, !Info,
             TargetTypeInfoMap,
             TypeInfoMap0, RevTypeInfoMap0, TypeCtorMap0, RevTypeCtorMap0,
@@ -581,11 +575,11 @@
         TargetTypeInfoMap, TypeInfoMap0, RevTypeInfoMap0,
         TypeCtorMap0, RevTypeCtorMap0,
         TypeInfoMap, KnownSizeMap0, KnownSizeMap) :-
-    !:Info = !.Info ^ spi_type_info_map := TypeInfoMap0,
-    !:Info = !.Info ^ spi_rev_type_info_map := RevTypeInfoMap0,
-    !:Info = !.Info ^ spi_type_ctor_map := TypeCtorMap0,
-    !:Info = !.Info ^ spi_rev_type_ctor_map := RevTypeCtorMap0,
-    !:Info = !.Info ^ spi_known_size_map := KnownSizeMap0,
+    !Info ^ spi_type_info_map := TypeInfoMap0,
+    !Info ^ spi_rev_type_info_map := RevTypeInfoMap0,
+    !Info ^ spi_type_ctor_map := TypeCtorMap0,
+    !Info ^ spi_rev_type_ctor_map := RevTypeCtorMap0,
+    !Info ^ spi_known_size_map := KnownSizeMap0,
     First0 = case(FirstMainConsId, FirstOtherConsIds, FirstGoal0),
     size_prof_process_goal(FirstGoal0, FirstGoal, !Info),
     TypeInfoMapFirst = !.Info ^ spi_type_info_map,
@@ -595,7 +589,7 @@
         Later0 = [Head0 | Tail0],
         map.union(select_first, TargetTypeInfoMap,
             TypeInfoMapFirst, LaterTargetTypeInfoMap),
-        !:Info = !.Info ^ spi_target_type_info_map := LaterTargetTypeInfoMap,
+        !Info ^ spi_target_type_info_map := LaterTargetTypeInfoMap,
         size_prof_process_switch(Head0, Head, Tail0, Tail, !Info,
             TargetTypeInfoMap, TypeInfoMap0, RevTypeInfoMap0,
             TypeCtorMap0, RevTypeCtorMap0,
@@ -852,8 +846,8 @@
         make_int_const_construction_alloc(KnownSize,
             yes("KnownSize"), KnownSizeGoal, KnownSizeVar,
             VarSet0, VarSet1, VarTypes0, VarTypes1),
-        !:Info = !.Info ^ spi_varset := VarSet1,
-        !:Info = !.Info ^ spi_vartypes := VarTypes1,
+        !Info ^ spi_varset := VarSet1,
+        !Info ^ spi_vartypes := VarTypes1,
         get_new_var(int_type, "FinalSizeVar", SizeVar, !Info),
         TermSizeProfModule = mercury_term_size_prof_builtin_module,
         goal_util.generate_simple_call(TermSizeProfModule,
@@ -912,12 +906,12 @@
                 polymorphism.new_type_info_var_raw(Type, type_info,
                     TypeInfoVar, VarSet0, VarSet1, VarTypes0, VarTypes1,
                     RttiVarMaps0, RttiVarMaps),
-                !:Info = !.Info ^ spi_rtti_varmaps := RttiVarMaps
+                !Info ^ spi_rtti_varmaps := RttiVarMaps
             ),
             make_int_const_construction_alloc(Slot, yes("TypeClassInfoSlot"),
                 SlotGoal, SlotVar, VarSet1, VarSet, VarTypes1, VarTypes),
-            !:Info = !.Info ^ spi_varset := VarSet,
-            !:Info = !.Info ^ spi_vartypes := VarTypes,
+            !Info ^ spi_varset := VarSet,
+            !Info ^ spi_vartypes := VarTypes,
             PrivateBuiltin = mercury_private_builtin_module,
             goal_util.generate_simple_call(PrivateBuiltin,
                 "type_info_from_typeclass_info", pf_predicate, only_mode,
@@ -957,8 +951,8 @@
         VarTypes0 = !.Info ^ spi_vartypes,
         make_int_const_construction_alloc(Arity, yes("TupleArity"), ArityGoal,
             ArityVar, VarSet0, VarSet1, VarTypes0, VarTypes1),
-        !:Info = !.Info ^ spi_varset := VarSet1,
-        !:Info = !.Info ^ spi_vartypes := VarTypes1,
+        !Info ^ spi_varset := VarSet1,
+        !Info ^ spi_vartypes := VarTypes1,
         FrontGoals = list.append(TypeCtorGoals, [ArityGoal]),
         ArgVars = [TypeCtorVar, ArityVar | ArgTypeInfoVars]
     ;
@@ -1147,15 +1141,15 @@
         % holds the typeinfo for more than one type.
         RevTypeInfoMap = RevTypeInfoMap0
     ),
-    !:Info = !.Info ^ spi_type_info_map := TypeInfoMap,
-    !:Info = !.Info ^ spi_rev_type_info_map := RevTypeInfoMap.
+    !Info ^ spi_type_info_map := TypeInfoMap,
+    !Info ^ spi_rev_type_info_map := RevTypeInfoMap.
 
 :- pred record_known_size(prog_var::in, int::in, info::in, info::out) is det.
 
 record_known_size(Var, KnownSize, !Info) :-
     KnownSizeMap0 = !.Info ^ spi_known_size_map,
     map.det_insert(KnownSizeMap0, Var, KnownSize, KnownSizeMap),
-    !:Info = !.Info ^ spi_known_size_map := KnownSizeMap.
+    !Info ^ spi_known_size_map := KnownSizeMap.
 
 :- pred record_typeinfo_in_type_info_varmap(rtti_varmaps::in, tvar::in,
     info::in, info::out) is det.
@@ -1176,7 +1170,7 @@
         % TypeClassInfoMap0 = !.Info ^ spi_type_class_info_map,
         % map.det_insert(TypeClassInfoMap0,
         %   TypeClassInfoVar - Offset, Type, TypeClassInfoMap),
-        % !:Info = !.Info ^ spi_type_class_info_map := TypeClassInfoMap
+        % !Info ^ spi_type_class_info_map := TypeClassInfoMap
     ).
 
 %---------------------------------------------------------------------------%
@@ -1204,8 +1198,8 @@
     count_appearances(TypeCtorList, VarCounts1, VarCounts),
     construct_rev_map(TypeInfoList, VarCounts, map.init, RevTypeInfoMap),
     construct_rev_map(TypeCtorList, VarCounts, map.init, RevTypeCtorMap),
-    !:Info = !.Info ^ spi_rev_type_info_map := RevTypeInfoMap,
-    !:Info = !.Info ^ spi_rev_type_ctor_map := RevTypeCtorMap.
+    !Info ^ spi_rev_type_info_map := RevTypeInfoMap,
+    !Info ^ spi_rev_type_ctor_map := RevTypeCtorMap.
 
 :- pred count_appearances(assoc_list(T, prog_var)::in,
     map(prog_var, int)::in, map(prog_var, int)::out) is det.
@@ -1254,7 +1248,7 @@
     map.to_sorted_assoc_list(TargetTypeInfoMap0, TargetTypeInfoList),
     list.foldl(include_in_target_map(TypeInfoMap), TargetTypeInfoList,
         map.init, TargetTypeInfoMap),
-    !:Info = !.Info ^ spi_target_type_info_map := TargetTypeInfoMap.
+    !Info ^ spi_target_type_info_map := TargetTypeInfoMap.
 
 :- pred include_in_target_map(type_info_map::in, pair(mer_type, prog_var)::in,
     type_info_map::in, type_info_map::out) is det.
Index: compiler/smm_common.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/smm_common.m,v
retrieving revision 1.7
diff -u -b -r1.7 smm_common.m
--- compiler/smm_common.m	20 Dec 2010 07:47:37 -0000	1.7
+++ compiler/smm_common.m	30 Dec 2010 06:50:00 -0000
@@ -71,13 +71,9 @@
 
 :- import_module check_hlds.
 :- import_module check_hlds.type_util.
-:- import_module ll_backend.
-:- import_module ll_backend.liveness.
 :- import_module parse_tree.prog_out.
 
 :- import_module bool.
-:- import_module cord.
-:- import_module int.
 :- import_module map.
 
 %-----------------------------------------------------------------------------%
Index: compiler/stack_alloc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_alloc.m,v
retrieving revision 1.25
diff -u -b -r1.25 stack_alloc.m
--- compiler/stack_alloc.m	5 Aug 2010 03:07:09 -0000	1.25
+++ compiler/stack_alloc.m	30 Dec 2010 07:07:18 -0000
@@ -52,7 +52,6 @@
 
 :- import_module bool.
 :- import_module int.
-:- import_module io.
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_layout.m,v
retrieving revision 1.153
diff -u -b -r1.153 stack_layout.m
--- compiler/stack_layout.m	20 Dec 2010 07:47:37 -0000	1.153
+++ compiler/stack_layout.m	30 Dec 2010 07:07:23 -0000
@@ -106,7 +106,6 @@
 :- import_module hlds.goal_util.
 :- import_module hlds.hlds_pred.
 :- import_module hlds.hlds_rtti.
-:- import_module hlds.instmap.
 :- import_module libs.globals.
 :- import_module libs.options.
 :- import_module libs.trace_params.
Index: compiler/stack_opt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_opt.m,v
retrieving revision 1.46
diff -u -b -r1.46 stack_opt.m
--- compiler/stack_opt.m	20 Dec 2010 07:47:38 -0000	1.46
+++ compiler/stack_opt.m	30 Dec 2010 07:07:31 -0000
@@ -103,7 +103,6 @@
 :- import_module ll_backend.liveness.
 :- import_module ll_backend.store_alloc.
 :- import_module mdbcomp.program_representation.
-:- import_module parse_tree.mercury_to_mercury.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_type.
 
Index: compiler/stdlabel.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stdlabel.m,v
retrieving revision 1.6
diff -u -b -r1.6 stdlabel.m
--- compiler/stdlabel.m	15 Dec 2010 06:30:03 -0000	1.6
+++ compiler/stdlabel.m	30 Dec 2010 07:07:35 -0000
@@ -45,7 +45,6 @@
 
 :- import_module bool.
 :- import_module map.
-:- import_module pair.
 :- import_module require.
 :- import_module svmap.
 
Index: compiler/stm_expand.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stm_expand.m,v
retrieving revision 1.14
diff -u -b -r1.14 stm_expand.m
--- compiler/stm_expand.m	29 Dec 2010 04:52:19 -0000	1.14
+++ compiler/stm_expand.m	30 Dec 2010 06:50:25 -0000
@@ -180,7 +180,6 @@
 :- import_module hlds.goal_util.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_pred.
-:- import_module hlds.hlds_rtti.
 :- import_module hlds.instmap.
 :- import_module hlds.pred_table.
 :- import_module hlds.quantification.
@@ -201,7 +200,6 @@
 :- import_module require.
 :- import_module set.
 :- import_module string.
-:- import_module svmap.
 :- import_module svvarset.
 :- import_module term.
 :- import_module varset.
Index: compiler/store_alloc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/store_alloc.m,v
retrieving revision 1.112
diff -u -b -r1.112 store_alloc.m
--- compiler/store_alloc.m	15 Dec 2010 06:30:03 -0000	1.112
+++ compiler/store_alloc.m	30 Dec 2010 07:07:39 -0000
@@ -45,7 +45,6 @@
 
 :- implementation.
 
-:- import_module hlds.goal_util.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_llds.
 :- import_module hlds.instmap.
Index: compiler/string_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/string_switch.m,v
retrieving revision 1.70
diff -u -b -r1.70 string_switch.m
--- compiler/string_switch.m	15 Dec 2010 06:30:03 -0000	1.70
+++ compiler/string_switch.m	30 Dec 2010 07:08:01 -0000
@@ -72,13 +72,10 @@
 
 :- import_module backend_libs.builtin_ops.
 :- import_module backend_libs.switch_util.
-:- import_module hlds.hlds_data.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_llds.
-:- import_module ll_backend.code_gen.
 :- import_module ll_backend.lookup_util.
 :- import_module ll_backend.switch_case.
-:- import_module ll_backend.trace_gen.
 
 :- import_module assoc_list.
 :- import_module bool.
@@ -90,7 +87,6 @@
 :- import_module require.
 :- import_module set.
 :- import_module std_util.
-:- import_module string.
 
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
Index: compiler/structure_reuse.direct.choose_reuse.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_reuse.direct.choose_reuse.m,v
retrieving revision 1.24
diff -u -b -r1.24 structure_reuse.direct.choose_reuse.m
--- compiler/structure_reuse.direct.choose_reuse.m	15 Dec 2010 06:30:03 -0000	1.24
+++ compiler/structure_reuse.direct.choose_reuse.m	30 Dec 2010 06:50:33 -0000
@@ -118,7 +118,6 @@
 :- import_module int.
 :- import_module maybe.
 :- import_module multi_map.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module string.
Index: compiler/structure_reuse.direct.detect_garbage.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_reuse.direct.detect_garbage.m,v
retrieving revision 1.24
diff -u -b -r1.24 structure_reuse.direct.detect_garbage.m
--- compiler/structure_reuse.direct.detect_garbage.m	20 Dec 2010 07:47:38 -0000	1.24
+++ compiler/structure_reuse.direct.detect_garbage.m	30 Dec 2010 06:50:42 -0000
@@ -44,9 +44,7 @@
 
 :- import_module bool.
 :- import_module io.
-:- import_module pair.
 :- import_module require.
-:- import_module set.
 :- import_module string.
 
 %-----------------------------------------------------------------------------%
Index: compiler/structure_reuse.direct.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_reuse.direct.m,v
retrieving revision 1.16
diff -u -b -r1.16 structure_reuse.direct.m
--- compiler/structure_reuse.direct.m	20 Dec 2010 07:47:38 -0000	1.16
+++ compiler/structure_reuse.direct.m	30 Dec 2010 06:58:07 -0000
@@ -30,7 +30,6 @@
 :- import_module transform_hlds.ctgc.structure_reuse.domain.
 :- import_module transform_hlds.ctgc.structure_sharing.domain.
 
-:- import_module io.
 :- import_module list.
 
 %-----------------------------------------------------------------------------%
@@ -57,13 +56,13 @@
 :- import_module libs.file_util.
 :- import_module libs.globals.
 :- import_module libs.options.
-:- import_module parse_tree.error_util.
 :- import_module transform_hlds.ctgc.structure_reuse.direct.choose_reuse.
 :- import_module transform_hlds.ctgc.structure_reuse.direct.detect_garbage.
 :- import_module transform_hlds.ctgc.util.
 :- import_module transform_hlds.smm_common.
 
 :- import_module bool.
+:- import_module io.
 :- import_module map.
 :- import_module svmap.
 
Index: compiler/structure_reuse.lbu.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_reuse.lbu.m,v
retrieving revision 1.13
diff -u -b -r1.13 structure_reuse.lbu.m
--- compiler/structure_reuse.lbu.m	15 Dec 2010 06:30:04 -0000	1.13
+++ compiler/structure_reuse.lbu.m	30 Dec 2010 06:51:03 -0000
@@ -45,7 +45,6 @@
 :- import_module parse_tree.prog_type.
 
 :- import_module list.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 
Index: compiler/structure_reuse.lfu.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_reuse.lfu.m,v
retrieving revision 1.15
diff -u -b -r1.15 structure_reuse.lfu.m
--- compiler/structure_reuse.lfu.m	15 Dec 2010 06:30:04 -0000	1.15
+++ compiler/structure_reuse.lfu.m	30 Dec 2010 06:51:08 -0000
@@ -49,7 +49,6 @@
 
 :- import_module list.
 :- import_module map.
-:- import_module pair.
 :- import_module require.
 
 %-----------------------------------------------------------------------------%
Index: compiler/structure_reuse.versions.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_reuse.versions.m,v
retrieving revision 1.21
diff -u -b -r1.21 structure_reuse.versions.m
--- compiler/structure_reuse.versions.m	15 Dec 2010 06:30:04 -0000	1.21
+++ compiler/structure_reuse.versions.m	30 Dec 2010 07:16:43 -0000
@@ -79,7 +79,6 @@
 :- import_module maybe.
 :- import_module require.
 :- import_module set.
-:- import_module string.
 
 %------------------------------------------------------------------------------%
 
Index: compiler/structure_sharing.domain.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_sharing.domain.m,v
retrieving revision 1.42
diff -u -b -r1.42 structure_sharing.domain.m
--- compiler/structure_sharing.domain.m	15 Dec 2010 06:30:04 -0000	1.42
+++ compiler/structure_sharing.domain.m	30 Dec 2010 07:15:38 -0000
@@ -301,9 +301,7 @@
 
 :- import_module check_hlds.inst_match.
 :- import_module check_hlds.mode_util.
-:- import_module check_hlds.type_util.
 :- import_module hlds.hlds_llds.
-:- import_module mdbcomp.prim_data.
 :- import_module parse_tree.prog_ctgc.
 :- import_module parse_tree.prog_out.
 :- import_module parse_tree.prog_type.
@@ -321,7 +319,6 @@
 :- import_module string.
 :- import_module svmap.
 :- import_module svset.
-:- import_module unit.
 :- import_module univ.
 :- import_module varset.
 
Index: compiler/switch_case.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/switch_case.m,v
retrieving revision 1.5
diff -u -b -r1.5 switch_case.m
--- compiler/switch_case.m	1 Nov 2010 04:02:59 -0000	1.5
+++ compiler/switch_case.m	30 Dec 2010 07:08:09 -0000
@@ -75,7 +75,6 @@
 
 :- implementation.
 
-:- import_module backend_libs.switch_util.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_llds.
 :- import_module hlds.hlds_out.
Index: compiler/switch_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/switch_gen.m,v
retrieving revision 1.115
diff -u -b -r1.115 switch_gen.m
--- compiler/switch_gen.m	1 Nov 2010 04:02:59 -0000	1.115
+++ compiler/switch_gen.m	30 Dec 2010 07:08:19 -0000
@@ -71,7 +71,6 @@
 :- import_module hlds.hlds_module.
 :- import_module hlds.hlds_out.
 :- import_module hlds.hlds_out.hlds_out_goal.
-:- import_module libs.compiler_util.
 :- import_module libs.globals.
 :- import_module libs.options.
 :- import_module ll_backend.code_gen.
@@ -87,7 +86,6 @@
 :- import_module bool.
 :- import_module cord.
 :- import_module int.
-:- import_module map.
 :- import_module maybe.
 :- import_module pair.
 :- import_module string.
Index: compiler/switch_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/switch_util.m,v
retrieving revision 1.49
diff -u -b -r1.49 switch_util.m
--- compiler/switch_util.m	15 Dec 2010 06:30:04 -0000	1.49
+++ compiler/switch_util.m	30 Dec 2010 06:33:24 -0000
@@ -342,12 +342,10 @@
 :- import_module check_hlds.type_util.
 :- import_module hlds.hlds_data.
 :- import_module hlds.hlds_code_util.
-:- import_module hlds.hlds_out.
 :- import_module libs.options.
 :- import_module parse_tree.prog_type.
 
 :- import_module char.
-:- import_module cord.
 :- import_module int.
 :- import_module io.
 :- import_module require.
@@ -507,7 +505,7 @@
         ),
         % You can't have a switch without at least two arms, or without values
         % that can be deconstructed.
-        unexpected(this_file, "type_ctor_cat_to_switch_cat: bad type ctor cat")
+        unexpected($module, $pred, "bad type ctor cat")
     ).
 
 estimate_switch_tag_test_cost(Tag) = Cost :-
Index: compiler/tabling_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/tabling_analysis.m,v
retrieving revision 1.22
diff -u -b -r1.22 tabling_analysis.m
--- compiler/tabling_analysis.m	15 Dec 2010 06:30:05 -0000	1.22
+++ compiler/tabling_analysis.m	30 Dec 2010 06:51:37 -0000
@@ -104,7 +104,6 @@
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module string.
Index: compiler/tag_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/tag_switch.m,v
retrieving revision 1.85
diff -u -b -r1.85 tag_switch.m
--- compiler/tag_switch.m	15 Dec 2010 06:30:05 -0000	1.85
+++ compiler/tag_switch.m	30 Dec 2010 07:16:23 -0000
@@ -42,14 +42,9 @@
 :- import_module backend_libs.rtti.
 :- import_module backend_libs.switch_util.
 :- import_module hlds.hlds_data.
-:- import_module hlds.hlds_llds.
-:- import_module hlds.hlds_out.
-:- import_module hlds.hlds_pred.
 :- import_module libs.globals.
 :- import_module libs.options.
-:- import_module ll_backend.code_gen.
 :- import_module ll_backend.switch_case.
-:- import_module ll_backend.trace_gen.
 :- import_module parse_tree.prog_data.
 
 :- import_module assoc_list.
@@ -60,7 +55,6 @@
 :- import_module pair.
 :- import_module require.
 :- import_module string.
-:- import_module svmap.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/term_constr_build.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_constr_build.m,v
retrieving revision 1.28
diff -u -b -r1.28 term_constr_build.m
--- compiler/term_constr_build.m	15 Dec 2010 06:30:05 -0000	1.28
+++ compiler/term_constr_build.m	30 Dec 2010 06:51:44 -0000
@@ -85,7 +85,6 @@
 :- import_module require.
 :- import_module set.
 :- import_module std_util.
-:- import_module string.
 :- import_module svmap.
 :- import_module svvarset.
 :- import_module term.
Index: compiler/term_constr_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_constr_util.m,v
retrieving revision 1.19
diff -u -b -r1.19 term_constr_util.m
--- compiler/term_constr_util.m	15 Dec 2010 06:30:06 -0000	1.19
+++ compiler/term_constr_util.m	30 Dec 2010 06:51:56 -0000
@@ -193,8 +193,6 @@
 :- import_module hlds.hlds_out.
 :- import_module hlds.hlds_out.hlds_out_util.
 :- import_module hlds.hlds_pred.
-:- import_module libs.globals.
-:- import_module libs.options.
 :- import_module libs.rat.
 :- import_module transform_hlds.term_constr_errors.
 :- import_module transform_hlds.term_norm.
Index: compiler/trace_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/trace_gen.m,v
retrieving revision 1.31
diff -u -b -r1.31 trace_gen.m
--- compiler/trace_gen.m	20 Dec 2010 07:47:38 -0000	1.31
+++ compiler/trace_gen.m	30 Dec 2010 07:08:49 -0000
@@ -254,7 +254,6 @@
 :- import_module libs.trace_params.
 :- import_module ll_backend.code_util.
 :- import_module ll_backend.layout_out.
-:- import_module ll_backend.llds_out.
 :- import_module mdbcomp.prim_data.
 :- import_module parse_tree.prog_type.
 
Index: compiler/trailing_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/trailing_analysis.m,v
retrieving revision 1.41
diff -u -b -r1.41 trailing_analysis.m
--- compiler/trailing_analysis.m	15 Dec 2010 06:30:07 -0000	1.41
+++ compiler/trailing_analysis.m	30 Dec 2010 06:52:01 -0000
@@ -105,7 +105,6 @@
 :- import_module list.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module string.
Index: compiler/trans_opt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/trans_opt.m,v
retrieving revision 1.56
diff -u -b -r1.56 trans_opt.m
--- compiler/trans_opt.m	30 Jul 2010 05:16:18 -0000	1.56
+++ compiler/trans_opt.m	30 Dec 2010 06:52:22 -0000
@@ -93,7 +93,6 @@
 :- import_module parse_tree.mercury_to_mercury.
 :- import_module parse_tree.modules.
 :- import_module parse_tree.module_cmds.
-:- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_item.
 :- import_module parse_tree.prog_io.
 :- import_module transform_hlds.ctgc.
@@ -108,13 +107,9 @@
 :- import_module transform_hlds.termination.
 :- import_module transform_hlds.trailing_analysis.
 
-:- import_module assoc_list.
 :- import_module cord.
 :- import_module list.
-:- import_module map.
-:- import_module pair.
 :- import_module set.
-:- import_module term.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/transform.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/transform.m,v
retrieving revision 1.30
diff -u -b -r1.30 transform.m
--- compiler/transform.m	7 Aug 2007 07:10:07 -0000	1.30
+++ compiler/transform.m	30 Dec 2010 06:52:29 -0000
@@ -52,8 +52,6 @@
 :- import_module check_hlds.delay_info.
 :- import_module hlds.instmap.
 
-:- import_module pair.
-
 %-----------------------------------------------------------------------------%
 
 reschedule_conj([], [], !ModeInfo).
Index: compiler/transform_llds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/transform_llds.m,v
retrieving revision 1.35
diff -u -b -r1.35 transform_llds.m
--- compiler/transform_llds.m	15 Dec 2010 06:30:07 -0000	1.35
+++ compiler/transform_llds.m	30 Dec 2010 07:08:54 -0000
@@ -45,7 +45,6 @@
 :- import_module int.
 :- import_module list.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module string.
Index: compiler/tupling.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/tupling.m,v
retrieving revision 1.54
diff -u -b -r1.54 tupling.m
--- compiler/tupling.m	20 Dec 2010 07:47:38 -0000	1.54
+++ compiler/tupling.m	30 Dec 2010 06:52:39 -0000
@@ -101,7 +101,6 @@
 :- import_module check_hlds.mode_util.
 :- import_module hlds.arg_info.
 :- import_module hlds.goal_path.
-:- import_module hlds.goal_util.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_llds.
 :- import_module hlds.hlds_out.
@@ -127,7 +126,6 @@
 
 :- import_module assoc_list.
 :- import_module bool.
-:- import_module cord.
 :- import_module counter.
 :- import_module digraph.
 :- import_module float.
Index: compiler/type_ctor_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/type_ctor_info.m,v
retrieving revision 1.102
diff -u -b -r1.102 type_ctor_info.m
--- compiler/type_ctor_info.m	15 Dec 2010 06:30:07 -0000	1.102
+++ compiler/type_ctor_info.m	30 Dec 2010 06:33:24 -0000
@@ -70,7 +70,6 @@
 :- import_module backend_libs.type_class_info.
 :- import_module check_hlds.        % needed for type_util, mode_util
 :- import_module check_hlds.type_util.
-:- import_module hlds.hlds_code_util.
 :- import_module hlds.hlds_data.
 :- import_module hlds.hlds_pred.
 :- import_module hlds.hlds_rtti.
@@ -84,7 +83,6 @@
 :- import_module parse_tree.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_type.
-:- import_module parse_tree.prog_util.
 
 :- import_module assoc_list.
 :- import_module bool.
Index: compiler/unneeded_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unneeded_code.m,v
retrieving revision 1.56
diff -u -b -r1.56 unneeded_code.m
--- compiler/unneeded_code.m	20 Dec 2010 07:47:40 -0000	1.56
+++ compiler/unneeded_code.m	30 Dec 2010 06:52:44 -0000
@@ -90,7 +90,6 @@
 
 :- import_module assoc_list.
 :- import_module bool.
-:- import_module cord.
 :- import_module int.
 :- import_module io.
 :- import_module list.
Index: compiler/use_local_vars.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/use_local_vars.m,v
retrieving revision 1.41
diff -u -b -r1.41 use_local_vars.m
--- compiler/use_local_vars.m	15 Dec 2010 06:30:10 -0000	1.41
+++ compiler/use_local_vars.m	30 Dec 2010 07:08:58 -0000
@@ -93,7 +93,6 @@
 :- import_module int.
 :- import_module map.
 :- import_module maybe.
-:- import_module pair.
 :- import_module require.
 :- import_module set.
 :- import_module string.
Index: compiler/var_locn.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/var_locn.m,v
retrieving revision 1.71
diff -u -b -r1.71 var_locn.m
--- compiler/var_locn.m	15 Dec 2010 06:30:10 -0000	1.71
+++ compiler/var_locn.m	30 Dec 2010 07:09:14 -0000
@@ -371,12 +371,10 @@
 
 :- import_module backend_libs.builtin_ops.
 :- import_module check_hlds.type_util.
-:- import_module libs.options.
 :- import_module ll_backend.code_util.
 :- import_module ll_backend.exprn_aux.
 
 :- import_module cord.
-:- import_module getopt_io.
 :- import_module int.
 :- import_module pair.
 :- import_module require.
Index: compiler/wrap_blocks.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/wrap_blocks.m,v
retrieving revision 1.18
diff -u -b -r1.18 wrap_blocks.m
--- compiler/wrap_blocks.m	15 Dec 2010 06:30:10 -0000	1.18
+++ compiler/wrap_blocks.m	30 Dec 2010 07:09:18 -0000
@@ -38,7 +38,6 @@
 
 :- import_module bool.
 :- import_module int.
-:- import_module pair.
 :- import_module require.
 
 %-----------------------------------------------------------------------------%
Index: compiler/x86_64_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/x86_64_out.m,v
retrieving revision 1.6
diff -u -b -r1.6 x86_64_out.m
--- compiler/x86_64_out.m	15 Dec 2010 06:30:10 -0000	1.6
+++ compiler/x86_64_out.m	30 Dec 2010 07:09:34 -0000
@@ -46,14 +46,12 @@
 :- import_module ll_backend.x86_64_regs.
 
 :- import_module bool.
-:- import_module char.
 :- import_module int.
 :- import_module list.
 :- import_module maybe.
 :- import_module require.
 :- import_module stream.string_writer.
 :- import_module string.
-:- import_module type_desc.
 
 %-----------------------------------------------------------------------------%
 %
Index: compiler/x86_64_regs.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/x86_64_regs.m,v
retrieving revision 1.3
diff -u -b -r1.3 x86_64_regs.m
--- compiler/x86_64_regs.m	15 Dec 2010 06:30:11 -0000	1.3
+++ compiler/x86_64_regs.m	30 Dec 2010 07:09:45 -0000
@@ -91,7 +91,6 @@
 :- implementation.
 
 :- import_module bool.
-:- import_module io.
 :- import_module list. 
 :- import_module map.
 :- import_module pair. 
cvs diff: Diffing compiler/notes
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.616
diff -u -b -r1.616 user_guide.texi
--- doc/user_guide.texi	23 Nov 2010 04:37:15 -0000	1.616
+++ doc/user_guide.texi	30 Dec 2010 05:29:56 -0000
@@ -6246,6 +6246,12 @@
 after syntax checking and not do any semantic checking
 if it finds any syntax errors in the program.
 
+% @sp 1
+% @item --halt-at-auto-parallel-failure
+% @findex --halt-at-auto-parallel-failure
+% This option causes the compiler to halt if it cannot perform
+% an auto-parallelization requested by a feedback file.
+
 @sp 1
 @item --inhibit-accumulator-warnings
 @findex --inhibit-accumulator-warnings
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_allegro
cvs diff: Diffing extras/graphics/mercury_allegro/examples
cvs diff: Diffing extras/graphics/mercury_allegro/samples
cvs diff: Diffing extras/graphics/mercury_allegro/samples/demo
cvs diff: Diffing extras/graphics/mercury_allegro/samples/mandel
cvs diff: Diffing extras/graphics/mercury_allegro/samples/pendulum2
cvs diff: Diffing extras/graphics/mercury_allegro/samples/speed
cvs diff: Diffing extras/graphics/mercury_cairo
cvs diff: Diffing extras/graphics/mercury_cairo/samples
cvs diff: Diffing extras/graphics/mercury_cairo/samples/data
cvs diff: Diffing extras/graphics/mercury_cairo/tutorial
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/monte
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/posix/samples
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
Index: library/bit_buffer.read.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/bit_buffer.read.m,v
retrieving revision 1.1
diff -u -b -r1.1 bit_buffer.read.m
--- library/bit_buffer.read.m	30 May 2007 02:47:07 -0000	1.1
+++ library/bit_buffer.read.m	30 Dec 2010 08:09:07 -0000
@@ -198,9 +198,7 @@
 %-----------------------------------------------------------------------------%
 :- implementation.
 
-:- import_module maybe.
 :- import_module require.
-:- import_module string.
 
     % If an operation reports an error, it must set the read_error
     % field so that all further operations report an error as well.
@@ -624,60 +622,56 @@
 
 %-----------------------------------------------------------------------------%
 
-/*
-** None of these instances work because of limitations in the type and
-** RTTI system.
-**
-
-:- instance stream.stream(read_stream(Stream, Error),
-                read_buffer(Stream, State, Error))
-        <= stream.bulk_reader(Stream, bit_index, bitmap, State, Error)
-    where
-[
-    (name(_, Name, !Buffer) :-
-        name(!.Buffer ^ read_stream, StreamName,
-            !.Buffer ^ read_buffer_state, State),
-        Name = "bit_buffer.read.read_buffer(" ++ StreamName ++ ")",
-        set_state(State, !Buffer),
-        !:Buffer = unsafe_promise_unique(!.Buffer)
-    )
-].
-
-:- instance stream.input(read_stream(Stream, Error),
-            read_buffer(Stream, State, Error))
-        <= stream.bulk_reader(Stream, bit_index, bitmap, State, Error)
-    where [].
-
-:- instance stream.reader(read_stream(Stream, Error), bool,
-                read_buffer(Stream, State, Error), Error)
-        <= stream.bulk_reader(Stream, bit_index, bitmap, State, Error)
-    where
-[
-        (get(_, Result, !Buffer) :-
-            get_bit(Result, !Buffer)
-        )
-].
-
-:- instance stream.bulk_reader(read_stream(Stream, Error),
-            bit_index, word, read_buffer(Stream, State, Error), Error)
-        <= stream.bulk_reader(Stream, bit_index, bitmap, State, Error)
-    where
-[
-    (bulk_get(_, Index, NumBits, !Word, NumBitsRead, Result, !Buffer) :-
-            get_bits(Index, NumBits, !Word, NumBitsRead, Result, !Buffer)
-    )
-].
-
-:- instance stream.bulk_reader(read_stream(Stream, Error),
-            bit_index, bitmap, read_buffer(Stream, State, Error), Error)
-        <= stream.bulk_reader(Stream, bit_index, bitmap, State, Error)
-    where
-[
-    (bulk_get(_, Index, NumBits, !BM, NumBitsRead, Result, !Buffer) :-
-            get_bitmap(Index, NumBits, !BM, NumBitsRead, Result, !Buffer)
-    )
-].
-
-*/
+% None of these instances work because of limitations in the type and
+% RTTI system.
+%
+% :- instance stream.stream(read_stream(Stream, Error),
+%                 read_buffer(Stream, State, Error))
+%         <= stream.bulk_reader(Stream, bit_index, bitmap, State, Error)
+%     where
+% [
+%     (name(_, Name, !Buffer) :-
+%         name(!.Buffer ^ read_stream, StreamName,
+%             !.Buffer ^ read_buffer_state, State),
+%         Name = "bit_buffer.read.read_buffer(" ++ StreamName ++ ")",
+%         set_state(State, !Buffer),
+%         !:Buffer = unsafe_promise_unique(!.Buffer)
+%     )
+% ].
+%
+% :- instance stream.input(read_stream(Stream, Error),
+%             read_buffer(Stream, State, Error))
+%         <= stream.bulk_reader(Stream, bit_index, bitmap, State, Error)
+%     where [].
+%
+% :- instance stream.reader(read_stream(Stream, Error), bool,
+%                 read_buffer(Stream, State, Error), Error)
+%         <= stream.bulk_reader(Stream, bit_index, bitmap, State, Error)
+%     where
+% [
+%         (get(_, Result, !Buffer) :-
+%             get_bit(Result, !Buffer)
+%         )
+% ].
+%
+% :- instance stream.bulk_reader(read_stream(Stream, Error),
+%             bit_index, word, read_buffer(Stream, State, Error), Error)
+%         <= stream.bulk_reader(Stream, bit_index, bitmap, State, Error)
+%     where
+% [
+%     (bulk_get(_, Index, NumBits, !Word, NumBitsRead, Result, !Buffer) :-
+%             get_bits(Index, NumBits, !Word, NumBitsRead, Result, !Buffer)
+%     )
+% ].
+%
+% :- instance stream.bulk_reader(read_stream(Stream, Error),
+%             bit_index, bitmap, read_buffer(Stream, State, Error), Error)
+%         <= stream.bulk_reader(Stream, bit_index, bitmap, State, Error)
+%     where
+% [
+%     (bulk_get(_, Index, NumBits, !BM, NumBitsRead, Result, !Buffer) :-
+%             get_bitmap(Index, NumBits, !BM, NumBitsRead, Result, !Buffer)
+%     )
+% ].
 
 :- end_module bit_buffer.read.
Index: library/calendar.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/calendar.m,v
retrieving revision 1.2
diff -u -b -r1.2 calendar.m
--- library/calendar.m	14 Jul 2010 16:26:04 -0000	1.2
+++ library/calendar.m	30 Dec 2010 08:09:13 -0000
@@ -289,7 +289,6 @@
 :- implementation.
 
 :- import_module char.
-:- import_module float.
 :- import_module int.
 :- import_module list.
 :- import_module require.
Index: library/cord.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/cord.m,v
retrieving revision 1.17
diff -u -b -r1.17 cord.m
--- library/cord.m	22 Nov 2010 06:02:14 -0000	1.17
+++ library/cord.m	30 Dec 2010 08:09:54 -0000
@@ -222,7 +222,6 @@
 :- implementation.
 
 :- import_module int.
-:- import_module require.
 
 :- type cord(T)
     --->    empty_cord
Index: library/map.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/map.m,v
retrieving revision 1.121
diff -u -b -r1.121 map.m
--- library/map.m	22 Nov 2010 06:02:14 -0000	1.121
+++ library/map.m	30 Dec 2010 08:07:37 -0000
@@ -707,7 +707,6 @@
 
 :- import_module pair.
 :- import_module require.
-:- import_module string.
 :- import_module svmap.
 :- import_module svset.
 
Index: library/parsing_utils.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/parsing_utils.m,v
retrieving revision 1.5
diff -u -b -r1.5 parsing_utils.m
--- library/parsing_utils.m	27 Jan 2010 06:03:09 -0000	1.5
+++ library/parsing_utils.m	30 Dec 2010 08:15:43 -0000
@@ -11,8 +11,8 @@
 % Stability: low
 %
 % Utilities for recursive descent parsers.  Parsers take at least three
-% arguments: a source (src) containing the input string and a parser
-% state (ps) input/output pair tracking the current offset into the input.
+% arguments: a source (src) containing the input string and a parser state (ps)
+% input/output pair tracking the current offset into the input.
 %
 % Call parse(InputString, SkipWS, Parser, Result) to parse an input string
 % and return an error context and message if parsing failed.
@@ -41,11 +41,8 @@
 :- interface.
 
 :- import_module char.
-:- import_module float.
-:- import_module int.
 :- import_module list.
 :- import_module maybe.
-:- import_module string.
 :- import_module unit.
 
 %-----------------------------------------------------------------------------%
@@ -116,8 +113,7 @@
     % Obtain the current offset from the start of the input string
     % (the first character in the input has offset 0).
     %
-:- pred current_offset(src::in, int::out,
-        ps::in, ps::out) is det.
+:- pred current_offset(src::in, int::out, ps::in, ps::out) is det.
 
     % Compute a structure from the parser source which can be used to
     % convert offsets into line numbers and positions in the file (this
@@ -142,8 +138,7 @@
 
     % Read the next char.
     %
-:- pred next_char(src::in, char::out,
-        ps::in, ps::out) is semidet.
+:- pred next_char(src::in, char::out, ps::in, ps::out) is semidet.
 
     % Match a char from the given string.
     %
@@ -152,8 +147,7 @@
 
     % Match a string exactly and any subsequent whitespace.
     %
-:- pred punct(string::in, src::in, unit::out,
-        ps::in, ps::out) is semidet.
+:- pred punct(string::in, src::in, unit::out, ps::in, ps::out) is semidet.
 
     % keyword(IdChars, Keyword, Src, _, !PS) matches Keyword exactly (i.e., it
     % must not be followed by any character in IdChars) and any subsequent
@@ -190,8 +184,7 @@
 
     % Succeed if we have reached the end of the input.
     %
-:- pred eof(src::in, unit::out,
-        ps::in, ps::out) is semidet.
+:- pred eof(src::in, unit::out, ps::in, ps::out) is semidet.
 
     % Parse a float literal matching [-][0-9]+[.][0-9]+([Ee][-][0-9]+)?
     % followed by any whitespace.  The float_literal_as_string version simply
@@ -329,7 +322,9 @@
 :- implementation.
 
 :- import_module array.
+:- import_module int.
 :- import_module mutvar.
+:- import_module string.
 
     % The parser "state" is just the offset into the input string.
     %
@@ -524,8 +519,7 @@
 
 %-----------------------------------------------------------------------------%
 
-:- pred match_string(string::in, src::in,
-        ps::in, ps::out) is semidet.
+:- pred match_string(string::in, src::in, ps::in, ps::out) is semidet.
 
 match_string(MatchStr, Src, PS, PS + N) :-
     promise_pure (
@@ -546,8 +540,7 @@
         true
     ).
 
-:- pred imatch_string(string::in, src::in,
-        ps::in, ps::out) is semidet.
+:- pred imatch_string(string::in, src::in, ps::in, ps::out) is semidet.
 
 imatch_string(MatchStr, Src, PS, PS + N) :-
     promise_pure (
@@ -600,9 +593,8 @@
     zero_or_more_2(P, Src, [], RevResult, !PS),
     Result = list.reverse(RevResult).
 
-
-    % We use an auxiliary predicate to make this tail recursive.  This can
-    % be an issue with long sequences.
+    % We use an auxiliary predicate to make this tail recursive.
+    % This can be an issue with long sequences.
     %
 :- pred zero_or_more_2(parser(T)::in(parser), src::in,
         list(T)::in, list(T)::out, ps::in, ps::out) is semidet.
@@ -621,7 +613,6 @@
     zero_or_more_2(P, Src, [], RevResult, !S, !PS),
     Result = list.reverse(RevResult).
 
-
 :- pred zero_or_more_2(parser_with_state(T, S)::in(parser_with_state), src::in,
         list(T)::in, list(T)::out, S::in, S::out, ps::in, ps::out) is semidet.
 
@@ -664,7 +655,8 @@
 %-----------------------------------------------------------------------------%
 
 separated_list(Separator, P, Src, Result, !PS) :-
-    CommaP = ( pred(CommaPSrc::in, CommaPX::out, !.PS::in, !:PS::out)
+    CommaP = (
+        pred(CommaPSrc::in, CommaPX::out, !.PS::in, !:PS::out)
             is semidet :-
         punct(Separator, CommaPSrc, _, !PS),
         P(CommaPSrc, CommaPX, !PS)
@@ -676,9 +668,9 @@
 %-----------------------------------------------------------------------------%
 
 separated_list(Separator, P, Src, Result, !S, !PS) :-
-    CommaP = ( pred(CommaPSrc::in, CommaPX::out,
-            !.S::in, !:S::out, !.PS::in, !:PS::out)
-            is semidet :-
+    CommaP = (
+        pred(CommaPSrc::in, CommaPX::out, !.S::in, !:S::out,
+            !.PS::in, !:PS::out) is semidet :-
         punct(Separator, CommaPSrc, _, !PS),
         P(CommaPSrc, CommaPX, !S, !PS)
     ),
@@ -798,8 +790,7 @@
 
 %-----------------------------------------------------------------------------%
 
-:- pred digits(int::in, src::in, unit::out,
-        ps::in, ps::out) is semidet.
+:- pred digits(int::in, src::in, unit::out, ps::in, ps::out) is semidet.
 
 digits(Base, Src, unit, !PS) :-
     next_char(Src, C, !PS),
@@ -807,9 +798,7 @@
     D < Base,
     digits_2(Base, Src, _, !PS).
 
-
-:- pred digits_2(int::in, src::in, unit::out,
-        ps::in, ps::out) is semidet.
+:- pred digits_2(int::in, src::in, unit::out, ps::in, ps::out) is semidet.
 
 digits_2(Base, Src, unit, !PS) :-
     ( if
Index: library/pretty_printer.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/pretty_printer.m,v
retrieving revision 1.16
diff -u -b -r1.16 pretty_printer.m
--- library/pretty_printer.m	20 Dec 2010 07:47:47 -0000	1.16
+++ library/pretty_printer.m	30 Dec 2010 08:16:52 -0000
@@ -48,7 +48,6 @@
 :- import_module list.
 :- import_module io.
 :- import_module stream.
-:- import_module string.
 :- import_module type_desc.
 :- import_module univ.
 
@@ -246,11 +245,11 @@
 :- import_module bool.
 :- import_module char.                  % For char_to_doc.
 :- import_module deconstruct.
-:- import_module exception.
 :- import_module float.                 % For float_to_doc.
 :- import_module int.
 :- import_module map.
 :- import_module ops.
+:- import_module string.
 :- import_module term_io.
 :- import_module tree234.               % For tree234_to_doc.
 
Index: library/stream.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/stream.m,v
retrieving revision 1.9
diff -u -b -r1.9 stream.m
--- library/stream.m	30 May 2007 02:47:08 -0000	1.9
+++ library/stream.m	30 Dec 2010 08:06:46 -0000
@@ -23,13 +23,12 @@
 :- import_module bool.
 :- import_module char.
 :- import_module list.
-:- import_module string.
 
 :- include_module string_writer.
 
 %-----------------------------------------------------------------------------%
 % 
-% Types used by streams
+% Types used by streams.
 %
 
 :- type stream.name == string.
@@ -61,7 +60,7 @@
 
 %-----------------------------------------------------------------------------%
 %
-% Stream errors
+% Stream errors.
 %
 
 :- typeclass stream.error(Error) where
@@ -75,7 +74,7 @@
 
 %-----------------------------------------------------------------------------%
 %
-% Streams
+% Streams.
 %
 
     % A stream consists of a handle type and a state type.
@@ -92,7 +91,7 @@
 
 %-----------------------------------------------------------------------------%
 %
-% Input streams
+% Input streams.
 %
 
     % An input stream is a source of data.
@@ -172,7 +171,7 @@
 
 %-----------------------------------------------------------------------------%
 %
-% Output streams
+% Output streams.
 %
    
     % An output stream is a destination for data.
@@ -205,7 +204,7 @@
 
 %-----------------------------------------------------------------------------%
 %
-% Duplex streams
+% Duplex streams.
 %
 
     % A duplex stream is a stream that can act as both a source
@@ -218,7 +217,7 @@
 
 %----------------------------------------------------------------------------%
 %
-% Putback streams
+% Putback streams.
 %
 
     % A putback stream is an input stream that allows data to be
@@ -243,7 +242,7 @@
 
 %----------------------------------------------------------------------------%
 %
-% Seekable streams
+% Seekable streams.
 %
 
     % stream.whence denotes the base for a seek operation.
@@ -268,7 +267,7 @@
 
 %----------------------------------------------------------------------------%
 %
-% Line oriented streams
+% Line oriented streams.
 %
 
     % A line oriented stream is a stream that keeps track of line numbers.
@@ -287,7 +286,7 @@
 
 %-----------------------------------------------------------------------------%
 %
-% Generic folds over input streams
+% Generic folds over input streams.
 %
 
     % Applies the given closure to each Unit read from the input stream
@@ -341,7 +340,7 @@
 
 %-----------------------------------------------------------------------------%
 %
-% Misc. operations on input streams
+% Misc. operations on input streams.
 %
 
     % Discard all the whitespace from the specified stream.
@@ -352,7 +351,7 @@
 
 %-----------------------------------------------------------------------------%
 %
-% Misc. operations on output streams
+% Misc. operations on output streams.
 %
 
     % put_list(Stream, Write, Sep, List, !State).
@@ -381,7 +380,7 @@
 
 %-----------------------------------------------------------------------------%
 %
-% Folds over input streams
+% Folds over input streams.
 %
 
 stream.input_stream_fold(Stream, Pred, T0, Res, !S) :-
Index: library/table_builtin.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/table_builtin.m,v
retrieving revision 1.64
diff -u -b -r1.64 table_builtin.m
--- library/table_builtin.m	27 Feb 2008 08:35:17 -0000	1.64
+++ library/table_builtin.m	30 Dec 2010 08:07:28 -0000
@@ -121,12 +121,11 @@
 
 :- implementation.
 
-:- import_module int.
-
-    % This type represents the interior pointers of both call
-    % tables and answer tables.
+    % This type represents the interior pointers of both call tables
+    % and answer tables.
     %
-:- type ml_trie_node --->   ml_trie_node(c_pointer).
+:- type ml_trie_node
+    --->   ml_trie_node(c_pointer).
 :- pragma foreign_type("C", ml_trie_node, "MR_TrieNode",
     [can_pass_as_mercury_type]).
 :- pragma foreign_type(il,  ml_trie_node, "class [mscorlib]System.Object").
Index: library/type_desc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/type_desc.m,v
retrieving revision 1.69
diff -u -b -r1.69 type_desc.m
--- library/type_desc.m	15 Oct 2010 05:54:48 -0000	1.69
+++ library/type_desc.m	30 Dec 2010 08:05:28 -0000
@@ -236,8 +236,6 @@
 :- import_module require.
 :- import_module string.
 
-:- use_module    erlang_rtti_implementation. 
-
 :- pragma foreign_decl("C", "
 #include ""mercury_heap.h"" /* for MR_incr_hp_msg() etc. */
 #include ""mercury_misc.h"" /* for MR_fatal_error() */
Index: library/varset.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/varset.m,v
retrieving revision 1.84
diff -u -b -r1.84 varset.m
--- library/varset.m	16 Sep 2009 02:32:56 -0000	1.84
+++ library/varset.m	30 Dec 2010 08:05:09 -0000
@@ -272,7 +272,6 @@
 
 :- implementation.
 
-:- import_module bool.
 :- import_module int.
 :- import_module pair.
 :- import_module require.
Index: library/version_bitmap.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/version_bitmap.m,v
retrieving revision 1.8
diff -u -b -r1.8 version_bitmap.m
--- library/version_bitmap.m	30 Jul 2010 13:16:47 -0000	1.8
+++ library/version_bitmap.m	30 Dec 2010 08:16:04 -0000
@@ -115,7 +115,6 @@
 
 :- import_module exception.
 :- import_module int.
-:- import_module require.
 :- import_module version_array.
 
     % A version_bitmap is represented as an array of ints where each int stores
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/standalone_c
cvs diff: Diffing samples/concurrency
cvs diff: Diffing samples/concurrency/dining_philosophers
cvs diff: Diffing samples/concurrency/midimon
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/java_interface
cvs diff: Diffing samples/java_interface/java_calls_mercury
cvs diff: Diffing samples/java_interface/mercury_calls_java
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/solver_types
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing ssdb
cvs diff: Diffing tests
cvs diff: Diffing tests/analysis
cvs diff: Diffing tests/analysis/ctgc
cvs diff: Diffing tests/analysis/excp
cvs diff: Diffing tests/analysis/ext
cvs diff: Diffing tests/analysis/sharing
cvs diff: Diffing tests/analysis/table
cvs diff: Diffing tests/analysis/trail
cvs diff: Diffing tests/analysis/unused_args
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/stm
cvs diff: Diffing tests/stm/orig
cvs diff: Diffing tests/stm/orig/stm-compiler
cvs diff: Diffing tests/stm/orig/stm-compiler/test1
cvs diff: Diffing tests/stm/orig/stm-compiler/test10
cvs diff: Diffing tests/stm/orig/stm-compiler/test2
cvs diff: Diffing tests/stm/orig/stm-compiler/test3
cvs diff: Diffing tests/stm/orig/stm-compiler/test4
cvs diff: Diffing tests/stm/orig/stm-compiler/test5
cvs diff: Diffing tests/stm/orig/stm-compiler/test6
cvs diff: Diffing tests/stm/orig/stm-compiler/test7
cvs diff: Diffing tests/stm/orig/stm-compiler/test8
cvs diff: Diffing tests/stm/orig/stm-compiler/test9
cvs diff: Diffing tests/stm/orig/stm-compiler-par
cvs diff: Diffing tests/stm/orig/stm-compiler-par/bm1
cvs diff: Diffing tests/stm/orig/stm-compiler-par/bm2
cvs diff: Diffing tests/stm/orig/stm-compiler-par/stmqueue
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test1
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test10
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test11
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test2
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test3
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test4
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test5
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test6
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test7
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test8
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test9
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test1
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test2
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test3
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test4
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test5
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test6
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test7
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test8
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test9
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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