Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Apr 3, 2024
1 parent 0a3cfc2 commit e43dc4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
6 changes: 0 additions & 6 deletions .hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,3 @@
name: Use bvOne
lhs: "What4.Interface.bvLit sym w (Data.BitVector.Sized.one w)"
rhs: 'What4.Interface.bvOne sym w'

# TODO:
# - error:
# name: Use PP.viaShow
# lhs: "Prettyprinter.pretty (show x)"
# rhs: 'Prettyprinter.viaShow x'
11 changes: 6 additions & 5 deletions what4/src/What4/Interface.hs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ module What4.Interface
, SymEncoder(..)

-- * Utility combinators
-- ** Bitvector operations
, bvZero
, bvOne

-- ** Boolean operations
, backendPred
, andAllOf
Expand All @@ -180,10 +184,6 @@ module What4.Interface
-- * Exceptions
, InvalidRange(..)

-- * Bitvector utilities
, bvZero
, bvOne

-- * Reexports
, module Data.Parameterized.NatRepr
, module What4.BaseTypes
Expand Down Expand Up @@ -1121,7 +1121,7 @@ class ( IsExpr (SymExpr sym), HashableF (SymExpr sym), HashableF (BoundVar sym)
-- | Return the bitvector of the desired width with all 0 bits;
-- this is the minimum unsigned integer.
minUnsignedBV :: (1 <= w) => sym -> NatRepr w -> IO (SymBV sym w)
minUnsignedBV sym w = bvZero sym w
minUnsignedBV sym w = bvLit sym w (BV.zero w)

-- | Return the bitvector of the desired width with all bits set;
-- this is the maximum unsigned integer.
Expand Down Expand Up @@ -3309,5 +3309,6 @@ zeroStatistics = Statistics { statAllocs = 0
bvZero :: (1 <= w, IsExprBuilder sym) => sym -> NatRepr w -> IO (SymBV sym w)
bvZero = minUnsignedBV

-- | A bitvector that is all zeroes except the LSB, which is one.
bvOne :: (1 <= w, IsExprBuilder sym) => sym -> NatRepr w -> IO (SymBV sym w)
bvOne sym w = bvLit sym w (BV.one w)

0 comments on commit e43dc4f

Please sign in to comment.