-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2417 from ucsd-progsys/NumDef
define nums
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{- | ||
Without the | ||
define GHC.Internal.Num.fromInteger x = (x) | ||
define GHC.Num.Integer.IS = (x) | ||
this program crashes with: | ||
Illegal type specification for `NumRefl.toNum` | ||
NumRefl.toNum :: forall p . | ||
(Num<[]> p) => | ||
lq1:() -> {VV : p | VV == NumRefl.toNum lq1 | ||
&& VV == (-GHC.Internal.Num.fromInteger (GHC.Num.Integer.IS 1))} | ||
Sort Error in Refinement: {VV : p##aMJ | VV == NumRefl.toNum lq1 | ||
&& VV == (-GHC.Internal.Num.fromInteger (GHC.Num.Integer.IS 1))} | ||
The sort @(176) is not numeric | ||
Because the resule type (Num p) => p cannot be decided to be a numeric type. | ||
-} | ||
|
||
module NumRefl where | ||
|
||
{-@ reflect toNum @-} | ||
toNum :: Num p => () -> p | ||
toNum _ = -1 | ||
|
||
|
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