Skip to content

Commit

Permalink
fix: disable USize simprocs
Browse files Browse the repository at this point in the history
  • Loading branch information
leodemoura committed Feb 24, 2024
1 parent d179d6c commit 0e254f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Lean/Meta/Match/Value.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ prelude
import Lean.Expr

namespace Lean.Meta
-- TODO: produce error for `USize` because `USize.decEq` depends on an opaque value: `System.Platform.numBits`.

-- TODO: move?
private def UIntTypeNames : Array Name :=
Expand Down
6 changes: 5 additions & 1 deletion src/Lean/Meta/Tactic/Simp/BuiltinSimprocs/UInt.lean
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@ declare_uint_simprocs UInt8
declare_uint_simprocs UInt16
declare_uint_simprocs UInt32
declare_uint_simprocs UInt64
declare_uint_simprocs USize
/-
We disabled the simprocs for USize since the result of most operations depend on an opaque value: `System.Platform.numBits`.
We could reduce some cases using the fact that this opaque value is `32` or `64`, but it is unclear whether it would be useful in practice.
-/
-- declare_uint_simprocs USize
3 changes: 3 additions & 0 deletions tests/lean/run/no_simproc_usize.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
example : (10 : USize) + 2 = 12 := by
fail_if_success simp -- We don't have USize simprocs since operations depend on `System.Platform.numBits`
sorry

0 comments on commit 0e254f1

Please sign in to comment.