[m-rev.] diff: hlds_pred.m and sw=4

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Aug 12 11:59:36 AEST 2005


compiler/hlds_pred.m:
	Convert this module to four-space indentation to reduce the number
	of bad line breaks. Fix some departures from our coding standards.

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/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.168
diff -u -b -r1.168 hlds_pred.m
--- compiler/hlds_pred.m	8 Aug 2005 02:33:09 -0000	1.168
+++ compiler/hlds_pred.m	11 Aug 2005 14:31:17 -0000
@@ -1,4 +1,6 @@
 %-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
 % Copyright (C) 1996-2005 The University of Melbourne.
 % This file may only be copied under the terms of the GNU General
 % Public License - see the file COPYING in the Mercury distribution.
@@ -80,7 +82,7 @@
 	% use an integer in their place. However, you can convert between
 	% integers and pred_ids/proc_ids with the following predicates and
 	% functions.
-
+    %
 :- func shroud_pred_id(pred_id) = shrouded_pred_id.
 :- func shroud_proc_id(proc_id) = shrouded_proc_id.
 :- func shroud_pred_proc_id(pred_proc_id) = shrouded_pred_proc_id.
@@ -101,14 +103,14 @@
 
 	% Return the id of the first predicate in a module, and of the first
 	% procedure in a predicate.
-
+    %
 :- func hlds_pred__initial_pred_id = pred_id.
 :- func hlds_pred__initial_proc_id = proc_id.
 
-        % Return an invalid predicate or procedure id. These are intended
-	% to be used to initialize the relevant fields in in call(...) goals
-	% before we do type- and mode-checks, or when those check find that
-	% there was no predicate matching the call.
+    % Return an invalid predicate or procedure id. These are intended to be
+    % used to initialize the relevant fields in in call(...) goals before
+    % we do type- and mode-checks, or when those check find that there was
+    % no predicate matching the call.
 	%
 :- func invalid_pred_id = pred_id.
 :- func invalid_proc_id = proc_id.
@@ -144,6 +146,7 @@
 	% The rtti_proc_label type holds all the information about a procedure
 	% that we need to compute the entry label for that procedure
 	% in the target language (the llds__code_addr or mlds__code_addr).
