[m-dev.] Type info convention

Peter Ross peter.ross at miscrit.be
Mon Nov 20 21:39:18 AEDT 2000


On Sat, Nov 18, 2000 at 12:42:35AM +1100, Fergus Henderson wrote:
> On 17-Nov-2000, Peter Ross <peter.ross at miscrit.be> wrote:
> > The work done by Simon on the type spec change causes a few problems for
> > structure reuse.  This is because type_info's are a `hidden' type, ie
> > they don't appear in mode declarations. 
> 
> The polymorphism pass adjusts the mode declarations in the HLDS
> so that they include type_infos.
> 
> > Simons latest changes places
> > some new type infos at the end of the headvars, making it very hard to
> > determine which headvars are `real'.
> 
> Could you be more specific?  Which change of Simon's?
> Have you got a simple example program which demonstrates this?
> 
> Type_infos with type `private_builtin:type_info' are compiler-introduced.
> Type_infos with type `std_util:type_desc' are "real".
> 
> But why do you care?
> 
I don't, Nancy does. ;)

The problem is that Simons type specialization changes add some more
`hidden' arguments.

For example the specialization of list__merge from the std lib.

% V_16 (number 16) :: (private_builtin:type_info(V_V_2))
% V_17 (number 17) :: (private_builtin:type_ctor_info((term:var(V_V_2))))
:- mode 'TypeSpecOf__pred__merge__[T = var(V_2)]'((builtin:in), (builtin:in), (builtin:in), (builtin:out), (builtin:in), (builtin:in)) is det.
mylist:'TypeSpecOf__pred__merge__[T = var(V_2)]'(TypeInfo_for_T, HeadVar__1, HeadVar__2, HeadVar__3, V_17, V_16) :-

These two new introduced arguments V_16 and V_17 are placed at the end
of the argument list and are what I have called `hidden' arguments.

However Nancys structure reuse declarations require that we know the
variable names for each of the `real' arguments, so that we can use this
name as a key to determine the structure reuse/possible alias
information for that argument.

:- pragma pa_alias_info(list:'TypeSpecOf__pred__merge__[T = var(V_2)]'((builtin:in), (builtin:in), (builtin:out)), vars(HeadVar__3, V_17, V_16), yes([pair( cel(HeadVar__3, []) , cel(HeadVar__2, []) ) , pair( cel(HeadVar__3, []) , cel(HeadVar__1, []) ) , pair( cel(HeadVar__1, []) , cel(HeadVar__2, []) ) ])).


As you can see from the above declaration, we think that the real
arguments are vars(HeadVar__3, V_17, V_16) yet we refer the HeadVar__1
and HeadVar__2 in the possible alias information.

Pete
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list