[m-dev.] Type info convention
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Nov 20 23:11:17 AEDT 2000
On 20-Nov-2000, Peter Ross <peter.ross at miscrit.be> wrote:
> On Sat, Nov 18, 2000 at 12:42:35AM +1100, Fergus Henderson wrote:
> > 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.
What do you mean by "hidden"?
What distinguishes "hidden" arguments from other 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.
Why not apply structure reuse/possible alias information for
all arguments?
> :- 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.
I still don't understand why you care which arguments are "hidden"
and which are "real", or even what criteria you would use to decide
which is which.
It might help if you explained the intended semantics of the
`pa_alias_info' pragmas.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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