Skip to content

Commit

Permalink
chore: update lean-toolchain, consequently add sdiv support
Browse files Browse the repository at this point in the history
We mirror the implementation of udiv and umod,
where we check for the special case when width = 0
and return 0.
  • Loading branch information
bollu committed Oct 25, 2024
1 parent a51af40 commit aa04b90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Leanwuzla.lean
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ where
| .xor => pushBinaryOp "bvxor" lhs rhs
| .add => pushBinaryOp "bvadd" lhs rhs
| .mul => pushBinaryOp "bvmul" lhs rhs
| .sdiv =>
let zero := goBVExpr <| .const (w := w) 0
withParens do
push "ite "
pushBinaryOp "=" zero rhs
push " "
zero
push " "
pushBinaryOp "bvsdiv" lhs rhs
| .udiv =>
let zero := goBVExpr <| .const (w := w) 0
withParens do
Expand Down
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:nightly-2024-10-12
leanprover/lean4:nightly-2024-10-24

0 comments on commit aa04b90

Please sign in to comment.