[m-rev.] for prelim review: fix compiler performance problems on large programs

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed Mar 29 11:56:31 AEDT 2006


On 28-Mar-2006, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
> > > Would it be possible to use an equivalence type for the int argument
> > > here (and below)?
> >
> > What equivalence type name would be clearer to you?
> 
> number_of_clauses or num_clauses (basically something that gives me some
> idea of what that argument is supposed to be doing.)

It counts added goals, not clauses, so I used num_added_clauses.

It passed bootcheck with only the expected failures, so I am committing
this change. Here is the interdiff.

Zoltan.

diff -u compiler/add_clause.m compiler/add_clause.m
--- compiler/add_clause.m	27 Mar 2006 02:44:47 -0000
+++ compiler/add_clause.m	28 Mar 2006 10:58:12 -0000
@@ -535,7 +535,7 @@
     goal_info_set_context(Context, GoalInfo1, GoalInfo).
 
 :- pred transform_goal_2(goal_expr::in, prog_context::in,
-    prog_substitution::in, hlds_goal::out, int::out,
+    prog_substitution::in, hlds_goal::out, num_added_goals::out,
     prog_varset::in, prog_varset::out,
     module_info::in, module_info::out, qual_info::in, qual_info::out,
     svar_info::in, svar_info::out, io::di, io::uo) is det.
@@ -917,8 +917,8 @@
         MaybeUnifyContext, unqualified(UpdateStr)) - GoalInfo.
 
 :- pred transform_dcg_record_syntax_2(field_access_type::in, field_list::in,
-    list(prog_term)::in, prog_context::in, hlds_goal::out, int::out,
-    prog_varset::in, prog_varset::out,
+    list(prog_term)::in, prog_context::in, hlds_goal::out,
+    num_added_goals::out, prog_varset::in, prog_varset::out,
     module_info::in, module_info::out, qual_info::in, qual_info::out,
     svar_info::in, svar_info::out, io::di, io::uo) is det.
 
diff -u compiler/field_access.m compiler/field_access.m
--- compiler/field_access.m	24 Mar 2006 04:53:51 -0000
+++ compiler/field_access.m	28 Mar 2006 10:27:14 -0000
@@ -19,6 +19,7 @@
 :- import_module hlds.hlds_module.
 :- import_module hlds.make_hlds.qual_info.
 :- import_module hlds.make_hlds.state_var.
+:- import_module hlds.make_hlds.superhomogeneous.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_io_util.
 
@@ -44,8 +45,8 @@
 :- pred expand_set_field_function_call(prog_context::in,
     unify_main_context::in, unify_sub_contexts::in, field_list::in,
     prog_var::in, prog_var::in, prog_var::in, cons_id::out,
-    pair(cons_id, unify_sub_contexts)::out, hlds_goal::out, int::out,
-    prog_varset::in, prog_varset::out,
+    pair(cons_id, unify_sub_contexts)::out, hlds_goal::out,
+    num_added_goals::out, prog_varset::in, prog_varset::out,
     module_info::in, module_info::out, qual_info::in, qual_info::out,
     svar_info::in, svar_info::out, io::di, io::uo) is det.
 
@@ -64,10 +65,10 @@
 :- pred expand_dcg_field_extraction_goal(prog_context::in,
     unify_main_context::in, unify_sub_contexts::in, field_list::in,
     prog_var::in, prog_var::in, prog_var::in, cons_id::out,
-    pair(cons_id, unify_sub_contexts)::out, hlds_goal::out, int::out,
-    prog_varset::in, prog_varset::out, module_info::in, module_info::out,
-    qual_info::in, qual_info::out, svar_info::in, svar_info::out,
-    io::di, io::uo) is det.
+    pair(cons_id, unify_sub_contexts)::out, hlds_goal::out,
+    num_added_goals::out, prog_varset::in, prog_varset::out,
+    module_info::in, module_info::out, qual_info::in, qual_info::out,
+    svar_info::in, svar_info::out, io::di, io::uo) is det.
 
     % Expand a field extraction function call into a list of goals which
     % each get one level of the structure.
@@ -82,10 +83,10 @@
 :- pred expand_get_field_function_call(prog_context::in,
     unify_main_context::in, unify_sub_contexts::in, field_list::in,
     prog_var::in, prog_var::in, purity::in, cons_id::out,
-    pair(cons_id, unify_sub_contexts)::out, hlds_goal::out, int::out,
-    prog_varset::in, prog_varset::out,module_info::in, module_info::out,
-    qual_info::in, qual_info::out, svar_info::in, svar_info::out,
-    io::di, io::uo) is det.
+    pair(cons_id, unify_sub_contexts)::out,
+    hlds_goal::out, num_added_goals::out, prog_varset::in, prog_varset::out,
+    module_info::in, module_info::out, qual_info::in, qual_info::out,
+    svar_info::in, svar_info::out, io::di, io::uo) is det.
 
 :- pred parse_field_list(prog_term::in,
     maybe1(field_list, prog_var_type)::out) is det.
@@ -121,10 +122,10 @@
 :- pred expand_set_field_function_call_2(prog_context::in,
     unify_main_context::in, unify_sub_contexts::in, field_list::in,
     prog_var::in, prog_var::in, prog_var::in, cons_id::out,
-    pair(cons_id, unify_sub_contexts)::out, list(hlds_goal)::out, int::out,
-    prog_varset::in, prog_varset::out, module_info::in, module_info::out,
-    qual_info::in, qual_info::out, svar_info::in, svar_info::out,
-    io::di, io::uo) is det.
+    pair(cons_id, unify_sub_contexts)::out, list(hlds_goal)::out,
+    num_added_goals::out, prog_varset::in, prog_varset::out,
+    module_info::in, module_info::out, qual_info::in, qual_info::out,
+    svar_info::in, svar_info::out, io::di, io::uo) is det.
 
 expand_set_field_function_call_2(_, _, _, [], _, _, _, _, _, _, _,
         !VarSet, !ModuleInfo, !QualInfo, !SInfo, !IO) :-
@@ -212,10 +213,10 @@
 :- pred expand_get_field_function_call_2(prog_context::in,
     unify_main_context::in, unify_sub_contexts::in, field_list::in,
     prog_var::in, prog_var::in, purity::in, cons_id::out,
-    pair(cons_id, unify_sub_contexts)::out, list(hlds_goal)::out, int::out,
-    prog_varset::in, prog_varset::out, module_info::in, module_info::out,
-    qual_info::in, qual_info::out, svar_info::in, svar_info::out,
-    io::di, io::uo) is det.
+    pair(cons_id, unify_sub_contexts)::out, list(hlds_goal)::out,
+    num_added_goals::out, prog_varset::in, prog_varset::out,
+    module_info::in, module_info::out, qual_info::in, qual_info::out,
+    svar_info::in, svar_info::out, io::di, io::uo) is det.
 
 expand_get_field_function_call_2(_, _, _, [], _, _, _, _, _, _, _,
         !VarSet, !ModuleInfo, !QualInfo, !Sinfo, !IO) :-
diff -u compiler/higher_order.m compiler/higher_order.m
--- compiler/higher_order.m	25 Mar 2006 08:55:11 -0000
+++ compiler/higher_order.m	28 Mar 2006 10:18:00 -0000
@@ -76,7 +76,6 @@
 :- import_module int.
 :- import_module list.
 :- import_module map.
-:- import_module require.
 :- import_module set.
 :- import_module std_util.
 :- import_module string.
