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

Miscompilation of UInt64.modn #5818

Closed
3 tasks done
TwoFX opened this issue Oct 23, 2024 · 0 comments · Fixed by #5901
Closed
3 tasks done

Miscompilation of UInt64.modn #5818

TwoFX opened this issue Oct 23, 2024 · 0 comments · Fixed by #5901
Labels
bug Something isn't working P-high We will work on this issue

Comments

@TwoFX
Copy link
Member

TwoFX commented Oct 23, 2024

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

The code

lean4/src/runtime/object.cpp

Lines 1559 to 1562 in 174a5f3

extern "C" LEAN_EXPORT uint64 lean_uint64_big_modn(uint64 a1, b_lean_obj_arg) {
// TODO(Leo)
return a1;
}

fails if the second argument is large.

theorem false : False :=
  have : (UInt64.ofNat (2^64-1))%(2^63 : Nat) = 18446744073709551615 := by native_decide
  absurd this (by decide)

-- 'false' depends on axioms: [Lean.ofReduceBool]
#print axioms false

Expected behavior: Proof should be rejected.

Actual behavior: Proof is accepted.

Versions

4.11.0, 4.13.0-rc3, 4.12.0-nightly-2024-10-22, all on live.lean-lang.org

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@TwoFX TwoFX added the bug Something isn't working label Oct 23, 2024
@leanprover-bot leanprover-bot added the P-high We will work on this issue label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-high We will work on this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants