[m-dev.] add goal path at external ports

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Wed Jan 27 23:13:39 AEDT 1999


Fergus Henderson writes:
> 
> On 25-Jan-1999, Mark Anthony BROWN <dougl at cs.mu.OZ.AU> wrote:
> > I think I understand the difficulty.  Here is another problematic
> > example:
> > 
> > p(X, Y) :-
> > 	( c(X), c(Y) ->
> > 		d
> > 	;
> > 		e
> > 	).
> > 
> > If the condition fails, how do we know which call to c/1 failed?
> 
> By looking at the trace.

Okay, here's part of a possible trace (slightly abbreviated):

	2  2 CALL p (cc_multi)
	3  3 CALL c (semidet)
	3  3 FAIL c (semidet)
	2  2 ELSE p (cc_multi) e;
	4  3 CALL e (multi)
	4  3 EXIT e (multi)


Which call to c/1 failed?

Maybe it doesn't ever make any difference which one was
called, anyway.  I'll try to think of an example where it 
does matter.

> 
> Or by typing "retry", "step", and then "finish" at the mdb prompt.
> This will restart execution of p/2, step into the first call to c/1,
> and then run until that either succeeds or fails.  If it succeeds,
> then the second call must have been the one that failed.
> 
> Note however that "first" and "second" here refer to the order
> in which the compiler decided to execute them, which may not
> be the same as the order in the source code -- to be sure,
> you will have to either inspect the arguments of p and c,
> or look at the hlds dump.  Is that what you meant by the
> difficulty?
> 

Exactly.


Cheers,
Mark
-- 
Mark Brown  (dougl at cs.mu.oz.au)       )O+   |  For Microsoft to win,
MEngSc student,                             |  the customer must lose
Dept of Computer Science, Melbourne Uni     |          -- Eric S. Raymond



More information about the developers mailing list