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

feat: non-opaque UInt64.toUSize #6202

Merged
merged 1 commit into from
Nov 25, 2024
Merged

Conversation

tydeu
Copy link
Member

@tydeu tydeu commented Nov 24, 2024

This PR makes USize.toUInt64 a regular non-opaque definition.

It also moves it to Init.Data.UInt.Basic, as it is not actually used in Init.Prelude anymore.

@tydeu
Copy link
Member Author

tydeu commented Nov 24, 2024

It is not entirely clear to me whether these definitions belong in Init.Data.UInt.Basic or Init.Data.UInt.BasicAux, because I do not know what the meta code BasicAux refers to is. I placed them in Init.Data.UInt.Basic because that is where the corresponding UInt32.toUSize and USize.toUInt32 definitions are.

@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Nov 24, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 24, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 24, 2024
@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Nov 24, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Nov 24, 2024

Mathlib CI status (docs):

@tydeu tydeu added the release-ci Enable all CI checks for a PR, like is done for releases label Nov 24, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 24, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 24, 2024
@digama0
Copy link
Collaborator

digama0 commented Nov 24, 2024

It is not entirely clear to me whether these definitions belong in Init.Data.UInt.Basic or Init.Data.UInt.BasicAux, because I do not know what the meta code BasicAux refers to is. I placed them in Init.Data.UInt.Basic because that is where the corresponding UInt32.toUSize and USize.toUInt32 definitions are.

As far as I am aware, the only reason BasicAux exists is because of bootstrapping / import cycle issues. So if you got it to compile in Basic then I think that's fine. (If you would like to find out why this division exists, I encourage you to try merging the two files and see what goes wrong.)

@tydeu tydeu removed the release-ci Enable all CI checks for a PR, like is done for releases label Nov 24, 2024
tweak `UInt64.toUSize` def
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 24, 2024
@tydeu tydeu marked this pull request as ready for review November 24, 2024 23:07
@tydeu tydeu requested a review from kim-em as a code owner November 24, 2024 23:07
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 24, 2024
@tydeu tydeu added the changelog-library Library label Nov 24, 2024
@hargoniX
Copy link
Contributor

As far as I am aware, the only reason BasicAux exists is because of bootstrapping / import cycle issues. So if you got it to compile in Basic then I think that's fine.

Correct. The import cycle here is due to the fact that some UIntX stuff is used in conjunction with Array and from there with Syntax. For example the definition of the existential binder requires some UIntX stuff to already exist.

@hargoniX hargoniX added this pull request to the merge queue Nov 25, 2024
Merged via the queue into leanprover:master with commit 935fcfb Nov 25, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR changelog-library Library toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants