Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify inf - x to inf #1742

Merged
merged 5 commits into from
Sep 4, 2024
Merged

Simplify inf - x to inf #1742

merged 5 commits into from
Sep 4, 2024

Conversation

yav
Copy link
Member

@yav yav commented Sep 3, 2024

This PR fixes issue #1741, adding an extra simplification rule to the type checker.

Copy link
Contributor

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure to:

  • Add a test case where this simplification rule is important.
  • Mention this change in the CHANGELOG, since this is a user-facing change.

src/Cryptol/TypeCheck/SimpType.hs Show resolved Hide resolved
src/Cryptol/TypeCheck/SimpType.hs Show resolved Hide resolved
@@ -113,6 +113,7 @@ tSub :: Type -> Type -> Type
tSub x y
| Just t <- tOp TCSub (op2 nSub) [x,y] = t
| tIsInf y = tError (tf2 TCSub x y)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we assume the precondition that the second argument (y) is finite, then this case must be unreachable, right?

src/Cryptol/TypeCheck/SimpType.hs Outdated Show resolved Hide resolved
src/Cryptol/TypeCheck/SimpType.hs Outdated Show resolved Hide resolved
src/Cryptol/TypeCheck/SimpType.hs Outdated Show resolved Hide resolved
@yav yav merged commit c73d1d8 into master Sep 4, 2024
48 checks passed
@yav yav deleted the issue_1741 branch September 4, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants