Skip to content

Commit

Permalink
fix: handling BitVec.ofNat with Nat fvars in bv_decide (#5484)
Browse files Browse the repository at this point in the history
  • Loading branch information
hargoniX authored Sep 26, 2024
1 parent 91a0334 commit 13969ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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

0 comments on commit 13969ad

Please sign in to comment.