[m-rev.] diff: minor mode constraints cleanups

Zoltan Somogyi zs at csse.unimelb.edu.au
Thu Jun 4 14:38:46 AEST 2009


Minor cleanups of the mode constraints code.

compiler/abstract_mode_constraints.m:
compiler/build_mode_constraints.m:
compiler/mcsolver.m:
compiler/prop_mode_constraints.m:
	Add some optional diagnostic outputs.
	Pass around the extra data needed by the diagnostic output.

	Change the style of predicate comments to match the rest of the
	compiler. Delete the redundant copies of these comments near the start
	of the predicate definitions.

	Give some predicates, function symbols and types less ambiguous names.

	Use !StateVar ^ ... := ... syntax where applicable.

	Convert some predicates from using clauses to explicit disjunctions.

	Add a missing abort.

compiler/mode_constraints.m:
compiler/ordering_mode_constraints.m:
	Conform to the changes above.

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/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/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/abstract_mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/abstract_mode_constraints.m,v
retrieving revision 1.11
diff -u -b -r1.11 abstract_mode_constraints.m
--- compiler/abstract_mode_constraints.m	27 Sep 2006 06:16:46 -0000	1.11
+++ compiler/abstract_mode_constraints.m	2 Jun 2009 14:38:38 -0000
@@ -23,13 +23,11 @@
 :- import_module parse_tree.
 :- import_module parse_tree.prog_data.
 
-:- import_module assoc_list.
 :- import_module bool.
 :- import_module io.
 :- import_module list.
 :- import_module map.
 :- import_module multi_map.
-:- import_module pair.
 :- import_module set.
 :- import_module term.
 :- import_module varset.
@@ -57,24 +55,23 @@
     % Represents conjunctions and disjunctions between atomic constraints
     % on constraint variables.
     %
-:- type constraint_formulae == list(constraint_formula).
-:- type constraint_formula
-    --->    atomic_constraint(var_constraint)
+:- type mc_constraint
+    --->    mc_atomic(var_constraint)
 
-    ;       disj(constraint_formulae)
+    ;       mc_disj(list(mc_constraint))
             % Primarily included for the purposes of representing mode
             % declaration and call constraints, which are a disjunction
             % of conjunctions of atomic constraints.  The intended form
-            % is: disj([conj(...), ..., conj(...)])
+            % is: mc_disj([conj(...), ..., mc_conj(...)])
             %
-            % Note: disj([]) represents false.
+            % Note: mc_disj([]) represents false.
 
-    ;       conj(constraint_formulae).
-            % See disj.
-            % Note: conj([]) is the empty constraint, or true.
+    ;       mc_conj(list(mc_constraint)).
+            % See amc_disj.
+            % Note: amc_conj([]) is the empty constraint, or true.
 
     % var_constraint represents a boolean constraint between
-    % producer/consumer constraint variables
+    % producer/consumer constraint variables.
     %
 :- type var_constraint == var_constraint(mc_type).
 :- type var_constraint(T)
@@ -108,14 +105,17 @@
 % Constraint collection structures.
 %
 
-:- type constraint_and_annotation ==
-    pair(constraint_formula, constraint_annotation).
+:- type mc_ann_constraint
+    --->    mc_ann_constraint(mc_constraint, mc_annotation).
+
+:- func project_mc_constraint(mc_ann_constraint) = mc_constraint.
+:- func project_mc_annotation(mc_ann_constraint) = mc_annotation.
 
     % Various information about the creation of the constraint in
     % question.
     %
