Skip to content

Commit

Permalink
Remove NatRepr arg from resolveSymBV
Browse files Browse the repository at this point in the history
It's not necessary; it can be recovered from the bitvector itself.
  • Loading branch information
langston-barrett committed Apr 17, 2024
1 parent e46dff4 commit e9e8142
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions what4/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# next

* `What4.Utils.ResolveBounds.BV.resolveSymBV` no longer requires the width of
the bitvector as an explicit `NatRepr` argument. The argument can be removed.

# 1.5.1 (October 2023)

* Require building with `versions >= 6.0.2`.
Expand Down
6 changes: 3 additions & 3 deletions what4/src/What4/Utils/ResolveBounds/BV.hs
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,13 @@ resolveSymBV ::
-> SearchStrategy
-- ^ The strategy to use when searching for lower and upper bounds. For
-- many use cases, 'ExponentialSearch' is a reasonable default.
-> PN.NatRepr w
-- ^ The bitvector width
-> WPO.SolverProcess scope solver
-- ^ The online solver process to use to search for lower and upper
-- bounds.
-> WI.SymBV sym w
-- ^ The bitvector to resolve.
-> IO (ResolvedSymBV w)
resolveSymBV sym searchStrat w proc symBV =
resolveSymBV sym searchStrat proc symBV =
-- First check, if the SymBV can be trivially resolved as concrete. If so,
-- this can avoid the need to call out to the solver at all.
case WI.asBV symBV of
Expand Down Expand Up @@ -154,6 +152,8 @@ resolveSymBV sym searchStrat w proc symBV =
(BV.asUnsigned lowerBound) (BV.asUnsigned upperBound)
else pure $ BVConcrete modelForBV
where
w = WI.bvWidth symBV

conn :: WPS.WriterConn scope solver
conn = WPO.solverConn proc

Expand Down

0 comments on commit e9e8142

Please sign in to comment.