-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit removes checking constraints from synonym expansion, so the type: ``` type foo('n), 'n >= 32 = bar('n) ``` when appearing as `foo(N)` will just expand directly to `bar(N)` without checking `N >= 32`. This is possible because the well-formedness check already checks this, i.e. `foo(N)` is well-formed only if `N >= 32` holds, so we don't need to check again when we do the expansion. This fixes a bug where synonym expansion wasn't handling existentials correctly.
- Loading branch information
Showing
4 changed files
with
41 additions
and
35 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
[93mType error[0m: | ||
[96mfail/negative_bits_union.sail[0m:6.10-22: | ||
6[96m |[0m Bar : bits('n - 2), | ||
[91m |[0m [91m^----------^[0m | ||
[91m |[0m Could not prove constraints ('n - 2) >= 0 in type synonym bitvector(('n - 2)) with | ||
[96mfail/negative_bits_union.sail[0m:5.0-7.1: | ||
5[96m |[0munion Foo('n: Int) = { | ||
[91m |[0m[91m^---------------------[0m | ||
7[96m |[0m} | ||
[91m |[0m[91m^[0m | ||
[91m |[0m Types are not well-formed within this type definition. Note that recursive types are forbidden. | ||
[91m |[0m | ||
[91m |[0m [93mCaused by [0m[96mfail/negative_bits_union.sail[0m:6.10-22: | ||
[91m |[0m 6[96m |[0m Bar : bits('n - 2), | ||
[91m |[0m [91m |[0m [91m^----------^[0m | ||
[91m |[0m [91m |[0m Well-formedness check failed for type | ||
[91m |[0m [91m |[0m | ||
[91m |[0m [91m |[0m [93mCaused by [0m[96mfail/negative_bits_union.sail[0m:6.10-14: | ||
[91m |[0m [91m |[0m 6[96m |[0m Bar : bits('n - 2), | ||
[91m |[0m [91m |[0m [91m |[0m [91m^--^[0m | ||
[91m |[0m [91m |[0m [91m |[0m Could not prove ('n - 2) >= 0 for type constructor bits |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
[93mType error[0m: | ||
[96mfail/negative_bits_union2.sail[0m:8.10-22: | ||
8[96m |[0m Bar : bits('n - 2), | ||
[91m |[0m [91m^----------^[0m | ||
[91m |[0m Could not prove constraints ('n - 2) >= 0 in type synonym bitvector(('n - 2)) with | ||
[96mfail/negative_bits_union2.sail[0m:7.0-10.1: | ||
7 [96m |[0munion Foo('n: Int) = { | ||
[91m |[0m[91m^---------------------[0m | ||
10[96m |[0m} | ||
[91m |[0m[91m^[0m | ||
[91m |[0m Types are not well-formed within this type definition. Note that recursive types are forbidden. | ||
[91m |[0m | ||
[91m |[0m [93mCaused by [0m[96mfail/negative_bits_union2.sail[0m:8.10-22: | ||
[91m |[0m 8[96m |[0m Bar : bits('n - 2), | ||
[91m |[0m [91m |[0m [91m^----------^[0m | ||
[91m |[0m [91m |[0m Well-formedness check failed for type | ||
[91m |[0m [91m |[0m | ||
[91m |[0m [91m |[0m [93mCaused by [0m[96mfail/negative_bits_union2.sail[0m:8.10-14: | ||
[91m |[0m [91m |[0m 8[96m |[0m Bar : bits('n - 2), | ||
[91m |[0m [91m |[0m [91m |[0m [91m^--^[0m | ||
[91m |[0m [91m |[0m [91m |[0m Could not prove ('n - 2) >= 0 for type constructor bits |