[m-rev.] ssdb v1.0 fixed
Julien Fischer
juliensf at csse.unimelb.edu.au
Wed Dec 5 14:20:55 AEDT 2007
On Wed, 5 Dec 2007, Olivier Annet wrote:
> Estimated hours taken: 2
> Branches: main
>
> There are some modification for the nondet transformation. When a retry of a
> nondet procedure A is asked during the execution of the program, a choicepoint
> is left behind and the execution start the retry on procedure B. When the retry
> on B is finished, the compiler come back at the choicepoint and finish the call
> of the procedure A. This give a wrong number of event.
>
> The proposed solution is: when a retry is asked in a nondet procedure named A
> at an exit port, the debugger do not execute any operation until it reach the
> fail of the procedure A. It is only at this moment that the execution of B
> begin.
>
> If user use a predicate like solutions.unsorted_solutions, he will obtain more
> than one time the same solution. The use of solutions is right because it
> remove the duplicates
>
>
> Determinism failure tranformed:
>
> % detism_failure:
> %
> % p(...) :-
> % promise_<original_purity> (
> % (
> % CallVarDescs = [ ... ],
> % impure call_port(ProcId, CallVarDescs),
> % <original body>
> % ;
> % % preserve_backtrack_into
> % impure fail_port(ProcId, CallVarDescs, DoRetry),
> % (
> % DoRetry = do_retry,
> % p(...)
> % ;
> % DoRetry = do_not_retry,
> % fail
> % )
> % )
> % ).
>
>
> Determinism erroneous transformed:
> % p(...) :-
> % promise_<original_purity> (
> % (
> % CallVarDescs = [ ... ],
> % impure call_port(ProcId, CallVarDescs),
> % <original body>,
> % )
> % ).
>
>
> analysis/Mmakefile:
> Delete the LINK_STDLIB_ONLY=yes line as we need to link with the
> libmer_ssdb if source-to-source debugging is enabled.
>
> browser/util.m:
> At the browser prompt, use io.read_line_as_string instead of
> functions in the trace library to read input if the trace library is
> not linked in.
>
> compiler/mercury_compile.m:
> Move the ssdb transformation to after the higher order specialisation
> pass to work around a compiler abort. The higher order specialisation
> removes predicates which are used to "force the production of
> user-requested type specializations, since they are not called from
> anywhere and are no longer needed". Let `p' be such a procedure, and
> the specialised version be `p1'. Then remove `p'. But due to the ssdb
> transformation, `p1' will contain a call to `p', in order to support
> retry.
>
> I'm not sure where the ssdb transform should go. I assume as early as
> possible.
I think the opposite is probably true.
> compiler/ssdebug.m:
> - Transform procedures with `failure' and `erroneous' determinisms.
> - Funny modes are not managed
> I think we can and should handle `unused' arguments as well, but
> later.
>
> profiler/Mmakefile:
> Link with the mer_ssdb library.
>
> ssdb/Mercury.options:
> Link with the mer_browser library to support browsing of terms.
>
> ssdb/ssdb.m:
> - 4 new event for the nondet procedure are now use. They are :
> ssdb_call_nondet, ssdb_exit_nondet, ssdb_fail_nondet,
> and ssdb_redo_nondet. In the same way, an different event handler
> has been created to managed each of them.
> The ssdb_redo event was no more useful.
> - The old structure debugger_state has been divided in different
> mutable variables to allow more flexibility.
> - The old breakpoint list are now a map with (module_name, pred_name)
> as key and the breakpoint structure as value.
> - The depth is now compute with the stack depth, it is easier to manage
> and more flexible.
> - Some new command have been added: delete/enable/disable breakpoint,
> break info, finish N, retry N, browse X
>
> tests/.mgnuc_copts.ws:
> tests/WS_FLAGS.ws:
> Search in the ssdb directory for header files.
...
> Index: analysis/Mmakefile
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/analysis/Mmakefile,v
> retrieving revision 1.8
> diff -u -r1.8 Mmakefile
> --- analysis/Mmakefile 4 Dec 2007 13:50:58 -0000 1.8
> +++ analysis/Mmakefile 5 Dec 2007 02:03:05 -0000
> @@ -7,7 +7,7 @@
> # inter-module analysis library.
>
> MERCURY_DIR=..
> -LINK_STDLIB_ONLY=yes
> +# LINK_STDLIB_ONLY=yes
> include $(MERCURY_DIR)/Mmake.common
If the intention is to delete it (as per the log message), then delete it,
don't just comment it out. If you feel it is worth leaving in place add
a comment explaining *why* it has been commented out.
...
> %-----------------------------------------------------------------------------%
> Index: profiler/Mmakefile
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/profiler/Mmakefile,v
> retrieving revision 1.30
> diff -u -r1.30 Mmakefile
> --- profiler/Mmakefile 4 Dec 2007 13:51:00 -0000 1.30
> +++ profiler/Mmakefile 5 Dec 2007 02:03:08 -0000
> @@ -17,6 +17,8 @@
> MAIN_TARGET=all
> MERCURY_MAIN_MODULES=mercury_profile
>
> +VPATH = $(LIBRARY_DIR) $(SSDB_DIR)
> +
> #-----------------------------------------------------------------------------#
Is there a reason a similar change is not necessary in the deep_profiler
directory?
Julien.
--------------------------------------------------------------------------
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