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

Ian MacLarty maclarty at cs.mu.OZ.AU
Fri Jan 14 14:17:26 AEDT 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.
> I really need to get back and do some debugging again to
> refresh my memory!

If your at the exit/call event for the atom foo(a, [b, c, d, e, f], g, 
[[h], [i]]) then the following print commands would do the job:

        3:      2  2 CALL pred greg.foo/4-0 (semidet) greg.m:15 
(greg.m:21)
mdb> p
foo(a, [b, c, d, e, f], g, [[h], [i]])
mdb> p 2/2/2/1
        HeadVar__2
d
mdb> p 2/2/2/2/2/1
        HeadVar__2
f
mdb> p 4/1/1
        HeadVar__4
h

If you have a very deep list you can use the cdr command from the 
browser:
mdb> browse 2
browser> cdr 4 2
browser> p
[f]
browser>

If you're accessing a structure with field names you can use the field 
names instead of the argument numbers for the above commands.

Ian.

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