[m-rev.] for review: a better approximation to rational debugging
Mark Brown
mark at cs.mu.OZ.AU
Fri Jul 8 19:01:40 AEST 2005
On 06-Jul-2005, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> + Node = exit(_, CallId, _, _, _, _, _)
> + ->
> + %
> + % Only include an exit node as a missing answer child
> + % if it produces output. If the exit event doesn't
> + % produce output then the only way the call could have
> + % behaved differently is by failing, which won't change
> + % the FAIL, NEGS or ELSE anchoring the end of the
> + % current stratum.
...<thinks>...
Ok, that's right. But I would add "since the rest of the goal failed anyway"
to the end of that last sentence.
> + %
> + ( calls_arguments_are_all_ground(Store, CallId) ->
> + Ns1 = Ns0
> + ;
> + Ns1 = [dynamic(NodeId) | Ns0]
> + )
> + ;
> %
> - % This handles the following cases:
> - % redo, switch, first_disj, later_disj and
> - % then. Also handles cond when the status
> - % is anything other than failed.
> + % This handles the following cases: redo, switch,
> + % first_disj, later_disj, then and neg_succ. Also
> + % handles cond when the status is anything other than
> + % failed. We skip neg_succ nodes since they cannot
> + % bind anything, so could not be the cause of the
> + % FAIL, NEGS or ELSE anchoring the end of the
> + % current stratum.
Also add that here, or else change it to "We skip neg_succ nodes for the
same reason that we skip exit nodes where there are no outputs (see above)"
or something like that.
> +:- pred calls_arguments_are_all_ground(S::in, R::in) is semidet
> + <= annotated_trace(S, R).
> +
> +calls_arguments_are_all_ground(Store, CallId) :-
> + call_node_from_id(Store, CallId, Call),
> + Args = Call ^ call_atom_args,
> + %
> + % XXX The following won't work for partially instantiated arguments.
> + %
> + all [Arg] (
> + (
> + list.member(Arg, Args),
> + Arg = arg_info(yes, _, _)
> + )
Restricting the test to programmer visible arguments is unnecessary, and
possibly harmful (I can't think of any examples that would make any
difference at the moment, but if there ever were any cases where it would
make a difference in future then the above test would be wrong).
> + =>
> + Arg = arg_info(_, _, yes(_))
> + ).
Other than that (and assuming bootchecking passed in other grades) this
looks fine.
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