Skip to content

Commit

Permalink
fix: fix builtin simproc Nat.reduceAnd (#6773)
Browse files Browse the repository at this point in the history
This PR fixes a typo that prevented `Nat.reduceAnd` from working
correctly.

Closes #6772
  • Loading branch information
Rob23oba authored Jan 25, 2025
1 parent 58c7a4f commit e8bbba0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Lean/Meta/Tactic/Simp/BuiltinSimprocs/Nat.lean
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ builtin_dsimproc [simp, seval] reducePow ((_ ^ _ : Nat)) := fun e => do
unless (← checkExponent m) do return .continue
return .done <| toExpr (n ^ m)

builtin_dsimproc [simp, seval] reduceAnd ((_ &&& _ : Nat)) := reduceBin ``HOr.hOr 6 (· &&& ·)
builtin_dsimproc [simp, seval] reduceAnd ((_ &&& _ : Nat)) := reduceBin ``HAnd.hAnd 6 (· &&& ·)
builtin_dsimproc [simp, seval] reduceXor ((_ ^^^ _ : Nat)) := reduceBin ``HXor.hXor 6 (· ^^^ ·)
builtin_dsimproc [simp, seval] reduceOr ((_ ||| _ : Nat)) := reduceBin ``HOr.hOr 6 (· ||| ·)

Expand Down
2 changes: 1 addition & 1 deletion tests/lean/run/simprocNat.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ variable (a b : Nat)

/- bitwise operation tests -/

#check_simp (3 : Nat) &&& (1 : Nat) ~> 1
#check_simp (4 : Nat) &&& (5 : Nat) ~> 4
#check_simp (3 : Nat) ^^^ (1 : Nat) ~> 2
#check_simp (2 : Nat) ||| (1 : Nat) ~> 3
#check_simp (3 : Nat) <<< (2 : Nat) ~> 12
Expand Down

0 comments on commit e8bbba0

Please sign in to comment.