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

Mark Brown dougl at cs.mu.OZ.AU
Mon Jan 21 16:51:48 AEDT 2002


I haven't finished reviewing it yet, but here are some preliminary
comments.

On 18-Jan-2002, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> For review by Mark.
> 
> Estimated hours taken: 40
> Branches: main
> 
> A large step towards declarative debugging of goals that do I/O. This step
> does everything needed for that except modify the declarative debugger itself;
> that is for Mark to do.
> 
> The new functionality is enabled by the new option --trace-table-io-decl.
> It can be tested by the new debugger commands "print action <action-number>"
> and "browse action <action-number>"
> 
> The new option is currently not documented, because the declarative debugger
> does not yet use the information it provides. The new debugger commands are
> not documented because they are meant only for implementors, at least for
> now.
> 
> Since this change adds a field to proc_layout structures, any workspaces
> compiled with debugging enabled will need to do a cvs update when this change
> is installed.

This doesn't actually state what the new functionality is.  It would be
easier to understand this change if you mention here what "print/browse
action" does, and (briefly) mention what the transformation does.

> 
> compiler/options.m:
> 	Add the option --trace-table-io-decl. When set, this causes the
> 	compiler to transform I/O action primitives to allow declarative
> 	debugging of I/O actions.
> 
> compiler/handle_options.m:
> 	Make --trace-table-io-decl imply --trace-table-io.
> 
> compiler/table_gen.m:
> 	Perform the transformation, which is similar to the existing
> 	--trace-table-io transformation, but preserves the identity of all
> 	non-io-state arguments (not just the outputs) and the identity
> 	of the I/O primitive itself.
> 
> 	Provide better names for variables generated by tabling
> 	transformations.
> 
> compiler/goal_util.m:

I think you mean s/goal_util/hlds_goal/

> 	Add extra parameters to procedures whose job it is to create new
> 	goals to name the variables in those goals.
> 

> Index: library/table_builtin.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/library/table_builtin.m,v
> retrieving revision 1.11
> diff -u -b -r1.11 table_builtin.m
> --- library/table_builtin.m	2001/12/31 04:26:49	1.11
> +++ library/table_builtin.m	2002/01/14 10:11:50
> @@ -466,13 +484,17 @@
>  	[will_not_call_mercury],
>  "
>  	if (MR_io_tabling_enabled) {
> +		MR_Unsigned	old_counter;
> +
> +		old_counter = MR_io_tabling_counter;
> +
>  		MR_io_tabling_counter++;
>  
>  		if (MR_io_tabling_start < MR_io_tabling_counter 
>  			&& MR_io_tabling_counter <= MR_io_tabling_end)
>  		{
>  			T = (MR_Word) &MR_io_tabling_pointer;
> -			Counter = MR_io_tabling_counter;
> +			Counter = (MR_Word) old_counter;
>  			Start = MR_io_tabling_start;
>  			if (MR_io_tabling_counter > MR_io_tabling_counter_hwm)
>  			{

This is fixing a bug, I take it?  You should mention this change
in the log message.

Cheers,
Mark.

--------------------------------------------------------------------------
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