[m-rev.] for review: extending I/O tabling towards declarative debugging

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Feb 19 18:55:51 AEDT 2002


Here is the relative diff addressing your comments. Unfortunately, interdiff
also includes a bunch of non-differences; I don't know why.

Zoltan.

diff -u compiler/handle_options.m compiler/handle_options.m
--- compiler/handle_options.m	2002/01/14 08:18:31
+++ compiler/handle_options.m	19 Feb 2002 07:05:19 -0000
@@ -498,9 +498,6 @@
 		[]
 	),
 
-	% --trace-table-io-decl is an extension of --trace-table-io
-	option_implies(trace_table_io_decl, trace_table_io, bool(yes)),
-
 	% Execution tracing requires
 	% 	- disabling optimizations that would change
 	% 	  the trace being generated (except with --trace-optimized)
@@ -550,6 +547,9 @@
 
 		[]
 	),
+
+	% --trace-table-io-decl is an extension of --trace-table-io
+	option_implies(trace_table_io_decl, trace_table_io, bool(yes)),
 
 	% Execution tracing requires
 	% 	- disabling optimizations that would change
diff -u compiler/hlds_data.m compiler/hlds_data.m
--- compiler/hlds_data.m	2002/01/17 11:52:39
+++ compiler/hlds_data.m	24 Jan 2002 01:38:05 -0000
@@ -56,10 +56,12 @@
 				% memoization, loop checking or the minimal
 				% model semantics for the given procedure.
 			;	deep_profiling_proc_static(rtti_proc_label)
-				% The address of a procedure's layout
-				% structure, used e.g. for I/O tabling for
-				% declarative debugging.
+				% The ProcStatic structure of a procedure,
+				% as documented in the deep profiling paper.
 			;	table_io_decl(rtti_proc_label).
+				% The address of a structure that describes
+				% the layout of the answer block used by
+				% I/O tabling for declarative debugging.
 
 	% A cons_defn is the definition of a constructor (i.e. a constant
 	% or a functor) for a particular type.
diff -u compiler/mercury_to_mercury.m compiler/mercury_to_mercury.m
--- compiler/mercury_to_mercury.m	2002/01/17 11:52:40
+++ compiler/mercury_to_mercury.m	18 Feb 2002 03:52:48 -0000
@@ -1370,8 +1370,6 @@
 	add_string("<tabling pointer>").
 mercury_format_cons_id(deep_profiling_proc_static(_), _) -->
 	add_string("<deep_profiling_proc_static>").
