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: runtime primitives for mpz objects #6395

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tydeu
Copy link
Member

@tydeu tydeu commented Dec 16, 2024

This PR adds a basic C API interface for Lean MPZ objects. It includes constructors, conversions, and comparison operators.

These primitives are necessary to correctly and efficiently model runtime MPZ objects in Lean.

Where applicable, existing APIs were adjusted to use the new interface.

@tydeu tydeu force-pushed the lean-mpz-primitives branch 3 times, most recently from 69ed417 to 4a08e12 Compare December 16, 2024 02:43
@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 Dec 16, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 16, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Dec 16, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Dec 16, 2024

Mathlib CI status (docs):

@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Dec 16, 2024
@tydeu tydeu marked this pull request as ready for review December 16, 2024 04:07
@tydeu tydeu added the changelog-library Library label Dec 16, 2024
@tydeu tydeu marked this pull request as draft December 16, 2024 04:13
@leodemoura
Copy link
Member

Recall that we should be able to build Lean with and without GMP: https://github.com/leanprover/lean4/blob/master/src/CMakeLists.txt#L77

@tydeu
Copy link
Member Author

tydeu commented Dec 16, 2024

@leodemoura Yep! The good news is that these primitives are abstracted above the MPZ implementation. (They work with either GMP or our homegrown multiple precision integer implementation.)

@tydeu tydeu force-pushed the lean-mpz-primitives branch from e453b34 to ea15ca7 Compare December 16, 2024 04:45
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 16, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Dec 16, 2024
@tydeu tydeu force-pushed the lean-mpz-primitives branch from ea15ca7 to dc5e674 Compare December 16, 2024 05:24
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 16, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Dec 16, 2024
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.

3 participants