Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unsound contract equality fast check (#1703)
* Fix unsound ptr eq check in contract equality For performance reason, the contract equality checker performs a quick pointer check to see if the two terms to compare are physically equal. In this case, it used to return `true` directly, eschewing more costly recursive checks. However, this is unsound, because the same term (physically) might be in two different environments, and have two different values. This is typically the case with function application: when evaluating `f 1` and `f 2`, both terms will physically point to the body of `f`, but in a different environment. Thus, we also need to ensure that environment are equals as well in this quick check. This commit adds a fast `ptr_eq` check to the environment as well, and now checks that both terms and their respective environments are pairwise physically equals. Passing by, this commits also fix unrelated clippy warning, after the udpate to clippy 1.73. * Add regression test for #1700 * Implement env equality during typechecking * Cosmetic renaming and slight rework of comments * Fix contract test by deeply evaluating it * Remove confusing comments
- Loading branch information