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

fix: handling BitVec.ofNat with Nat fvars in bv_decide #5484

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ where
return mkApp4 congrProof (toExpr inner.width) innerExpr innerEval innerProof

goBvLit (x : Expr) : M (Option ReifiedBVExpr) := do
let some ⟨width, bvVal⟩ ← getBitVecValue? x | return none
let some ⟨width, bvVal⟩ ← getBitVecValue? x | return ← ofAtom x
let bvExpr : BVExpr width := .const bvVal
let expr := mkApp2 (mkConst ``BVExpr.const) (toExpr width) (toExpr bvVal)
let proof := do
Expand Down
4 changes: 4 additions & 0 deletions tests/lean/run/bv_decide_nat.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Std.Tactic.BVDecide

theorem cex (n : Nat) (hn : BitVec.ofNat 64 n ≠ 0) : BitVec.ofNat 64 n ≠ 0#64 := by
bv_decide
Loading