mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 03:13:40 +00:00
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.
12 lines
23 B
Plaintext
12 lines
23 B
Plaintext
10
|
|
9
|
|
8
|
|
7
|
|
6
|
|
5
|
|
4
|
|
3
|
|
2
|
|
1
|
|
0
|