[m-rev.] for review: atomic scope fixes

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Nov 6 11:40:26 AEDT 2009


On Thu, 5 Nov 2009, Peter Wang wrote:

> Branches: main
>
> Fix some problems with `atomic' scopes.  In particular, state variables in
> atomic scopes now works (again?)
>
> compiler/hlds_goal.m:
> compiler/saved_vars.m:
>        Add a goal feature to indicate when a goal within an atomic scope has
>        stm_from_outer_to_inner/stm_from_inner_to_outer calls added.
>
> compiler/quantification.m:
>        Add a predicate to quantify goals inside an atomic scope.
>        Quantification may occur before the calls to stm_from_*_to_* are
>        inserted.  If that is not taken into account, the nonlocal set for
>        an atomic goal won't include its inner interface variables, causing
>        problems (e.g. variables being renamed away).
>
>        Don't explicitly delete inner variables from the nonlocal vars of
>        atomic scope; this has no effect.  [Also, it only deleted the inner
>        variables for the main atomic goal.  The inner variables of the or_else
>        goals probably needed to be deleted as well.]
>
> compiler/purity.m:
>        Remove code that checks STM inner variables are not used outside of the
>        atomic scope, and outer variables not used within.  The changes in
>        quantification.m broke the assumption that inner variables don't appear
>        in the nonlocals of their respective atomic goals.  Mode checking
>        should catch the same errors anyway.
>
>        Add the new goal feature after inserting stm_from_*_to_* calls.
>
> compiler/state_var.m:
>        In svar_start_inner_atomic_scope, return the "dot" variable as inner
>        `di' variable.  Before, it returned the "colon" variable which resulted
>        in an incorrect ordering in the expanded goal.
>
>        In svar_finish_inner_atomic_scope, use the "dot" variable as the
>        inner `uo' variable.
>
> compiler/typecheck.m:
>        Unify the types of the outer variables on an atomic scope.
>
> tests/stm/Mmakefile:
> tests/stm/atomic_conj.exp:
> tests/stm/atomic_conj.m:
> tests/stm/atomic_ite.exp:
> tests/stm/atomic_ite.m:
>        Add test cases.

That looks fine.

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