[m-rev.] for review: switch representation for debugger

Zoltan Somogyi zs at csse.unimelb.edu.au
Wed Apr 18 20:08:19 AEST 2007


Fix a problem with the representation of goal paths for switches on unbounded
numbers of function symbols, such as ints, floats and strings. We used to
represent such switches as a negative number in the field representing the
number of function symbols in the switched-on type, but some parts of the
system weren't handling negative numbers specially, and they couldn't be
properly parsed back in anyway (since "-" was also the character separating
the case's ordinal number from this number).

mdbcomp/program_representation.m:
	Change the switch goal path step to use a maybe type to record the
	number of function symbols in the switched-on type, with a "no" meaning
	the type is unbounded. Update the goal path step printing and parsing
	code accordingly.

	Make the names of some other function symbols more expressive.

browser/declarative_execution.m:
	Conform to the change to program_representation.m.

compiler/goal_path.m:
compiler/deep_profiling.m:
compiler/unneeded_code.m:
	Update the code that creates goal path steps.

	In deep_profiling.m, fix an old bug: the two integers (case number,
	number of function symbols in switched-on type) were swapped.

	In deep_profiling.m, give a prefix to the field names of the main
	structure passed around, to try to make them unique.

tests/debugger/switch_on_unbounded.{m,inp,exp}:
	New test case to test this fix.

tests/debugger/Mmakefile:
	Enable the new test case.

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
Index: browser/declarative_execution.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/declarative_execution.m,v
retrieving revision 1.57
diff -u -b -r1.57 declarative_execution.m
--- browser/declarative_execution.m	19 Jan 2007 07:03:58 -0000	1.57
+++ browser/declarative_execution.m	13 Apr 2007 12:45:24 -0000
@@ -1636,9 +1636,9 @@
             GoalType = goal_scope,
             read_byte(Bytecode, !Pos, MaybeCutByte),
             ( MaybeCutByte = 0 ->
-                MaybeCut = no_cut
+                MaybeCut = scope_is_no_cut
             ; MaybeCutByte = 1 ->
-                MaybeCut = cut
+                MaybeCut = scope_is_cut
             ;
                 error("read_goal: bad maybe_cut")
             ),
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/deep_profiling.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deep_profiling.m,v
retrieving revision 1.62
diff -u -b -r1.62 deep_profiling.m
--- compiler/deep_profiling.m	19 Jan 2007 07:04:10 -0000	1.62
+++ compiler/deep_profiling.m	13 Apr 2007 13:13:05 -0000
@@ -32,6 +32,7 @@
 
 :- import_module backend_libs.rtti.
 :- import_module check_hlds.mode_util.
+:- import_module check_hlds.type_util.
 :- import_module hlds.code_model.
 :- import_module hlds.hlds_goal.
 :- import_module hlds.hlds_pred.
@@ -495,15 +496,15 @@
 
 :- type deep_info
     --->    deep_info(
-                module_info         :: module_info,
-                pred_proc_id        :: pred_proc_id,
-                current_csd         :: prog_var,
-                site_num_counter    :: counter,
-                call_sites          :: list(call_site_static_data),
-                vars                :: prog_varset,
-                var_types           :: vartypes,
-                proc_filename       :: string,
-                maybe_rec_info      :: maybe(deep_recursion_info)
+                deep_module_info        :: module_info,
+                deep_pred_proc_id       :: pred_proc_id,
+                deep_current_csd        :: prog_var,
+                deep_site_num_counter   :: counter,
+                deep_call_sites         :: list(call_site_static_data),
+                deep_varset             :: prog_varset,
+                deep_var_types          :: vartypes,
+                deep_proc_filename      :: string,
+                deep_maybe_rec_info     :: maybe(deep_recursion_info)
             ).
 
 :- pred transform_det_proc(module_info::in, pred_proc_id::in,
@@ -548,9 +549,9 @@
     deep_prof_transform_goal([], Goal0, TransformedGoal, _,
         DeepInfo0, DeepInfo),
 
-    Vars = DeepInfo ^ vars,
-    VarTypes = DeepInfo ^ var_types,
-    CallSites = DeepInfo ^ call_sites,
+    Vars = DeepInfo ^ deep_varset,
+    VarTypes = DeepInfo ^ deep_var_types,
+    CallSites = DeepInfo ^ deep_call_sites,
 
     (
         MaybeRecInfo = yes(RecInfo),
@@ -644,9 +645,9 @@
     deep_prof_transform_goal([], Goal0, TransformedGoal, _,
         DeepInfo0, DeepInfo),
 
-    Vars = DeepInfo ^ vars,
-    VarTypes = DeepInfo ^ var_types,
-    CallSites = DeepInfo ^ call_sites,
+    Vars = DeepInfo ^ deep_varset,
+    VarTypes = DeepInfo ^ deep_var_types,
+    CallSites = DeepInfo ^ deep_call_sites,
 
     (
         MaybeRecInfo = yes(RecInfo),
@@ -758,9 +759,9 @@
     deep_prof_transform_goal([], Goal0, TransformedGoal, _,
         DeepInfo0, DeepInfo),
 
-    Vars = DeepInfo ^ vars,
-    VarTypes = DeepInfo ^ var_types,
-    CallSites = DeepInfo ^ call_sites,
+    Vars = DeepInfo ^ deep_varset,
+    VarTypes = DeepInfo ^ deep_var_types,
+    CallSites = DeepInfo ^ deep_call_sites,
 
     PredProcId = proc(PredId, ProcId),
     IsInInterface = is_proc_in_interface(ModuleInfo, PredId, ProcId),
@@ -883,8 +884,8 @@
     deep_prof_transform_goal([], Goal0, TransformedGoal, _,
         DeepInfo0, DeepInfo),
 
-    VarSet = DeepInfo ^ vars,
-    VarTypes = DeepInfo ^ var_types,
+    VarSet = DeepInfo ^ deep_varset,
+    VarTypes = DeepInfo ^ deep_var_types,
 
     proc_info_set_varset(VarSet, !ProcInfo),
     proc_info_set_vartypes(VarTypes, !ProcInfo),
@@ -966,7 +967,15 @@
         Goal = hlds_goal(GoalExpr, GoalInfo)
     ;
         GoalExpr0 = switch(Var, CF, Cases0),
-        deep_prof_transform_switch(list.length(Cases0), 0, Path, Cases0, Cases,
+        ModuleInfo = !.DeepInfo ^ deep_module_info,
+        VarTypes = !.DeepInfo ^ deep_var_types,
+        map.lookup(VarTypes, Var, Type),
+        ( switch_type_num_functors(ModuleInfo, Type, NumFunctors) ->
+            MaybeNumFunctors = yes(NumFunctors)
+        ;
+            MaybeNumFunctors = no
+        ),
+        deep_prof_transform_switch(MaybeNumFunctors, 0, Path, Cases0, Cases,
             AddedImpurity, !DeepInfo),
         add_impurity_if_needed(AddedImpurity, GoalInfo0, GoalInfo),
         GoalExpr = switch(Var, CF, Cases),
@@ -1005,7 +1014,7 @@
         goal_info_get_determinism(GoalInfo0, OuterDetism),
         goal_info_get_determinism(InnerInfo, InnerDetism),
         ( InnerDetism = OuterDetism ->
-            MaybeCut = no_cut,
+            MaybeCut = scope_is_no_cut,
             Reason = Reason0,
             AddForceCommit = no
         ;
@@ -1017,7 +1026,7 @@
             % and the deep profiling transformation will make it impure
             % as well.
 
-            MaybeCut = cut,
+            MaybeCut = scope_is_cut,
             ( Reason0 = commit(_) ->
                 Reason = commit(force_pruning),
                 AddForceCommit = no
@@ -1071,17 +1080,17 @@
         !DeepInfo),
     bool.or(AddedImpurityFirst, AddedImpurityLater, AddedImpurity).
 
-:- pred deep_prof_transform_switch(int::in, int::in, goal_path::in,
+:- pred deep_prof_transform_switch(maybe(int)::in, int::in, goal_path::in,
     list(case)::in, list(case)::out, bool::out,
     deep_info::in, deep_info::out) is det.
 
 deep_prof_transform_switch(_, _, _, [], [], no, !DeepInfo).
-deep_prof_transform_switch(NumCases, N, Path, [case(Id, Goal0) | Goals0],
+deep_prof_transform_switch(MaybeNumCases, N, Path, [case(Id, Goal0) | Goals0],
         [case(Id, Goal) | Goals], AddedImpurity, !DeepInfo) :-
     N1 = N + 1,
-    deep_prof_transform_goal([step_switch(NumCases, N1) | Path], Goal0, Goal,
-        AddedImpurityFirst, !DeepInfo),
-    deep_prof_transform_switch(NumCases, N1, Path, Goals0, Goals,
+    deep_prof_transform_goal([step_switch(N1, MaybeNumCases) | Path],
+        Goal0, Goal, AddedImpurityFirst, !DeepInfo),
+    deep_prof_transform_switch(MaybeNumCases, N1, Path, Goals0, Goals,
         AddedImpurityLater, !DeepInfo),
     bool.or(AddedImpurityFirst, AddedImpurityLater, AddedImpurity).
 
@@ -1090,7 +1099,7 @@
 
 deep_prof_wrap_call(GoalPath, hlds_goal(GoalExpr0, GoalInfo0),
         hlds_goal(GoalExpr, GoalInfo), !DeepInfo) :-
-    ModuleInfo = !.DeepInfo ^ module_info,
+    ModuleInfo = !.DeepInfo ^ deep_module_info,
     goal_info_get_features(GoalInfo0, GoalFeatures),
     goal_info_remove_feature(feature_tailcall, GoalInfo0, GoalInfo1),
     make_impure(GoalInfo1, GoalInfo),
@@ -1105,15 +1114,16 @@
     % call port code).
     Goal1 = hlds_goal(GoalExpr0, GoalInfo),
 
-    SiteNumCounter0 = !.DeepInfo ^ site_num_counter,
+    SiteNumCounter0 = !.DeepInfo ^ deep_site_num_counter,
     counter.allocate(SiteNum, SiteNumCounter0, SiteNumCounter),
-    varset.new_named_var(!.DeepInfo ^ vars, "SiteNum", SiteNumVar, VarSet1),
+    varset.new_named_var(!.DeepInfo ^ deep_varset, "SiteNum", SiteNumVar,
+        VarSet1),
     IntType = int_type,
-    map.set(!.DeepInfo ^ var_types, SiteNumVar, IntType, VarTypes1),
+    map.set(!.DeepInfo ^ deep_var_types, SiteNumVar, IntType, VarTypes1),
     generate_unify(int_const(SiteNum), SiteNumVar, SiteNumVarGoal),
-    !:DeepInfo = !.DeepInfo ^ vars := VarSet1,
-    !:DeepInfo = !.DeepInfo ^ var_types := VarTypes1,
-    !:DeepInfo = !.DeepInfo ^ site_num_counter := SiteNumCounter,
+    !:DeepInfo = !.DeepInfo ^ deep_varset := VarSet1,
+    !:DeepInfo = !.DeepInfo ^ deep_var_types := VarTypes1,
+    !:DeepInfo = !.DeepInfo ^ deep_site_num_counter := SiteNumCounter,
 
     goal_info_get_context(GoalInfo0, Context),
     FileName0 = term.context_file(Context),
@@ -1131,11 +1141,11 @@
         ),
         PredProcId = proc(PredId, ProcId),
         TypeSubst = compute_type_subst(GoalExpr0, !.DeepInfo),
-        MaybeRecInfo = !.DeepInfo ^ maybe_rec_info,
+        MaybeRecInfo = !.DeepInfo ^ deep_maybe_rec_info,
         (
             MaybeRecInfo = yes(RecInfo1),
             RecInfo1 ^ role = inner_proc(OuterPredProcId),
-            PredProcId = !.DeepInfo ^ pred_proc_id
+            PredProcId = !.DeepInfo ^ deep_pred_proc_id
         ->
             OuterPredProcId = proc(OuterPredId, OuterProcId),
             RttiProcLabel = rtti.make_rtti_proc_label(ModuleInfo,
@@ -1145,7 +1155,7 @@
             RecInfo2 ^ role = outer_proc(InnerPredProcId),
             PredProcId = InnerPredProcId
         ->
-            OuterPredProcId = !.DeepInfo ^ pred_proc_id,
+            OuterPredProcId = !.DeepInfo ^ deep_pred_proc_id,
             OuterPredProcId = proc(OuterPredId, OuterProcId),
             RttiProcLabel = rtti.make_rtti_proc_label(ModuleInfo,
                 OuterPredId, OuterProcId)
@@ -1171,13 +1181,14 @@
             CallSite = higher_order_call(FileName, LineNumber, GoalPath)
         ;
             Generic = class_method(TypeClassInfoVar, MethodNum, _, _),
-            varset.new_named_var(!.DeepInfo ^ vars, "MethodNum",
+            varset.new_named_var(!.DeepInfo ^ deep_varset, "MethodNum",
                 MethodNumVar, VarSet2),
-            map.set(!.DeepInfo ^ var_types, MethodNumVar, IntType, VarTypes2),
+            map.set(!.DeepInfo ^ deep_var_types, MethodNumVar, IntType,
+                VarTypes2),
             generate_unify(int_const(MethodNum), MethodNumVar,
                 MethodNumVarGoal),
-            !:DeepInfo = !.DeepInfo ^ vars := VarSet2,
-            !:DeepInfo = !.DeepInfo ^ var_types := VarTypes2,
+            !:DeepInfo = !.DeepInfo ^ deep_varset := VarSet2,
+            !:DeepInfo = !.DeepInfo ^ deep_var_types := VarTypes2,
             generate_deep_det_call(ModuleInfo, "prepare_for_method_call", 3,
                 [SiteNumVar, TypeClassInfoVar, MethodNumVar],
                 [], PrepareCallGoal),
@@ -1207,15 +1218,15 @@
         )
     ),
 
-    !:DeepInfo = !.DeepInfo ^ call_sites :=
-        (!.DeepInfo ^ call_sites ++ [CallSite]),
+    !:DeepInfo = !.DeepInfo ^ deep_call_sites :=
+        (!.DeepInfo ^ deep_call_sites ++ [CallSite]),
     (
         set.member(feature_tailcall, GoalFeatures),
-        !.DeepInfo ^ maybe_rec_info = yes(RecInfo),
+        !.DeepInfo ^ deep_maybe_rec_info = yes(RecInfo),
         RecInfo ^ role = outer_proc(_)
     ->
         VisSCC = RecInfo ^ visible_scc,
-        MiddleCSD = !.DeepInfo ^ current_csd,
+        MiddleCSD = !.DeepInfo ^ deep_current_csd,
         (
             VisSCC = [],
             CallGoals = [],
@@ -1280,8 +1291,8 @@
 
 deep_prof_transform_higher_order_call(Globals, CodeModel, Goal0, Goal,
         !DeepInfo) :-
-    VarSet0 = !.DeepInfo ^ vars,
-    VarTypes0 = !.DeepInfo ^ var_types,
+    VarSet0 = !.DeepInfo ^ deep_varset,
+    VarTypes0 = !.DeepInfo ^ deep_var_types,
 
     CPointerType = c_pointer_type,
     varset.new_named_var(VarSet0, "SavedPtr", SavedPtrVar, VarSet1),
@@ -1296,34 +1307,34 @@
         varset.new_named_var(VarSet1, "SavedCounter", SavedCountVar, VarSet),
         map.set(VarTypes1, SavedCountVar, IntType, VarTypes),
 
-        !:DeepInfo = !.DeepInfo ^ vars := VarSet,
-        !:DeepInfo = !.DeepInfo ^ var_types := VarTypes,
+        !:DeepInfo = !.DeepInfo ^ deep_varset := VarSet,
+        !:DeepInfo = !.DeepInfo ^ deep_var_types := VarTypes,
         ExtraNonLocals = set.list_to_set([SavedCountVar, SavedPtrVar]),
 
-        generate_deep_det_call(!.DeepInfo ^ module_info,
+        generate_deep_det_call(!.DeepInfo ^ deep_module_info,
             "save_and_zero_activation_info_ac", 2,
             [SavedCountVar, SavedPtrVar],
             [SavedCountVar, SavedPtrVar], SaveStuff),
-        generate_deep_det_call(!.DeepInfo ^ module_info,
+        generate_deep_det_call(!.DeepInfo ^ deep_module_info,
             "reset_activation_info_ac", 2,
             [SavedCountVar, SavedPtrVar], [], RestoreStuff),
-        generate_deep_det_call(!.DeepInfo ^ module_info,
+        generate_deep_det_call(!.DeepInfo ^ deep_module_info,
             "rezero_activation_info_ac", 0,
             [], [], ReZeroStuff)
     ;
         UseActivationCounts = no,
 
-        !:DeepInfo = !.DeepInfo ^ vars := VarSet1,
-        !:DeepInfo = !.DeepInfo ^ var_types := VarTypes1,
+        !:DeepInfo = !.DeepInfo ^ deep_varset := VarSet1,
+        !:DeepInfo = !.DeepInfo ^ deep_var_types := VarTypes1,
         ExtraNonLocals = set.list_to_set([SavedPtrVar]),
 
-        generate_deep_det_call(!.DeepInfo ^ module_info,
+        generate_deep_det_call(!.DeepInfo ^ deep_module_info,
             "save_and_zero_activation_info_sr", 1,
             [SavedPtrVar], [SavedPtrVar], SaveStuff),
-        generate_deep_det_call(!.DeepInfo ^ module_info,
+        generate_deep_det_call(!.DeepInfo ^ deep_module_info,
             "reset_activation_info_sr", 1,
             [SavedPtrVar], [], RestoreStuff),
-        generate_deep_det_call(!.DeepInfo ^ module_info,
+        generate_deep_det_call(!.DeepInfo ^ deep_module_info,
             "rezero_activation_info_sr", 0,
             [], [], ReZeroStuff)
     ),
@@ -1400,12 +1411,13 @@
 
 deep_prof_wrap_foreign_code(GoalPath, Goal0, Goal, !DeepInfo) :-
     Goal0 = hlds_goal(_, GoalInfo0),
-    ModuleInfo = !.DeepInfo ^ module_info,
+    ModuleInfo = !.DeepInfo ^ deep_module_info,
 
-    SiteNumCounter0 = !.DeepInfo ^ site_num_counter,
+    SiteNumCounter0 = !.DeepInfo ^ deep_site_num_counter,
     counter.allocate(SiteNum, SiteNumCounter0, SiteNumCounter),
-    varset.new_named_var(!.DeepInfo ^ vars, "SiteNum", SiteNumVar, VarSet),
-    map.set(!.DeepInfo ^ var_types, SiteNumVar, int_type, VarTypes),
+    varset.new_named_var(!.DeepInfo ^ deep_varset, "SiteNum", SiteNumVar,
+        VarSet),
+    map.set(!.DeepInfo ^ deep_var_types, SiteNumVar, int_type, VarTypes),
     generate_unify(int_const(SiteNum), SiteNumVar, SiteNumVarGoal),
 
     generate_deep_det_call(ModuleInfo, "prepare_for_callback", 1,
@@ -1420,16 +1432,16 @@
     make_impure(GoalInfo0, GoalInfo),
     Goal = hlds_goal(conj(plain_conj, [SiteNumVarGoal, PrepareGoal, Goal0]),
         GoalInfo),
-    !:DeepInfo = !.DeepInfo ^ site_num_counter := SiteNumCounter,
-    !:DeepInfo = !.DeepInfo ^ vars := VarSet,
-    !:DeepInfo = !.DeepInfo ^ var_types := VarTypes,
-    !:DeepInfo = !.DeepInfo ^ call_sites :=
-        !.DeepInfo ^ call_sites ++ [CallSite].
+    !:DeepInfo = !.DeepInfo ^ deep_site_num_counter := SiteNumCounter,
+    !:DeepInfo = !.DeepInfo ^ deep_varset := VarSet,
+    !:DeepInfo = !.DeepInfo ^ deep_var_types := VarTypes,
+    !:DeepInfo = !.DeepInfo ^ deep_call_sites :=
+        !.DeepInfo ^ deep_call_sites ++ [CallSite].
 
 :- pred compress_filename(deep_info::in, string::in, string::out) is det.
 
 compress_filename(Deep, FileName0, FileName) :-
-    ( FileName0 = Deep ^ proc_filename ->
+    ( FileName0 = Deep ^ deep_proc_filename ->
         FileName = ""
     ;
         FileName = FileName0
@@ -1534,7 +1546,7 @@
         [i(Length)]),
     FailPredName = string.format("restore_recursion_depth_fail_%d",
         [i(Length)]),
-    ModuleInfo = !.DeepInfo ^ module_info,
+    ModuleInfo = !.DeepInfo ^ deep_module_info,
     generate_deep_det_call(ModuleInfo, CallPredName, Length + 2,
         [CSDVar, CallCellVar | DepthVars], DepthVars, CallCellGoal),
     generate_deep_det_call(ModuleInfo, ExitPredName, Length + 2,
@@ -1554,14 +1566,14 @@
     deep_info::in, deep_info::out) is det.
 
 generate_depth_var(CSN, DepthVar, !DeepInfo) :-
-    VarSet0 = !.DeepInfo ^ vars,
-    VarTypes0 = !.DeepInfo ^ var_types,
+    VarSet0 = !.DeepInfo ^ deep_varset,
+    VarTypes0 = !.DeepInfo ^ deep_var_types,
     IntType = int_type,
     VarName = string.format("Depth%d", [i(CSN)]),
     varset.new_named_var(VarSet0, VarName, DepthVar, VarSet),
     map.set(VarTypes0, DepthVar, IntType, VarTypes),
-    !:DeepInfo = !.DeepInfo ^ vars := VarSet,
-    !:DeepInfo = !.DeepInfo ^ var_types := VarTypes.
+    !:DeepInfo = !.DeepInfo ^ deep_varset := VarSet,
+    !:DeepInfo = !.DeepInfo ^ deep_var_types := VarTypes.
 
 :- pred generate_csn_vector(int::in, list(int)::in, list(prog_var)::out,
     list(hlds_goal)::out, prog_var::out,
@@ -1590,16 +1602,16 @@
     prog_var::out, hlds_goal::out, deep_info::in, deep_info::out) is det.
 
 generate_csn_vector_cell(Length, CSNVars, CellVar, CellGoal, !DeepInfo) :-
-    VarSet0 = !.DeepInfo ^ vars,
-    VarTypes0 = !.DeepInfo ^ var_types,
+    VarSet0 = !.DeepInfo ^ deep_varset,
+    VarTypes0 = !.DeepInfo ^ deep_var_types,
     varset.new_named_var(VarSet0, "CSNCell", CellVar, VarSet),
     ProfilingBuiltin = mercury_profiling_builtin_module,
     CellTypeName = string.format("call_site_nums_%d", [i(Length)]),
     CellTypeId = type_ctor(qualified(ProfilingBuiltin, CellTypeName), Length),
     construct_type(CellTypeId, [], CellType),
     map.set(VarTypes0, CellVar, CellType, VarTypes),
-    !:DeepInfo = !.DeepInfo ^ vars := VarSet,
-    !:DeepInfo = !.DeepInfo ^ var_types := VarTypes,
+    !:DeepInfo = !.DeepInfo ^ deep_varset := VarSet,
+    !:DeepInfo = !.DeepInfo ^ deep_var_types := VarTypes,
     ConsId = cons(qualified(ProfilingBuiltin, CellTypeName), Length),
     generate_cell_unify(Length, ConsId, CSNVars, CellVar, CellGoal).
 
@@ -1607,13 +1619,13 @@
     pair(prog_var, hlds_goal)::out, deep_info::in, deep_info::out) is det.
 
 generate_single_csn_unify(CSN, CSNVar - UnifyGoal, !DeepInfo) :-
-    VarSet0 = !.DeepInfo ^ vars,
-    VarTypes0 = !.DeepInfo ^ var_types,
+    VarSet0 = !.DeepInfo ^ deep_varset,
+    VarTypes0 = !.DeepInfo ^ deep_var_types,
     VarName = string.format("CSN%d", [i(CSN)]),
     varset.new_named_var(VarSet0, VarName, CSNVar, VarSet),
     map.set(VarTypes0, CSNVar, int_type, VarTypes),
-    !:DeepInfo = !.DeepInfo ^ vars := VarSet,
-    !:DeepInfo = !.DeepInfo ^ var_types := VarTypes,
+    !:DeepInfo = !.DeepInfo ^ deep_varset := VarSet,
+    !:DeepInfo = !.DeepInfo ^ deep_var_types := VarTypes,
     generate_unify(int_const(CSN), CSNVar, UnifyGoal).
 
 :- pred generate_deep_det_call(module_info::in, string::in, int::in,
Index: compiler/goal_path.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_path.m,v
retrieving revision 1.41
diff -u -b -r1.41 goal_path.m
--- compiler/goal_path.m	6 Jan 2007 10:56:12 -0000	1.41
+++ compiler/goal_path.m	13 Apr 2007 13:01:42 -0000
@@ -70,6 +70,7 @@
 :- import_module int.
 :- import_module list.
 :- import_module map.
+:- import_module maybe.
 :- import_module pair.
 
 %-----------------------------------------------------------------------------%
@@ -151,11 +152,11 @@
         ModuleInfo = SlotInfo ^ module_info,
         map.lookup(VarTypes, Var, Type),
         ( switch_type_num_functors(ModuleInfo, Type, NumFunctors) ->
-            NumCases = NumFunctors
+            MaybeNumFunctors = yes(NumFunctors)
         ;
-            NumCases = -1
+            MaybeNumFunctors = no
         ),
-        fill_switch_slots(Path0, 0, NumCases, SlotInfo, Cases0, Cases),
+        fill_switch_slots(Path0, 0, MaybeNumFunctors, SlotInfo, Cases0, Cases),
         Goal = switch(Var, CanFail, Cases)
     ;
         Goal0 = negation(SubGoal0),
@@ -167,9 +168,9 @@
         goal_info_get_determinism(GoalInfo, OuterDetism),
         goal_info_get_determinism(InnerInfo, InnerDetism),
         ( InnerDetism = OuterDetism ->
-            MaybeCut = no_cut
+            MaybeCut = scope_is_no_cut
         ;
-            MaybeCut = cut
+            MaybeCut = scope_is_cut
         ),
         fill_goal_slots([step_scope(MaybeCut) | Path0], SlotInfo,
             SubGoal0, SubGoal),
@@ -222,16 +223,16 @@
     fill_goal_slots([step_disj(N1) | Path0], SlotInfo, Goal0, Goal),
     fill_disj_slots(Path0, N1, SlotInfo, Goals0, Goals).
 
-:- pred fill_switch_slots(goal_path::in, int::in, int::in, slot_info::in,
-    list(case)::in, list(case)::out) is det.
+:- pred fill_switch_slots(goal_path::in, int::in, maybe(int)::in,
+    slot_info::in, list(case)::in, list(case)::out) is det.
 
 fill_switch_slots(_, _, _, _, [], []).
-fill_switch_slots(Path0, N0, NumCases, SlotInfo,
-        [case(A, Goal0) | Cases0], [case(A, Goal) | Cases]) :-
+fill_switch_slots(Path0, N0, MaybeNumFunctors, SlotInfo,
+        [case(ConsId, Goal0) | Cases0], [case(ConsId, Goal) | Cases]) :-
     N1 = N0 + 1,
-    fill_goal_slots([step_switch(N1, NumCases) | Path0], SlotInfo,
+    fill_goal_slots([step_switch(N1, MaybeNumFunctors) | Path0], SlotInfo,
         Goal0, Goal),
-    fill_switch_slots(Path0, N1, NumCases, SlotInfo, Cases0, Cases).
+    fill_switch_slots(Path0, N1, MaybeNumFunctors, SlotInfo, Cases0, Cases).
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/unneeded_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unneeded_code.m,v
retrieving revision 1.41
diff -u -b -r1.41 unneeded_code.m
--- compiler/unneeded_code.m	6 Jan 2007 10:56:18 -0000	1.41
+++ compiler/unneeded_code.m	13 Apr 2007 13:00:38 -0000
@@ -94,6 +94,7 @@
 :- import_module int.
 :- import_module list.
 :- import_module map.
+:- import_module maybe.
 :- import_module pair.
 :- import_module set.
 :- import_module svmap.
@@ -119,14 +120,17 @@
                             % the then branch (numbered 1) and the else branch
                             % (numbered 2).
 
-    ;       alt_switch(int).
+    ;       alt_switch(maybe(int)).
                             % The number of alternatives in a switch is equal
                             % to the number of function symbols in the type of
-                            % the switched-on variable; this number is given by
-                            % the argument. If the switch cannot_fail, then
-                            % this will be equal to the number of cases; if
-                            % the switch can_fail, there will be strictly
-                            % fewer cases than this.
+                            % the switched-on variable. This number is given by
+                            % the argument integer, if present; if the argument
+                            % is "no", then the number of function symbols in
+                            % the type is effectively infinite (this can happen
+                            % for builtin types such as "int"). If the switch
+                            % cannot_fail, then this will be equal to the
+                            % number of cases; if the switch can_fail, there
+                            % will be strictly fewer cases than this.
 
     % The location type identifies one arm of a branched control structure.
     % The branched control structure id is a branch_point instead of a
@@ -622,14 +626,14 @@
             Cases0 = [case(_, hlds_goal(_, FirstCaseGoalInfo)) | _],
             goal_info_get_goal_path(FirstCaseGoalInfo, FirstCaseGoalPath),
             FirstCaseGoalPath = [SwitchStep | _],
-            SwitchStep = step_switch(_, NumCases)
+            SwitchStep = step_switch(_, MaybeNumAltPrime)
         ->
-            NumAlt = NumCases
+            MaybeNumAlt = MaybeNumAltPrime
         ;
             unexpected(this_file, "process_goal_internal: switch count")
         ),
         goal_info_get_goal_path(GoalInfo0, GoalPath),
-        BranchPoint = branch_point(GoalPath, alt_switch(NumAlt)),
+        BranchPoint = branch_point(GoalPath, alt_switch(MaybeNumAlt)),
         map.map_values(demand_var_everywhere, !WhereNeededMap),
         map.init(BranchNeededMap0),
         process_cases(Cases0, Cases, BranchPoint, 1, InitInstMap, FinalInstMap,
@@ -1102,10 +1106,10 @@
 
 get_parent_branch_point([First | Rest], Parent, ParentStep,
         BranchAlt, BranchNum) :-
-    ( First = step_switch(Arm, NumAlts) ->
+    ( First = step_switch(Arm, MaybeNumAlts) ->
         Parent = Rest,
         ParentStep = First,
-        BranchAlt = alt_switch(NumAlts),
+        BranchAlt = alt_switch(MaybeNumAlts),
         BranchNum = Arm
     ; First = step_ite_then ->
         Parent = Rest,
@@ -1126,7 +1130,7 @@
 branch_point_is_complete(alt_ite, Alts) :-
     set.count(Alts, NumAlts),
     NumAlts = 2.
-branch_point_is_complete(alt_switch(NumFunctors), Alts) :-
+branch_point_is_complete(alt_switch(yes(NumFunctors)), Alts) :-
     set.count(Alts, NumAlts),
     NumAlts = NumFunctors.
 
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
Index: mdbcomp/program_representation.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/program_representation.m,v
retrieving revision 1.19
diff -u -b -r1.19 program_representation.m
--- mdbcomp/program_representation.m	6 Jan 2007 10:56:24 -0000	1.19
+++ mdbcomp/program_representation.m	13 Apr 2007 12:40:54 -0000
@@ -205,19 +205,19 @@
 
 %-----------------------------------------------------------------------------%
 
-% We can think of the goal that defines a procedure to be a tree,
-% whose leaves are primitive goals and whose interior nodes are
-% compound goals. These two types describe the position of a goal
-% in this tree. A goal_path_step type says which branch to take at an
-% interior node; the integer counts start at one. (For switches,
-% the second int gives the total number of function symbols in the type
-% of the switched-on var; for builtin types such as integer and string,
-% for which this number is effectively infinite, we store a negative
-% number.) The goal_path type gives the sequence of steps from the root
-% to the given goal *in reverse order*, so that the step closest to
-% the root is last. (Keeping the list in reverse order makes the
-% common operations constant-time instead of linear in the length
-% of the list.)
+% We can think of the goal that defines a procedure to be a tree, whose leaves
+% are primitive goals and whose interior nodes are compound goals. These two
+% types describe the position of a goal in this tree. A goal_path_step type
+% says which branch to take at an interior node; the integer counts start
+% at one. (For switches, the second int, if present, gives the total number
+% of function symbols in the type of the switched-on var; for builtin types
+% such as integer and string, for which this number is effectively infinite,
+% the second number won't be present.)
+%
+% The goal_path type gives the sequence of steps from the root to the given
+% goal *in reverse order*, so that the step closest to the root is last.
+% (Keeping the list in reverse order makes the common operations constant-time
+% instead of linear in the length of the list.)
 
 :- type goal_path == list(goal_path_step).
 
@@ -226,7 +226,7 @@
 :- type goal_path_step 
     --->    step_conj(int)
     ;       step_disj(int)
-    ;       step_switch(int, int)
+    ;       step_switch(int, maybe(int))
     ;       step_ite_cond
     ;       step_ite_then
     ;       step_ite_else
@@ -237,8 +237,8 @@
 
     % Does the scope goal have a different determinism inside than outside?
 :- type maybe_cut
-    --->    cut
-    ;       no_cut.
+    --->    scope_is_cut
+    ;       scope_is_no_cut.
 
 :- pred path_from_string_det(string::in, goal_path::out) is det.
 
@@ -474,16 +474,22 @@
     string.to_int(NStr, N).
 path_step_from_string_2('d', NStr, step_disj(N)) :-
     string.to_int(NStr, N).
-path_step_from_string_2('s', Str, step_switch(N, M)) :-
+path_step_from_string_2('s', Str, step_switch(N, MaybeM)) :-
     string.words_separator(unify('-'), Str) = [NStr, MStr],
     string.to_int(NStr, N),
-    string.to_int(MStr, M).
+    % short for "not applicable"
+    ( MStr = "na" ->
+        MaybeM = no
+    ;
+        string.to_int(MStr, M),
+        MaybeM = yes(M)
+    ).
 path_step_from_string_2('?', "", step_ite_cond).
 path_step_from_string_2('t', "", step_ite_then).
 path_step_from_string_2('e', "", step_ite_else).
 path_step_from_string_2('~', "", step_neg).
-path_step_from_string_2('q', "!", step_scope(cut)).
-path_step_from_string_2('q', "", step_scope(no_cut)).
+path_step_from_string_2('q', "!", step_scope(scope_is_cut)).
+path_step_from_string_2('q', "", step_scope(scope_is_no_cut)).
 path_step_from_string_2('f', "", step_first).
 path_step_from_string_2('l', "", step_later).
 
@@ -500,14 +506,16 @@
 
 goal_path_step_to_string(step_conj(N)) = "c" ++ int_to_string(N) ++ ";".
 goal_path_step_to_string(step_disj(N)) = "d" ++ int_to_string(N) ++ ";".
-goal_path_step_to_string(step_switch(N, M)) = "s" ++ int_to_string(N)
+goal_path_step_to_string(step_switch(N, yes(M))) = "s" ++ int_to_string(N)
     ++ "-" ++ int_to_string(M) ++ ";".
+goal_path_step_to_string(step_switch(N, no)) = "s" ++ int_to_string(N)
+    ++ "-na;".      % short for "not applicable"
 goal_path_step_to_string(step_ite_cond) = "?;".
 goal_path_step_to_string(step_ite_then) = "t;".
 goal_path_step_to_string(step_ite_else) = "e;".
 goal_path_step_to_string(step_neg) = "~;".
-goal_path_step_to_string(step_scope(cut)) = "q!;".
-goal_path_step_to_string(step_scope(no_cut)) = "q;".
+goal_path_step_to_string(step_scope(scope_is_cut)) = "q!;".
+goal_path_step_to_string(step_scope(scope_is_no_cut)) = "q;".
 goal_path_step_to_string(step_first) = "f;".
 goal_path_step_to_string(step_later) = "l;".
 
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_context.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_context.h,v
retrieving revision 1.41
diff -u -b -r1.41 mercury_context.h
--- runtime/mercury_context.h	17 Apr 2007 05:38:08 -0000	1.41
+++ runtime/mercury_context.h	17 Apr 2007 05:53:09 -0000
@@ -702,7 +702,6 @@
         /* it wouldn't be appropriate to copy the saved_owners field */       \
     } while (0)
 
-
 /*
 ** If you change MR_Sync_Term_Struct you need to update configure.in.
 */
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/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/Mmakefile,v
retrieving revision 1.131
diff -u -b -r1.131 Mmakefile
--- tests/debugger/Mmakefile	17 Apr 2007 05:38:19 -0000	1.131
+++ tests/debugger/Mmakefile	18 Apr 2007 09:58:53 -0000
@@ -50,6 +50,7 @@
 	save				\
 	shell				\
 	solver_test			\
+	switch_on_unbounded		\
 	synth_attr			\
 	type_desc_test			\
 	uci_index			\
@@ -507,6 +508,10 @@
 solver_test.out: solver_test solver_test.inp
 	$(MDB_STD) ./solver_test < solver_test.inp > solver_test.out 2>&1
 
+switch_on_unbounded.out: switch_on_unbounded switch_on_unbounded.inp
+	$(MDB_STD) ./switch_on_unbounded < switch_on_unbounded.inp \
+		> switch_on_unbounded.out 2>&1
+
 tabled_read.out: tabled_read tabled_read.inp tabled_read.data
 	$(MDB_STD) ./tabled_read < tabled_read.inp 2>&1 | \
 		sed 's/c_pointer(0x[0-9A-Fa-f]*)/c_pointer(0xXXXX)/g' \
Index: tests/debugger/switch_on_unbounded.exp
===================================================================
RCS file: tests/debugger/switch_on_unbounded.exp
diff -N tests/debugger/switch_on_unbounded.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/switch_on_unbounded.exp	18 Apr 2007 09:59:14 -0000
@@ -0,0 +1,31 @@
+      E1:     C1 CALL pred switch_on_unbounded.main/2-0 (det) switch_on_unbounded.m:18
+mdb> echo on
+Command echo enabled.
+mdb> register --quiet
+mdb> break edge
+ 0: + stop  interface pred switch_on_unbounded.edge/2-0 (semidet)
+mdb> continue
+      E2:     C2 CALL pred switch_on_unbounded.edge/2-0 (semidet) switch_on_unbounded.m:35 (switch_on_unbounded.m:19)
+mdb> print *
+       HeadVar__1             	2
+mdb> step
+      E3:     C2 SWTC pred switch_on_unbounded.edge/2-0 (semidet) s2-na; switch_on_unbounded.m:36
+mdb> print *
+       HeadVar__1             	2
+mdb> delete *
+ 0: E stop  interface pred switch_on_unbounded.edge/2-0 (semidet)
+mdb> break edge_str
+ 0: + stop  interface pred switch_on_unbounded.edge_str/2-0 (semidet)
+mdb> continue
+1
+      E4:     C3 CALL pred switch_on_unbounded.edge_str/2-0 (semidet) switch_on_unbounded.m:42 (switch_on_unbounded.m:25)
+mdb> print *
+       HeadVar__1             	"2"
+mdb> step
+      E5:     C3 SWTC pred switch_on_unbounded.edge_str/2-0 (semidet) s2-na; switch_on_unbounded.m:43
+mdb> print *
+       HeadVar__1             	"2"
+mdb> delete *
+ 0: E stop  interface pred switch_on_unbounded.edge_str/2-0 (semidet)
+mdb> continue
+1
Index: tests/debugger/switch_on_unbounded.inp
===================================================================
RCS file: tests/debugger/switch_on_unbounded.inp
diff -N tests/debugger/switch_on_unbounded.inp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/switch_on_unbounded.inp	18 Apr 2007 09:57:49 -0000
@@ -0,0 +1,15 @@
+echo on
+register --quiet
+break edge
+continue
+print *
+step
+print *
+delete *
+break edge_str
+continue
+print *
+step
+print *
+delete *
+continue
Index: tests/debugger/switch_on_unbounded.m
===================================================================
RCS file: tests/debugger/switch_on_unbounded.m
diff -N tests/debugger/switch_on_unbounded.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/switch_on_unbounded.m	18 Apr 2007 09:57:19 -0000
@@ -0,0 +1,44 @@
+% vim: ts=4 sw=4 et
+%
+% This test case tests the debugger's formatting of goal paths that include
+% switches on types with an unbounded number of function symbols.
+
+:- module switch_on_unbounded.
+
+:- interface.
+
+:- import_module io.
+
+:- pred main(io::di, io::uo) is det.
+
+:- implementation.
+
+:- import_module solutions, list.
+
+main(!IO) :-
+    ( edge(2, Two) ->
+        io.write_int(Two, !IO),
+        io.nl(!IO)
+    ;
+        io.write_string("edge(2, _) has no solution\n", !IO)
+    ),
+    ( edge_str("2", TwoStr) ->
+        io.write_string(TwoStr, !IO),
+        io.nl(!IO)
+    ;
+        io.write_string("edge_str(2, _) has no solution\n", !IO)
+    ).
+
+:- pred edge(int::in, int::out) is semidet.
+:- pragma no_inline(edge/2).
+
+edge(1, 2).
+edge(2, 1).
+edge(3, 4).
+
+:- pred edge_str(string::in, string::out) is semidet.
+:- pragma no_inline(edge_str/2).
+
+edge_str("1", "2").
+edge_str("2", "1").
+edge_str("3", "4").
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