[m-dev.] Re: retrieving arguments in the trace

Peter Schachte pets at students.cs.mu.oz.au
Thu Oct 30 11:57:37 AEDT 1997


> Zoltan Somogyi wrote:
> > Erwan wrote:
> > > By the way, is there presently a way to retrieve the source level
> > > variable names ? We thought that maybe code_info_get_varset could do
> > > it ??
> > 
> > In what context do you want to do it? code_info__get_varset is the right
> > way for code within the code generator, but code_info structures don't exist
> > in the front end, in the optimizer, or at runtime.
> > 
> > If you are after the names of the arguments, that information does not
> > exist anywhere in the system. Different clause heads may refer to the
> > same argument by different variable names, or some/all clauses may have
> > a term in a given argument position, so there is no natural correspondence
> > between argument positions and variable names. Even if it so happens that
> > all clauses refer to a given position by the same name, the compiler does
> > not know this. Instead, it always refers to the arguments by variables named
> > HeadVar__1, HeadVar__2, etc, which in the body are unified with whatever term
> > occupied that position in the head.

Can you use the hlds_goal_info to find the source clause each goal comes
from?  If so, and if the clauses_info contains the variable names from the
source clauses, then you should be able to get source variable names.

If it's at all possible, I think it would be very worthwhile to be able to
see source variable names during debugging.


-Peter Schachte			| Some lies are so well disguised to resemble
pets at cs.mu.OZ.AU		| truth, that we should be poor judges of the
http://www.cs.mu.oz.au/~pets/	| truth not to believe them. -- Anonymous 
PGP key available on request	| 




More information about the developers mailing list