[m-rev.] for review: better headvar names

Zoltan Somogyi zs at csse.unimelb.edu.au
Tue Apr 24 16:28:29 AEST 2007


For review by anyone.

Zoltan.

Replace names of the form "HeadVar__n" with meaningful names in a larger class
of cases than we do currently.

compiler/typecheck.m:
	Implement the change above.

compiler/clause_to_proc.m:
compiler/hlds_clauses.m:
compiler/simplify.m:
	Fix some minor issues I found while looking for the right piece of code
	to change.

tests/debugger/queens.{inp,exp,exp2}:
	Extend the input to the test case to print the names of the arguments
	of the nodiag predicate (whose head variables are now named "B" and
	"D", not HeadVar__1 and HeadVar__2).

	Expect fewer conjuncts in the top-level conjunction, since the
	unifications HeadVar__1 = B and HeadVar__2 = D can now be
	optimized away.

tests/debugger/higher_order.exp:
tests/debugger/synth_attr.exp:
tests/debugger/user_event.exp:
tests/debugger/user_event_shallow.exp:
	Update variable names and/or goal paths as for queens.

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/clause_to_proc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/clause_to_proc.m,v
retrieving revision 1.77
diff -u -b -r1.77 clause_to_proc.m
--- compiler/clause_to_proc.m	19 Jan 2007 07:04:08 -0000	1.77
+++ compiler/clause_to_proc.m	19 Apr 2007 07:35:08 -0000
@@ -105,20 +105,17 @@
     pred_info_get_procedures(PredInfo0, Procs0),
     PredOrFunc = pred_info_is_pred_or_func(PredInfo0),
     (
-        %
         % Is this a function with no modes?
-        %
         PredOrFunc = pf_function,
         map.is_empty(Procs0)
     ->
-        %
         % If so, add a default mode of
         %
         %   :- mode foo(in, in, ..., in) = out is det.
         %
-        % for this function.  (N.B. functions which can
-        % fail must be explicitly declared as semidet.)
-        %
+        % for this function.  (N.B. functions which can fail must be
+        % explicitly declared as semidet.)
+
         PredArity = pred_info_orig_arity(PredInfo0),
         FuncArity = PredArity - 1,
         in_mode(InMode),
@@ -205,7 +202,7 @@
                 MaybeTraceRuntimeCond, _)
         ->
             % Use the original variable names for the headvars of foreign_proc
-            % clauses, not the introduced `HeadVar.n' names.
+            % clauses, not the introduced `HeadVar__n' names.
             VarSet = list.foldl(set_arg_names, Args, VarSet0),
             expect(unify(ExtraArgs, []), this_file,
                 "copy_clauses_to_proc: extra_args"),
Index: compiler/hlds_clauses.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_clauses.m,v
retrieving revision 1.8
diff -u -b -r1.8 hlds_clauses.m
--- compiler/hlds_clauses.m	19 Jan 2007 07:04:13 -0000	1.8
+++ compiler/hlds_clauses.m	19 Apr 2007 07:30:15 -0000
@@ -237,11 +237,11 @@
 clauses_info_set_rtti_varmaps(X, CI, CI ^ clauses_rtti_varmaps := X).
 
     % In each of the alternatives below, the num field gives the number of
-    % clauses. in the forw_list and both_forw fields, the clauses are in
+    % clauses. In the forw_list and both_forw fields, the clauses are in
     % program order. In the rev_list and both_rev fields, the clauses are in
     % reverse program order. It is an invariant that
     %
-    %   list.reverse(Rep ^ both_rev, Rep & both_forw)
+    %   list.reverse(Rep ^ both_rev, Rep ^ both_forw)
     %
     % holds.
 :- type clauses_rep
Index: compiler/simplify.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/simplify.m,v
retrieving revision 1.207
diff -u -b -r1.207 simplify.m
--- compiler/simplify.m	22 Feb 2007 03:50:36 -0000	1.207
+++ compiler/simplify.m	19 Apr 2007 07:28:06 -0000
@@ -759,10 +759,9 @@
         Goal1 = Goal0
     ),
 
-    %
     % Remove unnecessary explicit quantifications before working
     % out whether the goal can cause a stack flush.
