-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(simplify): Correct regression in simplify (#2394)
* fix(simplify): Correct regression in simplify Also adds a 'debugConsole' option to simplify() so that it is possible to see the effect of each rule. This was critical to identifying the problem, which was that recent changes ended up with `simplifyConstant` in the wrong position in the list of rules. Correcting that also removed the need for the two rules coalescing negations with constants. Resolves #2393. * fix(simplify): Correct another regression based on rule ordering Disccovered that `x - (y-y+x)` had also stopped simplifying due to recent changes, again because of re-ordering of the rules. So added it to the tests, and fixed the rule ordering (adding a more extensive comment about it). A big part of the reason that rule ordering is so sensitive is that the reduction engine only checks once in each pass for each rule whether it matches. So an alternate fix to changing the rule ordering back would have been to re-check each rule after it's applied (in case its application created new instances of the rule) but since the re-ordering worked, that seemed simpler as a fix for now.
- Loading branch information
Showing
2 changed files
with
34 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters