[m-rev.] for review: trace goals

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Jul 27 14:01:38 AEST 2006


On Thu, 27 Jul 2006, Zoltan Somogyi wrote:

> Implement the trace goal construct we discussed, for now for the LLDS backends
> only.
>
> Since the syntax of trace goals is non-trivial, useful feedback on syntax
> errors inside trace goal attributes is essential. With the previous setup,
> this wasn't possible, since the code that turned terms into parse tree goals
> turned *all* terms into goals; it couldn't recognize any errors, sweeping
> them under the rug as calls. This diff changes that. Now, if this code
> recognizes a keyword that indicates a particular construct, it insists on
> the rest of the code following the syntax required for that construct, and
> returns error messages if it doesn't.
>
> We handle the trace goal attributes that specify state variables to be
> threaded through the trace goal (either the I/O state or a mutable variable)
> in add_clause.m, at the point at which we transform the list of items to the
> HLDS.  We handle the compile-time condition on trace goals in the invocation
> of simplify at the end of semantics analysis, by eliminating the goal if the
> compile-time condition isn't met. We handle run-time conditions on trace
> goals partially in the same invocation of simplify: we transform trace goals
> with runtime conditions into an if-then-else with the trace goal as the then
> part and `true' as the else part, the condition being a foreign_proc that is
> handled specially by the code generator, that special handling being to
> replace the actual code of the foreign_proc (which is a dummy) with the
> evaluation of the runtime condition
>
> Since these changes require significant changes to some of our key data
> structures, I took the liberty of doing some renaming of function symbols
> at the same time to avoid using ambiguities with respect to language keywords.

I've had a quick look through the diff and it seems okay - I'll take a
more detailed look at it after you have committed it (and posted the
documentation.)

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list