[m-dev.] trace goal `state' parameters

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Mar 16 08:51:10 AEDT 2007

On Fri, 16 Mar 2007, Ondrej Bojar wrote:

> Hi,
> I'm not sure if I understand correctly. Your plan is to disallow:
> :- mutable(my_mut, my_mut_type, my_mut_init, ground, [untrailed]).
>  ...
>  trace[state(my_mut, !M)] TraceGoal(!M),
>  ...
> but this would still work:
>  ...
>  trace [] some [!M] (
>    get_my_mut(!:M),
>    TraceGoal(!M),
>    set_my_mut(!.M)
>  ),
>  ...
> If I'm correct, I cannot object to the change proposed, all I would need to 
> do is a couple of code tweaking to get the same functionality.
> If the second example does not work now or will not work later, please let me 
> know how to write it correctly.

My plan is to disalow the first since the visibilty restrictions on
mutables aren't really compatible with their use as trace goal
parameters in multi-module programs.

Your second example won't work because (1) it contains a syntax error
and (2) the list of parameters is empty.

A working version is:g

 	trace [io(!IO)] (
 		some [!M] (

A possible extensions to trace goal syntax would be to push the
existential quantification used to introduce the state variable into
the parameter list, e.g.

 	trace [some(!M)] (

but that is incidental to what I am trying to address here.

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

More information about the developers mailing list