-:- type constraint_annotation
-    --->    constraint_annotation(
+:- type mc_annotation
+    --->    mc_annotation(
                 % Context of the goal this constraint was formed for.
                 context             ::      prog_context
             ).
@@ -123,166 +123,163 @@
     % producer/consumer constraints for a predicate.
     %
 :- type pred_p_c_constraints
-    --->    pred_constraints(
+    --->    pred_p_c_constraints(
                 % Stores procedure specific constraints such as mode
                 % declaration constraints.
-                proc_constraints    ::  multi_map(proc_id,
-                                            constraint_and_annotation),
+                ppcc_procspec_constraints   ::  multi_map(proc_id,
+                                                    mc_ann_constraint),
 
                 % Stores constraints that apply to all procedures of the
                 % predicate - typically generated from its clauses.
-                pred_constraints    ::  assoc_list(constraint_formula,
-                                            constraint_annotation),
+                ppcc_allproc_constraints    ::  list(mc_ann_constraint),
 
                 % Collection of predicates with no declared modes that are
                 % called by this predicate.
-                mode_infer_callees  ::  set(pred_id)
+                ppcc_mode_infer_callees     ::  set(pred_id)
             ).
 
 %-----------------------------------------------------------------------------%
 
-    % Prints the constraint_formulae it is passed in a human readable
-    % format.
+    % Print the mc_constraint it is passed in a human readable format.
     %
-:- pred pretty_print_constraints(mc_varset::in, constraint_formulae::in,
+:- pred pretty_print_constraint(mc_varset::in, mc_constraint::in,
     io::di, io::uo) is det.
 
-    % Prints the constraint_formulae it is passed in a human readable
-    % format.
+    % Print the mc_constraints it is passed in a human readable format.
     %
-:- pred dump_constraints_and_annotations(mc_varset::in,
-    assoc_list(constraint_formula, constraint_annotation)::in,
+:- pred pretty_print_constraints(mc_varset::in, list(mc_constraint)::in,
     io::di, io::uo) is det.
 
-    % Prints a list of models for the constraint system.
+    % Print the mc_constraints it is passed in a human readable format.
+    %
+:- pred dump_constraints_and_annotations(mc_varset::in,
+    list(mc_ann_constraint)::in, io::di, io::uo) is det.
+
+    % Print a list of models for the constraint system.
     %
-:- pred pretty_print_solutions(mc_varset::in, list(mc_bindings)::in, io::di,
-    io::uo) is det.
+:- pred pretty_print_solutions(mc_varset::in, list(mc_bindings)::in,
+    io::di, io::uo) is det.
 
 %-----------------------------------------------------------------------------%
 
-    % Function version if init/1.
+    % Return a representation of the empty set of constraints.
     %
-:- func init = pred_p_c_constraints.
+:- func init_pred_p_c_constraints = pred_p_c_constraints.
 
-    % add_constraint(Context, Formula, !PredConstraints):
+    % add_constraint(MCVarSet, Context, Constraint, !PredPCConstraints):
     %
-    % adds the constraint given by Formula to the constraint system
-    % in PredConstraints.
+    % Add the constraint given by Constraint (whose vars are described by
+    % MCVarSet, and which comes from Context) to the constraint system
+    % in PredPCConstraints.
     %
-:- pred add_constraint(prog_context::in, constraint_formula::in,
+:- pred add_constraint(mc_varset::in, prog_context::in, mc_constraint::in,
     pred_p_c_constraints::in, pred_p_c_constraints::out) is det.
 
-    % add_proc_specific_constraint(Context, ProcId, Formula, !PredConstraints):
+    % add_proc_specific_constraint(MCVarSet, Context, ProcId, Constraint,
+    %   !PredPCConstraints):
     %
-    % adds the constraint given by Formula to the constraint system in
-    % PredConstraints, and associates it specificaly with procedure ProcId.
+    % Add the constraint given by Constraint to the constraint system in
+    % PredPCConstraints, and associate it specifically with the given procedure.
     %
-:- pred add_proc_specific_constraint(prog_context::in, proc_id::in,
-    constraint_formula::in,
+:- pred add_proc_specific_constraint(mc_varset::in, prog_context::in,
+    proc_id::in, mc_constraint::in,
     pred_p_c_constraints::in, pred_p_c_constraints::out) is det.
 
-    % add_mode_infer_callee(PredId, !PredConstraints)
+    % add_mode_infer_callee(PredId, !PredPCConstraints):
     %
-    % Records in PredConstraints that predicate PredId is called and
-    % needs to have modes inferred for it for mode analysis of the
-    % predicate PredConstraints refers to.
+    % Record in PredPCConstraints that predicate PredId is called and
+    % therefore needs to have modes inferred for it. Without those inferred
+    % modes, mode analysis cannot properly analyze the predicate whose
+    % mode constraints PredPCConstraints represents.
     %
-:- pred add_mode_infer_callee(pred_id::in, pred_p_c_constraints::in,
-    pred_p_c_constraints::out) is det.
+:- pred add_mode_infer_callee(pred_id::in,
+    pred_p_c_constraints::in, pred_p_c_constraints::out) is det.
 
-    % pred_constraints_to_formulae rips the barebones
-    % constraints (those that apply to all procedures of a
-    % predicate) out of the pred_p_c_constraints structure
-    % and returns them as a list of constraint formulae.
+    % Return the constraints that apply to all procedures of a predicate.
     %
-:- func pred_constraints_to_formulae(pred_p_c_constraints)
-    = constraint_formulae.
+:- func allproc_constraints(pred_p_c_constraints)
+    = list(mc_constraint).
 
-    % pred_constraints_for_proc_to_formulae returns all constraints that
-    % apply to the given procedure from the pred_p_c_constraints,
-    % including constraints that apply to all procedures.
+    % Return all constraints that apply to the given procedure.
+    % This includes both constraints specific to that procedure,
+    % and constraints that apply to all procedures.
     %
-:- func pred_constraints_for_proc_to_formulae(proc_id, pred_p_c_constraints)
-    = constraint_formulae.
+:- func all_constraints_for_proc(proc_id, pred_p_c_constraints)
+    = list(mc_constraint).
 
-    % pred_constraints_to_formulae_and_annotations returns constraints
-    % that apply to all procedures of a predicate as a list of pairs of
-    % constraint_formula and constraint_annotation.
+    % Return the annotated constraints that apply to all procedures
+    % of a predicate.
     %
-:- func pred_constraints_to_formulae_and_annotations(pred_p_c_constraints) =
-    assoc_list(constraint_formula, constraint_annotation).
+:- func allproc_annotated_constraints(pred_p_c_constraints) =
+    list(mc_ann_constraint).
 
-    % pred_constraints_for_proc_to_formulae_and_annotations
-    % returns all constraints that apply to the given procedure from the
-    % pred_p_c_constraints, including constraints that apply to all
-    % procedures, with their constraint annotations, in pairs.
+    % Return the annotated constraints that apply to the given procedure.
+    % This includes both constraints specific to that procedure,
+    % and constraints that apply to all procedures.
     %
-:- func pred_constraints_for_proc_to_formulae_and_annotations(proc_id,
-    pred_p_c_constraints)
-    = assoc_list(constraint_formula, constraint_annotation).
+:- func all_annotated_constraints_for_proc(proc_id, pred_p_c_constraints)
+    = list(mc_ann_constraint).
 
-    % proc_constraints_to_formulae_and_annotations(ProcId, PredConstraints)
-    % returns constraints that apply specifically to the given
-    % procedure (but not constraints that apply to all procedures).
+    % Return the annotation constraints that apply specifically to the given
+    % procedure, but not constraints that apply to all procedures.
     %
-:- func proc_constraints_to_formulae_and_annotations(proc_id,
-    pred_p_c_constraints)
-    = assoc_list(constraint_formula, constraint_annotation).
+:- func proc_specific_annotated_constraints(proc_id, pred_p_c_constraints)
+    = list(mc_ann_constraint).
 
 %-----------------------------------------------------------------------------%
 
-    % equiv_no(Context, MCVar, !Constraints) constrains MCVar to `no' in
-    % Constraints. Context should be the context of the goal or
-    % declaration that imposed this constraint.
+    % equiv_no(MCVarSet, Context, MCVar, !Constraints) constrains MCVar to `no'
+    % in Constraints. Context should be the context of the goal or declaration
+    % that imposed this constraint.
     %
-:- pred equiv_no(prog_context::in, mc_var::in,
+:- pred equiv_no(mc_varset::in, prog_context::in, mc_var::in,
     pred_p_c_constraints::in, pred_p_c_constraints::out) is det.
 
-    % equivalent(Context, MCVars, !Constraints) constrains MCVars in
-    % Constraints to all take the same value. Context should be the context of
-    % the goal or declaration that imposed this constraint.
+    % equivalent(Context, MCVars, !Constraints) constrains MCVars
+    % in Constraints to all take the same value. Context should be
+    % the context of the goal or declaration that imposed this constraint.
     %
-:- pred equivalent(prog_context::in, list(mc_var)::in,
+:- pred equivalent(mc_varset::in, prog_context::in, list(mc_var)::in,
     pred_p_c_constraints::in, pred_p_c_constraints::out) is det.
 
-    % equiv_disj(Context, X, Ys, !Constraints) constrains X and Ys in
+    % equiv_disj(MCVarSet, Context, X, Ys, !Constraints) constrains X and Ys in
     % Constraints such that (X <-> disj(Ys)) - i.e. if X is true at least one
-    % of the Ys must be true, if X is false, all of Ys must be false.
+    % of the Ys must be true, and if X is false, all of Ys must be false.
     % Context should be the context of the goal or declaration that imposed
     % this constraint.
     %
-:- pred equiv_disj(prog_context::in, mc_var::in, list(mc_var)::in,
+:- pred equiv_disj(mc_varset::in, prog_context::in,
+    mc_var::in, list(mc_var)::in,
     pred_p_c_constraints::in, pred_p_c_constraints::out) is det.
 
-    % at_most_one(Context, MCVars, !Constraints) constrains MCVars in
+    % at_most_one(MCVarSet, Context, MCVars, !Constraints) constrains MCVars in
     % Constraints such that at most one of them can be true. Context should be
     % the context of the goal or declaration that imposed this constraint.
     %
-:- pred at_most_one(prog_context::in, list(mc_var)::in,
+:- pred at_most_one(mc_varset::in, prog_context::in, list(mc_var)::in,
     pred_p_c_constraints::in, pred_p_c_constraints::out) is det.
 
-    % not_both(Context, A, B, !Constraints) constrains mode constraint
-    % variables A and B in Constraints by the constraint (not A ^ B). Context
-    % should be the context of the goal or declaration that imposed this
-    % constraint.
+    % not_both(MCVarSet, Context, A, B, !Constraints) constrains mode
+    % constraint variables A and B in Constraints by the constraint
+    % `not (A and B)'. Context should be the context of the goal or
+    % declaration that imposed this constraint.
     %
-:- pred not_both(prog_context::in, mc_var::in, mc_var::in,
+:- pred not_both(mc_varset::in, prog_context::in, mc_var::in, mc_var::in,
     pred_p_c_constraints::in, pred_p_c_constraints::out) is det.
 
-    % exactly_one(Context, MCVars, !Constraints) constrains MCVars in
+    % exactly_one(MCVarSet, Context, MCVars, !Constraints) constrains MCVars in
     % Constraints such that exactly one of them is `yes'. Context should be
     % the context of the goal or declaration that imposed this constraint.
     %
-:- pred exactly_one(prog_context::in, list(mc_var)::in,
+:- pred exactly_one(mc_varset::in, prog_context::in, list(mc_var)::in,
     pred_p_c_constraints::in, pred_p_c_constraints::out) is det.
 
-    % xor(Context, A, B, !Constraints) constrains mode constraint variables A
-    % and B in Constraints by the constraint (A xor B), i.e. constrains exactly
-    % one of them to be true. Context should be the context of the goal or
-    % declaration that imposed this constraint.
+    % xor(MCVarSet, Context, A, B, !Constraints) constrains mode constraint
+    % variables A and B in Constraints by the constraint (A xor B),
+    % i.e. constrains exactly one of them to be true. Context should be
+    % the context of the goal or declaration that imposed this constraint.
     %
-:- pred xor(prog_context::in, mc_var::in, mc_var::in,
+:- pred xor(mc_varset::in, prog_context::in, mc_var::in, mc_var::in,
     pred_p_c_constraints::in, pred_p_c_constraints::out) is det.
 
 %-----------------------------------------------------------------------------%
@@ -302,199 +299,220 @@
 :- type mc_type
     --->    mc_type.
 
+project_mc_constraint(mc_ann_constraint(Constraint, _)) = Constraint.
+project_mc_annotation(mc_ann_constraint(_, Annotation)) = Annotation.
+
+%-----------------------------------------------------------------------------%
+
     % Initialises all the parts of a mode_constraints_info type.
     %
-init = pred_constraints(multi_map.init, [], set.init).
+init_pred_p_c_constraints = pred_p_c_constraints(multi_map.init, [], set.init).
 
-add_constraint(Context, ConstraintFormula, !PredConstraints) :-
-    AllProcsConstraints = !.PredConstraints ^ pred_constraints,
-    ConstraintAnnotation = constraint_annotation(Context),
-    FormulaAndAnnotation = pair(ConstraintFormula, ConstraintAnnotation),
-    !:PredConstraints = !.PredConstraints ^ pred_constraints :=
-        list.cons(FormulaAndAnnotation, AllProcsConstraints).
-
-add_proc_specific_constraint(Context, ProcId, ConstraintFormula,
-        !PredConstraints) :-
-    ProcConstraints = !.PredConstraints ^ proc_constraints,
-    ConstraintAnnotation = constraint_annotation(Context),
-    FormulaAndAnnotation = pair(ConstraintFormula, ConstraintAnnotation),
-    !:PredConstraints = !.PredConstraints ^ proc_constraints :=
-        multi_map.add(ProcConstraints, ProcId, FormulaAndAnnotation).
-
-add_mode_infer_callee(PredId, !PredConstraints) :-
-    ModeInferCallees = !.PredConstraints ^ mode_infer_callees,
-    !:PredConstraints = !.PredConstraints ^ mode_infer_callees :=
+add_constraint(MCVarSet, Context, Constraint, !PredPCConstraints) :-
+    trace [
+        compile_time(flag("goal_mode_constraints")),
+        run_time(env("GOAL_MODE_CONSTRAINTS")),
+        io(!IO)
+    ] (
+        io.write_string("add constraint ", !IO),
+        pretty_print_constraint(MCVarSet, Constraint, !IO)
+    ),
+
+    AllProcsConstraints = !.PredPCConstraints ^ ppcc_allproc_constraints,
+    ConstraintAnnotation = mc_annotation(Context),
+    AnnotatedConstraint = mc_ann_constraint(Constraint, ConstraintAnnotation),
+    !PredPCConstraints ^ ppcc_allproc_constraints :=
+        [AnnotatedConstraint | AllProcsConstraints].
+
+add_proc_specific_constraint(MCVarSet, Context, ProcId, Constraint,
+        !PredPCConstraints) :-
+    trace [
+        compile_time(flag("goal_mode_constraints")),
+        run_time(env("GOAL_MODE_CONSTRAINTS")),
+        io(!IO)
+    ] (
+        io.format("add proc-specific constraint for proc %d ",
+            [i(proc_id_to_int(ProcId))], !IO),
+        pretty_print_constraint(MCVarSet, Constraint, !IO)
+    ),
+
+    ProcConstraints = !.PredPCConstraints ^ ppcc_procspec_constraints,
+    ConstraintAnnotation = mc_annotation(Context),
+    AnnotatedConstraint = mc_ann_constraint(Constraint, ConstraintAnnotation),
+    !PredPCConstraints ^ ppcc_procspec_constraints :=
+        multi_map.add(ProcConstraints, ProcId, AnnotatedConstraint).
+
+add_mode_infer_callee(PredId, !PredPCConstraints) :-
+    ModeInferCallees = !.PredPCConstraints ^ ppcc_mode_infer_callees,
+    !PredPCConstraints ^ ppcc_mode_infer_callees :=
         set.insert(ModeInferCallees, PredId).
 
-    % pred_constraints_to_formulae returns constraints that apply
-    % to all procedures of a predicate as a list of constraint formulae.
-    %
-pred_constraints_to_formulae(PCs) = assoc_list.keys(PCs ^ pred_constraints).
+%-----------------------------------------------------------------------------%
 
-    % pred_constraints_to_formulae/2 returns all constraints that
-    % apply to the given procedure from the pred_p_c_constraints,
-    % including constraints that apply to all procedures.
-    %
-pred_constraints_for_proc_to_formulae(ProcId, PredConstraints)
-        = ConstraintFormulae :-
-    ThisProcConstraints = multi_map.lookup(PredConstraints ^ proc_constraints,
-        ProcId),
-    AllProcConstraints = PredConstraints ^ pred_constraints,
-    ConstraintFormulae = assoc_list.keys(ThisProcConstraints) ++
-        assoc_list.keys(AllProcConstraints).
-
-    % pred_constraints_to_formulae_and_annotations returns constraints
-    % that apply to all procedures of a predicate as a list of pairs of
-    % constraint_formula and constraint_annotation.
-    %
-pred_constraints_to_formulae_and_annotations(PredConstraints) =
-    PredConstraints ^ pred_constraints.
-
-    % pred_constraints_to_formulae_and_annotations(PredConstraints)
-    % returns all constraints that apply to the given procedure from the
-    % pred_p_c_constraints, including constraints that apply to all
-    % procedures, with their constraint annotations, in pairs.
-    %
-pred_constraints_for_proc_to_formulae_and_annotations(ProcId, PredConstraints)
-        = ConstraintFormulae :-
-    ThisProcConstraints = multi_map.lookup(PredConstraints ^ proc_constraints,
-        ProcId),
-    AllProcConstraints = PredConstraints ^ pred_constraints,
-    ConstraintFormulae = ThisProcConstraints ++ AllProcConstraints.
+allproc_constraints(PredPCConstraints) = Constraints :-
+    AnnotatedConstraints = allproc_annotated_constraints(PredPCConstraints),
+    Constraints = list.map(project_mc_constraint, AnnotatedConstraints).
+
+all_constraints_for_proc(ProcId, PredPCConstraints) = Constraints :-
+    AnnotatedConstraints = all_annotated_constraints_for_proc(ProcId,
+        PredPCConstraints),
+    Constraints = list.map(project_mc_constraint, AnnotatedConstraints).
+
+allproc_annotated_constraints(PredPCConstraints) = AnnotatedConstraints :-
+    AnnotatedConstraints = PredPCConstraints ^ ppcc_allproc_constraints.
+
+all_annotated_constraints_for_proc(ProcId, PredPCConstraints)
+        = AnnotatedConstraints :-
+    multi_map.lookup(PredPCConstraints ^ ppcc_procspec_constraints, ProcId,
+        ThisProcConstraints),
+    AllProcConstraints = PredPCConstraints ^ ppcc_allproc_constraints,
+    AnnotatedConstraints = ThisProcConstraints ++ AllProcConstraints.
 
-proc_constraints_to_formulae_and_annotations(ProcId, PredConstraints) =
-    multi_map.lookup(PredConstraints ^ proc_constraints, ProcId).
+proc_specific_annotated_constraints(ProcId, PredPCConstraints) =
+    multi_map.lookup(PredPCConstraints ^ ppcc_procspec_constraints, ProcId).
 
 %-----------------------------------------------------------------------------%
 %
 % Predicates to allow easy adding of var_constraints.
 %
 
-equiv_no(Context, MCVar, !Constraints) :-
-    add_constraint(Context, atomic_constraint(equiv_bool(MCVar, no)),
+equiv_no(MCVarSet, Context, MCVar, !Constraints) :-
+    add_constraint(MCVarSet, Context, mc_atomic(equiv_bool(MCVar, no)),
         !Constraints).
 
-equivalent(Context, MCVars, !Constraints) :-
-    add_constraint(Context, atomic_constraint(equivalent(MCVars)),
+equivalent(MCVarSet, Context, MCVars, !Constraints) :-
+    add_constraint(MCVarSet, Context, mc_atomic(equivalent(MCVars)),
         !Constraints).
 
-equiv_disj(Context, X, Ys, !Constraints) :-
-    add_constraint(Context, atomic_constraint(equiv_disj(X, Ys)),
+equiv_disj(MCVarSet, Context, X, Ys, !Constraints) :-
+    add_constraint(MCVarSet, Context, mc_atomic(equiv_disj(X, Ys)),
         !Constraints).
 
-at_most_one(Context, MCVars, !Constraints) :-
-    add_constraint(Context, atomic_constraint(at_most_one(MCVars)),
+at_most_one(MCVarSet, Context, MCVars, !Constraints) :-
+    add_constraint(MCVarSet, Context, mc_atomic(at_most_one(MCVars)),
         !Constraints).
 
-not_both(Context, A, B, !Constraints) :-
-    at_most_one(Context, [A, B], !Constraints).
+not_both(MCVarSet, Context, A, B, !Constraints) :-
+    add_constraint(MCVarSet, Context, mc_atomic(at_most_one([A, B])),
+        !Constraints).
 
-exactly_one(Context, MCVars, !Constraints) :-
-    add_constraint(Context, atomic_constraint(exactly_one(MCVars)),
+exactly_one(MCVarSet, Context, MCVars, !Constraints) :-
+    add_constraint(MCVarSet, Context, mc_atomic(exactly_one(MCVars)),
         !Constraints).
 
-xor(Context, A, B, !Constraints) :-
-    exactly_one(Context, [A, B], !Constraints).
+xor(MCVarSet, Context, A, B, !Constraints) :-
+    add_constraint(MCVarSet, Context, mc_atomic(exactly_one([A, B])),
+        !Constraints).
 
 %-----------------------------------------------------------------------------%
 %
 % Dumping constraints for --debug-mode-constraints
 %
 
-dump_constraints_and_annotations(Varset, ConstraintsAndAnnotations, !IO) :-
+dump_constraints_and_annotations(VarSet, AnnConstraints, !IO) :-
     Indent = 0,
-    keys_and_values(ConstraintsAndAnnotations, Constraints, Annotations),
-    list.foldl_corresponding(dump_constraint(Varset, Indent), Annotations,
-        Constraints, !IO).
+    list.foldl(dump_ann_constraint(VarSet, Indent), AnnConstraints, !IO).
 
     % Dumps a list of constraints using the same constraint annotation
     % at indent level indicated by the int.
     %
-:- pred dump_constraints(mc_varset::in, int::in, constraint_annotation::in,
-    constraint_formulae::in, io::di, io::uo) is det.
+:- pred dump_constraints(mc_varset::in, int::in, mc_annotation::in,
+    list(mc_constraint)::in, io::di, io::uo) is det.
+
+dump_constraints(VarSet, Indent, Annotation, Constraints, !IO) :-
+    list.foldl(dump_constraint(VarSet, Indent, Annotation), Constraints, !IO).
 
-dump_constraints(Varset, Indent, Annotation, Constraints, !IO) :-
-    list.foldl(dump_constraint(Varset, Indent, Annotation), Constraints, !IO).
+:- pred dump_ann_constraint(mc_varset::in, int::in, mc_ann_constraint::in,
+    io::di, io::uo) is det.
 
-    % Prints one constraint_formulae to the output. The int is an
-    % indent level.
+dump_ann_constraint(VarSet, Indent, AnnConstraint, !IO) :-
+    AnnConstraint = mc_ann_constraint(Constraint, Annotation),
+    dump_constraint(VarSet, Indent, Annotation, Constraint, !IO).
+
+    % Prints one mc_constraint to the output. The int is an indent level.
     %
-:- pred dump_constraint(mc_varset::in, int::in, constraint_annotation::in,
-    constraint_formula::in, io::di, io::uo) is det.
+:- pred dump_constraint(mc_varset::in, int::in, mc_annotation::in,
+    mc_constraint::in, io::di, io::uo) is det.
 
-dump_constraint(Varset, Indent, Annotation, disj(Constraints), !IO) :-
+dump_constraint(VarSet, Indent, Annotation, Constraint, !IO) :-
+    (
+        Constraint = mc_disj(Constraints),
     Context = context(Annotation),
     write_error_pieces(Context, Indent, [words("disj(")], !IO),
-    dump_constraints(Varset, Indent+1, Annotation, Constraints, !IO),
-    write_error_pieces(Context, Indent, [words(") end disj")], !IO).
-
-dump_constraint(Varset, Indent, Annotation, conj(Constraints), !IO) :-
+        dump_constraints(VarSet, Indent+1, Annotation, Constraints, !IO),
+        write_error_pieces(Context, Indent, [words(") end disj")], !IO)
+    ;
+        Constraint = mc_conj(Constraints),
     Context = context(Annotation),
     write_error_pieces(Context, Indent, [words("conj(")], !IO),
-    dump_constraints(Varset, Indent+1, Annotation, Constraints, !IO),
-    write_error_pieces(Context, Indent, [words(") end conj")], !IO).
-
-dump_constraint(Varset, Indent, Annotation, atomic_constraint(Constraint),
-        !IO) :-
-    dump_var_constraint(Varset, Indent, Annotation, Constraint, !IO).
+        dump_constraints(VarSet, Indent+1, Annotation, Constraints, !IO),
+        write_error_pieces(Context, Indent, [words(") end conj")], !IO)
+    ;
+        Constraint = mc_atomic(AtomicConstraint),
+        dump_var_constraint(VarSet, Indent, Annotation, AtomicConstraint, !IO)
+    ).
 
     % Prints a var_constraint to the output. The int is an indent level.
     %
-:- pred dump_var_constraint(mc_varset::in, int::in, constraint_annotation::in,
+:- pred dump_var_constraint(mc_varset::in, int::in, mc_annotation::in,
     var_constraint::in, io::di, io::uo) is det.
 
-dump_var_constraint(Varset, Indent, Annotation, equiv_bool(X, Val), !IO) :-
-    mc_var_list_to_string(Varset, [X], VarName),
+dump_var_constraint(VarSet, Indent, Annotation, Constraint, !IO) :-
+    (
+        Constraint = equiv_bool(X, Val),
+        mc_var_list_to_string(VarSet, [X], VarName),
     mc_var_val_to_string(Val, ValString),
     Context = context(Annotation),
     write_error_pieces(Context, Indent,
-        [words(VarName ++ " = " ++ ValString)], !IO).
-
-dump_var_constraint(Varset, Indent, Annotation, equivalent(Xs), !IO) :-
-    mc_var_list_to_string(Varset, Xs, VarsString),
+            [words(VarName ++ " = " ++ ValString)], !IO)
+    ;
+        Constraint = equivalent(Xs),
+        mc_var_list_to_string(VarSet, Xs, VarsString),
     Context = context(Annotation),
     write_error_pieces(Context, Indent,
-        [words("equivalent(" ++ VarsString ++ ")")], !IO).
-
-dump_var_constraint(Varset, Indent, Annotation, implies(X, Y), !IO) :-
-    mc_var_list_to_string(Varset, [X], XName),
-    mc_var_list_to_string(Varset, [Y], YName),
+            [words("equivalent(" ++ VarsString ++ ")")], !IO)
+    ;
+        Constraint = implies(X, Y),
+        mc_var_list_to_string(VarSet, [X], XName),
+        mc_var_list_to_string(VarSet, [Y], YName),
     Context = context(Annotation),
     write_error_pieces(Context, Indent,
-        [words(XName ++ " -> " ++ YName)], !IO).
-
-dump_var_constraint(Varset, Indent, Annotation, equiv_disj(X, Xs), !IO) :-
-    mc_var_list_to_string(Varset, [X], XName),
-    mc_var_list_to_string(Varset, Xs, XsString),
+            [words(XName ++ " -> " ++ YName)], !IO)
+    ;
+        Constraint = equiv_disj(X, Xs),
+        mc_var_list_to_string(VarSet, [X], XName),
+        mc_var_list_to_string(VarSet, Xs, XsString),
     Context = context(Annotation),
     Pieces = [words(XName ++ " <-> disj(" ++ XsString ++ ")")],
-    write_error_pieces(Context, Indent, Pieces, !IO).
-
-dump_var_constraint(Varset, Indent, Annotation, at_most_one(Xs), !IO) :-
-    mc_var_list_to_string(Varset, Xs, XsString),
+        write_error_pieces(Context, Indent, Pieces, !IO)
+    ;
+        Constraint = at_most_one(Xs),
+        mc_var_list_to_string(VarSet, Xs, XsString),
     Pieces = [words("at_most_one(" ++ XsString ++ ")")],
     Context = context(Annotation),
-    write_error_pieces(Context, Indent, Pieces, !IO).
-
-dump_var_constraint(Varset, Indent, Annotation, exactly_one(Xs), !IO) :-
-    mc_var_list_to_string(Varset, Xs, XsString),
+        write_error_pieces(Context, Indent, Pieces, !IO)
+    ;
+        Constraint = exactly_one(Xs),
+        mc_var_list_to_string(VarSet, Xs, XsString),
     Pieces = [words("exactly_one(" ++ XsString ++ ")")],
     Context = context(Annotation),
-    write_error_pieces(Context, Indent, Pieces, !IO).
+        write_error_pieces(Context, Indent, Pieces, !IO)
+    ).
 
-    % mc_var_list_to_string(Varset, MCVars, MCVarsString)
+    % mc_var_list_to_string(VarSet, MCVars, MCVarsString):
+    %
     % Makes a comma separated list of MCVars as a string.
     %
 :- pred mc_var_list_to_string(mc_varset::in, list(mc_var)::in,
     string::out) is det.
 
-mc_var_list_to_string(_Varset, [], "").
-mc_var_list_to_string(Varset, [MCVar], VarName) :-
-    varset.lookup_name(Varset, MCVar, VarName).
-mc_var_list_to_string(Varset, [MCVar1, MCVar2 | MCVars],
+mc_var_list_to_string(_VarSet, [], "").
+mc_var_list_to_string(VarSet, [MCVar], VarName) :-
+    varset.lookup_name(VarSet, MCVar, VarName).
+mc_var_list_to_string(VarSet, [MCVar1, MCVar2 | MCVars],
     VarName ++ ", " ++ VarNames) :-
-    varset.lookup_name(Varset, MCVar1, VarName),
-    mc_var_list_to_string(Varset, [MCVar2 | MCVars], VarNames).
+    varset.lookup_name(VarSet, MCVar1, VarName),
+    mc_var_list_to_string(VarSet, [MCVar2 | MCVars], VarNames).
 
     % Makes a string representation of an mc_var binding.
     %
@@ -508,82 +526,94 @@
 % Pretty printing predicates for the formulae type, and others
 %
 
-pretty_print_constraints(VarSet, Constraints, !IO) :-
+pretty_print_constraint(VarSet, Constraint, !IO) :-
     Indent = "",
-    pretty_print_constraints_indent(VarSet, Constraints, Indent, !IO).
-
-    % Same as before, but with an indent argument used to indent
-    % conjunctions and disjunctions of constraints.
-    %
-:- pred pretty_print_constraints_indent(mc_varset::in, constraint_formulae::in,
-    string::in, io::di, io::uo) is det.
+    pretty_print_constraint_indent(VarSet, Indent, Constraint, !IO).
 
-pretty_print_constraints_indent(_VarSet, [], _Indent, !IO).
-pretty_print_constraints_indent(VarSet, [Constr | Constrs], Indent, !IO) :-
-    pretty_print_constraint_indent(VarSet, Constr, Indent, !IO),
-    pretty_print_constraints_indent(VarSet, Constrs, Indent, !IO).
+pretty_print_constraints(VarSet, Constraints, !IO) :-
+    Indent = "",
+    pretty_print_constraints_indent(VarSet, Indent, Constraints, !IO).
 
-    % Prints one constraint_formulae to the output stream. Always puts
+    % Prints one mc_constraint to the output stream. Always puts
     % a new line at the end.
     %
-:- pred pretty_print_constraint_indent(mc_varset::in, constraint_formula::in,
-    string::in, io::di, io::uo) is det.
+:- pred pretty_print_constraint_indent(mc_varset::in, string::in,
+    mc_constraint::in, io::di, io::uo) is det.
 
-pretty_print_constraint_indent(VarSet, disj(Constraints), Indent, !IO) :-
+pretty_print_constraint_indent(VarSet, Indent, Constraint, !IO) :-
+    (
+        Constraint = mc_disj(Constraints),
     io.write_string(Indent, !IO),
     io.write_string("disj(\n", !IO),
-    pretty_print_constraints_indent(VarSet, Constraints, "\t" ++ Indent, !IO),
+        pretty_print_constraints_indent(VarSet, "\t" ++ Indent, Constraints,
+            !IO),
     io.write_string(Indent, !IO),
-    io.write_string(") end disj\n", !IO).
-
-pretty_print_constraint_indent(VarSet, conj(Constraints), Indent, !IO) :-
+        io.write_string(") end disj\n", !IO)
+    ;
+        Constraint = mc_conj(Constraints),
     io.write_string(Indent, !IO),
     io.write_string("conj(\n", !IO),
-    pretty_print_constraints_indent(VarSet, Constraints, "\t" ++ Indent, !IO),
+        pretty_print_constraints_indent(VarSet, "\t" ++ Indent, Constraints,
+            !IO),
     io.write_string(Indent, !IO),
-    io.write_string(") end conj\n", !IO).
+        io.write_string(") end conj\n", !IO)
+    ;
+        Constraint = mc_atomic(AtomicConstraint),
+        io.write_string(Indent, !IO),
+        pretty_print_var_constraint(VarSet, AtomicConstraint, !IO),
+        io.nl(!IO)
+    ).
 
-pretty_print_constraint_indent(VarSet, atomic_constraint(Constraint), Indent,
+    % Same as before, but with an indent argument used to indent
+    % conjunctions and disjunctions of constraints.
+    %
+:- pred pretty_print_constraints_indent(mc_varset::in, string::in,
+    list(mc_constraint)::in, io::di, io::uo) is det.
+
+pretty_print_constraints_indent(_VarSet, _Indent, [], !IO).
+pretty_print_constraints_indent(VarSet, Indent, [Constraint | Constraints],
         !IO) :-
-    io.write_string(Indent, !IO),
-    pretty_print_var_constraint(VarSet, Constraint, !IO),
-    io.nl(!IO).
+    pretty_print_constraint_indent(VarSet, Indent, Constraint, !IO),
+    pretty_print_constraints_indent(VarSet, Indent, Constraints, !IO).
 
     % Prints a var_constraint to the screen. No indents, no line return.
     %
 :- pred pretty_print_var_constraint(mc_varset::in, var_constraint::in,
     io::di, io::uo) is det.
 
-pretty_print_var_constraint(VarSet, equiv_bool(X, TF), !IO) :-
+pretty_print_var_constraint(VarSet, Constraint, !IO) :-
+    (
+        Constraint = equiv_bool(X, TF),
     pretty_print_mc_var(VarSet, X, !IO),
     io.write_string(" = ", !IO),
-    io.print(TF, !IO).
-
-pretty_print_var_constraint(VarSet, equivalent(Xs), !IO) :-
+        io.print(TF, !IO)
+    ;
+        Constraint = equivalent(Xs),
     io.write_string("equivalent(", !IO),
     pretty_print_mc_vars(VarSet, Xs, !IO),
-    io.write_string(")", !IO).
-
-pretty_print_var_constraint(VarSet, implies(X, Y), !IO) :-
+        io.write_string(")", !IO)
+    ;
+        Constraint = implies(X, Y),
     pretty_print_mc_var(VarSet, X, !IO),
     io.write_string(" -> ", !IO),
-    pretty_print_mc_var(VarSet, Y, !IO).
-
-pretty_print_var_constraint(VarSet, equiv_disj(X, Xs), !IO) :-
+        pretty_print_mc_var(VarSet, Y, !IO)
+    ;
+        Constraint = equiv_disj(X, Xs),
     pretty_print_mc_var(VarSet, X, !IO),
     io.write_string(" <-> disj(", !IO),
     pretty_print_mc_vars(VarSet, Xs, !IO),
-    io.write_string(")", !IO).
-
-pretty_print_var_constraint(VarSet, at_most_one(Xs), !IO) :-
+        io.write_string(")", !IO)
+    ;
+        Constraint = at_most_one(Xs),
     io.write_string("at_most_one(", !IO),
     pretty_print_mc_vars(VarSet, Xs, !IO),
-    io.write_string(")", !IO).
-
-pretty_print_var_constraint(VarSet, exactly_one(Xs), !IO) :-
+        io.write_string(")", !IO)
+    ;
+        Constraint = exactly_one(Xs),
     io.write_string("exactly_one(", !IO),
     pretty_print_mc_vars(VarSet, Xs, !IO),
-    io.write_string(")", !IO).
+        io.write_string(")", !IO)
+    ).
 
     % Prints a constraint var to the screen. No indents, no line return.
     % Simply uses the variable's name from the varset.
@@ -620,8 +650,8 @@
 
     % Prints the variable bindings of this solution, one per line.
     %
-:- pred pretty_print_bindings(mc_varset::in, mc_bindings::in, int::in, int::out,
-    io::di, io::uo) is det.
+:- pred pretty_print_bindings(mc_varset::in, mc_bindings::in,
+    int::in, int::out, io::di, io::uo) is det.
 
 pretty_print_bindings(VarSet, Bindings, N, N + 1, !IO) :-
     io.write_string("Solution " ++ string.from_int(N) ++ ":\n{\n", !IO),
Index: compiler/build_mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/build_mode_constraints.m,v
retrieving revision 1.34
diff -u -b -r1.34 build_mode_constraints.m
--- compiler/build_mode_constraints.m	10 Mar 2009 05:00:29 -0000	1.34
+++ compiler/build_mode_constraints.m	2 Jun 2009 06:29:20 -0000
@@ -158,9 +158,8 @@
     % satisfied. Predicates with mode inference requested should
     % not be handled by this.
     %
-:- pred mode_decls_constraints(module_info::in, mc_var_map::in,
-    pred_id::in, list(list(mer_mode))::in, list(args)::in,
-    constraint_formulae::out) is det.
+:- pred mode_decls_constraints(module_info::in, mc_var_map::in, pred_id::in,
+    list(list(mer_mode))::in, list(args)::in, list(mc_constraint)::out) is det.
 
     % add_mode_decl_constraints(ModuleInfo, PredId, ProcId,
     %   Decl, Args, !VarInfo, !Constraints)
@@ -201,11 +200,13 @@
 :- import_module check_hlds.mode_util.
 :- import_module hlds.hlds_args.
 :- import_module hlds.hlds_clauses.
+:- import_module hlds.hlds_desc.
 :- import_module libs.
 :- import_module libs.compiler_util.
 
 :- import_module bool.
 :- import_module cord.
+:- import_module io.
 :- import_module map.
 :- import_module maybe.
 :- import_module multi_map.
@@ -397,13 +398,18 @@
     hlds_goal::in, mc_var_info::in, mc_var_info::out, mode_constraints::in,
     mode_constraints::out) is det.
 
-add_goal_constraints(ModuleInfo, ProgVarset, PredId,
-        hlds_goal(GoalExpr, GoalInfo), !VarInfo, !Constraints) :-
+add_goal_constraints(ModuleInfo, ProgVarset, PredId, Goal,
+        !VarInfo, !Constraints) :-
+    Goal = hlds_goal(GoalExpr, GoalInfo), 
     Nonlocals = goal_info_get_nonlocals(GoalInfo),
     GoalPath = goal_info_get_goal_path(GoalInfo),
     Context = goal_info_get_context(GoalInfo),
-    add_goal_expr_constraints(ModuleInfo, ProgVarset, PredId, GoalExpr, Context,
-        GoalPath, Nonlocals, !VarInfo, !Constraints).
+    trace [compile_time(flag("goal_mode_constraints")), io(!IO)] (
+        GoalDesc = describe_goal(ModuleInfo, ProgVarset, Goal),
+        io.format("constraints for %s:\n", [s(GoalDesc)], !IO)
+    ),
+    add_goal_expr_constraints(ModuleInfo, ProgVarset, PredId, GoalExpr,
+        Context, GoalPath, Nonlocals, !VarInfo, !Constraints).
 
     % add_goal_expr_constraints(ModuleInfo, ProgVarset, PredId, GoalExpr,
     %   Context, GoalPath, Nonlocals, !VarInfo, !Constraints)
@@ -420,8 +426,8 @@
     %
 :- pred add_goal_expr_constraints(module_info::in, prog_varset::in,
     pred_id::in, hlds_goal_expr::in, prog_context::in, goal_path::in,
-    nonlocals::in, mc_var_info::in, mc_var_info::out, mode_constraints::in,
-    mode_constraints::out) is det.
+    nonlocals::in, mc_var_info::in, mc_var_info::out,
+    mode_constraints::in, mode_constraints::out) is det.
 
 add_goal_expr_constraints(ModuleInfo, ProgVarset, PredId, GoalExpr,
         Context, GoalPath, Nonlocals, !VarInfo, !Constraints) :-
@@ -436,7 +442,8 @@
             VarMap = rep_var_map(!.VarInfo),
             list.foldl2(add_goal_constraints(ModuleInfo, ProgVarset, PredId),
                 Goals, !VarInfo, !Constraints),
-            map.foldl(add_local_var_conj_constraints(Context),
+            map.foldl(
+                add_local_var_conj_constraints(!.VarInfo ^ mc_varset, Context),
                 locals_positions(ConjConstraintsInfo), !Constraints),
             map.foldl2(add_nonlocal_var_conj_constraints(ProgVarset, PredId,
                 Context, GoalPath), nonlocals_positions(ConjConstraintsInfo),
@@ -503,8 +510,8 @@
             % is produced at the unification.
             prog_var_at_path(ProgVarset, PredId, RHSvar, GoalPath,
                 RHSvarProducedHere, !VarInfo),
-            not_both(Context, LHSvarProducedHere, RHSvarProducedHere,
-                !Constraints)
+            not_both(!.VarInfo ^ mc_varset, Context,
+                LHSvarProducedHere, RHSvarProducedHere, !Constraints)
         ;
             RHS = rhs_functor(_Functor, _IsExistConstr, Args),
             prog_vars_at_path(ProgVarset, PredId, Args, GoalPath,
@@ -514,15 +521,16 @@
                 % Goal: LHSvar = functor(Args)
                 % (a): If one arg is produced here, then they all are.
                 % (b): At most one side of the unification is produced.
-                equivalent(Context, ArgsProducedHere, !Constraints),
-                not_both(Context, LHSvarProducedHere, OneArgProducedHere,
-                    !Constraints)
+                equivalent(!.VarInfo ^ mc_varset ,Context, ArgsProducedHere,
+                    !Constraints),
+                not_both(!.VarInfo ^ mc_varset, Context,
+                    LHSvarProducedHere, OneArgProducedHere, !Constraints)
             ;
                 ArgsProducedHere = [OneArgProducedHere],
                 % Goal: LHSvar = functor(Arg)
                 % At most one side of the unification is produced.
-                not_both(Context, LHSvarProducedHere, OneArgProducedHere,
-                    !Constraints)
+                not_both(!.VarInfo ^ mc_varset, Context,
+                    LHSvarProducedHere, OneArgProducedHere, !Constraints)
             ;
                 ArgsProducedHere = []
                 % Goal: LHSvar = functor
@@ -549,7 +557,8 @@
         % it must be able to be bound at any.
         EquivVarss = list.map_corresponding(list.cons, NonlocalsHere,
             NonlocalsAtDisjuncts),
-        list.foldl(equivalent(Context), EquivVarss, !Constraints)
+        list.foldl(equivalent(!.VarInfo ^ mc_varset, Context), EquivVarss,
+            !Constraints)
     ;
         GoalExpr = negation(Goal),
         Goal = hlds_goal(_, NegatedGoalInfo),
@@ -568,7 +577,8 @@
         % The variables non-local to the negation are not to be produced
         % at the negation or any deeper, so we constrain their mode constraint
         % variables for these positions to `no'.
-        list.foldl(equiv_no(Context), NonlocalsConstraintVars, !Constraints)
+        list.foldl(equiv_no(!.VarInfo ^ mc_varset, Context),
+            NonlocalsConstraintVars, !Constraints)
     ;
         GoalExpr = scope(_Reason, Goal),
         Goal = hlds_goal(_, SomeGoalInfo),
@@ -586,7 +596,8 @@
         EquivVarss = list.map_corresponding(
             func(NlAtPath, NlAtSubPath) = [NlAtPath, NlAtSubPath],
             NonlocalsHere, NonlocalsAtSubGoal),
-        list.foldl(equivalent(Context), EquivVarss, !Constraints),
+        list.foldl(equivalent(!.VarInfo ^ mc_varset, Context), EquivVarss,
+            !Constraints),
 
         add_goal_constraints(ModuleInfo, ProgVarset, PredId, Goal, !VarInfo,
             !Constraints)
@@ -635,22 +646,25 @@
         % constrained equivalent to reflect this.
         EquivVarss = list.map_corresponding3(func(A, B, C) = [A, B, C],
             NonlocalsHere, NonlocalsAtThen, NonlocalsAtElse),
-        list.foldl(equivalent(Context), EquivVarss, !Constraints),
+        list.foldl(equivalent(!.VarInfo ^ mc_varset, Context), EquivVarss,
+            !Constraints),
 
         % No nonlocal is produced in the condition.
-        list.foldl(equiv_no(Context), NonlocalsAtCond, !Constraints),
+        list.foldl(equiv_no(!.VarInfo ^ mc_varset, Context), NonlocalsAtCond,
+            !Constraints),
 
         % In case the program variable appears in the nonlocal set
         % of the condition, but its value is not used, we do not
         % simply constrain LocalAtCond = yes and LocalAtThen = no.
         % Instead we constrain exactly one of them to be yes.
-        list.foldl_corresponding(xor(Context), LocalAndSharedAtCond,
-            LocalAndSharedAtThen, !Constraints)
+        list.foldl_corresponding(xor(!.VarInfo ^ mc_varset, Context),
+            LocalAndSharedAtCond, LocalAndSharedAtThen, !Constraints)
     ;
         GoalExpr = call_foreign_proc(_, CalledPred, ProcId, ForeignArgs,
             _, _, _),
         CallArgs = list.map(foreign_arg_var, ForeignArgs),
-        module_info_pred_proc_info(ModuleInfo, CalledPred, ProcId, _, ProcInfo),
+        module_info_pred_proc_info(ModuleInfo, CalledPred, ProcId, _,
+            ProcInfo),
         ( proc_info_get_maybe_declared_argmodes(ProcInfo, yes(_OrigDecl)) ->
             proc_info_get_argmodes(ProcInfo, Decl),
 
@@ -699,10 +713,10 @@
         mode_decl_constraints(ModuleInfo), HeadVarsMCVars, Decls),
 
     Constraints0 = list.condense(ConstraintsList),
-    ( Constraints0 = [conj(OneModeOnlyConstraints)] ->
+    ( Constraints0 = [mc_conj(OneModeOnlyConstraints)] ->
         Constraints = OneModeOnlyConstraints
     ;
-        Constraints = [disj(Constraints0)]
+        Constraints = [mc_disj(Constraints0)]
     ).
 
 add_mode_decl_constraints(ModuleInfo, PredId, ProcId, Decl, Args,
@@ -716,8 +730,9 @@
 
     DeclConstraints = mode_decl_constraints(ModuleInfo, ArgsAtHead, Decl),
 
-    list.foldl(add_proc_specific_constraint(Context, ProcId), DeclConstraints,
-        !Constraints).
+    list.foldl(
+        add_proc_specific_constraint(!.VarInfo ^ mc_varset, Context, ProcId),
+        DeclConstraints, !Constraints).
 
     % add_call_mode_decls_constraints(ModuleInfo, ProgVarset, Context,
     %   CallingPred, Decls, GoalPath, CallArgs, !VarInfo, !Constraints)
@@ -755,18 +770,19 @@
         CallingPred, Decls, GoalPath, CallArgs, !VarInfo, !Constraints) :-
     prog_vars_at_path(ProgVarset, CallingPred, CallArgs, GoalPath,
         CallArgsHere, !VarInfo),
-    ConstraintFormulae = list.condense(list.map(
+    ModeSpecificConstraints = list.condense(list.map(
         mode_decl_constraints(ModuleInfo, CallArgsHere),
         Decls)),
-    ( ConstraintFormulae = [conj(OneModeOnlyConstraints)] ->
-        list.foldl(add_constraint(CallContext), OneModeOnlyConstraints,
-            !Constraints)
+    ( ModeSpecificConstraints = [mc_conj(OneModeOnlyConstraints)] ->
+        list.foldl(add_constraint(!.VarInfo ^ mc_varset, CallContext),
+            OneModeOnlyConstraints, !Constraints)
     ;
-        add_constraint(CallContext, disj(ConstraintFormulae), !Constraints)
+        add_constraint(!.VarInfo ^ mc_varset, CallContext,
+            mc_disj(ModeSpecificConstraints), !Constraints)
     ).
 
     % add_call_headvar_constraints(ProgVarset, Context, GoalPath, Caller,
-    %   CallArgs, Callee, HeadVars, CallArgs, !VarInfo, !Constraints)
+    %   CallArgs, Callee, HeadVars, CallArgs, !VarInfo, !Constraints):
     %
     % Forms constraints that, when satisfied, mean any call arg will be
     % produced if the corresponding headvar is produced by the main goal
@@ -795,7 +811,8 @@
     % of the call.
     EquivVarss = list.map_corresponding(func(A, B) = [A, B],
         HeadVarsAtHead, CallArgsHere),
-    list.foldl(equivalent(Context), EquivVarss, !Constraints).
+    list.foldl(equivalent(!.VarInfo ^ mc_varset, Context), EquivVarss,
+        !Constraints).
 
     % mode_decl_constraints(ModuleInfo, ConstraintVars, ArgModes)
     % looks at each mode in ArgModes to see if its variable is produced,
@@ -803,10 +820,10 @@
     % in ConstraintVars accordingly.
     %
 :- func mode_decl_constraints(module_info, list(mc_var), list(mer_mode)) =
-    constraint_formulae.
+    list(mc_constraint).
 
 mode_decl_constraints(ModuleInfo, ConstraintVars, ArgModes) =
-    [conj(list.map_corresponding(
+    [mc_conj(list.map_corresponding(
         single_mode_constraints(ModuleInfo), ConstraintVars, ArgModes))].
 
     % single_mode_constraints(ModuleInfo, MCVar, Mode) returns a
@@ -815,10 +832,9 @@
     % at the goal path it refers to.
     %
 :- func single_mode_constraints(module_info, mc_var, mer_mode) =
-    constraint_formula.
+    mc_constraint.
 
-single_mode_constraints(ModuleInfo, MCVar, Mode) =
-        atomic_constraint(equiv_bool(MCVar, IsProduced)) :-
+single_mode_constraints(ModuleInfo, MCVar, Mode) = Constraint :-
     mode_util.mode_get_insts(ModuleInfo, Mode, InitialInst, FinalInst),
     (
         % Already produced?
@@ -833,7 +849,8 @@
     ;
         % free -> free
         IsProduced = no     % Not produced here.
-    ).
+    ),
+    Constraint = mc_atomic(equiv_bool(MCVar, IsProduced)).
 
 %-----------------------------------------------------------------------------%
 
@@ -921,13 +938,16 @@
 add_nonlocal_var_conj_constraints(ProgVarset, PredId, Context, GoalPath,
     ProgVar, ProgVarAtConjuncts, !VarInfo, !Constraints) :-
 
-    equiv_disj(Context, ProgVarAtGoalPath, ProgVarAtConjuncts, !Constraints),
-    at_most_one(Context, ProgVarAtConjuncts, !Constraints),
+    equiv_disj(!.VarInfo ^ mc_varset, Context,
+        ProgVarAtGoalPath, ProgVarAtConjuncts, !Constraints),
+    at_most_one(!.VarInfo ^ mc_varset, Context,
+        ProgVarAtConjuncts, !Constraints),
 
     prog_var_at_path(ProgVarset, PredId, ProgVar, GoalPath, ProgVarAtGoalPath,
         !VarInfo).
 
-    % add_local_var_conj_constraints(Context, ProgVar, MCVars, !Constraints)
+    % add_local_var_conj_constraints(MCVarSet, Context, ProgVar, MCVars,
+    %   !Constraints)
     %
     % Adds conjunct constraints relating to ProgVar, to Constraints.
     % ProgVar should be local to the conjunction, and MCVars should
@@ -939,12 +959,13 @@
     % The constraints are: the program variable must be produced at
     % exactly one conjunct.
     %
-:- pred add_local_var_conj_constraints(prog_context::in, prog_var::in,
-    list(mc_var)::in, mode_constraints::in, mode_constraints::out) is det.
+:- pred add_local_var_conj_constraints(mc_varset::in, prog_context::in,
+    prog_var::in, list(mc_var)::in,
+    mode_constraints::in, mode_constraints::out) is det.
 
-add_local_var_conj_constraints(Context, _ProgVar, ProgVarAtConjuncts,
+add_local_var_conj_constraints(MCVarSet, Context, _ProgVar, ProgVarAtConjuncts,
         !Constraints) :-
-    exactly_one(Context, ProgVarAtConjuncts, !Constraints).
+    exactly_one(MCVarSet, Context, ProgVarAtConjuncts, !Constraints).
 
     % Initialises the conj_constraints_info_structure.
     %
Index: compiler/mcsolver.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mcsolver.m,v
retrieving revision 1.8
diff -u -b -r1.8 mcsolver.m
--- compiler/mcsolver.m	6 Jan 2007 09:23:40 -0000	1.8
+++ compiler/mcsolver.m	2 Jun 2009 06:27:54 -0000
@@ -48,7 +48,7 @@
     % Prepares the constraints described in abstract_mode_constraints.m
     % appropriately.
     %
-:- pred prepare_abstract_constraints(constraint_formulae::in,
+:- pred prepare_abstract_constraints(list(mc_constraint)::in,
     prep_cstrts::in, prep_cstrts::out) is det.
 
     % NOTE: where possible, prepare_abstract_constraints/3 should be used
@@ -167,9 +167,10 @@
 
     % A propagation graph is an optimised representation of a set of
     % binary implication constraints. It consists of a pair of mappings
-    % from vars to consequent assignments, where the LHS of the pair
-    % is the mapping when the var in question is bound to `yes'
-    % and the RHS is the mapping when the var in question is bound to `no'.
+    % from vars to consequent assignments, where prop_graph_yes field
+    % is the mapping when the var in question is bound to `yes', and the
+    % prop_graph_no field is the mapping when the var in question
+    % is bound to `no'.
     %
 :- type prop_graph
     --->    prop_graph(
@@ -239,30 +240,33 @@
     % Prepares a constraint (as described in abstract_mode_constraints.m)
     % appropriately.
     %
-:- pred prepare_abstract_constraint(constraint_formula::in, prep_cstrts::in,
-    prep_cstrts::out) is det.
-
-prepare_abstract_constraint(atomic_constraint(VarConstraint), PCs0, PCs) :-
-    prepare_var_constraint(VarConstraint, PCs0, PCs).
-
-prepare_abstract_constraint(conj(Formulae), !PCs) :-
-    prepare_abstract_constraints(Formulae, !PCs).
+:- pred prepare_abstract_constraint(mc_constraint::in,
+    prep_cstrts::in, prep_cstrts::out) is det.
 
-prepare_abstract_constraint(disj(Formulae), !PCs) :-
+prepare_abstract_constraint(Constraint, !PCs) :-
+    (
+        Constraint = mc_atomic(VarConstraint),
+        prepare_var_constraint(VarConstraint, !PCs)
+    ;
+        Constraint = mc_conj(Constraints),
+        prepare_abstract_constraints(Constraints, !PCs)
+    ;
+        Constraint = mc_disj(Constraints),
     (
         % Build var - bool pairs assuming structure
-        % disj(conj(assgts), conj(assgts, ...), otherwise fail.
+            % mc_disj(mc_conj(assgts), mc_conj(assgts), ...), otherwise fail.
         list.map(
-            ( pred(conj(Fls)::in, VarValPairs::out) is semidet :-
-                list.map((pred(atomic_constraint(equiv_bool(Var, Val))::in,
+                ( pred(mc_conj(Fls)::in, VarValPairs::out) is semidet :-
+                    list.map((pred(mc_atomic(equiv_bool(Var, Val))::in,
                     (Var - Val)::out) is semidet), Fls, VarValPairs)
             ),
-            Formulae, DisjOfAssgts)
+                Constraints, DisjOfAssgts)
     ->
         disjunction_of_assignments(DisjOfAssgts, !PCs)
     ;
         compiler_util.sorry(this_file,
             "Disjuction of constraints - general case.")
+        )
     ).
 
     % Prepares an atomic constraint (as described in
@@ -291,99 +295,96 @@
 
 %-----------------------------------------------------------------------------%
 
-equivalent(X, Y, PCs0, PCs) :-
-    PCs = PCs0 ^ prep_eqv_vars :=
-        ensure_equivalence(PCs0 ^ prep_eqv_vars, X, Y).
+equivalent(X, Y, !PCs) :-
+    !PCs ^ prep_eqv_vars := ensure_equivalence(!.PCs ^ prep_eqv_vars, X, Y).
 
 %-----------------------------------------------------------------------------%
 
-equivalent([], PCs, PCs).
-equivalent([X | Xs], PCs0, PCs) :-
-    list.foldl(equivalent(X), Xs, PCs0, PCs).
+equivalent([], !PCs).
+equivalent([X | Xs], !PCs) :-
+    list.foldl(equivalent(X), Xs, !PCs).
 
 %-----------------------------------------------------------------------------%
 
-implies(X, Y, PCs0, PCs) :-
-    PCs = PCs0 ^ prep_impls := [ (X == yes) `implies` (Y == yes),
+implies(X, Y, !PCs) :-
+    !PCs ^ prep_impls := [ (X == yes) `implies` (Y == yes),
                                  (Y == no)  `implies` (X == no)
-                               | PCs0 ^ prep_impls ].
+                         | !.PCs ^ prep_impls ].
 
 %-----------------------------------------------------------------------------%
 
-not_both(X, Y, PCs0, PCs) :-
-    PCs = PCs0 ^ prep_impls := [ (X == yes) `implies` (Y == no),
+not_both(X, Y, !PCs) :-
+    !PCs ^ prep_impls := [ (X == yes) `implies` (Y == no),
                                  (Y == yes) `implies` (X == no)
-                               | PCs0 ^ prep_impls ].
+                         | !.PCs ^ prep_impls ].
 
 %-----------------------------------------------------------------------------%
 
-different(X, Y, PCs0, PCs) :-
-    PCs = PCs0 ^ prep_impls := [ (X == yes) `implies` (Y == no),
+different(X, Y, !PCs) :-
+    !PCs ^ prep_impls := [ (X == yes) `implies` (Y == no),
                                  (X == no)  `implies` (Y == yes),
                                  (Y == yes) `implies` (X == no),
                                  (Y == no)  `implies` (X == yes)
-                               | PCs0 ^ prep_impls ].
+                         | !.PCs ^ prep_impls ].
 
 %-----------------------------------------------------------------------------%
 
-assign(X, V, PCs0, PCs) :-
-    PCs = PCs0 ^ prep_assgts := [(X == V) | PCs0 ^ prep_assgts].
+assign(X, V, !PCs) :-
+    !PCs ^ prep_assgts := [(X == V) | !.PCs ^ prep_assgts].
 
 %-----------------------------------------------------------------------------%
 
-equivalent_to_disjunction(X, Ys, PCs0, PCs) :-
+equivalent_to_disjunction(X, Ys, !PCs) :-
     (
         Ys = [],
-        assign(X, no, PCs0, PCs)
+        assign(X, no, !PCs)
     ;
         Ys = [Y],
-        equivalent(X, Y, PCs0, PCs)
+        equivalent(X, Y, !PCs)
     ;
         Ys = [_, _ | _],
-        PCs = PCs0 ^ prep_complex_cstrts :=
-            [eqv_disj(X, Ys) | PCs0 ^ prep_complex_cstrts]
+        !PCs ^ prep_complex_cstrts :=
+            [eqv_disj(X, Ys) | !.PCs ^ prep_complex_cstrts]
     ).
 
 %-----------------------------------------------------------------------------%
 
-at_most_one(Xs, PCs0, PCs) :-
+at_most_one(Xs, !PCs) :-
     (
-        Xs = [],
-        PCs = PCs0
+        Xs = []
     ;
-        Xs = [_],
-        PCs = PCs0
+        Xs = [_]
     ;
         Xs = [X, Y],
-        not_both(X, Y, PCs0, PCs)
+        not_both(X, Y, !PCs)
     ;
         Xs = [_, _, _ | _],
-        PCs = PCs0 ^ prep_complex_cstrts :=
-            [at_most_one(Xs) | PCs0 ^ prep_complex_cstrts]
+        !PCs ^ prep_complex_cstrts :=
+            [at_most_one(Xs) | !.PCs ^ prep_complex_cstrts]
     ).
 
 %-----------------------------------------------------------------------------%
 
-exactly_one(Xs, PCs0, PCs) :-
+exactly_one(Xs, !PCs) :-
     (
         Xs = [],
-        PCs = PCs0
+        unexpected(this_file, "exactly_one of zero variables")
     ;
         Xs = [X],
-        assign(X, yes, PCs0, PCs)
+        assign(X, yes, !PCs)
     ;
         Xs = [_, _ | _],
-        PCs = PCs0 ^ prep_complex_cstrts :=
-            [exactly_one(Xs) | PCs0 ^ prep_complex_cstrts]
+        !PCs ^ prep_complex_cstrts :=
+            [exactly_one(Xs) | !.PCs ^ prep_complex_cstrts]
     ).
 
 %-----------------------------------------------------------------------------%
 
-disjunction_of_assignments(DisjOfAssgts, PCs0, PCs) :-
+disjunction_of_assignments(DisjOfAssgts, !PCs) :-
     Assgtss =
         list.map(list.map(func((Var - Value)) = (Var == Value)), DisjOfAssgts),
-    PCs = PCs0 ^ prep_complex_cstrts :=
-        [disj_of_assgts(Assgtss) | PCs0 ^ prep_complex_cstrts].
+    !PCs ^ prep_complex_cstrts :=
+        [disj_of_assgts(Assgtss) | !.PCs ^ prep_complex_cstrts].
 
 %-----------------------------------------------------------------------------%
 
@@ -574,6 +575,7 @@
     mc_bindings::in, mc_bindings::out) is semidet.
 
 solve_assgt(SCs, (X == V), Bs0, Bs) :-
+    % XXX
     ( Bs0 ^ elem(X) = V0 ->
         ( V = V0 ->
             true
@@ -588,6 +590,7 @@
         trace [compiletime(flag("debug_mcsolver")), io(!IO)] (
             io.write_string(".", !IO)
         ),
+        % XXX
         Bs1 = Bs0 ^ elem(X) := V,
 
         Assgts = var_consequents(SCs ^ prop_graph, X, V),
@@ -754,7 +757,7 @@
     mc_bindings::in, mc_bindings::out) is nondet.
 
 solve_var(SCs, X, Bs0, Bs) :-
-    ( contains(Bs0, X) ->
+    ( map.contains(Bs0, X) ->
         Bs = Bs0
     ;
         ( V = yes ; V = no ),
@@ -773,6 +776,7 @@
 
 all_yes(_,  []).
 all_yes(Bs, [X | Xs]) :-
+    % XXX
     Bs ^ elem(X) = yes,
     all_yes(Bs, Xs).
 
@@ -782,6 +786,7 @@
 
 all_no(_,  []).
 all_no(Bs, [X | Xs]) :-
+    % XXX
     Bs ^ elem(X) = no,
     all_no(Bs, Xs).
 
Index: compiler/mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_constraints.m,v
retrieving revision 1.49
diff -u -b -r1.49 mode_constraints.m
--- compiler/mode_constraints.m	4 Sep 2008 11:41:00 -0000	1.49
+++ compiler/mode_constraints.m	2 Jun 2009 06:43:01 -0000
@@ -160,12 +160,13 @@
 
         % Stage 1: Process SCCs bottom-up to determine constraints on
         % variable producers and consumers.
-        list.foldl3(prop_mode_constraints.process_scc,
+        list.foldl3(prop_mode_constraints_in_scc,
             SCCs, !ModuleInfo, var_info_init, VarInfo,
             map.init, AbstractModeConstraints),
 
         globals.io_lookup_bool_option(debug_mode_constraints, Debug, !IO),
-        (   Debug = yes,
+        (
+            Debug = yes,
             ConstraintVarset = mc_varset(VarInfo),
             pretty_print_pred_constraints_map(!.ModuleInfo, ConstraintVarset,
                 AbstractModeConstraints, !IO)
@@ -186,7 +187,6 @@
         ;
             Debug = no
         )
-
     ).
 
 dump_abstract_constraints(ModuleInfo, ConstraintVarset, ModeConstraints,
Index: compiler/ordering_mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ordering_mode_constraints.m,v
retrieving revision 1.22
diff -u -b -r1.22 ordering_mode_constraints.m
--- compiler/ordering_mode_constraints.m	10 Mar 2009 05:00:30 -0000	1.22
+++ compiler/ordering_mode_constraints.m	2 Jun 2009 07:20:24 -0000
@@ -260,11 +260,10 @@
     pred_info_proc_info(!.PredInfo, ProcId, ProcInfo0),
     proc_info_get_goal(ProcInfo0, Goal0),
 
-    ConstraintFormulae =
-        pred_constraints_for_proc_to_formulae(ProcId, PredConstraints),
+    ConstraintsForProc = all_constraints_for_proc(ProcId, PredConstraints),
 
     PrepConstraints0 = new_prep_cstrts,
-    prepare_abstract_constraints(ConstraintFormulae, PrepConstraints0,
+    prepare_abstract_constraints(ConstraintsForProc, PrepConstraints0,
         PrepConstraints1),
     SolverConstraints = make_solver_cstrts(PrepConstraints1),
 
Index: compiler/prop_mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prop_mode_constraints.m,v
retrieving revision 1.22
diff -u -b -r1.22 prop_mode_constraints.m
--- compiler/prop_mode_constraints.m	10 Mar 2009 05:00:30 -0000	1.22
+++ compiler/prop_mode_constraints.m	2 Jun 2009 07:24:32 -0000
@@ -38,18 +38,20 @@
 
 %-----------------------------------------------------------------------------%
 
-    % process_scc(SCC, !ModuleInfo, !Varset, !VarMap, !PredConstraintsMap),
+    % prop_mode_constraints_in_scc(SCC, !ModuleInfo, !Varset, !VarMap,
+    %   !PredConstraintsMap):
     %
     % For each predicate in SCC:
-    %   Adds producer/consumer constraints to PredConstraintsMap,
-    %   Adds goal path annotations to its clauses in ModuleInfo,
-    %   Adds any constraint variables it requires to Varset and VarMap
-    %
-:- pred process_scc(list(pred_id)::in, module_info::in, module_info::out,
-    mc_var_info::in, mc_var_info::out, pred_constraints_map::in,
-    pred_constraints_map::out) is det.
+    %
+    % - Add producer/consumer constraints to PredConstraintsMap.
+    % - Add goal path annotations to its clauses in ModuleInfo.
+    % - Add any constraint variables it requires to Varset and VarMap.
+    %
+:- pred prop_mode_constraints_in_scc(list(pred_id)::in,
+    module_info::in, module_info::out, mc_var_info::in, mc_var_info::out,
+    pred_constraints_map::in, pred_constraints_map::out) is det.
 
-    % ensure_unique_arguments(PredId, !ModuleInfo)
+    % ensure_unique_arguments(PredId, !ModuleInfo):
     %
     % Creates variables and introduces unifications in predicate PredId where
     % appropriate to ensure that no program variable is used as an argument of
@@ -58,14 +60,14 @@
 :- pred ensure_unique_arguments(pred_id::in, module_info::in, module_info::out)
     is det.
 
-    % Checks whether a predicate has been imported according to the
+    % Check whether a predicate has been imported according to the
     % status_is_imported pred in the hlds_pred module.
     %
 :- pred module_info_pred_status_is_imported(module_info::in, pred_id::in)
     is semidet.
 
-    % Writes in human readable form to the current output stream the
-    % information in the pred_constraints_map, indicating which
+    % Write in human readable form to the current output stream
+    % the information in the pred_constraints_map, indicating which
     % predicate each set of constraints applies to.
     %
 :- pred pretty_print_pred_constraints_map(module_info::in, mc_varset::in,
@@ -99,89 +101,85 @@
 
 %-----------------------------------------------------------------------------%
 
-process_scc(SCC0, !ModuleInfo, !VarInfo, !Constraints) :-
-    % Process only predicates from this module
+prop_mode_constraints_in_scc(SCC0, !ModuleInfo, !VarInfo, !Constraints) :-
+    % Process only predicates from this module.
     list.filter(module_info_pred_status_is_imported(!.ModuleInfo),
         SCC0, _, SCC),
 
-    % Prepare the solver variables for the home path of
-    % each predicate of the SCC - needed for calls to
-    % predicates in the same SCC that do not have mode
-    % declarations.
+    % Prepare the solver variables for the home path of each predicate
+    % of the SCC - needed for calls to predicates in the same SCC
+    % that do not have mode declarations.
     add_mc_vars_for_scc_heads(!.ModuleInfo, SCC, !VarInfo),
 
     % Now go through the SCC and add the constraint
     % variables and then constraints predicate by predicate
-    list.foldl3(process_pred, SCC, !ModuleInfo, !VarInfo, !Constraints).
+    list.foldl3(prop_mode_constraints_in_pred, SCC,
+        !ModuleInfo, !VarInfo, !Constraints).
 
-    % process_pred(PredId, !ModuleInfo, !Varset, !VarMap, !Constraints)
+    % prop_mode_constraints_in_pred(PredId, !ModuleInfo, !Varset, !VarMap,
+    %   !Constraints):
     %
     % Performs a number of tasks for predicate PredId:
-    %   1) Fills out the goal_path information in the
-    %      ModuleInfo structure
-    %   2) Adds producer/consumer constraint variables for program
+    %   1) Fill out the goal_path information in the ModuleInfo structure.
+    %   2) Add producer/consumer constraint variables for program
     %      variables corresponding to any location at which they are
     %      nonlocal to Varset and VarMap. (Elsewhere is is clear as to
     %      whether they are produced or consumed.)
-    %   3) Adds mode declaration constraints to Constraints
-    %   4) Adds goal constraints to Constraints
+    %   3) Add mode declaration constraints to Constraints.
+    %   4) Add goal constraints to Constraints.
     %
-    % NOTE: it relies on the head variables for any predicate
-    % without mode declarations that is called by this one (PredId)
-    % to have the constraint variables corresponding to the empty
-    % goal path (ie the whole body of the predicate) to already be
-    % in VarMap (and therefore Varset).
-    %
-:- pred process_pred(pred_id::in, module_info::in, module_info::out,
-    mc_var_info::in, mc_var_info::out, pred_constraints_map::in,
-    pred_constraints_map::out) is det.
+    % NOTE: This relies on the head variables for any predicate without mode
+    % declarations that is called by this one (PredId) to have the constraint
+    % variables corresponding to the empty goal path (i.e. the whole body
+    % of the predicate) to already be VarMap (and therefore also in Varset).
+    %
+:- pred prop_mode_constraints_in_pred(pred_id::in,
+    module_info::in, module_info::out, mc_var_info::in, mc_var_info::out,
+    pred_constraints_map::in, pred_constraints_map::out) is det.
 
-process_pred(PredId, !ModuleInfo, !VarInfo, !Constraints) :-
+prop_mode_constraints_in_pred(PredId, !ModuleInfo, !VarInfo, !Constraints) :-
     module_info_pred_info(!.ModuleInfo, PredId, PredInfo0),
-    process_pred(!.ModuleInfo, PredId, PredInfo0, PredInfo, !VarInfo,
-        !Constraints),
+    do_prop_mode_constraints_in_pred(!.ModuleInfo, PredId, PredInfo0, PredInfo,
+        !VarInfo, !Constraints),
     module_info_set_pred_info(PredId, PredInfo, !ModuleInfo).
 
-    % The working part of process_pred/8 - just with the PredInfo
-    % unpacked from the ModuleInfo.
+    % The working part of prop_mode_constraints_in_pred/8, with just
+    % the PredInfo unpacked from the ModuleInfo.
     %
-:- pred process_pred(module_info::in, pred_id::in, pred_info::in,
-    pred_info::out, mc_var_info::in, mc_var_info::out,
+:- pred do_prop_mode_constraints_in_pred(module_info::in, pred_id::in,
+    pred_info::in, pred_info::out, mc_var_info::in, mc_var_info::out,
     pred_constraints_map::in, pred_constraints_map::out)
     is det.
 
-process_pred(ModuleInfo, PredId, !PredInfo, !VarInfo, !Constraints) :-
+do_prop_mode_constraints_in_pred(ModuleInfo, PredId, !PredInfo, !VarInfo,
+        !Constraints) :-
     fill_goal_path_slots_in_clauses(ModuleInfo, GoalPathOptimisation,
         !PredInfo),
 
-    %
     % If mode inference requested, just add constraints for the clause body,
     % otherwise, process the predicate for each of the procedures.
-    %
+
     ( pred_info_infer_modes(!.PredInfo) ->
         add_clauses_constraints(ModuleInfo, PredId, !.PredInfo, !VarInfo,
-            abstract_mode_constraints.init, BodyConstraints),
+            init_pred_p_c_constraints, BodyConstraints),
         svmap.set(PredId, BodyConstraints, !Constraints)
     ;
-        process_mode_declared_pred(ModuleInfo, PredId, !.PredInfo,
-            !VarInfo, !Constraints)
+        prop_mode_constraints_in_mode_declared_pred(ModuleInfo, PredId,
+            !.PredInfo, !VarInfo, !Constraints)
     ),
 
-    % XXX Currently the constraints simply say that if a
-    % variable is bound at a disjunct it is bound at the
-    % disjunction by making the relevant variables
-    % equivalent. Setting GoalPathOptimisation to yes will
-    % cause the disjucts to be given the same path as the
-    % disjunction, so that the relevant constraint variables
-    % will not need to be constrained equivalent - they will
-    % be the same variable. It will do the same for other
-    % path types with similar equivalence constraints -
-    % refer to the goal_path module for a more detailed
-    % description.
+    % XXX Currently the constraints simply say that if a variable is bound
+    % at a disjunct it is bound at the disjunction by making the relevant
+    % variables equivalent. Setting GoalPathOptimisation to yes will cause
+    % the disjucts to be given the same path as the disjunction, so that
+    % the relevant constraint variables will not need to be constrained
+    % equivalent - they will be the same variable. It will do the same
+    % for other path types with similar equivalence constraints -
+    % refer to the goal_path module for a more detailed description.
     GoalPathOptimisation = no.
 
-    % process_mode_declared_pred(ModuleInfo, PredId, PredInfo, !VarInfo,
-    %   !PredConstraintsMap)
+    % prop_mode_constraints_in_mode_declared_pred(ModuleInfo, PredId, PredInfo,
+    %   !VarInfo, !PredConstraintsMap):
     %
     % Uses the clauses and mode declarations in PredInfo (which should
     % be for predicate PredId taken from ModuleInfo) to create
@@ -189,46 +187,42 @@
     % PredId and stores them in PredConstraintsMap. VarInfo is updated
     % with any constraint variables used.
     %
-:- pred process_mode_declared_pred(module_info::in, pred_id::in,
-    pred_info::in, mc_var_info::in, mc_var_info::out,
+:- pred prop_mode_constraints_in_mode_declared_pred(module_info::in,
+    pred_id::in, pred_info::in, mc_var_info::in, mc_var_info::out,
     pred_constraints_map::in, pred_constraints_map::out)
     is det.
 
-process_mode_declared_pred(ModuleInfo, PredId, PredInfo, !VarInfo,
-    !PredConstraintsMap) :-
-
+prop_mode_constraints_in_mode_declared_pred(ModuleInfo, PredId, PredInfo,
+        !VarInfo, !PredConstraintsMap) :-
     ProcIds = pred_info_all_procids(PredInfo),
 
     add_clauses_constraints(ModuleInfo, PredId, PredInfo, !VarInfo,
-        abstract_mode_constraints.init, BodyConstr),
+        init_pred_p_c_constraints, BodyConstr),
 
     % Store procedure specific constraints in the constraints structure
     list.map(pred_info_proc_info(PredInfo), ProcIds, ProcInfos),
     list.foldl2_corresponding(
-        process_mode_declared_proc(ModuleInfo, PredId),
+        prop_mode_constraints_in_mode_declared_proc(ModuleInfo, PredId),
         ProcIds, ProcInfos, !VarInfo, BodyConstr, FullConstraints),
 
     svmap.set(PredId, FullConstraints, !PredConstraintsMap).
 
-    % process_mode_declared_proc(ModuleInfo, PredId, ProcId,
-    %   ProcInfo, !VarInfo, !PredConstraints)
+    % prop_mode_constraints_in_mode_declared_proc(ModuleInfo, PredId, ProcId,
+    %   ProcInfo, !VarInfo, !PredConstraints):
     %
-    % Adds constraints based on the mode declaration in
-    % ProcInfo to PredConstraints structure, associating them
-    % specifically with ProcId. Relies on the constraint variables
-    % associated with the head variables of PredId at the empty goal
-    % path being stored in VarInfo.
+    % Adds constraints based on the mode declaration in ProcInfo to
+    % the PredConstraints structure, associating them specifically with ProcId.
+    % Relies on the constraint variables associated with the head variables
+    % of PredId at the empty goal path being stored in VarInfo.
     %
-:- pred process_mode_declared_proc(module_info::in,
+:- pred prop_mode_constraints_in_mode_declared_proc(module_info::in,
     pred_id::in, proc_id::in, proc_info::in, mc_var_info::in,
     mc_var_info::out, mode_constraints::in, mode_constraints::out) is det.
 
-process_mode_declared_proc(ModuleInfo, PredId, ProcId, ProcInfo, !VarInfo,
+prop_mode_constraints_in_mode_declared_proc(ModuleInfo, PredId, ProcId, ProcInfo, !VarInfo,
     !PredConstraints) :-
-
     proc_info_get_argmodes(ProcInfo, ArgModes),
     proc_info_get_headvars(ProcInfo, Args),
-
     add_mode_decl_constraints(ModuleInfo, PredId, ProcId, ArgModes, Args,
         !VarInfo, !PredConstraints).
 
@@ -239,62 +233,61 @@
     pred_info_get_clauses_info(PredInfo0, ClausesInfo0),
     clauses_info_clauses_only(ClausesInfo0, Clauses0),
     clauses_info_get_varset(ClausesInfo0, Varset0),
-    clauses_info_get_vartypes(ClausesInfo0, Vartypes0),
+    clauses_info_get_vartypes(ClausesInfo0, VarTypes0),
     clauses_info_get_headvars(ClausesInfo0, HeadVars),
 
     SeenSoFar = proc_arg_vector_to_set(HeadVars),
     BodyGoals0 = list.map(func(X) = clause_body(X), Clauses0),
     list.map_foldl3(ensure_unique_arguments_in_goal, BodyGoals0, BodyGoals,
-        SeenSoFar, _, Varset0, Varset, Vartypes0, Vartypes),
+        SeenSoFar, _, Varset0, Varset, VarTypes0, VarTypes),
 
     Clauses = list.map_corresponding(func(C, B) = C ^ clause_body := B,
         Clauses0, BodyGoals),
     some [!ClausesInfo] (
         !:ClausesInfo = ClausesInfo0,
         clauses_info_set_varset(Varset, !ClausesInfo),
-        clauses_info_set_vartypes(Vartypes, !ClausesInfo),
+        clauses_info_set_vartypes(VarTypes, !ClausesInfo),
         clauses_info_set_clauses(Clauses, !ClausesInfo),
         pred_info_set_clauses_info(!.ClausesInfo, PredInfo0, PredInfo)
     ),
     module_info_set_pred_info(PredId, PredInfo, !ModuleInfo).
 
-    % ensure_unique_arguments_in_goal(!Goal, !SeenSoFar, !Varset,
-    %   !Vartypes)
+    % ensure_unique_arguments_in_goal(!Goal, !SeenSoFar, !Varset, !VarTypes):
     %
-    % Creates variables and introduces unifications in Goal, where appropriate,
+    % Create variables and introduce unifications in Goal, where appropriate,
     % to ensure that no program variable in SeenSoFar is used as an argument in
     % a predicate call and that  no program variable is used as an argument for
     % more than one predicate call.
-    % Created variables are added Varset, Vartypes and SeenSoFar. Variables
+    % Created variables are added to Varset, VarTypes and SeenSoFar. Variables
     % used as arguments in predicate calls are added to SeenSoFar.
     %
 :- pred ensure_unique_arguments_in_goal(hlds_goal::in, hlds_goal::out,
     set(prog_var)::in, set(prog_var)::out, prog_varset::in, prog_varset::out,
     vartypes::in, vartypes::out) is det.
 
-ensure_unique_arguments_in_goal(hlds_goal(!.GoalExpr, !.GoalInfo),
-        hlds_goal(!:GoalExpr, !:GoalInfo), !SeenSoFar, !Varset, !Vartypes) :-
+ensure_unique_arguments_in_goal(!Goal, !SeenSoFar, !Varset, !VarTypes) :-
+    some [!GoalExpr, !GoalInfo] (
+        !.Goal = hlds_goal(!:GoalExpr, !:GoalInfo),
     (
         !.GoalExpr = conj(ConjType, Goals0),
         (
             ConjType = plain_conj,
-            list.map_foldl3(ensure_unique_arguments_in_goal, Goals0, Goals1,
-                !SeenSoFar, !Varset, !Vartypes),
+                list.map_foldl3(ensure_unique_arguments_in_goal,
+                    Goals0, Goals1, !SeenSoFar, !Varset, !VarTypes),
             flatten_conjunction(Goals1, Goals),
             !:GoalExpr = conj(plain_conj, Goals)
         ;
             ConjType = parallel_conj,
-            list.map_foldl3(ensure_unique_arguments_in_goal, Goals0, Goals,
-                !SeenSoFar, !Varset, !Vartypes),
+                list.map_foldl3(ensure_unique_arguments_in_goal,
+                    Goals0, Goals, !SeenSoFar, !Varset, !VarTypes),
             !:GoalExpr = conj(parallel_conj, Goals)
-
         )
     ;
         !.GoalExpr = plain_call(CalleePredId, CalleeProcId, Args0,
             Builtin, UnifyContext, SymName),
         Context = goal_info_get_context(!.GoalInfo),
         make_unifications(Context, Unifications, Args0, Args, !SeenSoFar,
-            !Varset, !Vartypes),
+                !Varset, !VarTypes),
         (
             % No arguments changed.
             Unifications = []
@@ -313,7 +306,7 @@
         !.GoalExpr = generic_call(Details, Args0, Modes, Determinism),
         Context = goal_info_get_context(!.GoalInfo),
         make_unifications(Context, Unifications, Args0, Args, !SeenSoFar,
-            !Varset, !Vartypes),
+                !Varset, !VarTypes),
         (
             % No arguments changed.
             Unifications = []
@@ -334,53 +327,55 @@
     ;
         !.GoalExpr = disj(Goals0),
         list.map_foldl3(ensure_unique_arguments_in_goal, Goals0, Goals,
-            !SeenSoFar, !Varset, !Vartypes),
+                !SeenSoFar, !Varset, !VarTypes),
         !:GoalExpr = disj(Goals)
     ;
         !.GoalExpr = negation(Goal0),
         ensure_unique_arguments_in_goal(Goal0, Goal, !SeenSoFar, !Varset,
-            !Vartypes),
+                !VarTypes),
         !:GoalExpr = negation(Goal)
     ;
         !.GoalExpr = scope(Reason, Goal0),
-        % XXX We should special-case the handling of from_ground_term_construct
-        % scopes.
+            % XXX We should special-case the handling of
+            % from_ground_term_construct scopes.
         ensure_unique_arguments_in_goal(Goal0, Goal, !SeenSoFar, !Varset,
-            !Vartypes),
+                !VarTypes),
         !:GoalExpr = scope(Reason, Goal)
     ;
         !.GoalExpr = if_then_else(ExistVars, Cond0, Then0, Else0),
         ensure_unique_arguments_in_goal(Cond0, Cond, !SeenSoFar, !Varset,
-            !Vartypes),
+                !VarTypes),
         ensure_unique_arguments_in_goal(Then0, Then, !SeenSoFar, !Varset,
-            !Vartypes),
+                !VarTypes),
         ensure_unique_arguments_in_goal(Else0, Else, !SeenSoFar, !Varset,
-            !Vartypes),
+                !VarTypes),
         !:GoalExpr = if_then_else(ExistVars, Cond, Then, Else)
     ;
         !.GoalExpr = call_foreign_proc(_, _, _, _, _, _, _)
     ;
         !.GoalExpr = shorthand(ShortHand0),
         (
-            ShortHand0 = atomic_goal(GoalType, Outer, Inner, MaybeOutputVars,
-                MainGoal0, OrElseGoals0, OrElseInners),
-            ensure_unique_arguments_in_goal(MainGoal0, MainGoal, !SeenSoFar,
-                !Varset, !Vartypes),
+                ShortHand0 = atomic_goal(GoalType, Outer, Inner,
+                    MaybeOutputVars, MainGoal0, OrElseGoals0, OrElseInners),
+                ensure_unique_arguments_in_goal(MainGoal0, MainGoal,
+                    !SeenSoFar, !Varset, !VarTypes),
             list.map_foldl3(ensure_unique_arguments_in_goal,
-                OrElseGoals0, OrElseGoals, !SeenSoFar, !Varset, !Vartypes),
-            ShortHand = atomic_goal(GoalType, Outer, Inner, MaybeOutputVars,
-                MainGoal, OrElseGoals, OrElseInners),
+                    OrElseGoals0, OrElseGoals, !SeenSoFar, !Varset, !VarTypes),
+                ShortHand = atomic_goal(GoalType, Outer, Inner,
+                    MaybeOutputVars, MainGoal, OrElseGoals, OrElseInners),
             !:GoalExpr = shorthand(ShortHand)
         ;
             ShortHand0 = try_goal(MaybeIO, ResultVar, SubGoal0),
             ensure_unique_arguments_in_goal(SubGoal0, SubGoal, !SeenSoFar,
-                !Varset, !Vartypes),
+                    !Varset, !VarTypes),
             ShortHand = try_goal(MaybeIO, ResultVar, SubGoal),
             !:GoalExpr = shorthand(ShortHand)
         ;
             ShortHand0 = bi_implication(_, _),
             unexpected(this_file, "bi_implication")
         )
+        ),
+        !:Goal = hlds_goal(!.GoalExpr, !.GoalInfo)
     ).
 
     % flatten_conjunction(!Goals) flattens the conjunction Goals - that
@@ -391,10 +386,9 @@
 flatten_conjunction(!Goals) :-
     list.foldr(add_to_conjunction, !.Goals, [], !:Goals).
 
-    % add_to_conjunction(Goal, !Goals) adds Goal to the front of
-    % the conjunction Goals. It keeps the conjunction flat, so
-    % nested conjunctions are scrapped and their conjuncts prepended
-    % to Goals.
+    % add_to_conjunction(Goal, !Goals) adds Goal to the front of the
+    % conjunction Goals. It keeps the conjunction flat, so nested conjunctions
+    % are scrapped and their conjuncts prepended to Goals.
     %
 :- pred add_to_conjunction(hlds_goal::in, hlds_goals::in, hlds_goals::out)
     is det.
@@ -407,10 +401,10 @@
     ).
 
     % make_unifications(Context, MaybeUnifications, Args0, Args, !SeenSoFar,
-    %   !Varset, !Vartypes)
+    %   !Varset, !VarTypes):
     %
     % If any of the given arguments in Args0 is in SeenSoFar, creates a new
-    % argument (in Varset and Vartypes) to replace it (in Args), and generates
+    % argument (in Varset and VarTypes) to replace it (in Args), and generates
     % a unification between new argument and old (with context Context).
     %
 :- pred make_unifications(prog_context::in, hlds_goals::out,
@@ -419,15 +413,15 @@
     prog_varset::in, prog_varset::out, vartypes::in, vartypes::out) is det.
 
 make_unifications(Context, Unifications, !Args, !SeenSoFar,
-        !Varset, !Vartypes) :-
+        !Varset, !VarTypes) :-
     list.map_foldl4(make_unification(Context), !Args,
-        [], Unifications, !SeenSoFar, !Varset, !Vartypes).
+        [], Unifications, !SeenSoFar, !Varset, !VarTypes).
 
     % make_unification(Context, Var0, Var, !Unifications, !SeenSoFar,
-    %   !Varset, !Vartypes)
+    %   !Varset, !VarTypes):
     %
     % If Var0 is in SeenSoFar, creates a new argument Var (in Varset and
-    % Vartypes), and generates a unification between Var0 and Var.
+    % VarTypes), and generates a unification between Var0 and Var.
     %
 :- pred make_unification(prog_context::in, prog_var::in, prog_var::out,
     list(hlds_goal)::in, list(hlds_goal)::out,
@@ -435,14 +429,14 @@
     vartypes::in, vartypes::out) is det.
 
 make_unification(Context, Var0, Var, !Unifications, !SeenSoFar, !Varset,
-        !Vartypes) :-
+        !VarTypes) :-
     ( set.contains(!.SeenSoFar, Var0) ->
         % Make new variable.
         OldVarName = varset.lookup_name(!.Varset, Var0),
-        OldVarType = map.lookup(!.Vartypes, Var0),
+        OldVarType = map.lookup(!.VarTypes, Var0),
         NewVarName = "Arg_" ++ OldVarName,
         svvarset.new_uniquely_named_var(NewVarName, Var, !Varset),
-        svmap.set(Var, OldVarType, !Vartypes),
+        svmap.set(Var, OldVarType, !VarTypes),
 
         % Make new unification.
         create_atomic_complicated_unification(Var0, rhs_var(Var), Context,
@@ -461,7 +455,7 @@
     svset.insert(Var, !SeenSoFar).
 
     % replace_call_with_conjunction(NewCallGoalExpr, Unifications, NewArgs,
-    %   GoalExpr, !GoalInfo)
+    %   GoalExpr, !GoalInfo):
     %
     % Makes a conjunction out of CallGoalExpr and Unifications - the
     % conjunction becomes GoalExpr and the goal info for the conjunction
@@ -527,18 +521,19 @@
     % Start with a blank line.
     write_error_pieces_plain([fixed("")], !IO),
 
-    hlds_module.module_info_pred_info(ModuleInfo, PredId, PredInfo),
+    module_info_pred_info(ModuleInfo, PredId, PredInfo),
     write_error_pieces_plain([words("Constraints for")] ++
         describe_one_pred_info_name(should_module_qualify, PredInfo) ++
         [suffix(":")], !IO),
 
     map.lookup(PredConstraintsMap, PredId, PredConstraints),
-    FormulaeAndAnnotations = pred_constraints_to_formulae_and_annotations(
-        PredConstraints),
-    dump_constraints_and_annotations(ConstraintVarset, FormulaeAndAnnotations,
+    AllProcAnnConstraints = allproc_annotated_constraints(PredConstraints),
+    dump_constraints_and_annotations(ConstraintVarset, AllProcAnnConstraints,
         !IO),
-    list.foldl(pretty_print_proc_constraints(ModuleInfo, ConstraintVarset,
-        PredConstraints, PredId), pred_info_all_procids(PredInfo), !IO).
+    list.foldl(
+        pretty_print_proc_constraints(ModuleInfo, ConstraintVarset,
+            PredConstraints, PredId),
+        pred_info_all_procids(PredInfo), !IO).
 
     % Puts the constraints specific to the procedure indicated from
     % the pred_p_c_constraints to the current output stream in human
@@ -554,9 +549,9 @@
 
     write_error_pieces_plain(describe_one_proc_name(ModuleInfo,
         should_module_qualify, proc(PredId, ProcId)) ++ [suffix(":")], !IO),
-    FormulaeAndAnnotations =
-        proc_constraints_to_formulae_and_annotations(ProcId, PredConstraints),
-    dump_constraints_and_annotations(ConstraintVarset, FormulaeAndAnnotations,
+    ProcSpecAnnConstraints =
+        proc_specific_annotated_constraints(ProcId, PredConstraints),
+    dump_constraints_and_annotations(ConstraintVarset, ProcSpecAnnConstraints,
         !IO).
 
 %-----------------------------------------------------------------------------%
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
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/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/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_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/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
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/diff
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