[mercury-users] Paper on Mercury from AI practitioner's standpoint

Ralph Becket rafe at cs.mu.OZ.AU
Fri Jan 14 10:07:18 AEDT 2005


Gregory D. Weber, Thursday, 13 January 2005:
> 
> I was using 0.11, which has been the current release for about two
> years.  I did this programming last summer, and it is hard to
> remember the details about how I used the debugger.  On first
> reading your comment, I did not remember using the "set depth"
> command or the term browser.  But on further reflection I think
> I may have done that.  I think what I wanted the debugger to
> do was print _selective_ information, and using set depth,
> I could control the amount of information, but it was sometimes
> either too little or too much -- for example on a call such
> as foo(a, [b, c, d, e, f], g, [[h], [i]]), I might want to
> see something like "Entered foo with X = d, Y = f, Z = h.

One way to do this sort of thing without plumbing IO through your
program is to add as the first goal of foo a call to an auxiliary
predicate foo_called_with(X, Y, Z), then just trace foo_called_with/3 in
the debugger.

If you compile with -O0 then foo_called_with/3 shouldn't be optimised
away.

> But I think that if we have a sequence of calls
> 
> main --> p1 --> p2 --> ... --> p10,
> 
> and p10 does some I/O, then each of the predicates p1 ... p10
> needs to be declared with a pair of io__state variables,
> whether using state variable syntax or not, right?

That's right - you have to plumb the IO state all the way down
to where you need it.

Cheers,
-- Ralph
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list