mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 06:14:59 +00:00
Handle quantification analysis of bi-implication (`<=>') goals correctly.
Estimated hours taken: 10
Handle quantification analysis of bi-implication (`<=>') goals correctly.
Previously we used to expand bi-implications before doing quantification
analysis, which stuffed up the results of quantification analysis for
those goals. We need to do quantification analysis first, and only
then can we expand bi-implications. In addition, elimination of double
negation needs to come after expansion of bi-implication, so I moved
that from make_hlds.m to purity.m.
compiler/hlds_goal.m:
Add a new alternative to the HLDS goal type for bi-implications.
Also add a new predicate negate_goal, for use by purity.m.
compiler/make_hlds.m:
Don't expand bi-implication here, instead just use the new
bi_implication/2 HLDS goal type.
Don't eliminated double negation here.
compiler/quantification.m:
Handle quantification for bi-implications.
Expand bi-implications.
compiler/purity.m:
Eliminate double negation.
compiler/hlds_out.m:
Add code to print out bi-implication goals.
compiler/*.m:
Trivial changes to handle the new bi_implication/2
alternative in the HLDS goal type.
compiler/notes/compiler_design.html:
Document the above changes.
tests/hard_coded/Mmakefile:
tests/hard_coded/quantifier2.m:
tests/hard_coded/quantifier2.exp:
A regression test for the above change.
This commit is contained in:
@@ -255,6 +255,9 @@ lambda__process_goal_2(call(A,B,C,D,E,F), GoalInfo,
|
||||
lambda__process_goal_2(pragma_c_code(A,B,C,D,E,F,G), GoalInfo,
|
||||
pragma_c_code(A,B,C,D,E,F,G) - GoalInfo) -->
|
||||
[].
|
||||
lambda__process_goal_2(bi_implication(_, _), _, _) -->
|
||||
% these should have been expanded out by now
|
||||
{ error("lambda__process_goal_2: unexpected bi_implication") }.
|
||||
|
||||
:- pred lambda__process_goal_list(list(hlds_goal), list(hlds_goal),
|
||||
lambda_info, lambda_info).
|
||||
|
||||
Reference in New Issue
Block a user