[m-rev.] For review: changes to declarative debugger (Part 1)
Ian MacLarty
maclarty at cs.mu.OZ.AU
Tue Nov 9 17:22:35 AEDT 2004
On Mon, Nov 08, 2004 at 02:55:46PM +1100, Zoltan Somogyi wrote:
> On 29-Sep-2004, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> > % setup_binary_search(SearchSpace, TopId, BottomId, Response,
> > % SearchMode).
> > % Sets up the search mode to do a binary search between BottomId
> > % and TopId.
> > %
> > :- pred setup_binary_search(search_space(T)::in, suspect_id::in,
> > suspect_id::in, search_mode::out) is det.
> >
> > setup_binary_search(SearchSpace, TopId, BottomId, SearchMode) :-
> > (
> > get_path(SearchSpace, BottomId, TopId, [], Path)
>
> Get_path should have a non-accumulator version. Its documentation should say
> on which side (front or back) the initial accumulator is appended.
>
Okay:
get_path(SearchSpace, BottomId, TopId, Path) :-
get_path(SearchSpace, TopId, BottomId, [], Path).
% get_path(SearchSpace, BottomId, TopId, PathSoFar, Path).
% Path = append(RemainingPath, PathSoFar) where RemainingPath is the
% path in the search space between TopId and BottomId, starting at
% TopId and ending at BottomId (inclusive). Fails if TopId is not an
% ancestor of BottomId.
%
:- pred get_path(search_space(T)::in, suspect_id::in, suspect_id::in,
list(suspect_id)::in, list(suspect_id)::out) is semidet.
I export the non-accumulator version.
Ian.
--------------------------------------------------------------------------
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