Skip to content

feat: Float.Model#14079

Open
TwoFX wants to merge 8 commits into
leanprover:masterfrom
TwoFX:julia/float-model
Open

feat: Float.Model#14079
TwoFX wants to merge 8 commits into
leanprover:masterfrom
TwoFX:julia/float-model

Conversation

@TwoFX

@TwoFX TwoFX commented Jun 16, 2026

Copy link
Copy Markdown
Member

This PR adds types Float.Model and Float32.Model which will serve as logical models for the Float and Float32 types.

This PR contains just the implementation; we don't actually set it as the logical model yet. This will happen in a follow-up PR.

Further documentation will follow. For now, just the following information: the logical model will never support all of the operations that the native Float type supports. In this PR, we support the following operations: add, sub, mul, div, sqrt, abs, neg, isNaN, isInf, isFinite, le, lt, beq, ofInt, ofNat, ofIntX, ofUIntX, toIntX, toUIntX. Additional operations might follow in the future.

Extensive testing infrastructure is in place validating the model implementation against the native one using difficult test cases generated using Berkeley TestFloat and UCBTest.

@TwoFX TwoFX requested review from kim-em and tydeu as code owners June 16, 2026 15:18
@TwoFX TwoFX added the changelog-library Library label Jun 16, 2026
@TwoFX TwoFX added the release-ci Enable all CI checks for a PR, like is done for releases label Jun 16, 2026
@tydeu tydeu removed their request for review June 16, 2026 17:45

/--
A floating point format is specified by two pieces of information: the number
of bits in the mantissa, and the range of the exponent, which is represented by

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Out of date comment

@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 Jun 16, 2026
@mathlib-lean-pr-testing

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 99683cc4dbbf60324235b721c81e0bd8ca4c3b69 --onto 4792cd22887c8b529a351f6563b693426ff2a8f8. You can force Mathlib CI using the force-mathlib-ci label. (2026-06-16 18:26:33)

@leanprover-bot

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 99683cc4dbbf60324235b721c81e0bd8ca4c3b69 --onto 803553a556fd82fa1060efb0c43eda542130cb16. You can force reference manual CI using the force-manual-ci label. (2026-06-16 18:26:34)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-library Library release-ci Enable all CI checks for a PR, like is done for releases 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.

2 participants