@@ -669,7 +668,7 @@
     % works only on nonempty lists.
     (
         Cases0 = [],
-        error("traverse_cases: empty list of cases")
+        unexpected(this_file, "traverse_cases: empty list of cases")
     ;
         Cases0 = [_ | _],
         get_pre_branch_info(!.Info, PreInfo),
@@ -732,7 +731,7 @@
     post_branch_info::out) is det.
 
 merge_post_branch_infos_into_one([], _) :-
-    error("merge_post_branch_infos_into_one: empty list").
+    unexpected(this_file, "merge_post_branch_infos_into_one: empty list").
 merge_post_branch_infos_into_one([PostInfo], PostInfo).
 merge_post_branch_infos_into_one(PostInfos @ [_, _ | _], PostInfo) :-
     merge_post_branch_info_pass(PostInfos, [], MergedPostInfos),
@@ -796,12 +795,13 @@
 
 merge_common_var_const_list([], [], !List).
 merge_common_var_const_list([], [_ | _], !MergedList) :-
-    error("merge_common_var_const_list: mismatched list").
+    unexpected(this_file, "merge_common_var_const_list: mismatched list").
 merge_common_var_const_list([_ | _], [], !MergedList) :-
-    error("merge_common_var_const_list: mismatched list").
+    unexpected(this_file, "merge_common_var_const_list: mismatched list").
 merge_common_var_const_list([VarA - ValueA | ListA], [VarB - ValueB | ListB],
         !MergedList) :-
-    require(unify(VarA, VarB), "merge_common_var_const_list: var mismatch"),
+    expect(unify(VarA, VarB), this_file,
+        "merge_common_var_const_list: var mismatch"),
     ( ValueA = ValueB ->
         % It does not matter whether ValueA is bound to constant(_, _)
         % or to multiple_values, in both cases, if ValueA = ValueB, the
diff -u compiler/modecheck_unify.m compiler/modecheck_unify.m
--- compiler/modecheck_unify.m	25 Mar 2006 01:15:53 -0000
+++ compiler/modecheck_unify.m	29 Mar 2006 00:52:06 -0000
@@ -626,9 +626,19 @@
         modecheck_set_var_inst(X, Inst, yes(InstOfY), !ModeInfo),
         UnifyArgInsts = list.map(func(I) = yes(I), InstOfXArgs),
         mode_info_get_in_from_ground_term(!.ModeInfo, InFromGroundTerm),
-        % ZZZ
         (
             InFromGroundTerm = yes
+            % In the goals that result from the transformation of a unification
+            % of a variable with a ground term, the variables on the right hand
+            % sides of the construct unifications are all local to the scope
+            % of the from_ground_term scope, and their last appearance is in
+            % the construct. Therefore there is no need to update their inst.
+            %
+            % Avoiding the update can be a significant performance win, because
+            % for a ground list with N elements, the size of the inst of the
+            % average intermediate variable is proportional to N. Since there
+            % are N intermediate variables, the complexity of updating their
+            % insts would be quadratic.
         ;
             InFromGroundTerm = no,
         bind_args(Inst, ArgVars, UnifyArgInsts, !ModeInfo)
1 out of 2 hunks FAILED -- saving rejects to file /tmp/interdiff-1.eQxcye.rej
diff -u compiler/pd_debug.m compiler/pd_debug.m
--- compiler/pd_debug.m	24 Mar 2006 06:33:19 -0000
+++ compiler/pd_debug.m	28 Mar 2006 00:28:57 -0000
@@ -146,7 +146,7 @@
     goal_info_get_nonlocals(GoalInfo, NonLocals),
     module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo),
     proc_info_get_varset(ProcInfo, VarSet),
-    instmap.restrict(NonLocals, InstMap, InstMap1),
+    instmap_restrict(NonLocals, InstMap, InstMap1),
     io.write_string(" args: ", !IO),
     mercury_output_vars(Args, VarSet, yes, !IO),
     io.nl(!IO),
3 out of 33 hunks FAILED -- saving rejects to file /tmp/interdiff-1.rcv3TL.rej
diff -u compiler/simplify.m compiler/simplify.m
--- compiler/simplify.m	25 Mar 2006 13:59:00 -0000
+++ compiler/simplify.m	28 Mar 2006 00:43:48 -0000
@@ -97,6 +97,7 @@
 :- pred simplify_do_warn_duplicate_calls(simplify_info::in) is semidet.
 :- pred simplify_do_warn_known_bad_format(simplify_info::in) is semidet.
 :- pred simplify_do_warn_unknown_format(simplify_info::in) is semidet.
+:- pred simplify_do_warn_obsolete(simplify_info::in) is semidet.
 :- pred simplify_do_once(simplify_info::in) is semidet.
 :- pred simplify_do_excess_assign(simplify_info::in) is semidet.
 :- pred simplify_do_opt_duplicate_calls(simplify_info::in) is semidet.
@@ -155,6 +156,7 @@
                 do_warn_duplicate_calls     :: bool,
                 do_warn_known_bad_format    :: bool,
                 do_warn_unknown_format      :: bool,
+                do_warn_obsolete            :: bool,
                 do_do_once                  :: bool,
                 do_excess_assign            :: bool,
                 do_opt_duplicate_calls      :: bool,
@@ -165,13 +167,15 @@
 
 simplifications_to_list(Simplifications) = List :-
     Simplifications = simplifications(WarnSimpleCode, WarnDupCalls,
-        WarnKnownBadFormat, WarnUnknownFormat, DoOnce, ExcessAssign,
-        OptDuplicateCalls, ConstantProp, CommonStruct, ExtraCommonStruct),
+        WarnKnownBadFormat, WarnUnknownFormat, WarnObsolete, DoOnce,
+        ExcessAssign, OptDuplicateCalls, ConstantProp,
+        CommonStruct, ExtraCommonStruct),
     List = 
         ( WarnSimpleCode = yes -> [warn_simple_code] ; [] ) ++
         ( WarnDupCalls = yes -> [warn_duplicate_calls] ; [] ) ++
         ( WarnKnownBadFormat = yes -> [warn_known_bad_format] ; [] ) ++
         ( WarnUnknownFormat = yes -> [warn_unknown_format] ; [] ) ++
+        ( WarnObsolete = yes -> [warn_obsolete] ; [] ) ++
         ( DoOnce = yes -> [do_once] ; [] ) ++
         ( ExcessAssign = yes -> [excess_assigns] ; [] ) ++
         ( OptDuplicateCalls = yes -> [opt_duplicate_calls] ; [] ) ++
@@ -185,6 +189,7 @@
         ( list.member(warn_duplicate_calls, List) -> yes ; no ),
         ( list.member(warn_known_bad_format, List) -> yes ; no ),
         ( list.member(warn_unknown_format, List) -> yes ; no ),
+        ( list.member(warn_obsolete, List) -> yes ; no ),
         ( list.member(do_once, List) -> yes ; no ),
         ( list.member(excess_assigns, List) -> yes ; no ),
         ( list.member(opt_duplicate_calls, List) -> yes ; no ),
@@ -200,6 +205,7 @@
         WarnKnownBadFormat),
     globals.lookup_bool_option(Globals, warn_unknown_format_calls,
         WarnUnknownFormat),