-    %
+
     ( Goal1 = hlds_goal(scope(Reason1, SomeGoal1), GoalInfo1) ->
         nested_scopes(Reason1, SomeGoal1, GoalInfo1, Goal2)
     ;
@@ -785,15 +784,16 @@
     simplify_info_maybe_clear_structs(after, hlds_goal(GoalExpr, GoalInfo4),
         !Info),
     simplify_info_set_inside_duplicated_for_switch(InsideDuplForSwitch, !Info),
-    enforce_invariant(GoalInfo4, GoalInfo, !Info).
+    enforce_unreachability_invariant(GoalInfo4, GoalInfo, !Info).
 
     % Ensure that the mode information and the determinism
     % information say consistent things about unreachability.
     %
-:- pred enforce_invariant(hlds_goal_info::in, hlds_goal_info::out,
+:- pred enforce_unreachability_invariant(
+    hlds_goal_info::in, hlds_goal_info::out,
     simplify_info::in, simplify_info::out) is det.
 
-enforce_invariant(GoalInfo0, GoalInfo, !Info) :-
+enforce_unreachability_invariant(GoalInfo0, GoalInfo, !Info) :-
     goal_info_get_determinism(GoalInfo0, Determinism0),
     goal_info_get_instmap_delta(GoalInfo0, DeltaInstmap0),
     determinism_components(Determinism0, CanFail0, NumSolns0),
Index: compiler/typecheck.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.419
diff -u -b -r1.419 typecheck.m
--- compiler/typecheck.m	19 Jan 2007 07:04:33 -0000	1.419
+++ compiler/typecheck.m	19 Apr 2007 09:47:20 -0000
@@ -141,6 +141,7 @@
 :- import_module std_util.
 :- import_module string.
 :- import_module svmap.
+:- import_module svset.
 :- import_module svvarset.
 :- import_module term.
 :- import_module varset.
@@ -960,25 +961,15 @@
     ;
         % If a headvar is assigned to a variable with the same name
         % (or no name) in every clause, rename it to have that name.
-        list.foldl2(find_headvar_names_in_clause(VarSet0, HeadVars0),
-            Clauses0, map.init, HeadVarNames, yes, _),
-        map.foldl(maybe_update_headvar_name, HeadVarNames, VarSet0, VarSet),
+        list.map2(find_headvar_names_in_clause(VarSet0, HeadVars0), Clauses0,
+            VarNameInfoMaps, VarsInMapSets),
+        ConsensusMap = find_consensus_headvar_names(VarsInMapSets,
+            VarNameInfoMaps),
+        map.foldl(svvarset.name_var, ConsensusMap, VarSet0, VarSet),
         clauses_info_set_varset(VarSet, ClausesInfo0, ClausesInfo),
         pred_info_set_clauses_info(ClausesInfo, !PredInfo)
     ).
 
-:- pred maybe_update_headvar_name(prog_var::in, maybe(string)::in,
-    prog_varset::in, prog_varset::out) is det.
-
-maybe_update_headvar_name(HeadVar, MaybeHeadVarName, VarSet0, VarSet) :-
-    (
-        MaybeHeadVarName = yes(HeadVarName),
-        varset.name_var(VarSet0, HeadVar, HeadVarName, VarSet)
-    ;
-        MaybeHeadVarName = no,
-        VarSet = VarSet0
-    ).
-
 :- pred improve_single_clause_headvars(list(hlds_goal)::in,
     proc_arg_vector(prog_var)::in, list(prog_var)::in,
     prog_varset::in, prog_varset::out,
@@ -988,7 +979,7 @@
 improve_single_clause_headvars([], _, _, !VarSet, !Subst, !RevConj).
 improve_single_clause_headvars([Goal | Conj0], HeadVars, SeenVars0,
         !VarSet, !Subst, !RevConj) :-
-    ( goal_is_headvar_unification(HeadVars, Goal, HeadVar, OtherVar) ->
+    ( goal_is_headvar_unification(HeadVars, Goal, HeadVar, yes(OtherVar)) ->
         % If the headvar doesn't appear elsewhere the unification
         % can be removed.
         (
@@ -1039,89 +1030,200 @@
     improve_single_clause_headvars(Conj0, HeadVars, SeenVars, !VarSet,
         !Subst, !RevConj).
 
+:- type var_name_info_map == map(prog_var, var_name_info).
+:- type var_name_info
+    --->    var_name_info(
+                % Is the head variable unified with a functor?
+                vni_unified_with_functor    :: bool,
+
+                % What are the names of the named variables it is unified with?
+                vni_unified_with_vars       :: set(string)
+            ).
+
     % Head variables that have the same name in each clause
     % will have an entry of `yes(Name)' in the result map.
     %
 :- pred find_headvar_names_in_clause(prog_varset::in,
     proc_arg_vector(prog_var)::in, clause::in,
-    map(prog_var, maybe(string))::in, map(prog_var, maybe(string))::out,
-    bool::in, bool::out) is det.
+    var_name_info_map::out, set(prog_var)::out) is det.
 
-find_headvar_names_in_clause(VarSet, HeadVars, Clause,
-        HeadVarMap0, HeadVarMap, IsFirstClause, no) :-
+find_headvar_names_in_clause(VarSet, HeadVars, Clause, VarNameInfoMap,
+        VarsInMap) :-
     Goal = Clause ^ clause_body,
     goal_to_conj_list(Goal, Conj),
-    ClauseHeadVarMap = list.foldl(
-        find_headvar_names_in_goal(VarSet, HeadVars), Conj, map.init),
-    (
-        IsFirstClause = yes,
-        HeadVarMap = ClauseHeadVarMap
-    ;
-        IsFirstClause = no,
-        % Check that the variables in this clause match
-        % the names in previous clauses.
-        HeadVarMap1 = map.foldl(
-            (func(HeadVar, MaybeHeadVarName, Map) =
-                (
-                    map.search(Map, HeadVar, MaybeClauseHeadVarName),
-                    MaybeHeadVarName = MaybeClauseHeadVarName
-                ->
-                    Map
-                ;
-                    map.set(Map, HeadVar, no)
-                )
-            ), HeadVarMap0, ClauseHeadVarMap),
+    list.foldl2(find_headvar_names_in_goal(VarSet, HeadVars), Conj,
+        map.init, VarNameInfoMap, set.init, VarsInMap).
 
-        % Check for variables which weren't named in previous
-        % clauses. It would be confusing to refer to variable
-        % `A' in the second clause below.
-        %   p(A, _).
-        %   p([_ | _], _).
-        HeadVarMap = map.foldl(
-            (func(HeadVar, _, Map) =
-                ( map.contains(HeadVarMap0, HeadVar) ->
-                    Map
-                ;
-                    map.set(Map, HeadVar, no)
+:- pred find_headvar_names_in_goal(prog_varset::in,
+    proc_arg_vector(prog_var)::in, hlds_goal::in,
+    var_name_info_map::in, var_name_info_map::out,
+    set(prog_var)::in, set(prog_var)::out) is det.
+
+find_headvar_names_in_goal(VarSet, HeadVars, Goal, !VarNameInfoMap,
+        !VarsInMap) :-
+    ( goal_is_headvar_unification(HeadVars, Goal, HeadVar, MaybeOtherVar) ->
+        svset.insert(HeadVar, !VarsInMap),
+        (
+            MaybeOtherVar = no,
+            ( map.search(!.VarNameInfoMap, HeadVar, VarNameInfo0) ->
+                VarNameInfo0 = var_name_info(_UnifiedFunctor, VarNames),
+                VarNameInfo = var_name_info(yes, VarNames),
+                svmap.det_update(HeadVar, VarNameInfo, !VarNameInfoMap)
+            ;
+                VarNameInfo = var_name_info(yes, set.init),
+                svmap.det_insert(HeadVar, VarNameInfo, !VarNameInfoMap)
+            )
+        ;
+            MaybeOtherVar = yes(OtherVar),
+            ( varset.search_name(VarSet, OtherVar, OtherVarName) ->
+                ( map.search(!.VarNameInfoMap, HeadVar, VarNameInfo0) ->
+                    VarNameInfo0 = var_name_info(UnifiedFunctor, VarNames0),
+                    set.insert(VarNames0, OtherVarName, VarNames),
+                    VarNameInfo = var_name_info(UnifiedFunctor, VarNames),
+                    svmap.det_update(HeadVar, VarNameInfo, !VarNameInfoMap)
+                ;
+                    VarNames = set.make_singleton_set(OtherVarName),
+                    VarNameInfo = var_name_info(no, VarNames),
+                    svmap.det_insert(HeadVar, VarNameInfo, !VarNameInfoMap)
                 )
-            ), HeadVarMap1, HeadVarMap1)
-    ).
-
-:- func find_headvar_names_in_goal(prog_varset, proc_arg_vector(prog_var),
-    hlds_goal, map(prog_var, maybe(string))) = map(prog_var, maybe(string)).
-
-find_headvar_names_in_goal(VarSet, HeadVars, Goal, HeadVarMap0)
-        = HeadVarMap :-
-    ( goal_is_headvar_unification(HeadVars, Goal, HeadVar, OtherVar) ->
-        maybe_pred(varset.search_name(VarSet), OtherVar, MaybeOtherVarName),
-        ( map.search(HeadVarMap0, HeadVar, MaybeHeadVarName) ->
-            ( MaybeOtherVarName = MaybeHeadVarName ->
-                HeadVarMap = HeadVarMap0
             ;
-                HeadVarMap = map.det_update(HeadVarMap0, HeadVar, no)
+                true
             )
-        ;
-            HeadVarMap = map.set(HeadVarMap0, HeadVar, MaybeOtherVarName)
         )
     ;
-        HeadVarMap = HeadVarMap0
+        true
     ).
 
 :- pred goal_is_headvar_unification(proc_arg_vector(prog_var)::in,
-    hlds_goal::in, prog_var::out, prog_var::out) is semidet.
+    hlds_goal::in, prog_var::out, maybe(prog_var)::out) is semidet.
 
-goal_is_headvar_unification(HeadVars, Goal, HeadVar, OtherVar) :-
-    Goal = hlds_goal(unify(LVar, rhs_var(RVar), _, _, _), _),
+goal_is_headvar_unification(HeadVars, Goal, HeadVar, MaybeOtherVar) :-
+    Goal = hlds_goal(GoalExpr, _),
+    GoalExpr = unify(LVar, RHS, _, _, _),
+    (
+        RHS = rhs_var(RVar),
     ( proc_arg_vector_member(HeadVars, LVar) ->
         HeadVar = LVar,
-        OtherVar = RVar
+            MaybeOtherVar = yes(RVar)
     ; proc_arg_vector_member(HeadVars, RVar) ->
         HeadVar = RVar,
-        OtherVar = LVar
+            MaybeOtherVar = yes(LVar)
+        ;
+            fail
+        )
+    ;
+        RHS = rhs_functor(_, _, _),
+        ( proc_arg_vector_member(HeadVars, LVar) ->
+            HeadVar = LVar,
+            MaybeOtherVar = no
     ;
         fail
+        )
     ).
 
+:- func find_consensus_headvar_names(list(set(prog_var)),
+    list(var_name_info_map)) = map(prog_var, string).
+
+find_consensus_headvar_names(VarsInMapSets, VarNameInfoMaps) = ConsensusMap :-
+    VarsInMapSet = set.union_list(VarsInMapSets),
+    set.to_sorted_list(VarsInMapSet, VarsInMaps),
+    list.foldl(update_consensus_map_for_headvar(VarNameInfoMaps), VarsInMaps,
+        map.init, ConsensusMap).
+
+:- pred update_consensus_map_for_headvar(list(var_name_info_map)::in,
+    prog_var::in,
+    map(prog_var, string)::in, map(prog_var, string)::out) is det.
+
+update_consensus_map_for_headvar(VarNameInfos, HeadVar, !ConsensusMap) :-
+    MaybeName = find_consensus_name_for_headvar(VarNameInfos, HeadVar),
+    (
+        MaybeName = no
+    ;
+        MaybeName = yes(Name),
+        svmap.det_insert(HeadVar, Name, !ConsensusMap)
+    ).
+
+:- func find_consensus_name_for_headvar(list(var_name_info_map), prog_var)
+    = maybe(string).
+
+find_consensus_name_for_headvar(VarNameInfoMaps, HeadVar)
+        = MaybeConsensusName :-
+    group_var_infos(VarNameInfoMaps, HeadVar,
+        [], Inconsistents, [], Consistents, [], FunctorOnlys),
+    (
+        Inconsistents = [_ | _],
+        % Some clauses are lack consensus even among themselves.
+        MaybeConsensusName = no
+    ;
+        Inconsistents = [],
+        (
+            Consistents = [],
+            % There is no name we *can* give.
+            MaybeConsensusName = no
+        ;
+            Consistents = [_ | _],
+            (
+                FunctorOnlys = [],
+                list.sort_and_remove_dups(Consistents, SortedConsistents),
+                ( SortedConsistents = [ConsensusName] ->
+                    MaybeConsensusName = yes(ConsensusName)
+                ;
+                    MaybeConsensusName = no
+                )
+            ;
+                FunctorOnlys = [_ | _],
+                % There is no consensus as to whether the variable *should*
+                % have a name. Given a predicate definition like this:
+                %
+                %   p(A, _) :- ...
+                %   p([_ | _], _) :- ...
+                %
+                % referring to the first head variable in the second clause
+                % by the name "A" would be confusing.
+                MaybeConsensusName = no
+            )
+        )
+    ).
+
+:- pred group_var_infos(list(var_name_info_map)::in, prog_var::in,
+    list(var_name_info)::in, list(var_name_info)::out,
+    list(string)::in, list(string)::out,
+    list(var_name_info)::in, list(var_name_info)::out) is det.
+
+group_var_infos([], _, !Inconsistents, !Consistents, !FunctorOnlys).
+group_var_infos([VarNameInfoMap | VarNameInfoMaps], HeadVar,
+        !Inconsistents, !Consistents, !FunctorOnlys) :-
+    ( map.search(VarNameInfoMap, HeadVar, VarInfo) ->
+        VarInfo = var_name_info(UnifiedFunctor, VarNameSet),
+        set.count(VarNameSet, NameCount),
+        ( NameCount = 0 ->
+            (
+                UnifiedFunctor = yes,
+                !:FunctorOnlys = [VarInfo | !.FunctorOnlys]
+            ;
+                UnifiedFunctor = no
+                % The variable was unified only with anonymous variables.
+            )
+        ; NameCount = 1 ->
+            % If the clause gave the variable a name, we don't care that
+            % it also unified the variable with a functor.
+            set.to_sorted_list(VarNameSet, VarNameList),
+            ( VarNameList = [VarName] ->
+                !:Consistents = [VarName | !.Consistents]
+            ;
+                unexpected(this_file, "group_var_infos: bad singleton set")
+            )
+        ;
+            % NameCount > 1, so this *single clause* calls HeadVar
+            % by more than one name.
+            !:Inconsistents = [VarInfo | !.Inconsistents]
+        )
+    ;
+        true
+    ),
+    group_var_infos(VarNameInfoMaps, HeadVar,
+        !Inconsistents, !Consistents, !FunctorOnlys).
+
 %-----------------------------------------------------------------------------%
 
     % Iterate over the list of clauses for a predicate.
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_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/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/stream
cvs diff: Diffing extras/stream/tests
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 tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
Index: tests/debugger/higher_order.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/higher_order.exp,v
retrieving revision 1.9
diff -u -b -r1.9 higher_order.exp
--- tests/debugger/higher_order.exp	15 Feb 2007 00:41:50 -0000	1.9
+++ tests/debugger/higher_order.exp	20 Apr 2007 08:06:00 -0000
@@ -9,56 +9,56 @@
 mdb> step
       E2:     C2 CALL pred higher_order.domap/3-0 (det)
 mdb> print *
-       HeadVar__1             	float_add2(3.0)
+       P (arg 1)              	float_add2(3.0)
        HeadVar__2             	[1.0, 2.0, 3.0, 4.0, 5.0]
 mdb> finish
       E3:     C2 EXIT pred higher_order.domap/3-0 (det)
 mdb> print *
-       HeadVar__1             	float_add2(3.0)
+       P (arg 1)              	float_add2(3.0)
        HeadVar__2             	[1.0, 2.0, 3.0, 4.0, 5.0]
        HeadVar__3             	[4.0, 5.0, 6.0, 7.0, 8.0]
 mdb> step
       E4:     C3 CALL pred higher_order.domap/3-0 (det)
 mdb> print *
-       HeadVar__1             	float_op3(4.0, 5.0)
+       P (arg 1)              	float_op3(4.0, 5.0)
        HeadVar__2             	[1.0, 2.0, 3.0, 4.0, 5.0]
 mdb> finish
       E5:     C3 EXIT pred higher_order.domap/3-0 (det)
 mdb> print *
-       HeadVar__1             	float_op3(4.0, 5.0)
+       P (arg 1)              	float_op3(4.0, 5.0)
        HeadVar__2             	[1.0, 2.0, 3.0, 4.0, 5.0]
        HeadVar__3             	[9.0, 14.0, 19.0, 24.0, 29.0]
 mdb> step
       E6:     C4 CALL pred higher_order.domap/3-0 (det)
 mdb> print *
-       HeadVar__1             	max(3)
+       P (arg 1)              	max(3)
        HeadVar__2             	[1, 2, 3, 4, 5]
 mdb> finish
       E7:     C4 EXIT pred higher_order.domap/3-0 (det)
 mdb> print *
-       HeadVar__1             	max(3)
+       P (arg 1)              	max(3)
        HeadVar__2             	[1, 2, 3, 4, 5]
        HeadVar__3             	[3, 3, 3, 4, 5]
 mdb> step
       E8:     C5 CALL pred higher_order.domap/3-0 (det)
 mdb> print *
-       HeadVar__1             	lambda_higher_order_m_21([6])
+       P (arg 1)              	lambda_higher_order_m_21([6])
        HeadVar__2             	[[1, 2], [3, 4, 5]]
 mdb> finish
       E9:     C5 EXIT pred higher_order.domap/3-0 (det)
 mdb> print *
-       HeadVar__1             	lambda_higher_order_m_21([6])
+       P (arg 1)              	lambda_higher_order_m_21([6])
        HeadVar__2             	[[1, 2], [3, 4, 5]]
        HeadVar__3             	[[6, 1, 2], [6, 3, 4, 5]]
 mdb> step
      E10:     C6 CALL pred higher_order.domap/3-0 (det)
 mdb> print *
-       HeadVar__1             	lambda_higher_order_m_22(["a"])
+       P (arg 1)              	lambda_higher_order_m_22(["a"])
        HeadVar__2             	[["one", "two"], ["three", "four", "five"]]
 mdb> finish
      E11:     C6 EXIT pred higher_order.domap/3-0 (det)
 mdb> print *
-       HeadVar__1             	lambda_higher_order_m_22(["a"])
+       P (arg 1)              	lambda_higher_order_m_22(["a"])
        HeadVar__2             	[["one", "two"], ["three", "four", "five"]]
        HeadVar__3             	[["a", "one", "two"], ["a", "three", "four", "five"]]
 mdb> continue -S
Index: tests/debugger/queens.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/queens.exp,v
retrieving revision 1.34
diff -u -b -r1.34 queens.exp
--- tests/debugger/queens.exp	19 Jan 2007 04:42:48 -0000	1.34
+++ tests/debugger/queens.exp	20 Apr 2007 08:08:46 -0000
@@ -252,9 +252,9 @@
      E41:    C16 SWTC queens.m:61
                          pred queens.nodiag/3-0 (semidet) s2-2;
      E42:    C16 COND queens.m:64
-                         pred queens.nodiag/3-0 (semidet) s2-2;c6;?;
+                         pred queens.nodiag/3-0 (semidet) s2-2;c4;?;
      E43:    C16 THEN queens.m:65
-                         pred queens.nodiag/3-0 (semidet) s2-2;c6;t;
+                         pred queens.nodiag/3-0 (semidet) s2-2;c4;t;
      E44:    C16 FAIL queens.m:60 (from queens.m:54)
                          pred queens.nodiag/3-0 (semidet)
      E45:    C15 FAIL queens.m:52 (from queens.m:31)
@@ -371,5 +371,16 @@
 Are you sure you want to do it? yes
       E1:     C1 CALL queens.m:14
                          pred queens.main/2-0 (cc_multi)
+mdb> break nodiag
+ 1: + stop  interface pred queens.nodiag/3-0 (semidet)
+mdb> continue
+     E40:    C16 CALL queens.m:60 (from queens.m:54)
+                         pred queens.nodiag/3-0 (semidet)
+mdb> print *
+       B (arg 1)              	1
+       D (arg 2)              	1
+       HeadVar__3             	[2, 3, 4, 5]
+mdb> delete 0
+ 0: E stop  interface pred queens.main/2-0 (cc_multi)
 mdb> continue -n -S
 [1, 3, 5, 2, 4]
Index: tests/debugger/queens.exp2
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/queens.exp2,v
retrieving revision 1.15
diff -u -b -r1.15 queens.exp2
--- tests/debugger/queens.exp2	23 Jan 2007 03:45:39 -0000	1.15
+++ tests/debugger/queens.exp2	19 Apr 2007 10:06:02 -0000
@@ -260,9 +260,9 @@
      E45:    C18 EXIT int.m:NNNN (from queens.m:63)
                          func int.-/2-0 (det)
      E46:    C16 COND queens.m:64
-                         pred queens.nodiag/3-0 (semidet) s2-2;c6;?;
+                         pred queens.nodiag/3-0 (semidet) s2-2;c4;?;
      E47:    C16 THEN queens.m:65
-                         pred queens.nodiag/3-0 (semidet) s2-2;c6;t;
+                         pred queens.nodiag/3-0 (semidet) s2-2;c4;t;
      E48:    C16 FAIL queens.m:60 (from queens.m:54)
                          pred queens.nodiag/3-0 (semidet)
      E49:    C15 FAIL queens.m:52 (from queens.m:31)
@@ -379,5 +379,16 @@
 Are you sure you want to do it? yes
       E1:     C1 CALL queens.m:14
                          pred queens.main/2-0 (cc_multi)
+mdb> break nodiag
+ 1: + stop  interface pred queens.nodiag/3-0 (semidet)
+mdb> continue
+     E40:    C16 CALL queens.m:60 (from queens.m:54)
+                         pred queens.nodiag/3-0 (semidet)
+mdb> print *
+       B (arg 1)              	1
+       D (arg 2)              	1
+       HeadVar__3             	[2, 3, 4, 5]
+mdb> delete 0
+ 0: E stop  interface pred queens.main/2-0 (cc_multi)
 mdb> continue -n -S
 [1, 3, 5, 2, 4]
Index: tests/debugger/queens.inp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/queens.inp,v
retrieving revision 1.16
diff -u -b -r1.16 queens.inp
--- tests/debugger/queens.inp	19 Jan 2007 04:42:48 -0000	1.16
+++ tests/debugger/queens.inp	19 Apr 2007 10:06:01 -0000
@@ -101,4 +101,8 @@
 continue -n
 retry
 yes
+break nodiag
+continue
+print *
+delete 0
 continue -n -S
Index: tests/debugger/synth_attr.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/synth_attr.exp,v
retrieving revision 1.2
diff -u -b -r1.2 synth_attr.exp
--- tests/debugger/synth_attr.exp	6 Jan 2007 10:56:26 -0000	1.2
+++ tests/debugger/synth_attr.exp	20 Apr 2007 08:07:21 -0000
@@ -17,7 +17,7 @@
 2
 browser> quit
 mdb> user
-      E3:     C3 USER <nodiag_fail> pred synth_attr.nodiag/3-0 (semidet) s2-2;c6;t;c4; synth_attr.m:75
+      E3:     C3 USER <nodiag_fail> pred synth_attr.nodiag/3-0 (semidet) s2-2;c4;t;c4; synth_attr.m:75
 mdb> vars
         1 test_failed (attr 0)
         2 arg_b (attr 1, B)
@@ -27,15 +27,13 @@
         6 list_len_func (attr 5)
         7 list_sort_func (attr 6)
         8 arg_list (attr 7, HeadVar__3)
-        9 HeadVar__1
-       10 HeadVar__2
+        9 B (arg 1)
+       10 D (arg 2)
        11 HeadVar__3
-       12 B
-       13 BmN
-       14 D
-       15 L
-       16 N
-       17 NmB
+       12 BmN
+       13 L
+       14 N
+       15 NmB
 mdb> print *
        test_failed (attr 0)   	"N - B"
        arg_b (attr 1, B)      	1
@@ -45,10 +43,8 @@
        list_len_func (attr 5) 	lambda_synth_attr_m_75
        list_sort_func (attr 6)	lambda2_synth_attr_m_75
        arg_list (attr 7, HeadVar__3)	[2, 3, 4, 5]
-       HeadVar__1             	1
-       HeadVar__2             	1
+       D (arg 2)              	1
        BmN                    	-1
-       D                      	1
        L                      	[3, 4, 5]
        NmB                    	1
 mdb> print !arg_b
Index: tests/debugger/user_event.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/user_event.exp,v
retrieving revision 1.4
diff -u -b -r1.4 user_event.exp
--- tests/debugger/user_event.exp	19 Jan 2007 04:42:48 -0000	1.4
+++ tests/debugger/user_event.exp	20 Apr 2007 08:07:35 -0000
@@ -24,31 +24,27 @@
 2
 browser> quit
 mdb> user
-      E3:     C3 USER <nodiag_fail> pred user_event.nodiag/3-0 (semidet) s2-2;c6;t;c2; user_event.m:64
+      E3:     C3 USER <nodiag_fail> pred user_event.nodiag/3-0 (semidet) s2-2;c4;t;c2; user_event.m:64
        arg_b (attr 1, B)      	1
 mdb> vars
         1 test_failed (attr 0)
         2 arg_b (attr 1, B)
         3 arg_d (attr 2, N)
         4 arg_list (attr 3, HeadVar__3)
-        5 HeadVar__1
-        6 HeadVar__2
+        5 B (arg 1)
+        6 D (arg 2)
         7 HeadVar__3
-        8 B
-        9 BmN
-       10 D
-       11 L
-       12 N
-       13 NmB
+        8 BmN
+        9 L
+       10 N
+       11 NmB
 mdb> print *
        test_failed (attr 0)   	"N - B"
        arg_b (attr 1, B)      	1
        arg_d (attr 2, N)      	2
        arg_list (attr 3, HeadVar__3)	[2, 3, 4, 5]
-       HeadVar__1             	1
-       HeadVar__2             	1
+       D (arg 2)              	1
        BmN                    	-1
-       D                      	1
        L                      	[3, 4, 5]
        NmB                    	1
 mdb> print !arg_b
@@ -63,7 +59,7 @@
             !arg_b = 1
             !arg_b (flat)
 mdb> continue
-      E5:     C4 USER <nodiag_fail> pred user_event.nodiag/3-0 (semidet) s2-2;c6;t;c2; user_event.m:64
+      E5:     C4 USER <nodiag_fail> pred user_event.nodiag/3-0 (semidet) s2-2;c4;t;c2; user_event.m:64
        arg_b (attr 1, B)      	1
 mdb> continue -S
 [1, 3, 5, 2, 4]
Index: tests/debugger/user_event_shallow.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/user_event_shallow.exp,v
retrieving revision 1.2
diff -u -b -r1.2 user_event_shallow.exp
--- tests/debugger/user_event_shallow.exp	6 Jan 2007 10:56:26 -0000	1.2
+++ tests/debugger/user_event_shallow.exp	20 Apr 2007 08:08:03 -0000
@@ -36,22 +36,22 @@
       E3:     C3 USER <nodiag_fail>  user_event_shallow.m:64
 mdb> vars
         1 test_failed (attr 0)
-        2 arg_b (attr 1, HeadVar__1)
+        2 arg_b (attr 1, B)
         3 arg_d (attr 2, N)
         4 arg_list (attr 3, HeadVar__3)
-        5 HeadVar__1
-        6 HeadVar__2
+        5 B (arg 1)
+        6 D (arg 2)
         7 HeadVar__3
         8 L
 mdb> print *
        test_failed (attr 0)   	"N - B"
-       arg_b (attr 1, HeadVar__1)	1
+       arg_b (attr 1, B)      	1
        arg_d (attr 2, N)      	2
        arg_list (attr 3, HeadVar__3)	[2, 3, 4, 5]
-       HeadVar__2             	1
+       D (arg 2)              	1
        L                      	[3, 4, 5]
 mdb> print !arg_b
-       arg_b (attr 1, HeadVar__1)	1
+       arg_b (attr 1, B)      	1
 mdb> user
       E4:     C2 USER <safe_test>  user_event_shallow.m:32
 mdb> print *
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/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