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

Remove NatRepr arg from resolveSymBV #260

Closed
wants to merge 1 commit into from
Closed
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
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
Loading