-mercury_format_cons_id(table_io_decl(_), _) -->
-	add_string("<table_io_decl>").
 
 :- pred mercury_format_mode_defn(inst_varset::in, sym_name::in,
 	list(inst_var)::in, mode_defn::in, prog_context::in,
@@ -1444,6 +1442,8 @@
 	add_string("<tabling pointer>").
 mercury_format_cons_id(deep_profiling_proc_static(_), _) -->
 	add_string("<deep_profiling_proc_static>").
+mercury_format_cons_id(table_io_decl(_), _) -->
+	add_string("<table_io_decl>").
 
 :- pred mercury_format_mode_defn(inst_varset::in, sym_name::in,
 	list(inst_var)::in, mode_defn::in, prog_context::in,
@@ -3539,8 +3539,6 @@
 	output_string("eval_memo").
 output_eval_method(eval_table_io) -->
 	output_string("eval_table_io").
-output_eval_method(eval_table_io_decl) -->
-	output_string("eval_table_io_decl").
 output_eval_method(eval_minimal) -->
 	output_string("eval_minimal").
 
@@ -3644,6 +3642,8 @@
 	output_string("eval_memo").
 output_eval_method(eval_table_io) -->
 	output_string("eval_table_io").
+output_eval_method(eval_table_io_decl) -->
+	output_string("eval_table_io_decl").
 output_eval_method(eval_minimal) -->
 	output_string("eval_minimal").
 
diff -u compiler/ml_unify_gen.m compiler/ml_unify_gen.m
--- compiler/ml_unify_gen.m	2002/01/11 09:17:13
+++ compiler/ml_unify_gen.m	19 Feb 2002 07:05:20 -0000
@@ -1676,9 +1676,6 @@
 		{ Tag = deep_profiling_proc_static_tag(_) },
 		{ MLDS_Statements = [] }
 	;
-		{ Tag = table_io_decl_tag(_) },
-		{ MLDS_Statements = [] }
-	;
 		{ Tag = no_tag },
 		( { Args = [Arg], Modes = [Mode] } ->
 			ml_variable_type(Arg, ArgType),
@@ -1791,9 +1788,6 @@
 		Tag = deep_profiling_proc_static_tag(_),
 		error("ml_tag_offset_and_argnum")
 	;
-		Tag = table_io_decl_tag(_),
-		error("ml_tag_offset_and_argnum")
-	;
 		Tag = no_tag,
 		error("ml_tag_offset_and_argnum")
 	;
@@ -1847,6 +1841,9 @@
 		{ Tag = deep_profiling_proc_static_tag(_) },
 		{ MLDS_Statements = [] }
 	;
+		{ Tag = table_io_decl_tag(_) },
+		{ MLDS_Statements = [] }
+	;
 		{ Tag = no_tag },
 		( { Args = [Arg], Modes = [Mode] } ->
 			ml_variable_type(Arg, ArgType),
@@ -1959,6 +1956,9 @@
 		Tag = deep_profiling_proc_static_tag(_),
 		error("ml_tag_offset_and_argnum")
 	;
+		Tag = table_io_decl_tag(_),
+		error("ml_tag_offset_and_argnum")
+	;
 		Tag = no_tag,
 		error("ml_tag_offset_and_argnum")
 	;
@@ -2118,9 +2118,6 @@
 ml_gen_tag_test_rval(deep_profiling_proc_static_tag(_), _, _, _) = _ :-
 	% This should never happen
 	error("Attempted deep_profiling_proc_static unification").
-ml_gen_tag_test_rval(table_io_decl_tag(_), _, _, _) = _ :-
-	% This should never happen
-	error("Attempted proc_layout unification").
 ml_gen_tag_test_rval(no_tag, _, _, _Rval) = const(true).
 ml_gen_tag_test_rval(single_functor, _, _, _Rval) = const(true).
 ml_gen_tag_test_rval(unshared_tag(UnsharedTag), _, _, Rval) =
@@ -2286,6 +2283,9 @@
 ml_gen_tag_test_rval(deep_profiling_proc_static_tag(_), _, _, _) = _ :-
 	% This should never happen
 	error("Attempted deep_profiling_proc_static unification").
+ml_gen_tag_test_rval(table_io_decl_tag(_), _, _, _) = _ :-
+	% This should never happen
+	error("Attempted table_io_decl unification").
 ml_gen_tag_test_rval(no_tag, _, _, _Rval) = const(true).
 ml_gen_tag_test_rval(single_functor, _, _, _Rval) = const(true).
 ml_gen_tag_test_rval(unshared_tag(UnsharedTag), _, _, Rval) =
diff -u compiler/options.m compiler/options.m
--- compiler/options.m	2001/12/17 02:06:18
+++ compiler/options.m	18 Feb 2002 03:53:04 -0000
@@ -1090,7 +1090,6 @@
 long_option("trace-optimised",		trace_optimized).
 long_option("trace-optimized",		trace_optimized).
 long_option("trace-table-io",		trace_table_io).
-long_option("trace-table-io-decl",	trace_table_io_decl).
 long_option("trace-table-io-states",	trace_table_io_states).
 long_option("suppress-trace",		suppress_trace).
 long_option("delay-death",		delay_death).
@@ -1102,6 +1101,7 @@
 long_option("trace-optimised",		trace_optimized).
 long_option("trace-optimized",		trace_optimized).
 long_option("trace-table-io",		trace_table_io).
+long_option("trace-table-io-decl",	trace_table_io_decl).
 long_option("trace-table-io-states",	trace_table_io_states).
 long_option("suppress-trace",		suppress_trace).
 long_option("delay-death",		delay_death).
@@ -2028,9 +2028,6 @@
 %		"--trace-table-io",
 %		"\tEnable the tabling of I/O actions, to allow the debugger",
 %		"\tto execute retry commands across I/O actions.",
-%		"--trace-table-io-decl",
-%		"\tSet up I/O tabling so that the declarative debugger can",
-%		"\tmake use of it.",
 %		"--trace-table-io-states",
 %		"\tWhen tabling I/O actions, table the io__state arguments",
 %		"\ttogether with the others. This should be required iff",
@@ -2081,6 +2078,9 @@
 %		"--trace-table-io",
 %		"\tEnable the tabling of I/O actions, to allow the debugger",
 %		"\tto execute retry commands across I/O actions.",
+%		"--trace-table-io-decl",
+%		"\tSet up I/O tabling so that the declarative debugger can",
+%		"\tmake use of it.",
 %		"--trace-table-io-states",
 %		"\tWhen tabling I/O actions, table the io__state arguments",
 %		"\ttogether with the others. This should be required iff",
diff -u compiler/prog_data.m compiler/prog_data.m
--- compiler/prog_data.m	2002/01/17 11:52:40
+++ compiler/prog_data.m	9 Feb 2002 15:12:31 -0000
@@ -317,8 +317,6 @@
 	;	eval_loop_check		% loop check only
 	;	eval_memo		% memoing + loop check 
 	;	eval_table_io		% memoing I/O actions for debugging
-	;	eval_table_io_decl	% memoing I/O actions for declarative
-					% debugging
 	;	eval_minimal.		% minimal model 
 					% evaluation 
 %
@@ -341,6 +339,8 @@
 	;	eval_loop_check		% loop check only
 	;	eval_memo		% memoing + loop check 
 	;	eval_table_io		% memoing I/O actions for debugging
+	;	eval_table_io_decl	% memoing I/O actions for declarative
+					% debugging
 	;	eval_minimal.		% minimal model 
 					% evaluation 
 %
diff -u compiler/stack_layout.m compiler/stack_layout.m
--- compiler/stack_layout.m	2001/12/28 11:10:28
+++ compiler/stack_layout.m	24 Jan 2002 01:40:18 -0000
@@ -87,7 +87,7 @@
 	list__foldl(stack_layout__construct_layouts, ProcLayoutList,
 		LayoutInfo2, LayoutInfo),
 	ModuleInfo = LayoutInfo ^ module_info,
-	TableIoDecls = LayoutInfo ^ table_io_decl,
+	TableIoDecls = LayoutInfo ^ table_io_decls,
 	ProcLayouts = LayoutInfo ^ proc_layouts,
 	InternalLayouts = LayoutInfo ^ internal_layouts,
 	LayoutLabels = LayoutInfo ^ label_set,
@@ -459,9 +459,9 @@
 		{ MaybeTableIoDeclInfo = no }
 	;
 		{ MaybeTableIoDeclInfo = yes(TableIoDeclInfo) },
-		stack_layout__make_table_decl_io_data(RttiProcLabel, Kind,
+		stack_layout__make_table_io_decl_data(RttiProcLabel, Kind,
 			TableIoDeclInfo, TableIoDeclData),
-		stack_layout__add_table_decl_io_data(TableIoDeclData)
+		stack_layout__add_table_io_decl_data(TableIoDeclData)
 	).
 
 :- pred stack_layout__construct_trace_layout(rtti_proc_label::in,
@@ -1071,11 +1071,11 @@
 
 %---------------------------------------------------------------------------%
 
-:- pred stack_layout__make_table_decl_io_data(rtti_proc_label::in,
+:- pred stack_layout__make_table_io_decl_data(rtti_proc_label::in,
 	proc_layout_kind::in, table_io_decl_info::in, layout_data::out,
 	stack_layout_info::in, stack_layout_info::out) is det.
 
-stack_layout__make_table_decl_io_data(RttiProcLabel, Kind, TableIoDeclInfo,
+stack_layout__make_table_io_decl_data(RttiProcLabel, Kind, TableIoDeclInfo,
 		TableIoDeclData) -->
 	{ TableIoDeclInfo = table_io_decl_info(SavedArgs, TVarSlotMap) },
 	{ list__length(SavedArgs, NumPTIs) },
@@ -1460,7 +1460,7 @@
 		trace_level		:: trace_level,
 		trace_suppress_items	:: trace_suppress_items,
 		static_code_addresses	:: bool, % have static code addresses?
-		table_io_decl		:: list(comp_gen_c_data),
+		table_io_decls		:: list(comp_gen_c_data),
 		proc_layouts		:: list(comp_gen_c_data),
 		internal_layouts	:: list(comp_gen_c_data),
 		label_set		:: map(label, data_addr),
@@ -1532,7 +1532,7 @@
 stack_layout__get_trace_level(LI ^ trace_level, LI, LI).
 stack_layout__get_trace_suppress(LI ^ trace_suppress_items, LI, LI).
 stack_layout__get_static_code_addresses(LI ^ static_code_addresses, LI, LI).
-stack_layout__get_table_io_decl_data(LI ^ table_io_decl, LI, LI).
+stack_layout__get_table_io_decl_data(LI ^ table_io_decls, LI, LI).
 stack_layout__get_proc_layout_data(LI ^ proc_layouts, LI, LI).
 stack_layout__get_internal_layout_data(LI ^ internal_layouts, LI, LI).
 stack_layout__get_label_set(LI ^ label_set, LI, LI).
@@ -1554,13 +1554,13 @@
 	stack_layout__get_module_info(ModuleInfo),
 	{ module_info_get_cell_counter(ModuleInfo, CellCounter) }.
 
-:- pred stack_layout__add_table_decl_io_data(layout_data::in,
+:- pred stack_layout__add_table_io_decl_data(layout_data::in,
 	stack_layout_info::in, stack_layout_info::out) is det.
 
-stack_layout__add_table_decl_io_data(TableIoDeclData, LI0, LI) :-
-	TableIoDecls0 = LI0 ^ table_io_decl,
+stack_layout__add_table_io_decl_data(TableIoDeclData, LI0, LI) :-
+	TableIoDecls0 = LI0 ^ table_io_decls,
 	TableIoDecls = [layout_data(TableIoDeclData) | TableIoDecls0],
-	LI = LI0 ^ table_io_decl := TableIoDecls.
+	LI = LI0 ^ table_io_decls := TableIoDecls.
 
 :- pred stack_layout__add_proc_layout_data(comp_gen_c_data::in,
 	layout_name::in, label::in,
diff -u compiler/table_gen.m compiler/table_gen.m
--- compiler/table_gen.m	2002/01/14 14:28:44
+++ compiler/table_gen.m	24 Jan 2002 01:48:04 -0000
@@ -380,7 +380,7 @@
 				OrigGoal, PredId, ProcId, HeadVars, ArgModes,
 				VarTypes0, VarTypes, VarSet0, VarSet,
 				TableInfo0, TableInfo, CallTableTip, Goal)
-	),
+		),
 		MaybeCallTableTip = yes(CallTableTip),
 		MaybeTableIoDeclInfo = no
 	),
@@ -492,7 +492,6 @@
 		list__filter(key_belong_to_list(SavedOutputVars),
 			NumberedSaveVars, NumberedSavedOutputVars),
 		NumberedRestoreVars = NumberedSavedOutputVars,
-		list__length(NumberedSaveVars, BlockSize),
 
 		ProcInfo0 = TableInfo0 ^ table_cur_proc_info,
 		continuation_info__generate_table_decl_io_layout(ProcInfo0,
@@ -507,9 +506,10 @@
 			NumberedSavedOutputVars),
 		NumberedRestoreVars = NumberedSavedOutputVars,
 		NumberedSaveVars = NumberedSavedOutputVars,
-		list__length(NumberedSavedOutputVars, BlockSize),
 		MaybeTableIoDeclInfo = no
 	),
+
+	list__length(NumberedSaveVars, BlockSize),
 
 	generate_restore_goal(NumberedRestoreVars, TableVar,
 		ModuleInfo, Context, VarTypes5, VarTypes6, VarSet5, VarSet6,
diff -u compiler/unify_gen.m compiler/unify_gen.m
--- compiler/unify_gen.m	2001/12/25 10:46:23
+++ compiler/unify_gen.m	24 Jan 2002 01:48:36 -0000
@@ -426,7 +426,7 @@
 	( { Args = [] } ->
 		[]
 	;
-		{ error("unify_gen: proc_layout has args") }
+		{ error("unify_gen: table_io_decl has args") }
 	),
 	{ DataAddr = layout_addr(table_io_decl(RttiProcLabel)) },
 	code_info__assign_const_to_var(Var, const(data_addr_const(DataAddr))).
reverted:
--- library/Mmakefile	2002/01/14 10:15:05
+++ library/Mmakefile	2002/01/09 06:41:31	1.82
@@ -305,10 +305,6 @@
 	../runtime/mercury_deconstruct_macros.h \
 	../runtime/mercury_deconstruct.h
 
-$(os_subdir)table_builtin.$O \
-$(os_subdir)table_builtin.pic_o \
-	: ../runtime/mercury_tabling_macros.h
-
 #-----------------------------------------------------------------------------#
 
 realclean_local:
37 out of 40 hunks FAILED -- saving rejects to file /tmp/interdiff-1.TG6BdZ.rej
diff -u library/table_builtin.m library/table_builtin.m
--- library/table_builtin.m	2002/01/14 10:11:50
+++ library/table_builtin.m	19 Feb 2002 07:05:28 -0000
@@ -180,7 +180,9 @@
 :- implementation.
 
 :- pragma foreign_proc("C",
-	table_simple_is_complete(T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_is_complete(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -198,7 +200,9 @@
 ").
 
 :- pragma foreign_proc("C",
-	table_simple_has_succeeded(T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_has_succeeded(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -215,7 +219,9 @@
 ").
 
 :- pragma foreign_proc("C",
-	table_simple_has_failed(T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_has_failed(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -232,7 +238,9 @@
 ").
 
 :- pragma foreign_proc("C",
-	table_simple_is_active(T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_is_active(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -249,7 +257,9 @@
 ").
 
 :- pragma foreign_proc("C",
-	table_simple_is_inactive(T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_is_inactive(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -266,7 +276,9 @@
 ").
 
 :- pragma foreign_proc("C",
-	table_simple_mark_as_succeeded(T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_mark_as_succeeded(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -280,7 +292,9 @@
 ").
 
 :- pragma foreign_proc("C",
-	table_simple_mark_as_failed(T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_mark_as_failed(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -294,7 +308,9 @@
 ").
 
 :- pragma foreign_proc("C",
-	table_simple_mark_as_active(T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_mark_as_active(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -308,7 +324,9 @@
 ").
 
 :- pragma foreign_proc("C",
-	table_simple_mark_as_inactive(T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_mark_as_inactive(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -324,47 +342,65 @@
 
 
 :- pragma foreign_proc("MC++",
-	table_simple_is_complete(_T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_is_complete(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
-	table_simple_has_succeeded(_T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_has_succeeded(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
-	table_simple_has_failed(_T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_has_failed(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
-	table_simple_is_active(_T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_is_active(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
-	table_simple_is_inactive(_T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_is_inactive(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
-	table_simple_mark_as_succeeded(_T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_mark_as_succeeded(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
-	table_simple_mark_as_failed(_T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_mark_as_failed(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
-	table_simple_mark_as_active(_T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_mark_as_active(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
-	table_simple_mark_as_inactive(_T::in), [will_not_call_mercury, promise_pure], "
+	table_simple_mark_as_inactive(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
@@ -602,7 +638,9 @@
 :- implementation.
 
 :- pragma foreign_proc("C",
-	table_nondet_setup(T0::in, T::out), [will_not_call_mercury, promise_pure], "
+	table_nondet_setup(T0::in, T::out),
+	[will_not_call_mercury, promise_pure],
+"
 #ifndef	MR_USE_MINIMAL_MODEL
 	MR_fatal_error(""minimal model code entered when not enabled"");
 #else
@@ -664,7 +702,9 @@
 ").
 
 :- pragma foreign_proc("MC++",
-	table_nondet_setup(_T0::in, _T::out), [will_not_call_mercury, promise_pure], "
+	table_nondet_setup(_T0::in, _T::out),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
@@ -709,7 +749,9 @@
 ").
 
 :- pragma foreign_proc("C",
-	table_nondet_is_active(T::in), [will_not_call_mercury, promise_pure], "
+	table_nondet_is_active(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 #ifdef	MR_USE_MINIMAL_MODEL
 	MR_TrieNode	table;
 
@@ -722,7 +764,9 @@
 ").
 
 :- pragma foreign_proc("C",
-	table_nondet_mark_as_active(T::in), [will_not_call_mercury, promise_pure], "
+	table_nondet_mark_as_active(T::in),
+	[will_not_call_mercury, promise_pure],
+"
 #ifdef	MR_USE_MINIMAL_MODEL
 	MR_TrieNode	table;
 
@@ -738,7 +782,8 @@
 
 :- pragma foreign_proc("C",
 	table_nondet_get_ans_table(T::in, AT::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 #ifdef	MR_USE_MINIMAL_MODEL
 	MR_TrieNode	table;
 
@@ -752,7 +797,8 @@
 
 :- pragma foreign_proc("C",
 	table_nondet_answer_is_not_duplicate(T::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 #ifndef	MR_USE_MINIMAL_MODEL
 	MR_fatal_error(""minimal model code entered when not enabled"");
 #else
@@ -776,7 +822,8 @@
 
 :- pragma foreign_proc("C",
 	table_nondet_new_ans_slot(T::in, Slot::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 #ifndef	MR_USE_MINIMAL_MODEL
 	MR_fatal_error(""minimal model code entered when not enabled"");
 #else
@@ -891,42 +938,51 @@
 ").
 
 :- pragma foreign_proc("MC++",
-	table_nondet_is_active(_T::in), [will_not_call_mercury, promise_pure], "
+	table_nondet_is_active(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
-	table_nondet_mark_as_active(_T::in), [will_not_call_mercury, promise_pure], "
+	table_nondet_mark_as_active(_T::in),
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_nondet_get_ans_table(_T::in, _AT::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_nondet_answer_is_not_duplicate(_T::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_nondet_new_ans_slot(_T::in, _Slot::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	pickup_answer_list(_T::in, _CurNode::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	return_next_answer(_CurNode0::in, _AnswerBlock::out, _CurNode::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
@@ -1085,7 +1141,8 @@
 ").
 
 :- pragma foreign_proc("C", table_lookup_insert_int(T0::in, I::in, T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table0, table;
 
 	table0 = (MR_TrieNode) T0;
@@ -1095,7 +1152,8 @@
 
 :- pragma foreign_proc("C",
 	table_lookup_insert_start_int(T0::in, S::in, I::in, T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table0, table;
 
 	table0 = (MR_TrieNode) T0;
@@ -1106,7 +1164,8 @@
 
 :- pragma foreign_proc("C",
 	table_lookup_insert_char(T0::in, C::in, T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table0, table;
 
 	table0 = (MR_TrieNode) T0;
@@ -1114,8 +1173,10 @@
 	T = (MR_Word) table;
 ").
 
-:- pragma foreign_proc("C", table_lookup_insert_string(T0::in, S::in, T::out),
-		[will_not_call_mercury, promise_pure], "
+:- pragma foreign_proc("C",
+	table_lookup_insert_string(T0::in, S::in, T::out),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table0, table;
 
 	table0 = (MR_TrieNode) T0;
@@ -1123,8 +1184,10 @@
 	T = (MR_Word) table;
 ").
 
-:- pragma foreign_proc("C", table_lookup_insert_float(T0::in, F::in, T::out),
-		[will_not_call_mercury, promise_pure], "
+:- pragma foreign_proc("C",
+	table_lookup_insert_float(T0::in, F::in, T::out),
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table0, table;
 
 	table0 = (MR_TrieNode) T0;
@@ -1134,7 +1197,8 @@
 
 :- pragma foreign_proc("C", 
 	table_lookup_insert_enum(T0::in, R::in, V::in, T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table0, table;
 
 	table0 = (MR_TrieNode) T0;
@@ -1144,7 +1208,8 @@
 
 :- pragma foreign_proc("C",
 	table_lookup_insert_user(T0::in, V::in, T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table0, table;
 
 	table0 = (MR_TrieNode) T0;
@@ -1154,7 +1219,8 @@
 
 :- pragma foreign_proc("C",
 	table_lookup_insert_poly(T0::in, V::in, T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table0, table;
 
 	table0 = (MR_TrieNode) T0;
@@ -1164,27 +1230,28 @@
 
 :- pragma foreign_proc("C",
 	table_save_int_ans(T::in, Offset::in, I::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
-	MR_TABLE_SAVE_ANSWER(table, Offset, I,
-		&MR_TYPE_CTOR_INFO_INT);
+	MR_TABLE_SAVE_ANSWER(table, Offset, I, &MR_TYPE_CTOR_INFO_INT);
 ").
 
 :- pragma foreign_proc("C",
 	table_save_char_ans(T::in, Offset::in, C::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
-	MR_TABLE_SAVE_ANSWER(table, Offset, C,
-		&MR_TYPE_CTOR_INFO_CHAR);
+	MR_TABLE_SAVE_ANSWER(table, Offset, C, &MR_TYPE_CTOR_INFO_CHAR);
 ").
 
 :- pragma foreign_proc("C",
 	table_save_string_ans(T::in, Offset::in, S::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -1194,24 +1261,24 @@
 
 :- pragma foreign_proc("C",
 	table_save_float_ans(T::in, Offset::in, F::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
 #ifdef MR_HIGHLEVEL_CODE
-	MR_TABLE_SAVE_ANSWER(table, Offset,
-		(MR_Word) MR_box_float(F),
+	MR_TABLE_SAVE_ANSWER(table, Offset, (MR_Word) MR_box_float(F),
 		&MR_TYPE_CTOR_INFO_FLOAT);
 #else
-	MR_TABLE_SAVE_ANSWER(table, Offset,
-		MR_float_to_word(F),
+	MR_TABLE_SAVE_ANSWER(table, Offset, MR_float_to_word(F),
 		&MR_TYPE_CTOR_INFO_FLOAT);
 #endif
 ").
 
 :- pragma foreign_proc("C",
 	table_save_io_state_ans(T::in, Offset::in, S::ui),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -1221,7 +1288,8 @@
 
 :- pragma foreign_proc("C", 
 	table_save_any_ans(T::in, Offset::in, V::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -1230,7 +1298,8 @@
 
 :- pragma foreign_proc("C",
 	table_restore_int_ans(T::in, Offset::in, I::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -1239,7 +1308,8 @@
 
 :- pragma foreign_proc("C",
 	table_restore_char_ans(T::in, Offset::in, C::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -1248,7 +1318,8 @@
 
 :- pragma foreign_proc("C",
 	table_restore_string_ans(T::in, Offset::in, S::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -1257,7 +1328,8 @@
 
 :- pragma foreign_proc("C",
 	table_restore_float_ans(T::in, Offset::in, F::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -1270,7 +1342,8 @@
 
 :- pragma foreign_proc("C",
 	table_restore_io_state_ans(T::in, Offset::in, V::uo),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -1279,7 +1352,8 @@
 
 :- pragma foreign_proc("C",
 	table_restore_any_ans(T::in, Offset::in, V::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table;
 
 	table = (MR_TrieNode) T;
@@ -1288,7 +1362,8 @@
 
 :- pragma foreign_proc("C",
 	table_create_ans_block(T0::in, Size::in, T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	MR_TrieNode	table0;
 
 	table0 = (MR_TrieNode) T0;
@@ -1307,133 +1382,156 @@
 
 :- pragma foreign_proc("MC++",
 	table_lookup_insert_int(_T0::in, _I::in, _T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_lookup_insert_start_int(_T0::in, _S::in, _I::in, _T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_lookup_insert_char(_T0::in, _C::in, _T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_lookup_insert_string(_T0::in, _S::in, _T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_lookup_insert_float(_T0::in, _F::in, _T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++", 
 	table_lookup_insert_enum(_T0::in, _R::in, _V::in, _T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_lookup_insert_user(_T0::in, _V::in, _T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_lookup_insert_poly(_T0::in, _V::in, _T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_save_int_ans(_T::in, _Offset::in, _I::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_save_char_ans(_T::in, _Offset::in, _C::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_save_string_ans(_T::in, _Offset::in, _S::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_save_float_ans(_T::in, _Offset::in, _F::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_save_io_state_ans(_T::in, _Offset::in, _S::ui),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 
 :- pragma foreign_proc("MC++",
 	table_save_any_ans(_T::in, _Offset::in, _V::in),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_restore_int_ans(_T::in, _Offset::in, _I::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_restore_char_ans(_T::in, _Offset::in, _C::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_restore_string_ans(_T::in, _Offset::in, _S::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_restore_float_ans(_T::in, _Offset::in, _F::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_restore_io_state_ans(_T::in, _Offset::in, _V::uo),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_restore_any_ans(_T::in, _Offset::in, _V::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
 	table_create_ans_block(_T0::in, _Size::in, _T::out),
-		[will_not_call_mercury, promise_pure], "
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
 :- pragma foreign_proc("MC++",
-	table_report_statistics, [will_not_call_mercury, promise_pure], "
+	table_report_statistics,
+	[will_not_call_mercury, promise_pure],
+"
 	mercury::runtime::Errors::SORRY(""foreign code for this function"");
 ").
 
diff -u library/varset.m library/varset.m
--- library/varset.m	2001/12/25 15:10:22
+++ library/varset.m	4 Feb 2002 02:53:18 -0000
@@ -1,5 +1,5 @@
 %---------------------------------------------------------------------------%
-% Copyright (C) 1993-2000 The University of Melbourne.
+% Copyright (C) 1993-2000,2002 The University of Melbourne.
 % This file may only be copied under the terms of the GNU Library General
 % Public License - see the file COPYING.LIB in the Mercury distribution.
 %---------------------------------------------------------------------------%
2 out of 5 hunks FAILED -- saving rejects to file /tmp/interdiff-1.fq7Pmz.rej
diff -u runtime/mercury_layout_util.c runtime/mercury_layout_util.c
--- runtime/mercury_layout_util.c	2002/01/14 11:42:02
+++ runtime/mercury_layout_util.c	19 Feb 2002 07:11:22 -0000
@@ -17,6 +17,8 @@
 
 static MR_Word MR_lookup_closure_long_lval(MR_Long_Lval locn,
 	MR_Closure *closure, MR_bool *succeeded);
+static MR_Word MR_lookup_answer_block_long_lval(MR_Long_Lval locn,
+	MR_Word *answer_block, int block_size, bool *succeeded);
 
 void
 MR_copy_regs_to_saved_regs(int max_mr_num, MR_Word *saved_regs)
@@ -304,8 +306,7 @@
 			if (! *succeeded) {
 				break;
 			}
-			value = MR_typeclass_info_type_info(baseaddr,
-				offset);
+			value = MR_typeclass_info_type_info(baseaddr, offset);
 			*succeeded = MR_TRUE;
 			break;
 
@@ -335,7 +336,7 @@
 	MR_Word	baseaddr;
 	MR_Word	sublocn;
 
-	*succeeded = FALSE;
+	*succeeded = MR_FALSE;
 	value = 0;
 
 	locn_num = (int) MR_LONG_LVAL_NUMBER(locn);
@@ -346,7 +347,7 @@
 			}
 			if (locn_num <= block_size) {
 				value = answer_block[locn_num];
-				*succeeded = TRUE;
+				*succeeded = MR_TRUE;
 			}
 			break;
 
@@ -410,7 +411,7 @@
 				break;
 			}
 			value = MR_typeclass_info_type_info(baseaddr, offset);
-			*succeeded = TRUE;
+			*succeeded = MR_TRUE;
 			break;
 
 		case MR_LONG_LVAL_TYPE_UNKNOWN:
diff -u runtime/mercury_stack_layout.h runtime/mercury_stack_layout.h
--- runtime/mercury_stack_layout.h	2002/01/14 04:43:27
+++ runtime/mercury_stack_layout.h	18 Feb 2002 03:53:55 -0000
@@ -420,19 +420,20 @@
 ** To enable declarative debugging of I/O actions, the compiler generates one
 ** of these structures for each I/O primitive. The compiler transforms the
 ** bodies of those primitives to create a block of memory and fill it in with
-** (a) a pointer to the primitive's MR_Table_Io_Decl structure and (2) the
+** (1) a pointer to the primitive's MR_Table_Io_Decl structure and (2) the
 ** values of the primitive's arguments (both input and output, but excluding
 ** the I/O states). The array of pseudo-typeinfos pointed to by the ptis field
-** gives the types of these arguments, while the arity field gives the number
-** of arguments (and thus the size of the ptis array, and the size of the block
-** exclusive of the pointer). The proc field allows us to identify the
-** primitive procedure. This is all the information we need to describe the
-** I/O action to the user.
+** gives the types of these arguments, while the filtered_arity field gives
+** the number of saved arguments, which will be all the arguments except the
+** I/O states. The number in this field is the size of the ptis array, and
+** the size of the block exclusive of the pointer. The proc field allows us
+** to identify the primitive procedure. This is all the information we need
+** to describe the I/O action to the user.
 */
 
 typedef struct MR_Table_Io_Decl_Struct {
 	const MR_Proc_Layout		*MR_table_io_decl_proc;
-	MR_Integer			MR_table_io_decl_arity;
+	MR_Integer			MR_table_io_decl_filtered_arity;
 	const MR_PseudoTypeInfo		*MR_table_io_decl_ptis;
 	const MR_Type_Param_Locns	*MR_table_io_decl_type_params;
 } MR_Table_Io_Decl;
diff -u runtime/mercury_tabling_macros.h runtime/mercury_tabling_macros.h
--- runtime/mercury_tabling_macros.h	2002/01/14 10:25:38
+++ runtime/mercury_tabling_macros.h	19 Feb 2002 07:05:29 -0000
@@ -374,7 +374,8 @@
 #define MR_TABLE_GET_ANSWER(table, offset)				\
 	(( MR_tabledebug ?						\
 		printf("using answer block: %p -> %p, slot %d\n",	\
-			table, table->MR_answerblock, (int) (offset))	\
+			(table), (table)->MR_answerblock,		\
+			(int) (offset))					\
 	:								\
 		(void) 0 /* do nothing */				\
 	),								\
@@ -385,7 +386,7 @@
 		if (MR_tabledebug)					\
 			printf("saving to answer block: %p -> %p, "	\
 				"slot %d = %lx\n",			\
-				table, table->MR_answerblock,		\
+				(table), (table)->MR_answerblock,	\
 				(int) (offset), (long) (value));	\
 		(table)->MR_answerblock[offset] =			\
 			MR_make_permanent((value),			\
diff -u tests/debugger/Mmakefile tests/debugger/Mmakefile
--- tests/debugger/Mmakefile	2002/01/14 03:53:58
+++ tests/debugger/Mmakefile	18 Feb 2002 07:28:19 -0000
@@ -21,7 +21,8 @@
 	mdb_command_test		\
 	queens				\
 	retry				\
-	tabled_read
+	tabled_read			\
+	tabled_read_decl
 
 NONRETRY_PROGS = \
 	breakpoints			\
@@ -44,7 +45,8 @@
 	shallow
 
 MCFLAGS-shallow = --trace shallow
-MCFLAGS-tabled_read = --trace-table-io-decl
+MCFLAGS-tabled_read = --trace-table-io
+MCFLAGS-tabled_read_decl = --trace-table-io-decl
 # By default, we reclaim heap on failure in non-Boehm-gc grades.
 # The extra stack slots required for this reclamation cause spurious
 # differences from the expected output on the nondet_stack test case.
@@ -254,8 +256,12 @@
 shallow.out: shallow shallow.inp
 	$(MDB) ./shallow < shallow.inp > shallow.out 2>&1
 
-tabled_read.out: tabled_read tabled_read.inp
+tabled_read.out: tabled_read tabled_read.inp tabled_read.data
 	$(MDB) ./tabled_read < tabled_read.inp > tabled_read.out 2>&1
+
+tabled_read_decl.out: tabled_read_decl tabled_read_decl.inp tabled_read_decl.data
+	$(MDB) ./tabled_read_decl < tabled_read_decl.inp \
+		> tabled_read_decl.out 2>&1
 
 # Note that interactive.out.orig depends on $(interactive.ints) because
 # interactive.inp contains interactive queries that require interactive.ints
diff -u tests/debugger/tabled_read.exp tests/debugger/tabled_read.exp
--- tests/debugger/tabled_read.exp	2002/01/14 16:20:42
+++ tests/debugger/tabled_read.exp	18 Feb 2002 07:20:21 -0000
@@ -34,67 +34,29 @@
        HeadVar__2             	0
        HeadVar__3             	123
        HeadVar__5             	state('<<c_pointer>>')
-mdb> break tabled_read__poly_test
- 1: + stop  interface pred tabled_read:poly_test/6-0 (det)
+mdb> table_io end
+io tabling ended
 mdb> continue
 123
-      38:     13  3 CALL pred tabled_read:poly_test/6-0 (det)
+456
+      66:     23  3 CALL pred tabled_read:test/5-0 (det)
 mdb> finish -n
-      65:     13  3 EXIT pred tabled_read:poly_test/6-0 (det)
+      89:     23  3 EXIT pred tabled_read:test/5-0 (det)
 mdb> print *
        HeadVar__1             	'<<c_pointer>>'
-       HeadVar__2             	['a', 'b', 'c']
-       HeadVar__3             	0
-       HeadVar__4             	456
-       HeadVar__6             	state('<<c_pointer>>')
+       HeadVar__2             	0
+       HeadVar__3             	789
+       HeadVar__5             	state('<<c_pointer>>')
 mdb> retry
 Retry across I/O operations is not always safe.
 Are you sure you want to do it? y
-      38:     13  3 CALL pred tabled_read:poly_test/6-0 (det)
+      66:     23  3 CALL pred tabled_read:test/5-0 (det)
 mdb> finish -n
-      65:     13  3 EXIT pred tabled_read:poly_test/6-0 (det)
+      83:     23  3 EXIT pred tabled_read:test/5-0 (det)
 mdb> print *
        HeadVar__1             	'<<c_pointer>>'
-       HeadVar__2             	['a', 'b', 'c']
-       HeadVar__3             	0
-       HeadVar__4             	456
-       HeadVar__6             	state('<<c_pointer>>')
-mdb> delete *
- 0: E stop  interface pred tabled_read:test/5-0 (det)
- 1: E stop  interface pred tabled_read:poly_test/6-0 (det)
-mdb> break part_2
- 0: + stop  interface pred tabled_read:part_2/3-0 (det)
-mdb> continue
-456
-      69:     22  2 CALL pred tabled_read:part_2/3-0 (det)
-mdb> table_io end
-io tabling ended
-mdb> print action 0
-open_input("tabled_read.data", 0, '<<c_pointer>>')
-mdb> print action 1
-read_char_code('<<c_pointer>>', 49)
-mdb> browse action 1
-browser> p
-read_char_code('<<c_pointer>>', 49)
-browser> ^1
-browser> p
-'<<c_pointer>>'
-browser> quit
-mdb> print action 2
-read_char_code('<<c_pointer>>', 50)
-mdb> print action 3
-read_char_code('<<c_pointer>>', 51)
-mdb> print action 4
-read_char_code('<<c_pointer>>', 10)
-mdb> print action 5
-poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]('c', []))), 52)
-mdb> print action 6
-poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]('c', []))), 53)
-mdb> print action 7
-poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]('c', []))), 54)
-mdb> print action 8
-poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]('c', []))), 10)
-mdb> print action 9
-mdb: I/O action number not in range.
+       HeadVar__2             	0
+       HeadVar__3             	42
+       HeadVar__5             	state('<<c_pointer>>')
 mdb> continue -S
-789
+42
diff -u tests/debugger/tabled_read.exp2 tests/debugger/tabled_read.exp2
--- tests/debugger/tabled_read.exp2	2002/01/14 19:43:50
+++ tests/debugger/tabled_read.exp2	18 Feb 2002 10:56:15 -0000
@@ -34,67 +34,29 @@
        HeadVar__2             	0
        HeadVar__3             	123
        HeadVar__5             	state('<<c_pointer>>')
-mdb> break tabled_read__poly_test
- 1: + stop  interface pred tabled_read:poly_test/6-0 (det)
+mdb> table_io end
+io tabling ended
 mdb> continue
 123
-      60:     24  3 CALL pred tabled_read:poly_test/6-0 (det)
+456
+     110:     45  3 CALL pred tabled_read:test/5-0 (det)
 mdb> finish -n
-     109:     24  3 EXIT pred tabled_read:poly_test/6-0 (det)
+     155:     45  3 EXIT pred tabled_read:test/5-0 (det)
 mdb> print *
        HeadVar__1             	'<<c_pointer>>'
-       HeadVar__2             	['a', 'b', 'c']
-       HeadVar__3             	0
-       HeadVar__4             	456
-       HeadVar__6             	state('<<c_pointer>>')
+       HeadVar__2             	0
+       HeadVar__3             	789
+       HeadVar__5             	state('<<c_pointer>>')
 mdb> retry
 Retry across I/O operations is not always safe.
 Are you sure you want to do it? y
-      60:     24  3 CALL pred tabled_read:poly_test/6-0 (det)
+     110:     45  3 CALL pred tabled_read:test/5-0 (det)
 mdb> finish -n
-     109:     24  3 EXIT pred tabled_read:poly_test/6-0 (det)
+     143:     45  3 EXIT pred tabled_read:test/5-0 (det)
 mdb> print *
        HeadVar__1             	'<<c_pointer>>'
-       HeadVar__2             	['a', 'b', 'c']
-       HeadVar__3             	0
-       HeadVar__4             	456
-       HeadVar__6             	state('<<c_pointer>>')
-mdb> delete *
- 0: E stop  interface pred tabled_read:test/5-0 (det)
- 1: E stop  interface pred tabled_read:poly_test/6-0 (det)
-mdb> break part_2
- 0: + stop  interface pred tabled_read:part_2/3-0 (det)
-mdb> continue
-456
-     113:     44  2 CALL pred tabled_read:part_2/3-0 (det)
-mdb> table_io end
-io tabling ended
-mdb> print action 0
-open_input("tabled_read.data", 0, '<<c_pointer>>')
-mdb> print action 1
-read_char_code('<<c_pointer>>', 49)
-mdb> browse action 1
-browser> p
-read_char_code('<<c_pointer>>', 49)
-browser> ^1
-browser> p
-'<<c_pointer>>'
-browser> quit
-mdb> print action 2
-read_char_code('<<c_pointer>>', 50)
-mdb> print action 3
-read_char_code('<<c_pointer>>', 51)
-mdb> print action 4
-read_char_code('<<c_pointer>>', 10)
-mdb> print action 5
-poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 52)
-mdb> print action 6
-poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 53)
-mdb> print action 7
-poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 54)
-mdb> print action 8
-poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 10)
-mdb> print action 9
-mdb: I/O action number not in range.
+       HeadVar__2             	0
+       HeadVar__3             	42
+       HeadVar__5             	state('<<c_pointer>>')
 mdb> continue -S
-789
+42
reverted:
--- tests/debugger/tabled_read.inp	2002/01/14 16:20:40
+++ tests/debugger/tabled_read.inp	2000/12/06 06:05:54	1.1
@@ -12,7 +12,7 @@
 print *
 finish -n
 print *
+table_io end
-break tabled_read__poly_test
 continue
 finish -n
 print *
@@ -20,23 +20,4 @@
 y
 finish -n
 print *
-delete *
-break part_2
-continue
-table_io end
-print action 0
-print action 1
-browse action 1
-p
-^1
-p
-quit
-print action 2
-print action 3
-print action 4
-print action 5
-print action 6
-print action 7
-print action 8
-print action 9
 continue -S
diff -u tests/debugger/tabled_read.m tests/debugger/tabled_read.m
--- tests/debugger/tabled_read.m	2002/01/14 16:16:07
+++ tests/debugger/tabled_read.m	18 Feb 2002 07:02:43 -0000
@@ -64,7 +64,8 @@
 		{ char__is_digit(Char) },
 		{ char__digit_to_int(Char, CharInt) }
 	->
-		tabled_read__poly_test(Stream, Unused, SoFar * 10 + CharInt, N)
+		tabled_read__poly_test(Stream, Unused,
+			SoFar * 10 + CharInt, N)
 	;
 		{ N = SoFar }
 	).
@@ -74,9 +75,10 @@
 :- pred tabled_read__open_input(string::in, int::out, c_pointer::out,
 	io__state::di, io__state::uo) is det.
 
-:- pragma c_code(tabled_read__open_input(FileName::in, Res::out, Stream::out,
-	IO0::di, IO::uo),
-	[will_not_call_mercury, tabled_for_io],
+:- pragma foreign_proc("C",
+	tabled_read__open_input(FileName::in, Res::out, Stream::out,
+		IO0::di, IO::uo),
+	[will_not_call_mercury, promise_pure, tabled_for_io],
 "
 	Stream = (MR_Word) fopen((const char *) FileName, ""r"");
 	Res = Stream? 0 : -1;
@@ -86,9 +88,10 @@
 :- pred tabled_read__read_char_code(c_pointer::in, int::out,
 	io__state::di, io__state::uo) is det.
 
-:- pragma c_code(tabled_read__read_char_code(Stream::in, CharCode::out,
-	IO0::di, IO::uo),
-	[will_not_call_mercury, tabled_for_io],
+:- pragma foreign_proc("C",
+	tabled_read__read_char_code(Stream::in, CharCode::out,
+		IO0::di, IO::uo),
+	[will_not_call_mercury, promise_pure, tabled_for_io],
 "
 	CharCode = getc((FILE *) Stream);
 	IO = IO0;
@@ -97,19 +100,22 @@
 :- pred tabled_read__poly_read_char_code(c_pointer::in, T::in, int::out,
 	io__state::di, io__state::uo) is det.
 
-:- pragma c_code(tabled_read__poly_read_char_code(Stream::in, Unused::in,
-	CharCode::out, IO0::di, IO::uo),
-	[will_not_call_mercury, tabled_for_io],
+:- pragma foreign_proc("C",
+	tabled_read__poly_read_char_code(Stream::in, Unused::in,
+		CharCode::out, IO0::di, IO::uo),
+	[will_not_call_mercury, promise_pure, tabled_for_io],
 "
 	/* ignore Unused */
 	CharCode = getc((FILE *) Stream);
 	IO = IO0;
 ").
 
-:- pred tabled_read__write_int(int::in, io__state::di, io__state::uo) is det.
+:- pred tabled_read__write_int(int::in, io__state::di, io__state::uo)
+	is det.
 
-:- pragma c_code(tabled_read__write_int(N::in, IO0::di, IO::uo),
-	[will_not_call_mercury],
+:- pragma foreign_proc("C",
+	tabled_read__write_int(N::in, IO0::di, IO::uo),
+	[will_not_call_mercury, promise_pure],
 "{
 	printf(""%d\\n"", (int) N);
 	IO = IO0;
diff -u trace/mercury_trace_internal.c trace/mercury_trace_internal.c
--- trace/mercury_trace_internal.c	2002/01/14 04:17:20
+++ trace/mercury_trace_internal.c	19 Feb 2002 07:05:49 -0000
@@ -1065,7 +1065,6 @@
 		}
 	} else if (streq(words[0], "print")) {
 		MR_Browse_Format	format;
-		int			n;
 
 		if (! MR_trace_options_format(&format, &words, &word_count,
 					"browsing", "print"))
@@ -1106,25 +1105,11 @@
 				fflush(MR_mdb_out);
 				fprintf(MR_mdb_err, "mdb: %s.\n", problem);
 			}
-		} else if (word_count == 3 && streq(words[1], "action")
-				&& MR_trace_is_number(words[2], &n))
-		{
-			const char	*problem;
-
-			problem = MR_trace_browse_action(MR_mdb_out, n,
-					MR_trace_browse_goal_internal,
-					MR_BROWSE_CALLER_PRINT, format);
-
-			if (problem != NULL) {
-				fflush(MR_mdb_out);
-				fprintf(MR_mdb_err, "mdb: %s.\n", problem);
-			}
 		} else {
 			MR_trace_usage("browsing", "print");
 		}
 	} else if (streq(words[0], "browse")) {
 		MR_Browse_Format	format;
-		int			n;
 
 		if (! MR_trace_options_format(&format, &words, &word_count,
 					"browsing", "browse"))
@@ -1160,19 +1145,6 @@
 
 			if (problem != NULL) {
 				fflush(MR_mdb_out);
-				fprintf(MR_mdb_err, "mdb: %s.\n", problem);
-			}
-		} else if (word_count == 3 && streq(words[1], "action")
-				&& MR_trace_is_number(words[2], &n))
-		{
-			const char	*problem;
-
-			problem = MR_trace_browse_action(MR_mdb_out, n,
-					MR_trace_browse_goal_internal,
-					MR_BROWSE_CALLER_BROWSE, format);
-
-			if (problem != NULL) {
-				fflush(MR_mdb_out);
 
 
 
@@ -1383,6 +1355,7 @@
 		}
 	} else if (MR_streq(words[0], "print")) {
 		MR_Browse_Format	format;
+		int			n;
 
 		if (! MR_trace_options_format(&format, &words, &word_count,
 					"browsing", "print"))
@@ -1424,11 +1397,25 @@
 				fflush(MR_mdb_out);
 				fprintf(MR_mdb_err, "mdb: %s.\n", problem);
 			}
+		} else if (word_count == 3 && streq(words[1], "action")
+				&& MR_trace_is_number(words[2], &n))
+		{
+			const char	*problem;
+
+			problem = MR_trace_browse_action(MR_mdb_out, n,
+					MR_trace_browse_goal_internal,
+					MR_BROWSE_CALLER_PRINT, format);
+
+			if (problem != NULL) {
+				fflush(MR_mdb_out);
+				fprintf(MR_mdb_err, "mdb: %s.\n", problem);
+			}
 		} else {
 			MR_trace_usage("browsing", "print");
 		}
 	} else if (MR_streq(words[0], "browse")) {
 		MR_Browse_Format	format;
+		int			n;
 
 		if (! MR_trace_options_format(&format, &words, &word_count,
 					"browsing", "browse"))
@@ -1462,6 +1449,19 @@
 					MR_BROWSE_CALLER_BROWSE, format,
 					MR_TRUE);
 			}
+
+			if (problem != NULL) {
+				fflush(MR_mdb_out);
+				fprintf(MR_mdb_err, "mdb: %s.\n", problem);
+			}
+		} else if (word_count == 3 && streq(words[1], "action")
+				&& MR_trace_is_number(words[2], &n))
+		{
+			const char	*problem;
+
+			problem = MR_trace_browse_action(MR_mdb_out, n,
+					MR_trace_browse_goal_internal,
+					MR_BROWSE_CALLER_BROWSE, format);
 
 			if (problem != NULL) {
 				fflush(MR_mdb_out);
diff -u trace/mercury_trace_vars.c trace/mercury_trace_vars.c
--- trace/mercury_trace_vars.c	2002/01/18 04:23:26
+++ trace/mercury_trace_vars.c	19 Feb 2002 07:05:49 -0000
@@ -450,7 +450,7 @@
 	}
 
 	slot_max = slot;
-	MR_free(type_params);
+	free(type_params);
 
 	if (slot_max > 0) {
 		qsort(MR_point.MR_point_vars, slot_max,
@@ -469,7 +469,7 @@
 	}
 
 	slot_max = slot;
-	free(type_params);
+	MR_free(type_params);
 
 	if (slot_max > 0) {
 		qsort(MR_point.MR_point_vars, slot_max,
@@ -659,6 +659,26 @@
 	return NULL;
 }
 
+/*
+** The following declaration allocates a cell to a typeinfo even if though
+** its arity is zero. This wastes a word of space but avoids depending on the
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+	return NULL;
+}
+
 static void
 MR_generate_proc_name_from_layout(const MR_Proc_Layout *proc_layout,
 	MR_ConstString *proc_name_ptr, int *arity_ptr, MR_Word *is_func_ptr)
@@ -694,26 +714,6 @@
 
 
 
-
-
-
-
-
-
-
-	return NULL;
-}
-
-/*
-** The following declaration allocates a cell to a typeinfo even if though
-** its arity is zero. This wastes a word of space but avoids depending on the
-
-
-
-
-
-
-
 	int			slot;
 
 	proc_layout = MR_point.MR_point_level_entry;
@@ -801,7 +801,7 @@
 
 	table_io_decl = (const MR_Table_Io_Decl *) answer_block[0];
 	proc_layout = table_io_decl->MR_table_io_decl_proc;
-	filtered_arity = table_io_decl->MR_table_io_decl_arity;
+	filtered_arity = table_io_decl->MR_table_io_decl_filtered_arity;
 
 	MR_generate_proc_name_from_layout(proc_layout, &proc_name, &arity,
 		&is_func);
diff -u trace/mercury_trace_vars.h trace/mercury_trace_vars.h
--- trace/mercury_trace_vars.h	2002/01/14 04:06:56
+++ trace/mercury_trace_vars.h	19 Feb 2002 07:05:49 -0000
@@ -120,7 +120,7 @@
 				MR_Browse_Format format);
 
 /*
-** Print I/O action action_number a goal.
+** Print I/O action <action_number> as a goal.
 **
 ** The goal is printed to the given file if the file pointer is non-NULL.
 ** The goal is printed by giving it to the specified browser.
only in patch2:
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/tabled_read_decl.m	18 Feb 2002 07:29:25 -0000
@@ -0,0 +1,122 @@
+% We define our own I/O primitives, in case the library was compiled without
+% IO tabling.
+
+:- module tabled_read_decl.
+
+:- interface.
+
+:- import_module io.
+
+:- pred main(io__state, io__state).
+:- mode main(di, uo) is det.
+
+:- implementation.
+
+:- import_module list, char, int.
+
+main -->
+	tabled_read_decl__open_input("tabled_read_decl.data", Res, Stream),
+	( { Res = 0 } ->
+		tabled_read_decl__part_1(Stream),
+		tabled_read_decl__part_2(Stream)
+	;
+		io__write_string("could not open tabled_read.data\n")
+	).
+
+:- pred tabled_read_decl__part_1(c_pointer::in, io__state::di, io__state::uo)
+	is det. 
+
+tabled_read_decl__part_1(Stream) -->
+	tabled_read_decl__test(Stream, 0, A),
+	tabled_read_decl__write_int(A),
+	tabled_read_decl__poly_test(Stream, ['a', 'b', 'c'], 0, B),
+	tabled_read_decl__write_int(B).
+
+:- pred tabled_read_decl__part_2(c_pointer::in, io__state::di, io__state::uo)
+	is det.
+
+tabled_read_decl__part_2(Stream) -->
+	tabled_read_decl__test(Stream, 0, A),
+	tabled_read_decl__write_int(A).
+
+:- pred tabled_read_decl__test(c_pointer::in, int::in, int::out,
+	io__state::di, io__state::uo) is det.
+
+tabled_read_decl__test(Stream, SoFar, N) -->
+	tabled_read_decl__read_char_code(Stream, CharCode),
+	(
+		{ char__to_int(Char, CharCode) },
+		{ char__is_digit(Char) },
+		{ char__digit_to_int(Char, CharInt) }
+	->
+		tabled_read_decl__test(Stream, SoFar * 10 + CharInt, N)
+	;
+		{ N = SoFar }
+	).
+
+:- pred tabled_read_decl__poly_test(c_pointer::in, T::in, int::in, int::out,
+	io__state::di, io__state::uo) is det.
+
+tabled_read_decl__poly_test(Stream, Unused, SoFar, N) -->
+	tabled_read_decl__poly_read_char_code(Stream, Unused, CharCode),
+	(
+		{ char__to_int(Char, CharCode) },
+		{ char__is_digit(Char) },
+		{ char__digit_to_int(Char, CharInt) }
+	->
+		tabled_read_decl__poly_test(Stream, Unused,
+			SoFar * 10 + CharInt, N)
+	;
+		{ N = SoFar }
+	).
+
+:- pragma c_header_code("#include <stdio.h>").
+
+:- pred tabled_read_decl__open_input(string::in, int::out, c_pointer::out,
+	io__state::di, io__state::uo) is det.
+
+:- pragma foreign_proc("C",
+	tabled_read_decl__open_input(FileName::in, Res::out, Stream::out,
+		IO0::di, IO::uo),
+	[will_not_call_mercury, promise_pure, tabled_for_io],
+"
+	Stream = (MR_Word) fopen((const char *) FileName, ""r"");
+	Res = Stream? 0 : -1;
+	IO = IO0;
+").
+
+:- pred tabled_read_decl__read_char_code(c_pointer::in, int::out,
+	io__state::di, io__state::uo) is det.
+
+:- pragma foreign_proc("C",
+	tabled_read_decl__read_char_code(Stream::in, CharCode::out,
+		IO0::di, IO::uo),
+	[will_not_call_mercury, promise_pure, tabled_for_io],
+"
+	CharCode = getc((FILE *) Stream);
+	IO = IO0;
+").
+
+:- pred tabled_read_decl__poly_read_char_code(c_pointer::in, T::in, int::out,
+	io__state::di, io__state::uo) is det.
+
+:- pragma foreign_proc("C",
+	tabled_read_decl__poly_read_char_code(Stream::in, Unused::in,
+		CharCode::out, IO0::di, IO::uo),
+	[will_not_call_mercury, promise_pure, tabled_for_io],
+"
+	/* ignore Unused */
+	CharCode = getc((FILE *) Stream);
+	IO = IO0;
+").
+
+:- pred tabled_read_decl__write_int(int::in, io__state::di, io__state::uo)
+	is det.
+
+:- pragma foreign_proc("C",
+	tabled_read_decl__write_int(N::in, IO0::di, IO::uo),
+	[will_not_call_mercury, promise_pure],
+"{
+	printf(""%d\\n"", (int) N);
+	IO = IO0;
+}").
only in patch2:
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/tabled_read_decl.inp	18 Feb 2002 07:16:40 -0000
@@ -0,0 +1,42 @@
+echo on
+register --quiet
+context none
+table_io
+break tabled_read_decl__test
+table_io start
+continue
+finish -n
+print *
+retry
+y
+print *
+finish -n
+print *
+break tabled_read_decl__poly_test
+continue
+finish -n
+print *
+retry
+y
+finish -n
+print *
+delete *
+break part_2
+continue
+table_io end
+print action 0
+print action 1
+browse action 1
+p
+^1
+p
+quit
+print action 2
+print action 3
+print action 4
+print action 5
+print action 6
+print action 7
+print action 8
+print action 9
+continue -S
only in patch2:
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/tabled_read_decl.exp2	18 Feb 2002 10:56:18 -0000
@@ -0,0 +1,100 @@
+       1:      1  1 CALL pred tabled_read_decl:main/2-0 (det) tabled_read_decl.m:17
+mdb> echo on
+Command echo enabled.
+mdb> register --quiet
+mdb> context none
+Contexts will not be printed.
+mdb> table_io
+io tabling has not yet started
+mdb> break tabled_read_decl__test
+ 0: + stop  interface pred tabled_read_decl:test/5-0 (det)
+mdb> table_io start
+io tabling started
+mdb> continue
+       8:      4  3 CALL pred tabled_read_decl:test/5-0 (det)
+mdb> finish -n
+      57:      4  3 EXIT pred tabled_read_decl:test/5-0 (det)
+mdb> print *
+       HeadVar__1             	'<<c_pointer>>'
+       HeadVar__2             	0
+       HeadVar__3             	123
+       HeadVar__5             	state('<<c_pointer>>')
+mdb> retry
+Retry across I/O operations is not always safe.
+Are you sure you want to do it? y
+       8:      4  3 CALL pred tabled_read_decl:test/5-0 (det)
+mdb> print *
+       HeadVar__1             	'<<c_pointer>>'
+       HeadVar__2             	0
+       HeadVar__4             	state('<<c_pointer>>')
+mdb> finish -n
+      57:      4  3 EXIT pred tabled_read_decl:test/5-0 (det)
+mdb> print *
+       HeadVar__1             	'<<c_pointer>>'
+       HeadVar__2             	0
+       HeadVar__3             	123
+       HeadVar__5             	state('<<c_pointer>>')
+mdb> break tabled_read_decl__poly_test
+ 1: + stop  interface pred tabled_read_decl:poly_test/6-0 (det)
+mdb> continue
+123
+      60:     24  3 CALL pred tabled_read_decl:poly_test/6-0 (det)
+mdb> finish -n
+     109:     24  3 EXIT pred tabled_read_decl:poly_test/6-0 (det)
+mdb> print *
+       HeadVar__1             	'<<c_pointer>>'
+       HeadVar__2             	['a', 'b', 'c']
+       HeadVar__3             	0
+       HeadVar__4             	456
+       HeadVar__6             	state('<<c_pointer>>')
+mdb> retry
+Retry across I/O operations is not always safe.
+Are you sure you want to do it? y
+      60:     24  3 CALL pred tabled_read_decl:poly_test/6-0 (det)
+mdb> finish -n
+     109:     24  3 EXIT pred tabled_read_decl:poly_test/6-0 (det)
+mdb> print *
+       HeadVar__1             	'<<c_pointer>>'
+       HeadVar__2             	['a', 'b', 'c']
+       HeadVar__3             	0
+       HeadVar__4             	456
+       HeadVar__6             	state('<<c_pointer>>')
+mdb> delete *
+ 0: E stop  interface pred tabled_read_decl:test/5-0 (det)
+ 1: E stop  interface pred tabled_read_decl:poly_test/6-0 (det)
+mdb> break part_2
+ 0: + stop  interface pred tabled_read_decl:part_2/3-0 (det)
+mdb> continue
+456
+     113:     44  2 CALL pred tabled_read_decl:part_2/3-0 (det)
+mdb> table_io end
+io tabling ended
+mdb> print action 0
+open_input("tabled_read_decl.data", 0, '<<c_pointer>>')
+mdb> print action 1
+read_char_code('<<c_pointer>>', 49)
+mdb> browse action 1
+browser> p
+read_char_code('<<c_pointer>>', 49)
+browser> ^1
+browser> p
+'<<c_pointer>>'
+browser> quit
+mdb> print action 2
+read_char_code('<<c_pointer>>', 50)
+mdb> print action 3
+read_char_code('<<c_pointer>>', 51)
+mdb> print action 4
+read_char_code('<<c_pointer>>', 10)
+mdb> print action 5
+poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 52)
+mdb> print action 6
+poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 53)
+mdb> print action 7
+poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 54)
+mdb> print action 8
+poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 10)
+mdb> print action 9
+mdb: I/O action number not in range.
+mdb> continue -S
+789
only in patch2:
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/tabled_read_decl.exp	18 Feb 2002 07:35:23 -0000
@@ -0,0 +1,100 @@
+       1:      1  1 CALL pred tabled_read_decl:main/2-0 (det) tabled_read_decl.m:17
+mdb> echo on
+Command echo enabled.
+mdb> register --quiet
+mdb> context none
+Contexts will not be printed.
+mdb> table_io
+io tabling has not yet started
+mdb> break tabled_read_decl__test
+ 0: + stop  interface pred tabled_read_decl:test/5-0 (det)
+mdb> table_io start
+io tabling started
+mdb> continue
+       8:      4  3 CALL pred tabled_read_decl:test/5-0 (det)
+mdb> finish -n
+      35:      4  3 EXIT pred tabled_read_decl:test/5-0 (det)
+mdb> print *
+       HeadVar__1             	'<<c_pointer>>'
+       HeadVar__2             	0
+       HeadVar__3             	123
+       HeadVar__5             	state('<<c_pointer>>')
+mdb> retry
+Retry across I/O operations is not always safe.
+Are you sure you want to do it? y
+       8:      4  3 CALL pred tabled_read_decl:test/5-0 (det)
+mdb> print *
+       HeadVar__1             	'<<c_pointer>>'
+       HeadVar__2             	0
+       HeadVar__4             	state('<<c_pointer>>')
+mdb> finish -n
+      35:      4  3 EXIT pred tabled_read_decl:test/5-0 (det)
+mdb> print *
+       HeadVar__1             	'<<c_pointer>>'
+       HeadVar__2             	0
+       HeadVar__3             	123
+       HeadVar__5             	state('<<c_pointer>>')
+mdb> break tabled_read_decl__poly_test
+ 1: + stop  interface pred tabled_read_decl:poly_test/6-0 (det)
+mdb> continue
+123
+      38:     13  3 CALL pred tabled_read_decl:poly_test/6-0 (det)
+mdb> finish -n
+      65:     13  3 EXIT pred tabled_read_decl:poly_test/6-0 (det)
+mdb> print *
+       HeadVar__1             	'<<c_pointer>>'
+       HeadVar__2             	['a', 'b', 'c']
+       HeadVar__3             	0
+       HeadVar__4             	456
+       HeadVar__6             	state('<<c_pointer>>')
+mdb> retry
+Retry across I/O operations is not always safe.
+Are you sure you want to do it? y
+      38:     13  3 CALL pred tabled_read_decl:poly_test/6-0 (det)
+mdb> finish -n
+      65:     13  3 EXIT pred tabled_read_decl:poly_test/6-0 (det)
+mdb> print *
+       HeadVar__1             	'<<c_pointer>>'
+       HeadVar__2             	['a', 'b', 'c']
+       HeadVar__3             	0
+       HeadVar__4             	456
+       HeadVar__6             	state('<<c_pointer>>')
+mdb> delete *
+ 0: E stop  interface pred tabled_read_decl:test/5-0 (det)
+ 1: E stop  interface pred tabled_read_decl:poly_test/6-0 (det)
+mdb> break part_2
+ 0: + stop  interface pred tabled_read_decl:part_2/3-0 (det)
+mdb> continue
+456
+      69:     22  2 CALL pred tabled_read_decl:part_2/3-0 (det)
+mdb> table_io end
+io tabling ended
+mdb> print action 0
+open_input("tabled_read_decl.data", 0, '<<c_pointer>>')
+mdb> print action 1
+read_char_code('<<c_pointer>>', 49)
+mdb> browse action 1
+browser> p
+read_char_code('<<c_pointer>>', 49)
+browser> ^1
+browser> p
+'<<c_pointer>>'
+browser> quit
+mdb> print action 2
+read_char_code('<<c_pointer>>', 50)
+mdb> print action 3
+read_char_code('<<c_pointer>>', 51)
+mdb> print action 4
+read_char_code('<<c_pointer>>', 10)
+mdb> print action 5
+poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 52)
+mdb> print action 6
+poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 53)
+mdb> print action 7
+poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 54)
+mdb> print action 8
+poly_read_char_code(<<typeinfo>>, <<c_pointer>>, [|]('a', [|]('b', [|]/2)), 10)
+mdb> print action 9
+mdb: I/O action number not in range.
+mdb> continue -S
+789
only in patch2:
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/debugger/tabled_read_decl.data	18 Feb 2002 07:28:34 -0000
@@ -0,0 +1,4 @@
+123
+456
+789
+42
only in patch2:
--- tests/debugger/tabled_read.data	6 Dec 2000 06:05:54 -0000	1.1
+++ tests/debugger/tabled_read.data	18 Feb 2002 07:18:01 -0000
@@ -1,3 +1,4 @@
 123
 456
 789
+42
--------------------------------------------------------------------------
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