+    globals.lookup_bool_option(Globals, warn_obsolete, WarnObsolete),
     globals.lookup_bool_option(Globals, excess_assign, ExcessAssign),
     globals.lookup_bool_option(Globals, common_struct, CommonStruct),
     globals.lookup_bool_option(Globals, optimize_duplicate_calls,
@@ -213,6 +219,7 @@
         ( WarnDupCalls = yes, WarnThisPass = yes -> yes ; no),
         ( WarnKnownBadFormat = yes, WarnThisPass = yes -> yes ; no),
         ( WarnUnknownFormat = yes, WarnThisPass = yes -> yes ; no),
+        ( WarnObsolete = yes, WarnThisPass = yes -> yes ; no),
         DoOnce,
         ExcessAssign,
         OptDuplicateCalls,
@@ -233,6 +240,9 @@
 simplify_do_warn_unknown_format(Info) :-
     simplify_info_get_simplifications(Info, Simplifications),
     Simplifications ^ do_warn_unknown_format = yes.
+simplify_do_warn_obsolete(Info) :-
+    simplify_info_get_simplifications(Info, Simplifications),
+    Simplifications ^ do_warn_obsolete = yes.
 simplify_do_once(Info) :-
     simplify_info_get_simplifications(Info, Simplifications),
     Simplifications ^ do_do_once = yes.
@@ -319,12 +329,25 @@
     simplify_proc_return_msgs(Simplifications, PredId, ProcId, !ModuleInfo,
         !Proc, _, !IO).
 
-simplify_proc_return_msgs(Simplifications, PredId, ProcId, !ModuleInfo,
+:- func turn_off_common_struct_threshold = int.
+
+turn_off_common_struct_threshold = 1000.
+
+simplify_proc_return_msgs(Simplifications0, PredId, ProcId, !ModuleInfo,
         !ProcInfo, DetMsgs, !IO) :-
     module_info_get_globals(!.ModuleInfo, Globals),
     proc_info_get_vartypes(!.ProcInfo, VarTypes0),
-    det_info_init(!.ModuleInfo, VarTypes0, PredId, ProcId, Globals,
-        DetInfo0),
+    NumVars = map.count(VarTypes0),
+    ( NumVars > turn_off_common_struct_threshold ->
+        % If we have too many variables, common_struct takes so long that
+        % either the compiler runs out of memory or the user runs out of
+        % patience. The fact that we would generate better code if the
+        % compilation finished is therefore of limited interest.
+        Simplifications = Simplifications0 ^ do_common_struct := no
+    ;
+        Simplifications = Simplifications0
+    ),
+    det_info_init(!.ModuleInfo, VarTypes0, PredId, ProcId, Globals, DetInfo0),
     proc_info_get_initial_instmap(!.ProcInfo, !.ModuleInfo, InstMap0),
     simplify_info_init(DetInfo0, Simplifications, InstMap0, !.ProcInfo, Info0),
     proc_info_get_goal(!.ProcInfo, Goal0),
@@ -475,47 +498,6 @@
 
 %-----------------------------------------------------------------------------%
 
-find_simplifications(WarnThisPass, Globals, Simps) :-
-    find_simplifications_2(WarnThisPass, Globals, [], Simps).
-
-:- pred find_simplifications_2(bool::in, globals::in,
-    list(simplification)::in, list(simplification)::out) is det.
-
-find_simplifications_2(WarnThisPass, Globals, !Simps) :-
-    (
-        WarnThisPass = yes,
-        set_by_option(Globals, warn_duplicate_calls,
-            warn_duplicate_calls, !Simps),
-        set_by_option(Globals, warn_simple_code,
-            warn_simple_code, !Simps),
-        set_by_option(Globals, warn_known_bad_format_calls,
-            warn_known_bad_format, !Simps),
-        set_by_option(Globals, warn_unknown_format_calls,
-            warn_unknown_format, !Simps),
-        set_by_option(Globals, warn_obsolete, warn_obsolete,
-            !Simps)
-    ;
-        WarnThisPass = no
-    ),
-    set_by_option(Globals, excess_assign, excess_assigns, !Simps),
-    set_by_option(Globals, common_struct, common_struct, !Simps),
-    set_by_option(Globals, optimize_duplicate_calls, duplicate_calls, !Simps),
-    set_by_option(Globals, constant_propagation, constant_prop, !Simps).
-
-:- pred set_by_option(globals::in, option::in, simplification::in,
-    list(simplification)::in, list(simplification)::out) is det.
-
-set_by_option(Globals, Option, Simplification, !Simplifications) :-
-    globals.lookup_bool_option(Globals, Option, Result),
-    (
-        Result = yes,
-        !:Simplifications = [Simplification | !.Simplifications]
-    ;
-        Result = no
-    ).
-
-%-----------------------------------------------------------------------------%
-
 :- pred simplify_goal(hlds_goal::in, hlds_goal::out,
     simplify_info::in, simplify_info::out, io::di, io::uo) is det.
 
@@ -1415,7 +1397,7 @@
     module_info_pred_proc_info(ModuleInfo, PredId, ProcId, PredInfo, ProcInfo),
     % Check for calls to predicates with `pragma obsolete' declarations.
     (
-        simplify_do_warn_simple_code(!.Info),
+        simplify_do_warn(!.Info),
         pred_info_get_markers(PredInfo, Markers),
         check_marker(Markers, obsolete),
 
@@ -1438,7 +1420,7 @@
     % Check for recursive calls with the same input arguments,
     % and warn about them (since they will lead to infinite loops).
     (
-        simplify_do_warn_simple_code(!.Info),
+        simplify_do_warn(!.Info),
 
         % Is this a (directly) recursive call, i.e. is the procedure being
         % called the same as the procedure we're analyzing?
@@ -1448,7 +1430,7 @@
     % Check for recursive calls with the same input arguments,
     % and warn about them (since they will lead to infinite loops).
     (
-        simplify_do_warn(!.Info),
+        simplify_do_warn_simple_code(!.Info),
 
         % Is this a (directly) recursive call, i.e. is the procedure being
         % called the same as the procedure we're analyzing?
@@ -2607,48 +2589,6 @@
     simplify_info_set_var_types(VarTypes, !Info),
     simplify_info_set_rtti_varmaps(RttiVarMaps, !Info).
 
-:- interface.
-
-:- pred simplify_do_warn(simplify_info::in) is semidet.
-:- pred simplify_do_warn_calls(simplify_info::in) is semidet.
-:- pred simplify_do_warn_obsolete(simplify_info::in) is semidet.
-:- pred simplify_do_once(simplify_info::in) is semidet.
-:- pred simplify_do_common(simplify_info::in) is semidet.
-:- pred simplify_do_excess_assigns(simplify_info::in) is semidet.
-:- pred simplify_do_calls(simplify_info::in) is semidet.
-:- pred simplify_do_const_prop(simplify_info::in) is semidet.
-:- pred simplify_do_more_common(simplify_info::in) is semidet.
-
-:- implementation.
-
-simplify_do_warn(Info) :-
-    simplify_info_get_simplifications(Info, Simplifications),
-    set.member(warn_simple_code, Simplifications).
-simplify_do_warn_calls(Info) :-
-    simplify_info_get_simplifications(Info, Simplifications),
-    set.member(warn_duplicate_calls, Simplifications).
-simplify_do_warn_obsolete(Info) :-
-    simplify_info_get_simplifications(Info, Simplifications),
-    set.member(warn_obsolete, Simplifications).
-simplify_do_once(Info) :-
-    simplify_info_get_simplifications(Info, Simplifications),
-    set.member(do_once, Simplifications).
-simplify_do_common(Info) :-
-    simplify_info_get_simplifications(Info, Simplifications),
-    set.member(common_struct, Simplifications).
-simplify_do_excess_assigns(Info) :-
-    simplify_info_get_simplifications(Info, Simplifications),
-    set.member(excess_assigns, Simplifications).
-simplify_do_calls(Info) :-
-    simplify_info_get_simplifications(Info, Simplifications),
-    set.member(duplicate_calls, Simplifications).
-simplify_do_const_prop(Info) :-
-    simplify_info_get_simplifications(Info, Simplifications),
-    set.member(constant_prop, Simplifications).
-simplify_do_more_common(Info) :-
-    simplify_info_get_simplifications(Info, Simplifications),
-    set.member(extra_common_struct, Simplifications).
-
 :- pred simplify_info_update_instmap(hlds_goal::in,
     simplify_info::in, simplify_info::out) is det.
 
diff -u compiler/superhomogeneous.m compiler/superhomogeneous.m
--- compiler/superhomogeneous.m	24 Mar 2006 06:01:14 -0000
+++ compiler/superhomogeneous.m	28 Mar 2006 11:09:17 -0000
@@ -44,6 +44,12 @@
                 unify_sub_contexts
             ).
 
+    % We count how many goals we insert in the course of a call to one of the
+    % predicates below. We compute this count because we want to wrap a
+    % from_ground_term scope only around goals where it saves us nontrivial
+    % time (since the scope itself adds overhead).
+:- type num_added_goals == int.
+
     % `insert_arg_unifications' takes a list of variables, a list of terms
     % to unify them with, and a goal, and inserts the appropriate unifications
     % onto the front of the goal. It calls `unravel_unification' to ensure that
@@ -53,14 +59,14 @@
     % We never insert unifications of the form X = X.
     %
 :- pred insert_arg_unifications(list(prog_var)::in, list(prog_term)::in,
-    prog_context::in, arg_context::in, hlds_goal::in, hlds_goal::out, int::out,
-    prog_varset::in, prog_varset::out, module_info::in, module_info::out,
-    qual_info::in, qual_info::out, svar_info::in, svar_info::out,
-    io::di, io::uo) is det.
+    prog_context::in, arg_context::in, hlds_goal::in, hlds_goal::out,
+    num_added_goals::out, prog_varset::in, prog_varset::out,
+    module_info::in, module_info::out, qual_info::in, qual_info::out,
+    svar_info::in, svar_info::out, io::di, io::uo) is det.
 
 :- pred insert_arg_unifications_with_supplied_contexts(list(prog_var)::in,
     list(prog_term)::in, assoc_list(int, arg_context)::in, prog_context::in,
-    hlds_goal::in, hlds_goal::out, int::out,
+    hlds_goal::in, hlds_goal::out, num_added_goals::out,
     prog_varset::in, prog_varset::out, module_info::in, module_info::out,
     qual_info::in, qual_info::out, svar_info::in, svar_info::out,
     io::di, io::uo) is det.
@@ -70,14 +76,14 @@
     % than before the goal.
     %
 :- pred append_arg_unifications(list(prog_var)::in, list(prog_term)::in,
-    prog_context::in, arg_context::in, hlds_goal::in, hlds_goal::out, int::out,
-    prog_varset::in, prog_varset::out, module_info::in, module_info::out,
-    qual_info::in, qual_info::out, svar_info::in, svar_info::out,
-    io::di, io::uo) is det.
+    prog_context::in, arg_context::in, hlds_goal::in, hlds_goal::out,
+    num_added_goals::out, prog_varset::in, prog_varset::out,
+    module_info::in, module_info::out, qual_info::in, qual_info::out,
+    svar_info::in, svar_info::out, io::di, io::uo) is det.
 
 :- pred unravel_unification(prog_term::in, prog_term::in, prog_context::in,
     unify_main_context::in, unify_sub_contexts::in, purity::in,
-    hlds_goal::out, int::out, prog_varset::in, prog_varset::out,
+    hlds_goal::out, num_added_goals::out, prog_varset::in, prog_varset::out,
     module_info::in, module_info::out, qual_info::in, qual_info::out,
     svar_info::in, svar_info::out, io::di, io::uo) is det.
 
@@ -168,7 +174,7 @@
 
 :- pred do_insert_arg_unifications(list(prog_var)::in, list(prog_term)::in,
     prog_context::in, arg_context::in,
-    hlds_goal::in, hlds_goal::out, maybe(int)::in, int::out,
+    hlds_goal::in, hlds_goal::out, maybe(int)::in, num_added_goals::out,
     prog_varset::in, prog_varset::out, module_info::in, module_info::out,
     qual_info::in, qual_info::out, svar_info::in, svar_info::out,
     io::di, io::uo) is det.
@@ -194,7 +200,7 @@
 :- pred do_insert_arg_unifications_2(list(prog_var)::in, list(prog_term)::in,
     prog_context::in, arg_context::in, int::in,
     list(hlds_goal)::in, list(hlds_goal)::out,
-    maybe(int)::in, int::in, int::out,
+    maybe(int)::in, num_added_goals::in, num_added_goals::out,
     prog_varset::in, prog_varset::out, module_info::in, module_info::out,
     qual_info::in, qual_info::out, svar_info::in, svar_info::out,
     io::di, io::uo) is det.
@@ -231,7 +237,7 @@
 
 :- pred do_insert_arg_unifications_with_supplied_contexts(list(prog_var)::in,
     list(prog_term)::in, assoc_list(int, arg_context)::in, prog_context::in,
-    hlds_goal::in, hlds_goal::out, maybe(int)::in, int::out,
+    hlds_goal::in, hlds_goal::out, maybe(int)::in, num_added_goals::out,
     prog_varset::in, prog_varset::out, module_info::in, module_info::out,
     qual_info::in, qual_info::out, svar_info::in, svar_info::out,
     io::di, io::uo) is det.
@@ -258,7 +264,7 @@
 :- pred do_insert_arg_unifications_with_supplied_contexts_2(list(prog_var)::in,
     list(prog_term)::in, assoc_list(int, arg_context)::in, prog_context::in,
     list(hlds_goal)::in, list(hlds_goal)::out,
-    maybe(int)::in, int::in, int::out,
+    maybe(int)::in, num_added_goals::in, num_added_goals::out,
     prog_varset::in, prog_varset::out, module_info::in, module_info::out,
     qual_info::in, qual_info::out, svar_info::in, svar_info::out,
     io::di, io::uo) is det.
@@ -290,10 +296,10 @@
     ).
 
 :- pred do_insert_arg_unification(prog_var::in, prog_term::in, prog_context::in,
-    arg_context::in, int::in, list(hlds_goal)::out, maybe(int)::in, int::out,
-    prog_varset::in, prog_varset::out, module_info::in, module_info::out,
-    qual_info::in, qual_info::out, svar_info::in, svar_info::out,
-    io::di, io::uo) is det.
+    arg_context::in, int::in, list(hlds_goal)::out, maybe(int)::in,
+    num_added_goals::out, prog_varset::in, prog_varset::out,
+    module_info::in, module_info::out, qual_info::in, qual_info::out,
+    svar_info::in, svar_info::out, io::di, io::uo) is det.
 
 do_insert_arg_unification(Var, Arg, Context, ArgContext, N1, ArgUnifyConj,
         MaybeThreshold, NumAdded, !VarSet, !ModuleInfo, !QualInfo,
@@ -314,7 +320,7 @@
 
 :- pred do_append_arg_unifications(list(prog_var)::in, list(prog_term)::in,
     prog_context::in, arg_context::in,
-    hlds_goal::in, hlds_goal::out, maybe(int)::in, int::out,
+    hlds_goal::in, hlds_goal::out, maybe(int)::in, num_added_goals::out,
     prog_varset::in, prog_varset::out, module_info::in, module_info::out,
     qual_info::in, qual_info::out, svar_info::in, svar_info::out,
     io::di, io::uo) is det.
@@ -339,7 +345,7 @@
 :- pred do_append_arg_unifications_2(list(prog_var)::in, list(prog_term)::in,
     prog_context::in, arg_context::in, int::in,
     list(hlds_goal)::in, list(hlds_goal)::out,
-    maybe(int)::in, int::in, int::out,
+    maybe(int)::in, num_added_goals::in, num_added_goals::out,
     prog_varset::in, prog_varset::out, module_info::in, module_info::out,
     qual_info::in, qual_info::out, svar_info::in, svar_info::out,
     io::di, io::uo) is det.
@@ -367,7 +373,7 @@
 
 :- pred do_append_arg_unification(prog_var::in, prog_term::in,
     prog_context::in, arg_context::in, int::in, list(hlds_goal)::out,
-    maybe(int)::in, int::out,
+    maybe(int)::in, num_added_goals::out,
     prog_varset::in, prog_varset::out, module_info::in, module_info::out,
     qual_info::in, qual_info::out, svar_info::in, svar_info::out,
     io::di, io::uo) is det.
@@ -393,7 +399,7 @@
 
 :- pred do_unravel_unification(prog_term::in, prog_term::in, prog_context::in,
     unify_main_context::in, unify_sub_contexts::in, purity::in,
-    hlds_goal::out, maybe(int)::in, int::out,
+    hlds_goal::out, maybe(int)::in, num_added_goals::out,
     prog_varset::in, prog_varset::out, module_info::in, module_info::out,
     qual_info::in, qual_info::out, svar_info::in, svar_info::out,
     io::di, io::uo) is det.
@@ -420,9 +426,10 @@
 
 :- pred classify_unravel_unification(prog_term::in, prog_term::in,
     prog_context::in, unify_main_context::in, unify_sub_contexts::in,
-    purity::in, hlds_goal::out, int::out, prog_varset::in, prog_varset::out,
-    module_info::in, module_info::out, qual_info::in, qual_info::out,
-    svar_info::in, svar_info::out, io::di, io::uo) is det.
+    purity::in, hlds_goal::out, num_added_goals::out,
+    prog_varset::in, prog_varset::out, module_info::in, module_info::out,
+    qual_info::in, qual_info::out, svar_info::in, svar_info::out,
+    io::di, io::uo) is det.
 
 classify_unravel_unification(TermX, TermY, Context, MainContext, SubContext,
         Purity, Goal, NumAdded, !VarSet, !ModuleInfo, !QualInfo, !SInfo,
@@ -484,9 +491,10 @@
 :- pred unravel_var_functor_unification(prog_var::in, term.const::in,
     list(prog_term)::in, term.context::in,
     prog_context::in, unify_main_context::in, unify_sub_contexts::in,
-    purity::in, hlds_goal::out, int::out, prog_varset::in, prog_varset::out,
-    module_info::in, module_info::out, qual_info::in, qual_info::out,
-    svar_info::in, svar_info::out, io::di, io::uo) is det.
+    purity::in, hlds_goal::out, num_added_goals::out,
+    prog_varset::in, prog_varset::out, module_info::in, module_info::out,
+    qual_info::in, qual_info::out, svar_info::in, svar_info::out,
+    io::di, io::uo) is det.
 
 unravel_var_functor_unification(X, F, Args1, FunctorContext,
         Context, MainContext, SubContext, Purity, Goal, NumAdded,
@@ -732,23 +740,6 @@
                     !VarSet, !ModuleInfo, !QualInfo, !SInfo, !IO)
             ),
             NumAdded = MainFunctorAdded + ArgAdded
-%           % This "optimization" is disabled, because the extra cost of
-%           % traversing the scope goals in typechecking is more than the
-%           % savings from the reduction in delays/wakeups in modechecking.
-%           (
-%               % ZZZ
-%               semidet_fail,
-%               ground_terms(FunctorArgs)
-%           ->
-%               % This insertion of the `scope' goal is undone by the code
-%               % handling `scope' goals in modecheck_goal_expr in modes.m.
-%
-%               Goal2 = _GoalExpr2 - GoalInfo,
-%               GoalExpr = scope(from_ground_term(X), Goal2),
-%               Goal = GoalExpr - GoalInfo
-%           ;
-%               Goal = Goal2
-%           )
         )
     ).
 
@@ -760,8 +751,8 @@
 :- pred build_lambda_expression(prog_var::in, purity::in, purity::in,
     pred_or_func::in, lambda_eval_method::in, list(prog_term)::in,
     list(mer_mode)::in, determinism::in, goal::in, prog_context::in,
-    unify_main_context::in, unify_sub_contexts::in, hlds_goal::out, int::out,
-    prog_varset::in, prog_varset::out,
+    unify_main_context::in, unify_sub_contexts::in,
+    hlds_goal::out, num_added_goals::out, prog_varset::in, prog_varset::out,
     module_info::in, module_info::out, qual_info::in, qual_info::out,
     svar_info::in, io::di, io::uo) is det.
 
diff -u tests/debugger/breakpoints.exp tests/debugger/breakpoints.exp
--- tests/debugger/breakpoints.exp	25 Mar 2006 19:40:55 -0000
+++ tests/debugger/breakpoints.exp	27 Mar 2006 05:20:33 -0000
@@ -22,7 +22,7 @@
 Which do you want to put a breakpoint on (0-1 or *)? 0
  0: + stop  interface pred breakpoints.data/1-0 (det)
 mdb> continue
-      E2:     C2 CALL pred breakpoints.data/1-0 (det) breakpoints.m:58 (breakpoints.m:55)
+      E2:     C2 CALL pred breakpoints.data/1-0 (det) breakpoints.m:58 (breakpoints.m:56)
 mdb> disable 0
  0: - stop  interface pred breakpoints.data/1-0 (det)
 mdb> break info
diff -u tests/debugger/loopcheck.exp tests/debugger/loopcheck.exp
--- tests/debugger/loopcheck.exp	25 Mar 2006 19:42:28 -0000
+++ tests/debugger/loopcheck.exp	27 Mar 2006 05:21:32 -0000
@@ -7,11 +7,11 @@
        2:      2  2 CALL pred loopcheck.loop/1-0 (det)
                          loopcheck.m:20 (from loopcheck.m:14)
        3:      3  3 CALL pred loopcheck.loop/1-0 (det)
-                         loopcheck.m:20 (from loopcheck.m:20)
+                         loopcheck.m:20 (from loopcheck.m:21)
        4:      3  3 EXCP pred loopcheck.loop/1-0 (det)
-                         loopcheck.m:20 (from loopcheck.m:20)
+                         loopcheck.m:21 (from loopcheck.m:21)
        5:      2  2 EXCP pred loopcheck.loop/1-0 (det)
-                         loopcheck.m:20 (from loopcheck.m:14)
+                         loopcheck.m:21 (from loopcheck.m:14)
        6:      1  1 EXCP pred loopcheck.main/2-0 (det)
                          loopcheck.m:14
 Uncaught Mercury exception:
only in patch2:
--- tests/debugger/declarative/shallow.exp	20 May 2005 05:40:29 -0000	1.5
+++ tests/debugger/declarative/shallow.exp	27 Mar 2006 05:27:19 -0000
@@ -5,9 +5,9 @@
 mdb> break shallow__test
  0: + stop  interface pred shallow.test/2-0 (det)
 mdb> continue
-       2:      2  2 CALL pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:9)
+       2:      2  2 CALL pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:9)
 mdb> finish
-      15:      2  2 EXIT pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:9)
+      15:      2  2 EXIT pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:9)
 mdb> dd -d 3 -n 7
 test(p("t1", 5), 1)
 Valid? no
@@ -28,13 +28,13 @@
 b("t1", 1, 5)
 p("t1", 5, 1)
 Is this a bug? yes
-      14:      3  3 EXIT pred shallow_2.p/3-0 (det) shallow_2.m:16 (shallow.m:29)
+      14:      3  3 EXIT pred shallow_2.p/3-0 (det) shallow_2.m:11 (shallow.m:29)
 mdb> continue
-      15:      2  2 EXIT pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:9)
+      15:      2  2 EXIT pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:9)
 mdb> continue
-      16:      6  2 CALL pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:10)
+      16:      6  2 CALL pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:10)
 mdb> finish
-      29:      6  2 EXIT pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:10)
+      29:      6  2 EXIT pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:10)
 mdb> dd -d 3 -n 7
 test(p("t2", 37), -11)
 Valid? no
@@ -55,13 +55,13 @@
 b("t2", 1, 5)
 p("t2", 37, -11)
 Is this a bug? yes
-      28:      7  3 EXIT pred shallow_2.p/3-0 (det) shallow_2.m:16 (shallow.m:29)
+      28:      7  3 EXIT pred shallow_2.p/3-0 (det) shallow_2.m:11 (shallow.m:29)
 mdb> continue
-      29:      6  2 EXIT pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:10)
+      29:      6  2 EXIT pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:10)
 mdb> continue
-      30:     10  2 CALL pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:11)
+      30:     10  2 CALL pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:11)
 mdb> finish
-      41:     10  2 EXIT pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:11)
+      41:     10  2 EXIT pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:11)
 mdb> dd -d 3 -n 7
 test(q("t3", 2), 2)
 Valid? no
@@ -79,13 +79,13 @@
 Found incorrect contour:
 q("t3", 2, 2)
 Is this a bug? yes
-      40:     11  3 EXIT pred shallow_2.q/3-0 (det) shallow_2.m:30 (shallow.m:29)
+      40:     11  3 EXIT pred shallow_2.q/3-0 (det) shallow_2.m:25 (shallow.m:29)
 mdb> continue
-      41:     10  2 EXIT pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:11)
+      41:     10  2 EXIT pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:11)
 mdb> continue
-      42:     13  2 CALL pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:12)
+      42:     13  2 CALL pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:12)
 mdb> finish
-      48:     13  2 EXIT pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:12)
+      48:     13  2 EXIT pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:12)
 mdb> dd -d 3 -n 7
 test(q("t4", -1), 11)
 Valid? no
@@ -97,13 +97,13 @@
 a("t4", -1, -1)
 q("t4", -1, 11)
 Is this a bug? yes
-      47:     14  3 EXIT pred shallow_2.q/3-0 (det) shallow_2.m:30 (shallow.m:29)
+      47:     14  3 EXIT pred shallow_2.q/3-0 (det) shallow_2.m:25 (shallow.m:29)
 mdb> continue
-      48:     13  2 EXIT pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:12)
+      48:     13  2 EXIT pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:12)
 mdb> continue
-      49:     16  2 CALL pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:13)
+      49:     16  2 CALL pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:13)
 mdb> finish
-      62:     16  2 EXIT pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:13)
+      62:     16  2 EXIT pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:13)
 mdb> dd -d 3 -n 7
 test(r("t5", 3), 23)
 Valid? no
@@ -124,9 +124,9 @@
 b("t5", 3, 5)
 r("t5", 3, 23)
 Is this a bug? yes
-      61:     17  3 EXIT pred shallow_2.r/3-0 (det) shallow_2.m:40 (shallow.m:29)
+      61:     17  3 EXIT pred shallow_2.r/3-0 (det) shallow_2.m:34 (shallow.m:29)
 mdb> continue
-      62:     16  2 EXIT pred shallow.test/2-0 (det) shallow.m:29 (shallow.m:13)
+      62:     16  2 EXIT pred shallow.test/2-0 (det) shallow.m:28 (shallow.m:13)
 mdb> continue
 1
 -11
only in patch2:
--- tests/debugger/declarative/remember_modes.exp	20 May 2005 05:40:28 -0000	1.4
+++ tests/debugger/declarative/remember_modes.exp	27 Mar 2006 05:26:08 -0000
@@ -1,4 +1,4 @@
-      E1:     C1 CALL pred remember_modes.main/2-0 (det) remember_modes.m:37
+      E1:     C1 CALL pred remember_modes.main/2-0 (det) remember_modes.m:29
 mdb> Contexts will not be printed.
 mdb> mdb> echo on
 Command echo enabled.
only in patch2:
--- tests/debugger/declarative/queens.exp	20 May 2005 05:40:28 -0000	1.15
+++ tests/debugger/declarative/queens.exp	27 Mar 2006 05:26:05 -0000
@@ -1,4 +1,4 @@
-       1:      1  1 CALL pred queens.main/2-0 (cc_multi) queens.m:17
+       1:      1  1 CALL pred queens.main/2-0 (cc_multi) queens.m:14
 mdb> echo on
 Command echo enabled.
 mdb> register --quiet
only in patch2:
--- tests/debugger/declarative/propositional.exp	20 May 2005 05:40:28 -0000	1.14
+++ tests/debugger/declarative/propositional.exp	27 Mar 2006 05:26:01 -0000
@@ -1,4 +1,4 @@
-      E1:     C1 CALL pred propositional.main/2-0 (det) propositional.m:13
+      E1:     C1 CALL pred propositional.main/2-0 (det) propositional.m:8
 mdb> echo on
 Command echo enabled.
 mdb> register --quiet
only in patch2:
--- tests/debugger/declarative/oracle_db.exp	20 May 2005 05:40:28 -0000	1.11
+++ tests/debugger/declarative/oracle_db.exp	27 Mar 2006 05:25:44 -0000
@@ -1,4 +1,4 @@
-       1:      1  1 CALL pred oracle_db.main/2-0 (det) oracle_db.m:12
+       1:      1  1 CALL pred oracle_db.main/2-0 (det) oracle_db.m:7
 mdb> echo on
 Command echo enabled.
 mdb> register --quiet
only in patch2:
--- tests/debugger/declarative/nodescend_tracking.exp	2 Nov 2005 14:02:14 -0000	1.1
+++ tests/debugger/declarative/nodescend_tracking.exp	27 Mar 2006 05:25:41 -0000
@@ -26,7 +26,7 @@
 browser> track
 make_test_list(1) = [leave(1, 2)]
 Valid? info
-Context of current question : nodescend_tracking.m:64 (nodescend_tracking.m:65)
+Context of current question : nodescend_tracking.m:61 (nodescend_tracking.m:65)
 Search mode                 : top down                                         
 The current question was chosen because the marked subterm was bound by
 the unification inside the function nodescend_tracking.make_test_list/2
only in patch2:
--- tests/debugger/declarative/negation.exp	20 May 2005 05:40:27 -0000	1.9
+++ tests/debugger/declarative/negation.exp	27 Mar 2006 05:25:32 -0000
@@ -5,9 +5,9 @@
 mdb> break p
  0: + stop  interface pred negation.p/2-0 (det)
 mdb> continue
-       2:      2  2 CALL pred negation.p/2-0 (det) negation.m:29 (negation.m:14)
+       2:      2  2 CALL pred negation.p/2-0 (det) negation.m:21 (negation.m:14)
 mdb> finish
-      31:      2  2 EXIT pred negation.p/2-0 (det) negation.m:29 (negation.m:14)
+      31:      2  2 EXIT pred negation.p/2-0 (det) negation.m:21 (negation.m:14)
 mdb> dd -d 3 -n 7
 p(1, 42)
 Valid? no
@@ -27,6 +27,6 @@
 Found incorrect contour:
 p(1, 42)
 Is this a bug? yes
-      31:      2  2 EXIT pred negation.p/2-0 (det) negation.m:29 (negation.m:14)
+      31:      2  2 EXIT pred negation.p/2-0 (det) negation.m:21 (negation.m:14)
 mdb> continue
 42
only in patch2:
--- tests/debugger/declarative/neg_conj.exp	20 May 2005 05:40:27 -0000	1.9
+++ tests/debugger/declarative/neg_conj.exp	27 Mar 2006 05:25:35 -0000
@@ -1,13 +1,13 @@
-       1:      1  1 CALL pred neg_conj.main/2-0 (det) neg_conj.m:11
+       1:      1  1 CALL pred neg_conj.main/2-0 (det) neg_conj.m:8
 mdb> echo on
 Command echo enabled.
 mdb> register --quiet
 mdb> break p
  0: + stop  interface pred neg_conj.p/1-0 (semidet)
 mdb> continue
-       3:      2  2 CALL pred neg_conj.p/1-0 (semidet) neg_conj.m:19 (neg_conj.m:9)
+       3:      2  2 CALL pred neg_conj.p/1-0 (semidet) neg_conj.m:18 (neg_conj.m:9)
 mdb> finish
-      18:      2  2 EXIT pred neg_conj.p/1-0 (semidet) neg_conj.m:19 (neg_conj.m:9)
+      18:      2  2 EXIT pred neg_conj.p/1-0 (semidet) neg_conj.m:18 (neg_conj.m:9)
 mdb> dd -d 3 -n 7
 p(0)
 Valid? no
@@ -27,6 +27,6 @@
 Found incorrect contour:
 p(0)
 Is this a bug? yes
-      18:      2  2 EXIT pred neg_conj.p/1-0 (semidet) neg_conj.m:19 (neg_conj.m:9)
+      18:      2  2 EXIT pred neg_conj.p/1-0 (semidet) neg_conj.m:18 (neg_conj.m:9)
 mdb> continue
 yes.
only in patch2:
--- tests/debugger/declarative/mapinit.exp	20 May 2005 05:40:27 -0000	1.4
+++ tests/debugger/declarative/mapinit.exp	27 Mar 2006 05:25:22 -0000
@@ -2,13 +2,13 @@
 mdb> echo on
 Command echo enabled.
 mdb> step
-      E2:     C2 CALL pred mapinit.xmap_init/1-0 (det) mapinit.m:37 (mapinit.m:29)
+      E2:     C2 CALL pred mapinit.xmap_init/1-0 (det) mapinit.m:36 (mapinit.m:29)
 mdb> finish
-      E3:     C2 EXIT pred mapinit.xmap_init/1-0 (det) mapinit.m:37 (mapinit.m:29)
+      E3:     C2 EXIT pred mapinit.xmap_init/1-0 (det) mapinit.m:36 (mapinit.m:29)
 mdb> dd -d 3 -n 7
 xmap_init(empty)
 Valid? q
 Diagnosis aborted.
-      E3:     C2 EXIT pred mapinit.xmap_init/1-0 (det) mapinit.m:37 (mapinit.m:29)
+      E3:     C2 EXIT pred mapinit.xmap_init/1-0 (det) mapinit.m:36 (mapinit.m:29)
 mdb> c
 two(0, "zero", empty, empty)
only in patch2:
--- tests/debugger/declarative/ite_2.exp	20 May 2005 05:40:26 -0000	1.7
+++ tests/debugger/declarative/ite_2.exp	27 Mar 2006 05:25:16 -0000
@@ -11,9 +11,9 @@
  0: + stop  interface pred ite_2.ite/3-1 (multi)
  1: + stop  interface pred ite_2.ite/3-0 (det)
 mdb> continue
-       2:      2  2 CALL pred ite_2.ite/3-0 (det) ite_2.m:27 (ite_2.m:9)
+       2:      2  2 CALL pred ite_2.ite/3-0 (det) ite_2.m:21 (ite_2.m:9)
 mdb> finish
-      11:      2  2 EXIT pred ite_2.ite/3-0 (det) ite_2.m:27 (ite_2.m:9)
+      11:      2  2 EXIT pred ite_2.ite/3-0 (det) ite_2.m:21 (ite_2.m:9)
 mdb> dd -d 3 -n 7
 ite(a, 1, 1)
 Valid? no
@@ -27,11 +27,11 @@
 c(1, 1)
 ite(a, 1, 1)
 Is this a bug? yes
-      11:      2  2 EXIT pred ite_2.ite/3-0 (det) ite_2.m:27 (ite_2.m:9)
+      11:      2  2 EXIT pred ite_2.ite/3-0 (det) ite_2.m:21 (ite_2.m:9)
 mdb> continue
-      12:      6  2 CALL pred ite_2.ite/3-1 (multi) ite_2.m:27 (ite_2.m:10)
+      12:      6  2 CALL pred ite_2.ite/3-1 (multi) ite_2.m:21 (ite_2.m:10)
 mdb> finish
-      29:      6  2 EXIT pred ite_2.ite/3-1 (multi) ite_2.m:27 (ite_2.m:10)
+      29:      6  2 EXIT pred ite_2.ite/3-1 (multi) ite_2.m:21 (ite_2.m:10)
 mdb> dd -d 3 -n 7
 ite(b, 1, 1)
 Valid? no
@@ -50,7 +50,7 @@
 c(1, 1)
 ite(b, 1, 1)
 Is this a bug? yes
-      29:      6  2 EXIT pred ite_2.ite/3-1 (multi) ite_2.m:27 (ite_2.m:10)
+      29:      6  2 EXIT pred ite_2.ite/3-1 (multi) ite_2.m:21 (ite_2.m:10)
 mdb> continue
 ite(a, 1, 1).
 ite(b, 1, 1).
only in patch2:
--- tests/debugger/declarative/input_term_dep.exp	8 Jul 2005 16:45:20 -0000	1.10
+++ tests/debugger/declarative/input_term_dep.exp	27 Mar 2006 05:25:06 -0000
@@ -56,9 +56,9 @@
       E5:     C3 EXIT pred input_term_dep.q/1-0 (semidet) input_term_dep.m:69 (input_term_dep.m:58)
 mdb> continue
 [[2, 3], [], [1]]
-      E6:     C4 CALL pred input_term_dep.r/2-0 (det) input_term_dep.m:111 (input_term_dep.m:93)
+      E6:     C4 CALL pred input_term_dep.r/2-0 (det) input_term_dep.m:100 (input_term_dep.m:93)
 mdb> finish
-      E7:     C4 EXIT pred input_term_dep.r/2-0 (det) input_term_dep.m:111 (input_term_dep.m:93)
+      E7:     C4 EXIT pred input_term_dep.r/2-0 (det) input_term_dep.m:100 (input_term_dep.m:93)
 mdb> dd -d 3 -n 7
 r(1, 33)
 Valid? browse 2
@@ -74,12 +74,12 @@
 Parent r(1, _)
 Call rc(3, _)
 Is this a bug? yes
-      E7:     C4 EXIT pred input_term_dep.r/2-0 (det) input_term_dep.m:111 (input_term_dep.m:93)
+      E7:     C4 EXIT pred input_term_dep.r/2-0 (det) input_term_dep.m:100 (input_term_dep.m:93)
 mdb> continue
 33
-      E8:     C5 CALL pred input_term_dep.s/1-0 (semidet) input_term_dep.m:146 (input_term_dep.m:135)
+      E8:     C5 CALL pred input_term_dep.s/1-0 (semidet) input_term_dep.m:145 (input_term_dep.m:135)
 mdb> finish
-      E9:     C5 EXIT pred input_term_dep.s/1-0 (semidet) input_term_dep.m:146 (input_term_dep.m:135)
+      E9:     C5 EXIT pred input_term_dep.s/1-0 (semidet) input_term_dep.m:145 (input_term_dep.m:135)
 mdb> dd -d 3 -n 7
 s(1)
 Valid? no
@@ -94,6 +94,6 @@
 Parent s(1)
 Call sc(7)
 Is this a bug? yes
-      E9:     C5 EXIT pred input_term_dep.s/1-0 (semidet) input_term_dep.m:146 (input_term_dep.m:135)
+      E9:     C5 EXIT pred input_term_dep.s/1-0 (semidet) input_term_dep.m:145 (input_term_dep.m:135)
 mdb> continue
 yes
only in patch2:
--- tests/debugger/declarative/info.exp	24 Aug 2005 09:07:13 -0000	1.6
+++ tests/debugger/declarative/info.exp	27 Mar 2006 05:25:02 -0000
@@ -1,4 +1,4 @@
-      E1:     C1 CALL pred info.main/2-0 (det) info.m:26
+      E1:     C1 CALL pred info.main/2-0 (det) info.m:13
 mdb> mdb> Contexts will not be printed.
 mdb> echo on
 Command echo enabled.
only in patch2:
--- tests/debugger/declarative/if_then_else.exp	20 May 2005 05:40:26 -0000	1.15
+++ tests/debugger/declarative/if_then_else.exp	27 Mar 2006 05:24:55 -0000
@@ -5,9 +5,9 @@
 mdb> break if_then_else.ite
  0: + stop  interface pred if_then_else.ite/2-0 (det)
 mdb> continue
-      E2:     C2 CALL pred if_then_else.ite/2-0 (det) if_then_else.m:22 (if_then_else.m:8)
+      E2:     C2 CALL pred if_then_else.ite/2-0 (det) if_then_else.m:19 (if_then_else.m:8)
 mdb> finish
-      E3:     C2 EXIT pred if_then_else.ite/2-0 (det) if_then_else.m:22 (if_then_else.m:8)
+      E3:     C2 EXIT pred if_then_else.ite/2-0 (det) if_then_else.m:19 (if_then_else.m:8)
 mdb> dd -d 3 -n 7
 ite(0, 1)
 Valid? no
@@ -20,12 +20,12 @@
 b(1)
 ite(0, 1)
 Is this a bug? yes
-      E3:     C2 EXIT pred if_then_else.ite/2-0 (det) if_then_else.m:22 (if_then_else.m:8)
+      E3:     C2 EXIT pred if_then_else.ite/2-0 (det) if_then_else.m:19 (if_then_else.m:8)
 mdb> continue
 ite(0, 1).
-      E4:     C3 CALL pred if_then_else.ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
+      E4:     C3 CALL pred if_then_else.ite/2-0 (det) if_then_else.m:19 (if_then_else.m:12)
 mdb> finish
-      E5:     C3 EXIT pred if_then_else.ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
+      E5:     C3 EXIT pred if_then_else.ite/2-0 (det) if_then_else.m:19 (if_then_else.m:12)
 mdb> dd -d 3 -n 7
 ite(1, 0)
 Valid? no
@@ -35,6 +35,6 @@
 a(0)
 ite(1, 0)
 Is this a bug? yes
-      E5:     C3 EXIT pred if_then_else.ite/2-0 (det) if_then_else.m:22 (if_then_else.m:12)
+      E5:     C3 EXIT pred if_then_else.ite/2-0 (det) if_then_else.m:19 (if_then_else.m:12)
 mdb> continue
 ite(1, 0).
only in patch2:
--- tests/debugger/declarative/filter.exp	20 May 2005 05:40:23 -0000	1.12
+++ tests/debugger/declarative/filter.exp	27 Mar 2006 05:24:25 -0000
@@ -1,4 +1,4 @@
-      E1:     C1 CALL pred filter.main/2-0 (det) filter.m:13
+      E1:     C1 CALL pred filter.main/2-0 (det) filter.m:8
 mdb> echo on
 Command echo enabled.
 mdb> register --quiet
only in patch2:
--- tests/debugger/declarative/confirm_abort.exp	20 May 2005 05:40:22 -0000	1.5
+++ tests/debugger/declarative/confirm_abort.exp	27 Mar 2006 05:23:50 -0000
@@ -5,9 +5,9 @@
 mdb> break p
  0: + stop  interface pred confirm_abort.p/1-0 (det)
 mdb> continue
-       2:      2  2 CALL pred confirm_abort.p/1-0 (det) confirm_abort.m:15 (confirm_abort.m:8)
+       2:      2  2 CALL pred confirm_abort.p/1-0 (det) confirm_abort.m:14 (confirm_abort.m:8)
 mdb> finish
-       5:      2  2 EXIT pred confirm_abort.p/1-0 (det) confirm_abort.m:15 (confirm_abort.m:8)
+       5:      2  2 EXIT pred confirm_abort.p/1-0 (det) confirm_abort.m:14 (confirm_abort.m:8)
 mdb> dd -d 3 -n 7
 p(27)
 Valid? no
@@ -43,14 +43,14 @@
 Found incorrect contour:
 q(27)
 Is this a bug? quit
-       5:      2  2 EXIT pred confirm_abort.p/1-0 (det) confirm_abort.m:15 (confirm_abort.m:8)
+       5:      2  2 EXIT pred confirm_abort.p/1-0 (det) confirm_abort.m:14 (confirm_abort.m:8)
 mdb> dd -d 3 -n 7
 p(27)
 Valid? [no] n
 Found incorrect contour:
 q(27)
 Is this a bug? q
-       5:      2  2 EXIT pred confirm_abort.p/1-0 (det) confirm_abort.m:15 (confirm_abort.m:8)
+       5:      2  2 EXIT pred confirm_abort.p/1-0 (det) confirm_abort.m:14 (confirm_abort.m:8)
 mdb> dd -d 3 -n 7
 p(27)
 Valid? [no] n
only in patch2:
--- tests/debugger/declarative/args.exp	20 May 2005 05:40:20 -0000	1.10
+++ tests/debugger/declarative/args.exp	27 Mar 2006 05:23:25 -0000
@@ -1,4 +1,4 @@
-      E1:     C1 CALL pred args.main/2-0 (cc_multi) args.m:17
+      E1:     C1 CALL pred args.main/2-0 (cc_multi) args.m:8
 mdb> echo on
 Command echo enabled.
 mdb> register --quiet
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list