mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 20:33:55 +00:00
Estimated hours taken: 12 Branches: main, release Fix a bug causing tests/hard_coded/unify_existq_cons to fail. Ensure that if a solver variable is initialised by some branches of a disjunction, then it is initialised by all branches. Make a similar guarantee for the branches of if-then-else goals. compiler/modecheck_unify.m: Move a call to mode_info_get_var_types so that it retrieves the VarTypes map at the right point. I had moved this call to the start of the clause, but it turns out that new prog_vars may be introduced in the body of the clause and it is important to have the up-to-date VarTypes including these variables. My earlier change broke the hard_coded/unify_existq_cons test case, which is now fixed. compiler/modes.m: Change modecheck_goal_expr to handle solver variables that should be initialised at the ends of disjunction branches or if-then-else branches. Added various support predicates and functions. Changed modecheck_disj_list so that it does not flatten nested disjunctions. This ensures that the number of disjuncts and the number of instmaps returned by modecheck_disj_list are the same. A new function, flatten_disjs, is then used to flatten nested disjunctions into one. tests/hard_coded/Mmakefile: tests/hard_coded/solver_disj_inits.m: tests/hard_coded/solver_disj_inits.exp: tests/hard_coded/solver_ite_inits.m: tests/hard_coded/solver_ite_inits.exp: Added test cases.
4 lines
6 B
Plaintext
4 lines
6 B
Plaintext
0
|
|
1
|
|
1
|