[m-dev.] for review: merge HAL branch onto main branch

David Jeffery dgj at cs.mu.OZ.AU
Mon Feb 19 15:57:05 AEDT 2001


On 19-Feb-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> > % This dummy layout should never actually be referenced; the ptag that
> > % this layout refers to should never actually be used by Mercury.
> 
> It will be referenced by the runtime system in HAL grades.

Well, it won't be accessed by anything in the Mercury runtime. Values that
are being treated by the Herbrand solver only ever have their structure
examined by C code generated by the HAL compiler. (At some stage in the future,
we hope to abstract this low-level code a little in order to port to the
other back ends, but for now things are very much geared towared the low level
C representation).

At the point at which the programmer asserts that a value is ground, its
instantiation goes from `any' to ground. Hmmmm, I just checked the code that
HAL executes for this case... it checks that the top level functor is bound
but does not traverse the whole structure. I guess this is fair, given the
likely performance impact. It does mean that I'll need to handle the case
where a `var' turns up where it shouldn't (from the user giving a bogues 
promise) more carefully.

> In general, you need to mark ptags reserved for HAL with a distinctive mark,
> maybe a fourth MR_SECTAG_xxx value (maybe MR_SECTAG_HAL_VAR), and teach the
> various routines the runtime and library directories how to handle it.
> For now, the "handling" may consist of aborting; you can put in real code over
> time, as you need the facilities.

That may be the most robust approach.


dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) | If your thesis is utterly vacuous
PhD student,                    | Use first-order predicate calculus.
Dept. of Comp. Sci. & Soft. Eng.|     With sufficient formality
The University of Melbourne     |     The sheerist banality
Australia                       | Will be hailed by the critics: "Miraculous!"
                                |     -- Anon.
--------------------------------------------------------------------------
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