[m-rev.] for review: fix nested atomic transactions and or_else alternatives

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Feb 25 23:30:39 AEDT 2009


On Mon, 23 Feb 2009, Ben Mellor wrote:

>
> Fix two bugs preventing the use of or_else alternatives to atomic
> transaction scopes and nested atomic scopes.
>
> The main issue was the assumption that the inner stm interface variables
> were the same for the main goal and the or_else goals, but quantification
> renames these variables to be distinct. The names of these variables for each
> or_else alternative are now stored in the atomic_goal structure.
>
>
> library/stm_builtin.m
>    Rename stm_from_outer_to_inner_io and stm_from_inner_to_outer_io, dropping
>    the _io suffix. They are used when the outer type is stm as well as io.
>
> compiler/hlds_goal.m
>    Add a field to the atomic_goal structure to hold the names of the STM
>    interface variables used in each or_else alternative, since quantification
>    renames these variables to be distinct from those used in the main atomic
>    goal.
>
> compiler/purity.m
>    Insert calls to the (renamed) dummy predicates stm_from_outer_to_inner and
>    stm_from_inner_to_outer regardless of the type of the outer variable,
>    instead of using the nonexistent stm_from_*_to_*_stm versions when the
>    outer type is stm. Also use the inner STM interface variables specific to
>    each or_else alternative when generating these calls.
>
> compiler/quantification.m
>    Explicitly rename the inner STM interface variables in each of the or_else
>    alternatives before calling implicitly_quantify_disj, so that the new names
>    of these variables can be stored in the atomic_goal structure.
>
> compiler/typecheck.m
>    Ensure all the inner STM interface variables are typed stm, not just the
>    ones in the main goal.

That looks okay -- you can go ahead and commit it provide it passes a
bootcheck.

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