+
 :- type rtti_proc_label --->
 	rtti_proc_label(
 		pred_or_func		::	pred_or_func,
@@ -154,8 +157,7 @@
 		proc_arg_types		::	list(type),
 		pred_id			::	pred_id,
 		proc_id			::	proc_id,
-		proc_headvars		::	assoc_list(prog_var,
-							prog_var_name),
+        proc_headvars           ::  assoc_list(prog_var, prog_var_name),
 		proc_arg_modes		::	list(arg_mode),
 		proc_interface_detism	::	determinism,
 
@@ -432,14 +434,9 @@
 	injection__forward_search(VarMaps ^ tci_varmap, Constraint, ProgVar).
 
 rtti_varmaps_var_info(VarMaps, Var, VarInfo) :-
-	(
-		map__search(VarMaps ^ ti_type_map, Var, Type)
-	->
+    ( map__search(VarMaps ^ ti_type_map, Var, Type) ->
 		VarInfo = type_info_var(Type)
-	;
-		injection__reverse_search(VarMaps ^ tci_varmap, Constraint,
-			Var)
-	->
+    ; injection__reverse_search(VarMaps ^ tci_varmap, Constraint, Var) ->
 		VarInfo = typeclass_info_var(Constraint)
 	;
 		VarInfo = non_rtti_var
@@ -461,16 +458,11 @@
 	rtti_varmaps::in, rtti_varmaps::out) is det.
 
 maybe_check_type_info_var(type_info(Var), TVar, !VarMaps) :-
-	(
-		map__search(!.VarMaps ^ ti_type_map, Var, Type)
-	->
-		(
-			Type = term__variable(TVar)
-		->
+    ( map__search(!.VarMaps ^ ti_type_map, Var, Type) ->
+        ( Type = term__variable(TVar) ->
 			true
 		;
-			unexpected(this_file,
-				"inconsistent info in rtti_varmaps")
+            unexpected(this_file, "inconsistent info in rtti_varmaps")
 		)
 	;
 		unexpected(this_file, "missing info in rtti_varmaps")
@@ -527,17 +519,13 @@
 	typeclass_info_varmap::in, typeclass_info_varmap::out) is det.
 
 apply_substitutions_to_typeclass_var_map(TRenaming, TSubst, Subst, !VarMap) :-
-	
 		% Note that the transformation on keys must be done before
 		% the transformation on values.  If the values are transformed
 		% first then the invariants on the data structure may be
 		% violated.
-		%
 	injection.map_keys(
-		apply_substitutions_to_tc_varmap_keys(TRenaming, TSubst),
-		!VarMap),
-	injection.map_values(apply_renaming_to_tc_varmap_values(Subst),
-		!VarMap).
+        apply_substitutions_to_tc_varmap_keys(TRenaming, TSubst), !VarMap),
+    injection.map_values(apply_renaming_to_tc_varmap_values(Subst), !VarMap).
 
 :- pred apply_substitutions_to_tc_varmap_keys(tsubst::in, tsubst::in,
 	prog_var::in, prog_constraint::in, prog_constraint::out) is det.
@@ -598,7 +586,6 @@
 		NewTVarType1 = term__variable(TVar)
 	),
 	term__apply_rec_substitution(NewTVarType1, TSubst, NewTVarType),
-
 	(
 		% If the tvar is still a variable, insert it into the
 		% map with the new var.
@@ -645,13 +632,10 @@
 	VarMapsB = rtti_varmaps(TCImapB, TImapB, TypeMapB),
 
 		% Prefer VarMapsB for this information.
-		%
 	injection__overlay(TCImapA, TCImapB, TCImap),
 	map__overlay(TImapA, TImapB, TImap),
 
-		% On the other hand, we insist that this information is
-		% consistent.
-		%
+        % On the other hand, we insist that this information is consistent.
 	map__merge(TypeMapA, TypeMapB, TypeMap),
 
 	VarMaps = rtti_varmaps(TCImap, TImap, TypeMap).
@@ -672,31 +656,22 @@
 		varset			:: prog_varset,
 						% variable names
 		explicit_vartypes	:: vartypes,
-						% variable types from
-						% explicit
-						% qualifications
+                                % variable types from explicit qualifications
 		tvar_name_map		:: tvar_name_map,
-						% map from variable
-						% name to type variable
-						% for the type
-						% variables occurring
-						% in the argument
-						% types. This is used
-						% to process explicit
-						% type qualifications.
+                                % map from variable name to type variable
+                                % for the type variables occurring in the
+                                % argument types. This is used to process
+                                % explicit type qualifications.
 		vartypes		:: vartypes,
-						% variable types
-						% inferred by
-						% typecheck.m.
+                                % variable types inferred by typecheck.m.
 		headvars		:: list(prog_var),
 						% head vars
 		clauses_rep		:: clauses_rep,
-						% the following field is
-						% computed by polymorphism.m
+                                % the following field is computed by
+                                % polymorphism.m
 		clauses_rtti_varmaps	:: rtti_varmaps,
 		have_foreign_clauses	:: bool
-						% do we have foreign
-						% language clauses?
+                                % do we have foreign language clauses?
 	).
 
 :- pred clauses_info_init(int::in, clauses_info::out) is det.
@@ -788,9 +763,8 @@
 :- type clause --->
 	clause(
 		applicable_procs	:: list(proc_id),
-					% modes for which this clause applies
-					% (empty list means it applies to all
-					% modes)
+                            % modes for which this clause applies (empty list
+                            % means it applies to all modes)
 		clause_body		:: hlds_goal,
 		clause_lang		:: implementation_language,
 		clause_context		:: prog_context
@@ -839,7 +813,10 @@
 :- type clauses_rep
 	--->	rev(list(clause))
 	;	forw(list(clause))
-	;	both(rev :: list(clause), forw :: list(clause)).
+    ;       both(
+                rev :: list(clause),
+                forw :: list(clause)
+            ).
 
 clause_list_is_empty(ClausesRep) = IsEmpty :-
 	(
@@ -935,10 +912,12 @@
 
 :- type liveness_info	==	set(prog_var).	% The live variables
 
-:- type liveness	--->	live
+:- type liveness
+    --->    live
 			;	dead.
 
-:- type arg_info	--->	arg_info(
+:- type arg_info   
+    --->    arg_info(
 					arg_loc,	% stored location
 					arg_mode	% mode of top functor
 				).
@@ -969,7 +948,8 @@
 	%	  mode `top_out', it is mapped to an MLDS return value.
 	% top_unused arguments are not passed at all.
 	%
-:- type arg_mode	--->	top_in
+:- type arg_mode
+    --->    top_in
 			;	top_out
 			;	top_unused.
 
@@ -983,47 +963,42 @@
 	%
 :- type import_status
 	--->	external(import_status)
-				% Declared `:- external'.
-				% This means that the implementation
-				% for this procedure will be provided
-				% by some external source, rather than
-				% via Mercury clauses (including
-				% `pragma foreign_code' clauses).
-				% It can be through the use of another
-				% language, or it could be through some
-				% other method we haven't thought of yet.
+                % Declared `:- external'. This means that the implementation
+                % for this procedure will be provided by some external source,
+                % rather than via Mercury clauses (including `pragma
+                % foreign_code' clauses). It can be through the use of another
+                % language, or it could be through some other method we haven't
+                % thought of yet.
 	;	imported(import_locn)
-				% defined in the interface of some other module
-	;	opt_imported	% defined in the optimization
-				% interface of another module
-	;	abstract_imported % describes a type with only an abstract
-				% declaration imported, maybe with the body
-				% of the type imported from a .opt file
-	;	pseudo_imported % this is used for entities that are defined
-				% in the interface of some other module but
-				% for which we may generate some code in
-				% this module - in particular, this is used
-				% for unification predicates (see comments in
-				% unify_proc.m)
-	;	exported	% defined in the interface of this module
-	;	opt_exported	% a local item for which the import-status
-				% has been changed due to its presence in
-				% the .opt files
-				% (intermod__adjust_pred_import_status)
-	;	abstract_exported % describes a type with only an abstract
-				% declaration exported
-	;	pseudo_exported % the converse of pseudo_imported
-				% this means that only the (in, in) mode
-				% of a unification is exported
+                % Defined in the interface of some other module.
+    ;       opt_imported
+                % Defined in the optimization interface of another module.
+    ;       abstract_imported
+                % Describes a type with only an abstract declaration imported,
+                % maybe with the body of the type imported from a .opt file.
+    ;       pseudo_imported
+                % This is used for entities that are defined in the interface
+                % of some other module but for which we may generate some code
+                % in this module - in particular, this is used for unification
+                % predicates (see comments in unify_proc.m).
+    ;       exported
+                % Defined in the interface of this module.
+    ;       opt_exported
+                % A local item for which the import-status has been changed
+                % due to its presence in the .opt files
+                % (intermod__adjust_pred_import_status).
+    ;       abstract_exported
+                % Describes a type with only an abstract declaration exported.
+    ;       pseudo_exported
+                % The converse of pseudo_imported; this means that only the
+                % (in, in) mode of a unification is exported.
 	;	exported_to_submodules
-				% defined in the implementation of this module,
-				% and thus in a sense local,
-				% but the module contains sub-modules,
-				% so the entity needs to be exported
-				% to those sub-modules
-	;	local.		% defined in the implementation of this module,
-				% and the module does not contain any
-				% sub-modules.
+                % Defined in the implementation of this module, and thus in
+                % a sense local, but the module contains sub-modules, so the
+                % entity needs to be exported to those sub-modules.
+    ;       local.
+                % Defined in the implementation of this module, and the module
+                % does not contain any sub-modules.
 
 	% Returns yes if the status indicates that the item was
 	% in any way exported -- that is, if it could be used
@@ -1050,48 +1025,49 @@
 	%
 :- pred status_defined_in_this_module(import_status::in, bool::out) is det.
 
-	% Are calls from a predicate with the given import_status
-	% always fully qualified. For calls occurring in `.opt' files
-	% this will return `is_fully_qualified', otherwise
-	% `may_be_partially_qualified'.
+    % Are calls from a predicate with the given import_status always fully
+    % qualified. For calls occurring in `.opt' files this will return
+    % `is_fully_qualified', otherwise `may_be_partially_qualified'.
+    %
 :- func calls_are_fully_qualified(pred_markers) = is_fully_qualified.
 
-	% Predicates can be marked with various boolean flags, called
-	% "markers".
+    % Predicates can be marked with various boolean flags, called "markers".
 
 	% An abstract set of markers.
 :- type pred_markers.
 
 :- type marker
-	--->	stub		% The predicate has no clauses.
-				% typecheck.m will generate a body for
-				% the predicate which just throws an exception.
-				% This marker is used to tell purity analysis
-				% and determinism analysis not to issue warnings
-				% for these predicates.
-	;	infer_type	% Requests type inference for the predicate
+    --->    stub        % The predicate has no clauses. typecheck.m will
+                        % generate a body for the predicate which just throws
+                        % an exception. This marker is used to tell purity
+                        % analysis and determinism analysis not to issue
+                        % warnings for these predicates.
+
+    ;       infer_type  % Requests type inference for the predicate.
 				% These markers are inserted by make_hlds
 				% for undeclared predicates.
-	;	infer_modes	% Requests mode inference for the predicate
+
+    ;       infer_modes % Requests mode inference for the predicate.
 				% These markers are inserted by make_hlds
 				% for undeclared predicates.
+
 	;	obsolete	% Requests warnings if this predicate is used.
 				% Used for pragma(obsolete).
+
 	;	inline		% Requests that this predicate be inlined.
 				% Used for pragma(inline).
-	;	no_inline	% Requests that this be predicate not be
-				% inlined.
-				% Used for pragma(no_inline).
-				% Conflicts with `inline' marker.
+
+    ;       no_inline   % Requests that this be predicate not be inlined.
+                        % Used for pragma(no_inline). Conflicts with `inline'
+                        % marker.
 
 		% The default flags for Aditi predicates are
 		% aditi, dnf, supp_magic, psn and memo.
 
-	;	dnf		% Requests that this predicate be transformed
-				% into disjunctive normal form.
+    ;       dnf         % Requests that this predicate be transformed into
+                        % disjunctive normal form.
 
-	;	aditi		% Generate bottom-up Aditi-RL for this
-				% predicate.
+    ;       aditi       % Generate bottom-up Aditi-RL for this predicate.
 
 	;	base_relation	% This predicate is an Aditi base relation.
 
@@ -1100,23 +1076,19 @@
 	;	psn		% Use predicate semi-naive evaluation of this
 				% Aditi predicate.
 
-	;	aditi_memo	% Requests that this Aditi predicate be
-				% evaluated using memoing. This has no
-				% relation to eval_method field of the
-				% pred_info, which is ignored for Aditi
+    ;       aditi_memo  % Requests that this Aditi predicate be evaluated using
+                        % memoing. This has no relation to eval_method field
+                        % of the pred_info, which is ignored for Aditi
 				% predicates.
-	;	aditi_no_memo	% Ensure that this Aditi predicate
-				% is not memoed.
+    ;       aditi_no_memo % Ensure that this Aditi predicate is not memoed.
+
+    % `context' and `supp_magic' are mutually exclusive. One of them must be
+    % performed on all Aditi predicates. `supp_magic' is the default.
 
-			% `context' and `supp_magic' are mutually
-			% exclusive. One of them must be performed
-			% on all Aditi predicates. `supp_magic'
-			% is the default
-
-	;	supp_magic	% Perform the supplementary magic sets
-				% transformation on this predicate. See magic.m
-	;	context		% Perform the context transformation on
-				% the predicate. See context.m
+    ;   supp_magic      % Perform the supplementary magic sets transformation
+                        % on this predicate. See magic.m
+    ;   context         % Perform the context transformation on the predicate.
+                        % See context.m
 
 	;	generate_inline % Used for small Aditi predicates which
 				% project a relation to be used as input to a
@@ -1128,75 +1100,67 @@
 				% where it is introduced in
 				% magic_util__create_closure.
 
-	;	class_method	% Requests that this predicate be transformed
-				% into the appropriate call to a class method
+    ;   class_method    % Requests that this predicate be transformed into
+                        % the appropriate call to a class method.
+
 	;	class_instance_method
-				% This predicate was automatically
-				% generated for the implementation of
-				% a class method for an instance.
+                        % This predicate was automatically generated for the
+                        % implementation of a class method for an instance.
+
 	;	named_class_instance_method
-				% This predicate was automatically
-				% generated for the implementation of
-				% a class method for an instance,
-				% and the instance was defined using the
-				% named syntax (e.g. "pred(...) is ...")
-				% rather than the clause syntax.
-				% (For such predicates, we output slightly
+                        % This predicate was automatically generated for the
+                        % implementation of a class method for an instance,
+                        % and the instance was defined using the named syntax
+                        % (e.g. "pred(...) is ...") rather than the clause
+                        % syntax. (For such predicates, we output slightly
 				% different error messages.)
 
-	;	(impure)	% Requests that no transformation that would
-				% be inappropriate for impure code be
-				% performed on calls to this predicate.  This
-				% includes reordering calls to it relative to
-				% other goals (in both conjunctions and
-				% disjunctions), and removing redundant calls
+    ;   (impure)        % Requests that no transformation that would be
+                        % inappropriate for impure code be performed on calls
+                        % to this predicate. This includes reordering calls
+                        % to it relative to other goals (in both conjunctions
+                        % and disjunctions), and removing redundant calls
 				% to it.
-	;	(semipure)	% Requests that no transformation that would
-				% be inappropriate for semipure code be
-				% performed on calls to this predicate.  This
-				% includes removing redundant calls to it on
-				% different sides of an impure goal.
-	;	promised_pure	% Requests that calls to this predicate be
-				% transformed as usual, despite any impure
-				% or semipure markers present.
+
+    ;   (semipure)      % Requests that no transformation that would be
+                        % inappropriate for semipure code be performed on
+                        % calls to this predicate. This includes removing
+                        % redundant calls to it on different sides of an
+                        % impure goal.
+    ;   promised_pure   % Requests that calls to this predicate be transformed
+                        % as usual, despite any impure or semipure markers
+                        % present.
 	;	promised_semipure
-				% Requests that calls to this predicate be
-				% treated as semipure, despite any impure
-				% calls in the body.
-
-				% The terminates and does_not_terminate
-				% pragmas are kept as markers to ensure
-				% that conflicting declarations are not
-				% made by the user.  Otherwise, the
-				% information could be added to the
-				% ProcInfos directly.
-	;	terminates	% The user guarantees that this predicate
-				% will terminate for all (finite?) input
+                        % Requests that calls to this predicate be treated as
+                        % semipure, despite any impure calls in the body.
+
+    % The terminates and does_not_terminate pragmas are kept as markers
+    % to ensure that conflicting declarations are not made by the user.
+    % Otherwise, the information could be added to the ProcInfos directly.
+
+    ;   terminates      % The user guarantees that this predicate will
+                        % terminate for all (finite?) input.
 	;	does_not_terminate
-				% States that this predicate does not
-				% terminate.  This is useful for pragma
-				% foreign_code, which the compiler assumes to be
-				% terminating.
+                        % States that this predicate does not terminate.
+                        % This is useful for pragma foreign_code, which the
+                        % compiler assumes to be terminating.
 	;	check_termination
 				% The user requires the compiler to guarantee
-				% the termination of this predicate.
-				% If the compiler cannot guarantee termination
-				% then it must give an error message.
+                        % the termination of this predicate. If the compiler
+                        % cannot guarantee termination then it must give an
+                        % error message.
 
 	;	calls_are_fully_qualified
-				% All calls in this predicate are
-				% fully qualified. This occurs for
-				% predicates read from `.opt' files
+                        % All calls in this predicate are fully qualified.
+                        % This occurs for predicates read from `.opt' files
 				% and compiler-generated predicates.
-	;	mode_check_clauses
-				% Each clause of the predicate should be
-				% modechecked separately. Used for predicates
-				% defined by lots of clauses (usually facts)
-				% for which the compiler's quadratic behavior
-				% during mode checking (in instmap__merge and
-				% inst_match.bound_inst_list_contains_instname)
-				% would be unacceptable.
-	.
+    ;   mode_check_clauses.
+                        % Each clause of the predicate should be modechecked
+                        % separately. Used for predicates defined by lots of
+                        % clauses (usually facts) for which the compiler's
+                        % quadratic behavior during mode checking (in
+                        % inst_match.bound_inst_list_contains_instname and
+                        % instmap__merge) would be unacceptable.
 
 	% An abstract set of attributes.
 :- type pred_attributes.
@@ -1217,42 +1181,36 @@
 				% specializations of the original predicate.
 		)
 	;	higher_order_type_specialization(
-			int	% The procedure number of the original
-				% procedure.
+                int % The procedure number of the original procedure.
 		)
 	;	type_specialization(
 			assoc_list(int, type)
-				% The substitution from type variables
-				% (represented by the integers) to types
-				% (represented by the terms).
+                    % The substitution from type variables (represented by
+                    % the integers) to types (represented by the terms).
 		)
 	;	unused_argument_elimination(
-			list(int)
-				% The list of eliminated argument numbers.
+                list(int) % The list of eliminated argument numbers.
 		)
 	;	accumulator(
 			list(int)
-				% The list of the numbers of the variables
-				% in the original predicate interface that have
-				% been converted to accumulators.
+                    % The list of the numbers of the variables in the original
+                    % predicate interface that have been converted to
+                    % accumulators.
 		)
 	;	loop_invariant(
-			int	% The procedure number of the original
-				% procedure.
+                int % The procedure number of the original procedure.
 		)
 	;	tuple(
-			int	% The procedure number of the original
-				% procedure.
+                int % The procedure number of the original procedure.
 		)
 	;	untuple(
-			int	% The procedure number of the original
-				% procedure.
+                int % The procedure number of the original procedure.
 		)
 	;	table_generator
 	;	dnf(
-			int	% This predicate was originally part of a
-				% predicate transformed into disjunctive normal
-				% form; this integers gives the part number.
+                int % This predicate was originally part of a predicate
+                    % transformed into disjunctive normal form; this integer
+                    % gives the part number.
 		).
 
 :- type pred_creation
@@ -1497,22 +1455,23 @@
 	% procedure_is_exported includes all modes of exported or
 	% exported_to_submodules predicates, plus the in-in mode
 	% for pseudo_exported unification predicates.
+    %
 :- pred procedure_is_exported(module_info::in, pred_info::in, proc_id::in)
 	is semidet.
 
 	% Set the import_status of the predicate to `imported'.
 	% This is used for `:- external(foo/2).' declarations.
-
+    %
 :- pred pred_info_mark_as_external(pred_info::in, pred_info::out) is det.
 
 	% Do we have a clause goal type?
 	% (this means either "clauses" or "clauses_and_pragmas")
-
+    %
 :- pred pred_info_clause_goal_type(pred_info::in) is semidet.
 
 	% Do we have a pragma goal type?
 	% (this means either "pragmas" or "clauses_and_pragmas")
-
+    %
 :- pred pred_info_pragma_goal_type(pred_info::in) is semidet.
 
 :- pred pred_info_update_goal_type(goal_type::in,
@@ -1522,12 +1481,12 @@
 	% for this predicate. Note that the compiler may decide
 	% to inline a predicate even if there was no pragma inline(...)
 	% declaration for that predicate.
-
+    %
 :- pred pred_info_requested_inlining(pred_info::in) is semidet.
 
 	% Succeeds if there was a `:- pragma no_inline(...)' declaration
 	% for this predicate.
-
+    %
 :- pred pred_info_requested_no_inlining(pred_info::in) is semidet.
 
 :- pred pred_info_get_purity(pred_info::in, purity::out) is det.
@@ -1542,38 +1501,48 @@
 
 :- pred pred_info_get_call_id(pred_info::in, simple_call_id::out) is det.
 
-	% create an empty set of markers
+    % Create an empty set of markers.
+    %
 :- pred init_markers(pred_markers::out) is det.
 
-	% check if a particular is in the set
+    % Check if a particular is in the set.
+    %
 :- pred check_marker(pred_markers::in, marker::in) is semidet.
 
-	% add a marker to the set
+    % Add a marker to the set.
+    %
 :- pred add_marker(marker::in, pred_markers::in, pred_markers::out) is det.
 
-	% remove a marker from the set
+    % Remove a marker from the set.
+    %
 :- pred remove_marker(marker::in, pred_markers::in, pred_markers::out) is det.
 
-	% convert the set to a list
+    % Convert the set to a list.
+    %
 :- pred markers_to_marker_list(pred_markers::in, list(marker)::out) is det.
 
 :- pred marker_list_to_markers(list(marker)::in, pred_markers::out) is det.
 
-	% create an empty set of attributes
+    % Create an empty set of attributes.
+    %
 :- pred init_attributes(pred_attributes::out) is det.
 
-	% check if a particular is in the set
+    % Check if a particular is in the set.
+    %
 :- pred check_attribute(pred_attributes::in, attribute::in) is semidet.
 
-	% add a attribute to the set
+    % Add a attribute to the set.
+    %
 :- pred add_attribute(attribute::in, pred_attributes::in, pred_attributes::out)
 	is det.
 
-	% remove a attribute from the set
+    % Remove a attribute from the set.
+    %
 :- pred remove_attribute(attribute::in,
 	pred_attributes::in, pred_attributes::out) is det.
 
-	% convert the set to a list
+    % Convert the set to a list.
+    %
 :- pred attributes_to_attribute_list(pred_attributes::in,
 	list(attribute)::out) is det.
 
@@ -1680,104 +1649,104 @@
  :- type pred_info --->
  	pred_info(
  		module_name	:: module_name,
- 				% module in which pred occurs
+                            % Module in which pred occurs.
+
  		name		:: string,
- 				% predicate name
+                            % Predicate name.
+
  		orig_arity	:: arity,
- 				% the arity of the pred
- 				% (*not* counting any inserted
- 				% type_info arguments)
+                            % The arity of the pred (*not* counting any
+                            % inserted type_info arguments)
+
  		is_pred_or_func	:: pred_or_func,
- 				% whether this "predicate" was really
- 				% a predicate or a function
+                            % Whether this "predicate" was really
+                            % a predicate or a function.
+
  		context		:: prog_context,
- 				% the location (line #) of the :- pred decl.
+                            % The location (line #) of the :- pred decl.
+
  		pred_origin	:: pred_origin,
- 				% where did the predicate come from.
+                            % Where did the predicate come from.
 
  		import_status	:: import_status,
+
  		goal_type	:: goal_type,
- 				% whether the goals seen so far, if any,
- 				% for this predicate are clauses or
- 				% pragma foreign_code(...) declarations
+                            % Whether the goals seen so far, if any, for this
+                            % predicate are clauses or foreign_code(...)
+                            % pragmas.
 
  		markers		:: pred_markers,
- 				% various boolean flags
+                            % Various boolean flags.
+
  		attributes	:: pred_attributes,
- 				% various attributes
+                            % Various attributes.
 
  		arg_types	:: list(type),
- 				% argument types
+                            % Argument types.
+
  		decl_typevarset	:: tvarset,
- 				% names of type vars
- 				% in the predicate's type decl
+                            % Names of type vars in the predicate's type decl.
+
  		typevarset	:: tvarset,
- 				% names of type vars
- 				% in the predicate's type decl
- 				% or in the variable type assignments
+                            % Names of type vars in the predicate's type decl
+                            % or in the variable type assignments.
 
  		exist_quant_tvars :: existq_tvars,
- 				% the set of existentially quantified
- 				% type variables in the predicate's
- 				% type decl
+                            % The set of existentially quantified type
+                            % variables in the predicate's type decl.
+
  		head_type_params :: head_type_params,
- 				% The set of type variables which the
- 				% body of the predicate can't bind,
- 				% and whose type_infos are produced
- 				% elsewhere.  This includes
- 				% universally quantified head types
- 				% (the type_infos are passed in)
- 				% plus existentially quantified types
- 				% in preds called from the body
- 				% (the type_infos are returned from
- 				% the called preds).
- 				% Computed during type checking.
+                            % The set of type variables which the body of the
+                            % predicate can't bind, and whose type_infos are
+                            % produced elsewhere. This includes universally
+                            % quantified head types (the type_infos are passed
+                            % in) plus existentially quantified types in preds
+                            % called from the body (the type_infos are returned
+                            % from the called preds). Computed during type
+                            % checking.
 
  		class_context	:: prog_constraints,
- 				% the class constraints on the
- 				% type variables in the predicate's
- 				% type declaration
+                            % The class constraints on the type variables
+                            % in the predicate's type declaration.
+
  		constraint_proofs :: constraint_proof_map,
- 				% explanations of how redundant
- 				% constraints were eliminated. These
- 				% are needed by polymorphism.m to
- 				% work out where to get the
- 				% typeclass_infos from.
- 				% Computed during type checking.
+                            % Explanations of how redundant constraints were
+                            % eliminated. These are needed by polymorphism.m
+                            % to work out where to get the typeclass_infos
+                            % from. Computed during type checking.
+
  		constraint_map	:: constraint_map,
- 				% maps constraint identifiers to the actual
- 				% constraints.
- 				% Computed during type checking.
+                            % Maps constraint identifiers to the actual
+                            % constraints. Computed during type checking.
+
  		unproven_body_constraints :: list(prog_constraint),
- 				% unproven class constraints on type
- 				% variables in the predicate's body,
- 				% if any (if this remains non-empty
- 				% after type checking has finished,
- 				% post_typecheck.m will report a type
- 				% error).
+                            % Unproven class constraints on type variables
+                            % in the predicate's body, if any (if this remains
+                            % non-empty after type checking has finished,
+                            % post_typecheck.m will report a type error).
 
  		inst_graph_info	:: inst_graph_info,
  				% The predicate's inst graph, for constraint
  				% based mode analysis.
+
  		modes		:: list(arg_modes_map),
  				% Mode information extracted from constraint
  				% based mode analysis.
 
  		assertions	:: set(assert_id),
- 				% List of assertions which
- 				% mention this predicate.
+                            % List of assertions which mention this predicate.
 
  		aditi_owner	:: aditi_owner,
- 				% The owner of this predicate if
- 				% it is an Aditi predicate. Set to
- 				% the value of --aditi-user if no
- 				% `:- pragma owner' declaration exists.
+                            % The owner of this predicate if it is an Aditi
+                            % predicate. Set to the value of --aditi-user
+                            % if no `:- pragma owner' declaration exists.
+
  		indexes		:: list(index_spec),
- 				% Indexes if this predicate is
- 				% an Aditi base relation, ignored
- 				% otherwise.
+                            % Indexes if this predicate is an Aditi base
+                            % relation, ignored otherwise.
 
  		clauses_info	:: clauses_info,
+
  		procedures	:: proc_table
  	).
 
@@ -1856,7 +1825,8 @@
 	ExportStatus = local,
 	non_special_interface_should_use_typeinfo_liveness(ExportStatus,
 		IsAddressTaken, Globals, TypeInfoLiveness),
-	( TypeInfoLiveness = yes ->
+    (
+        TypeInfoLiveness = yes,
 		goal_info_get_nonlocals(GoalInfo, NonLocals),
 		goal_util__extra_nonlocal_typeinfos(RttiVarMaps, VarTypes0,
 			ExistQVars, NonLocals, ExtraTypeInfos0),
@@ -1864,6 +1834,7 @@
 		set__to_sorted_list(ExtraTypeInfos1, ExtraTypeInfos),
 		list__append(ExtraTypeInfos, ArgVars0, ArgVars)
 	;
+        TypeInfoLiveness = no,
 		ArgVars = ArgVars0,
 		ExtraTypeInfos = []
 	),
@@ -1882,8 +1853,7 @@
 	map__select(VarTypes0, GoalVars, VarTypes),
 	varset__select(VarSet0, GoalVars, VarSet),
 
-		% Approximate the termination information
-		% for the new procedure.
+        % Approximate the termination information for the new procedure.
 	( goal_cannot_loop(ModuleInfo0, Goal0) ->
 		TermInfo = yes(cannot_loop(unit))
 	;
@@ -2275,12 +2245,10 @@
 	--->	deep_recursion_info(
 			role		:: deep_profile_role,
 			visible_scc	:: list(visible_scc_data)
-					% If the procedure is not tail
-					% recursive, this list is empty.
-					% Otherwise, it contains outer-inner
-					% pairs of procedures in the visible
-					% SCC, including this procedure and
-					% its copy.
+                            % If the procedure is not tail recursive, this list
+                            % is empty. Otherwise, it contains outer-inner
+                            % pairs of procedures in the visible SCC,
+                            % including this procedure and its copy.
 		).
 
 :- type visible_scc_data
@@ -2288,10 +2256,10 @@
 			vis_outer_proc	:: pred_proc_id,
 			vis_inner_proc	:: pred_proc_id,
 			rec_call_sites	:: list(int)
-					% A list of all the call site numbers
-					% that correspond to tail calls.
-					% (Call sites are numbered depth-first,
-					% left-to-right, from zero.)
+                                % A list of all the call site numbers that
+                                % correspond to tail calls. (Call sites are
+                                % numbered depth-first, left-to-right,
+                                % from zero.)
 		).
 
 :- type call_site_static_data			% defines MR_CallSiteStatic
@@ -2331,9 +2299,9 @@
 			call_site_statics	:: list(call_site_static_data)
 		).
 
-	% The hlds_deep_excp_vars gives the variables that hold
-	% the values returned by the call port code, which are needed to let
-	% exception.throw perform the work we need to do at the excp port.
+    % The hlds_deep_excp_vars gives the variables that hold the values returned
+    % by the call port code, which are needed to let exception.throw perform
+    % the work we need to do at the excp port.
 :- type hlds_deep_excp_vars
 	--->	hlds_deep_excp_vars(
 			top_csd		:: prog_var,
@@ -2354,17 +2322,15 @@
 	--->	deep_profile_proc_info(
 			deep_rec	:: maybe(deep_recursion_info),
 			deep_layout	:: maybe(hlds_deep_layout)
-					% The first field is set during
-					% the first, tail recursion
-					% part of the deep profiling
+                                % The first field is set during the first,
+                                % tail recursion part of the deep profiling
 					% transformation, if that is enabled.
-					% The deep_layout field is set during
-					% the second part; it will be bound
-					% to `no' before and during the first
-					% part, and to `yes' after the second.
-					% The contents of this field govern
-					% what will go into MR_ProcStatic
-					% structures.
+                                % The deep_layout field is set during the
+                                % second part; it will be bound to `no'
+                                % before and during the first part, and
+                                % to `yes' after the second. The contents
+                                % of this field govern what will go into
+                                % MR_ProcStatic structures.
 		).
 
 :- type table_arg_info
@@ -2386,10 +2352,9 @@
 	;	table_trie_step_char
 	;	table_trie_step_string
 	;	table_trie_step_float
-	;	table_trie_step_enum(int)	% The int gives the number of
-						% alternatives in the enum
-						% type, and thus the size of
-						% the corresponding trie node.
+    ;       table_trie_step_enum(int)
+                % The int gives the number of alternatives in the enum type,
+                % and thus the size of the corresponding trie node.
 	;	table_trie_step_user(type)
 	;	table_trie_step_user_fast_loose(type)
 	;	table_trie_step_poly
@@ -2586,7 +2551,7 @@
 	% This set of typeinfos is often needed in liveness computation
 	% for accurate garbage collection - live variables need to have
 	% their typeinfos stay live too.
-
+    %
 :- pred proc_info_get_typeinfo_vars(set(prog_var)::in, vartypes::in,
 	rtti_varmaps::in, set(prog_var)::out) is det.
 
@@ -2596,25 +2561,30 @@
 :- pred proc_info_ensure_unique_names(proc_info::in, proc_info::out) is det.
 
 	% Create a new variable of the given type to the procedure.
+    %
 :- pred proc_info_create_var_from_type((type)::in, maybe(string)::in,
 	prog_var::out, proc_info::in, proc_info::out) is det.
 
 	% Create a new variable for each element of the list of types.
+    %
 :- pred proc_info_create_vars_from_types(list(type)::in, list(prog_var)::out,
 	proc_info::in, proc_info::out) is det.
 
 	% Given a procedure, return a list of all its headvars which are
 	% (further) instantiated by the procedure.
+    %
 :- pred proc_info_instantiated_head_vars(module_info::in, proc_info::in,
 	list(prog_var)::out) is det.
 
 	% Given a procedure, return a list of all its headvars which are
 	% not (further) instantiated by the procedure.
+    %
 :- pred proc_info_uninstantiated_head_vars(module_info::in, proc_info::in,
 	list(prog_var)::out) is det.
 
 	% Return true if the interface of the given procedure must include
 	% typeinfos for all the type variables in the types of the arguments.
+    %
 :- pred proc_interface_should_use_typeinfo_liveness(pred_info::in, proc_id::in,
 	globals::in, bool::out) is det.
 
@@ -2625,6 +2595,7 @@
 	% Note that only a few predicates in the builtin modules are special
 	% in this sense, and that compiler-generated predicates are never
 	% special.
+    %
 :- pred non_special_interface_should_use_typeinfo_liveness(import_status::in,
 	is_address_taken::in, globals::in, bool::out) is det.
 
@@ -2633,12 +2604,14 @@
 	% variables whose type includes the corresponding type variable.
 	% Note that body typeinfo liveness implies interface typeinfo liveness,
 	% but not vice versa.
+    %
 :- pred body_should_use_typeinfo_liveness(pred_info::in, globals::in,
 	bool::out) is det.
 
 	% Return true if the body of a procedure in a non-special predicate
 	% must keep a typeinfo variable alive during the lifetime of all
 	% variables whose type includes the corresponding type variable.
+    %
 :- pred non_special_body_should_use_typeinfo_liveness(globals::in,
 	bool::out) is det.
 
@@ -2654,6 +2627,7 @@
 	% are defined by compiler implementors. They are all predicates
 	% implemented by foreign language code in the standard library.
 	% For some, but not all, the compiler generates code inline.
+    %
 :- pred no_type_info_builtin(module_name::in, string::in, int::in) is semidet.
 
 	% If the procedure has a input/output pair of io__state arguments,
@@ -2666,8 +2640,8 @@
 	% Note that the automatically constructed unify, index and compare
 	% procedures for the io:state type are not counted as having io:state
 	% args, since they do not fall into the scheme of one input and one
-	% output arg. Since they should never be called, this should not
-	% matter.
+    % output arg. Since they should never be called, this should not matter.
+    %
 :- pred proc_info_has_io_state_pair(module_info::in, proc_info::in,
 	int::out, int::out) is semidet.
 
@@ -2679,21 +2653,25 @@
 	% return a procedure id to be attached to a clone of that procedure.
 	% (The task of creating the clone proc_info and inserting into the
 	% procedure table is the task of the caller.)
+    %
 :- pred clone_proc_id(proc_table::in, proc_id::in, proc_id::out) is det.
 
 	% When mode inference is enabled, we record for each inferred
 	% mode whether it is valid or not by keeping a list of error
 	% messages in the proc_info.  The mode is valid iff this list
 	% is empty.
+    %
 :- func mode_errors(proc_info) = list(mode_error_info).
 :- func 'mode_errors :='(proc_info, list(mode_error_info)) = proc_info.
 :- pred proc_info_is_valid_mode(proc_info::in) is semidet.
 
 	% Make sure that all headvars are named. This can be useful e.g.
 	% becasue the debugger ignores unnamed variables.
+    %
 :- pred ensure_all_headvars_are_named(proc_info::in, proc_info::out) is det.
 
 	% Test whether the variable is of a dummy type, based on the vartypes.
+    %
 :- pred var_is_of_dummy_type(vartypes::in, prog_var::in) is semidet.
 
 :- implementation.
@@ -2710,7 +2688,7 @@
 		head_vars		:: list(prog_var),
 		inst_varset		:: inst_varset,
 		maybe_declared_head_modes :: maybe(list(mode)),
-					% declared modes of arguments.
+                                    % The declared modes of arguments.
 		actual_head_modes 	:: list(mode),
 		maybe_head_modes_constraint :: maybe(mode_constraint),
 		head_var_caller_liveness :: maybe(list(is_live)),
@@ -2719,22 +2697,23 @@
 					% whether each argument may be used
 					% after the call.
 		declared_detism		:: maybe(determinism),
-					% _declared_ determinism
-					% or `no' if there was no detism decl
+                                    % The _declared_ determinism of the
+                                    % procedure, or `no' if there was no
+                                    % detism decl.
 		inferred_detism		:: determinism,
 		body			:: hlds_goal,
 		can_process		:: bool,
-					% no if we must not process this
-					% procedure yet (used to delay
-					% mode checking etc. for complicated
-					% modes of unification procs until
-					% the end of the unique_modes pass.)
+                                    % No if we must not process this procedure
+                                    % yet (used to delay mode checking etc.
+                                    % for complicated modes of unification
+                                    % procs until the end of the unique_modes
+                                    % pass.)
 		mode_errors		:: list(mode_error_info),
 		proc_rtti_varmaps	:: rtti_varmaps,
 					% Information about type_infos and
 					% typeclass_infos.
 		eval_method		:: eval_method,
-					% how should the proc be evaluated
+                                    % How should the proc be evaluated.
 
 		proc_sub_info		:: proc_sub_info
 	).
@@ -2746,6 +2725,7 @@
 					% of the input and output args of the
 					% procedure. Set by termination
 					% analysis.
+
 		maybe_termination	:: maybe(termination_info),
 					% The termination properties of the
 					% procedure. Set by termination
@@ -2754,6 +2734,7 @@
 					% Termination properties and argument
 					% size constraints for the procedure.
 					% Set by termination2 analysis.
+
 		is_address_taken	:: is_address_taken,
 					% Is the address of this procedure
 					% taken? If yes, we will need to use
@@ -2765,18 +2746,22 @@
 					% must be considered as having its
 					% address taken, since it is possible
 					% that some other module may do so.
+
 		stack_slots		:: stack_slots,
-					% stack allocations
+                                    % Allocation of variables to stack slots.
+
 		arg_pass_info		:: maybe(list(arg_info)),
-					% calling convention of each arg:
+                                    % The calling convention of each arg:
 					% information computed by arg_info.m
 					% (based on the modes etc.)
 					% and used by code generation
 					% to determine how each argument
 					% should be passed.
+
 		initial_liveness 	:: liveness_info,
-					% the initial liveness,
-					% for code generation
+                                    % The initial liveness, for code
+                                    % generation.
+
 		need_maxfr_slot		:: bool,
 					% True iff tracing is enabled, this
 					% is a procedure that lives on the det
@@ -2791,6 +2776,7 @@
 					% backend XXX. Its value is set during
 					% the live_vars pass; it is invalid
 					% before then.
+
 		call_table_tip		:: maybe(prog_var),
 					% If the procedure's evaluation method
 					% is memo, loopcheck or minimal, this
@@ -2817,6 +2803,7 @@
 					% relevant backend must record this
 					% fact in a place accessible to the
 					% debugger, if debugging is enabled.
+
 		maybe_table_info 	:: maybe(proc_table_info),
 					% If set, it means that procedure
 					% has been subject to a tabling
@@ -2835,8 +2822,9 @@
 					% or strings. However, this is still
 					% sufficient for debugging most
 					% problems in the tabling system.
-		maybe_deep_profile_proc_info
-					:: maybe(deep_profile_proc_info),
+
+        maybe_deep_profile_proc_info :: maybe(deep_profile_proc_info),
+
 		maybe_untuple_info	:: maybe(untuple_proc_info)
 					% If set, it means this procedure was
 					% created from another procedure by the
@@ -2855,8 +2843,7 @@
 
 proc_info_init(MContext, Arity, Types, DeclaredModes, Modes, MaybeArgLives,
 		MaybeDet, IsAddressTaken, NewProc) :-
-	make_n_fresh_vars("HeadVar__", Arity, HeadVars,
-		varset__init, BodyVarSet),
+    make_n_fresh_vars("HeadVar__", Arity, HeadVars, varset__init, BodyVarSet),
 	varset__init(InstVarSet),
 	map__from_corresponding_lists(HeadVars, Types, BodyTypes),
 	ModeErrors = [],
@@ -2869,10 +2856,9 @@
 	CanProcess = yes,
 	rtti_varmaps_init(RttiVarMaps),
 	Term2Info = term_constr_main__term2_info_init,
-	NewProc = proc_info(MContext, BodyVarSet, BodyTypes, HeadVars,
-		InstVarSet, DeclaredModes, Modes, no, MaybeArgLives,
-		MaybeDet, InferredDet, ClauseBody, CanProcess, ModeErrors,
-		RttiVarMaps, eval_normal,
+    NewProc = proc_info(MContext, BodyVarSet, BodyTypes, HeadVars, InstVarSet,
+        DeclaredModes, Modes, no, MaybeArgLives, MaybeDet, InferredDet,
+        ClauseBody, CanProcess, ModeErrors, RttiVarMaps, eval_normal,
 		proc_sub_info(no, no, Term2Info, IsAddressTaken, StackSlots,
 		ArgInfo, InitialLiveness, no, no, no, no, no)).
 
@@ -2881,13 +2867,12 @@
 		RttiVarMaps, ArgSizes, Termination, Termination2,
 		IsAddressTaken, StackSlots, ArgInfo, Liveness, ProcInfo) :-
 	ModeErrors = [],
+    ProcSubInfo = proc_sub_info(ArgSizes, Termination, Termination2,
+        IsAddressTaken, StackSlots, ArgInfo, Liveness, no, no, no, no, no),
 	ProcInfo = proc_info(Context, BodyVarSet, BodyTypes, HeadVars,
 		InstVarSet, no, HeadModes, no, HeadLives,
 		DeclaredDetism, InferredDetism, Goal, CanProcess, ModeErrors,
-		RttiVarMaps, eval_normal,
-		proc_sub_info(ArgSizes, Termination, Termination2,
-		IsAddressTaken, StackSlots, ArgInfo, Liveness, no, no, no,
-			no, no)).
+        RttiVarMaps, eval_normal, ProcSubInfo).
 
 proc_info_create(Context, VarSet, VarTypes, HeadVars, InstVarSet,
 		HeadModes, Detism, Goal, RttiVarMaps, IsAddressTaken,
@@ -2904,20 +2889,20 @@
 	MaybeHeadLives = no,
 	ModeErrors = [],
 	Term2Info = term_constr_main__term2_info_init,
+    ProcSubInfo = proc_sub_info(no, no, Term2Info, IsAddressTaken,
+        StackSlots, no, Liveness, no, no, no, no, no),
 	ProcInfo = proc_info(Context, VarSet, VarTypes, HeadVars,
 		InstVarSet, no, HeadModes, no, MaybeHeadLives,
 		MaybeDeclaredDetism, Detism, Goal, yes, ModeErrors,
-		RttiVarMaps, eval_normal,
-		proc_sub_info(no, no, Term2Info, IsAddressTaken,
-		StackSlots, no, Liveness, no, no, no, no, no)).
+        RttiVarMaps, eval_normal, ProcSubInfo).
 
 proc_info_set_body(VarSet, VarTypes, HeadVars, Goal, RttiVarMaps,
-		ProcInfo0, ProcInfo) :-
-	ProcInfo = (((((ProcInfo0 ^ prog_varset := VarSet)
-		^ var_types := VarTypes)
-		^ head_vars := HeadVars)
-		^ body := Goal)
-		^ proc_rtti_varmaps := RttiVarMaps).
+        !ProcInfo) :-
+    !:ProcInfo = !.ProcInfo ^ prog_varset := VarSet,
+    !:ProcInfo = !.ProcInfo ^ var_types := VarTypes,
+    !:ProcInfo = !.ProcInfo ^ head_vars := HeadVars,
+    !:ProcInfo = !.ProcInfo ^ body := Goal,
+    !:ProcInfo = !.ProcInfo ^ proc_rtti_varmaps := RttiVarMaps.
 
 proc_info_context(PI, PI ^ proc_context).
 proc_info_varset(PI, PI ^ prog_varset).
@@ -3003,9 +2988,11 @@
 
 proc_info_declared_argmodes(ProcInfo, ArgModes) :-
 	proc_info_maybe_declared_argmodes(ProcInfo, MaybeArgModes),
-	( MaybeArgModes = yes(ArgModes1) ->
+    (
+        MaybeArgModes = yes(ArgModes1),
 		ArgModes = ArgModes1
 	;
+        MaybeArgModes = no,
 		proc_info_argmodes(ProcInfo, ArgModes)
 	).
 
@@ -3037,9 +3024,11 @@
 
 proc_info_arglives(ProcInfo, ModuleInfo, ArgLives) :-
 	proc_info_maybe_arglives(ProcInfo, MaybeArgLives),
-	( MaybeArgLives = yes(ArgLives0) ->
+    (
+        MaybeArgLives = yes(ArgLives0),
 		ArgLives = ArgLives0
 	;
+        MaybeArgLives = no,
 		proc_info_argmodes(ProcInfo, Modes),
 		get_arg_lives(Modes, ModuleInfo, ArgLives)
 	).
@@ -3066,8 +3055,7 @@
 proc_info_get_typeinfo_vars(Vars, VarTypes, RttiVarMaps, TypeInfoVars) :-
 	TVarMap = RttiVarMaps ^ ti_varmap,
 	set__to_sorted_list(Vars, VarList),
-	proc_info_get_typeinfo_vars_2(VarList, VarTypes, TVarMap,
-		TypeInfoVarList),
+    proc_info_get_typeinfo_vars_2(VarList, VarTypes, TVarMap, TypeInfoVarList),
 	set__list_to_set(TypeInfoVarList, TypeInfoVars).
 
 	% auxiliary predicate - traverses variables and builds a list of
@@ -3102,8 +3090,7 @@
 
 			proc_info_get_typeinfo_vars_2(Vars, VarTypes, TVarMap,
 				TypeInfoVars1),
-			list__append(TypeInfoVars0, TypeInfoVars1,
-				TypeInfoVars)
+            list__append(TypeInfoVars0, TypeInfoVars1, TypeInfoVars)
 		)
 	;
 		error("proc_info_get_typeinfo_vars_2: var not found in typemap")
@@ -3141,8 +3128,8 @@
 	proc_info_varset(!.ProcInfo, VarSet0),
 	proc_info_vartypes(!.ProcInfo, VarTypes0),
 	varset__new_vars(VarSet0, NumVars, NewVars, VarSet),
-	map__det_insert_from_corresponding_lists(VarTypes0,
-		NewVars, Types, VarTypes),
+    map__det_insert_from_corresponding_lists(VarTypes0, NewVars,
+        Types, VarTypes),
 	proc_info_set_varset(VarSet, !ProcInfo),
 	proc_info_set_vartypes(VarTypes, !ProcInfo).
 
@@ -3283,11 +3270,13 @@
 
 proc_info_has_io_state_pair_from_details(ModuleInfo, HeadVars, ArgModes,
 		VarTypes, InArgNum, OutArgNum) :-
-	assoc_list__from_corresponding_lists(HeadVars, ArgModes,
-		HeadVarsModes),
+    assoc_list__from_corresponding_lists(HeadVars, ArgModes, HeadVarsModes),
 	proc_info_has_io_state_pair_2(HeadVarsModes, ModuleInfo, VarTypes,
-		1, no, no, MaybeIn, MaybeOut),
-	( MaybeIn = yes(In), MaybeOut = yes(Out) ->
+        1, no, MaybeIn, no, MaybeOut),
+    (
+        MaybeIn = yes(In),
+        MaybeOut = yes(Out)
+    ->
 		InArgNum = In,
 		OutArgNum = Out
 	;
@@ -3295,54 +3284,48 @@
 	).
 
 :- pred proc_info_has_io_state_pair_2(assoc_list(prog_var, mode)::in,
-	module_info::in, map(prog_var, type)::in,
-	int::in, maybe(int)::in, maybe(int)::in,
-	maybe(int)::out, maybe(int)::out) is semidet.
+    module_info::in, map(prog_var, type)::in, int::in,
+    maybe(int)::in, maybe(int)::out, maybe(int)::in, maybe(int)::out)
+    is semidet.
 
-proc_info_has_io_state_pair_2([], _, _, _,
-		MaybeIn, MaybeOut, MaybeIn, MaybeOut).
+proc_info_has_io_state_pair_2([], _, _, _, !MaybeIn, !MaybeOut).
 proc_info_has_io_state_pair_2([Var - Mode | VarModes], ModuleInfo, VarTypes,
-		ArgNum, MaybeIn0, MaybeOut0, MaybeIn, MaybeOut) :-
+        ArgNum, !MaybeIn, !MaybeOut) :-
 	(
 		map__lookup(VarTypes, Var, VarType),
 		type_util__type_is_io_state(VarType)
 	->
 		( mode_is_fully_input(ModuleInfo, Mode) ->
 			(
-				MaybeIn0 = no,
-				MaybeIn1 = yes(ArgNum),
-				MaybeOut1 = MaybeOut0
-			;
-				MaybeIn0 = yes(_),
-				% Procedures with two input arguments
-				% of type io__state (e.g. the automatically
-				% generated unification or comparison procedure
-				% for the io__state type) do not fall into
-				% the one input/one output pattern we are
-				% looking for.
+                !.MaybeIn = no,
+                !:MaybeIn = yes(ArgNum)
+            ;
+                !.MaybeIn = yes(_),
+                % Procedures with two input arguments of type io__state
+                % (e.g. the automatically generated unification or comparison
+                % procedure for the io__state type) do not fall into the
+                % one input/one output pattern we are looking for.
 				fail
 			)
 		; mode_is_fully_output(ModuleInfo, Mode) ->
 			(
-				MaybeOut0 = no,
-				MaybeOut1 = yes(ArgNum),
-				MaybeIn1 = MaybeIn0
-			;
-				MaybeOut0 = yes(_),
-				% Procedures with two output arguments of
-				% type io__state do not fall into the one
-				% input/one output pattern we are looking for.
+                !.MaybeOut = no,
+                !:MaybeOut = yes(ArgNum)
+            ;
+                !.MaybeOut = yes(_),
+                % Procedures with two output arguments of type io__state
+                % do not fall into the one input/one output pattern we are
+                % looking for.
 				fail
 			)
 		;
 			fail
 		)
 	;
-		MaybeIn1 = MaybeIn0,
-		MaybeOut1 = MaybeOut0
+        true
 	),
 	proc_info_has_io_state_pair_2(VarModes, ModuleInfo, VarTypes,
-		ArgNum + 1, MaybeIn1, MaybeOut1, MaybeIn, MaybeOut).
+        ArgNum + 1, !MaybeIn, !MaybeOut).
 
 clone_proc_id(ProcTable, _ProcId, CloneProcId) :-
 	find_lowest_unused_proc_id(ProcTable, CloneProcId).
@@ -3357,8 +3340,7 @@
 
 find_lowest_unused_proc_id_2(TrialProcId, ProcTable, CloneProcId) :-
 	( map__search(ProcTable, TrialProcId, _) ->
-		find_lowest_unused_proc_id_2(TrialProcId + 1, ProcTable,
-			CloneProcId)
+        find_lowest_unused_proc_id_2(TrialProcId + 1, ProcTable, CloneProcId)
 	;
 		CloneProcId = TrialProcId
 	).
@@ -3395,10 +3377,12 @@
 	% field_extraction_function_args(Args, InputTermArg).
 	% Work out which arguments of a field access correspond to the
 	% field being extracted/set, and which are the container arguments.
+    %
 :- pred field_extraction_function_args(list(prog_var)::in, prog_var::out)
 	is det.
 
 	% field_update_function_args(Args, InputTermArg, FieldArg).
+    %
 :- pred field_update_function_args(list(prog_var)::in, prog_var::out,
 	prog_var::out) is det.
 
@@ -3406,6 +3390,7 @@
 	%
 	% From the access type and the name of the field,
 	% construct a function name.
+    %
 :- pred field_access_function_name(field_access_type::in, ctor_field_name::in,
 	sym_name::out) is det.
 
@@ -3413,6 +3398,7 @@
 	%	AccessType, FieldName).
 	%
 	% Inverse of the above.
+    %
 :- pred is_field_access_function_name(module_info::in, sym_name::in,
 	arity::out, field_access_type::out, ctor_field_name::out) is semidet.
 
@@ -3466,25 +3452,25 @@
 %-----------------------------------------------------------------------------%
 
 	% Predicates to deal with builtins.
-:- interface.
 
-	% is_unify_or_compare_pred(PredInfo) succeeds iff
-	% the PredInfo is for a compiler generated instance of a
-	% type-specific special_pred (i.e. one of the unify, compare,
-	% or index predicates generated as a type-specific instance of
-	% unify/2, index/2, or compare/3).
+:- interface.
 
+    % is_unify_or_compare_pred(PredInfo) succeeds iff the PredInfo is for a
+    % compiler generated instance of a type-specific special_pred (i.e. one
+    % of the unify, compare, or index predicates generated as a type-specific
+    % instance of unify/2, index/2, or compare/3).
+    %
 :- pred is_unify_or_compare_pred(pred_info::in) is semidet.
 
-	% Is the argument the pred_info for a builtin that can be
-	% generated inline?
+    % Is the argument the pred_info for a builtin that can be generated inline?
+    %
 :- pred pred_info_is_builtin(pred_info::in) is semidet.
 
-	% builtin_state(ModuleInfo, CallerPredId,
-	%	PredId, ProcId, BuiltinState)
+    % builtin_state(ModuleInfo, CallerPredId, PredId, ProcId, BuiltinState)
 	%
 	% Is the given procedure a builtin that should be generated inline
 	% in the given caller?
+    %
 :- func builtin_state(module_info, pred_id, pred_id, proc_id) = builtin_state.
 
 :- implementation.
@@ -3513,7 +3499,8 @@
 		% goal for each builtin must be generated inline, or
 		% we would generate an infinite loop.
 		(
-			AllowInlining = yes, InlineBuiltins = yes
+            AllowInlining = yes,
+            InlineBuiltins = yes
 		;
 			CallerPredId = PredId
 		),
@@ -3542,8 +3529,7 @@
 
 %-----------------------------------------------------------------------------%
 
-	% Predicates to check whether a given predicate
-	% is an Aditi query.
+    % Predicates to check whether a given predicate is an Aditi query.
 
 :- interface.
 
@@ -3552,11 +3538,13 @@
 :- pred hlds_pred__is_derived_relation(module_info::in, pred_id::in) is semidet.
 
 	% Is the given predicate a base or derived Aditi relation.
+    %
 :- pred hlds_pred__is_aditi_relation(module_info::in, pred_id::in) is semidet.
 
 	% Is the predicate `aditi:aggregate_compute_initial', declared
 	% in extras/aditi/aditi.m.
 	% Special code is generated for each call to this in rl_gen.m.
+    %
 :- pred hlds_pred__is_aditi_aggregate(module_info::in, pred_id::in) is semidet.
 
 :- pred hlds_pred__pred_info_is_aditi_relation(pred_info::in) is semidet.
@@ -3567,12 +3555,14 @@
 
 	% Aditi can optionally memo the results of predicates
 	% between calls to reduce redundant computation.
+    %
 :- pred hlds_pred__is_aditi_memoed(module_info::in, pred_id::in) is semidet.
 
 	% Differential evaluation is a method of evaluating recursive
 	% Aditi predicates which uses the just new tuples in each
 	% iteration where possible rather than the full relations,
 	% reducing the sizes of joins.
+    %
 :- pred hlds_pred__is_differential(module_info::in, pred_id::in) is semidet.
 
 %-----------------------------------------------------------------------------%
@@ -3627,8 +3617,7 @@
 		check_marker(Markers, aditi_memo)
 	;
 		% Memoing is the default for Aditi procedures.
-		semidet_fail, 	% XXX leave it off for now to
-				% reduce memory usage.
+        semidet_fail,   % XXX leave it off for now to reduce memory usage.
 		check_marker(Markers, aditi),
 		\+ check_marker(Markers, aditi_no_memo)
 	).
@@ -3651,31 +3640,38 @@
 
 	% Check if the given evaluation method is allowed with
 	% the given determinism.
+    %
 :- func valid_determinism_for_eval_method(eval_method, determinism) = bool.
 
 	% Return true if the given evaluation method requires a
 	% stratification check.
+    %
 :- func eval_method_needs_stratification(eval_method) = bool.
 
 	% Return true if the given evaluation method uses a per-procedure
 	% tabling pointer. If so, the back-end must generate a declaration
 	% for the variable to hold the table.
+    %
 :- func eval_method_has_per_proc_tabling_pointer(eval_method) = bool.
 
 	% Return true if the given evaluation method requires the body
 	% of the procedure using it to be transformed by table_gen.m.
+    %
 :- func eval_method_requires_tabling_transform(eval_method) = bool.
 
 	% Return true if the given evaluation method requires the arguments
 	% of the procedure using it to be ground.
+    %
 :- func eval_method_requires_ground_args(eval_method) = bool.
 
 	% Return true if the given evaluation method requires the arguments
 	% of the procedure using it to be non-unique.
+    %
 :- func eval_method_destroys_uniqueness(eval_method) = bool.
 
 	% Return the change a given evaluation method can do to a given
 	% determinism.
+    %
 :- func eval_method_change_determinism(eval_method, determinism) = determinism.
 
 :- implementation.
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
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/concurrency
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/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
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/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
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/odbc
cvs diff: Diffing extras/posix
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/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
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
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/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
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 tests
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/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
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:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list