Skip to content

Commit

Permalink
improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
LeventErkok committed Sep 4, 2024
1 parent 4be59f4 commit 224b176
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Data/SBV/Core/Symbolic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import Control.Monad.State.Lazy (MonadState)
import Control.Monad.Trans (MonadIO(liftIO), MonadTrans(lift))
import Control.Monad.Trans.Maybe (MaybeT)
import Control.Monad.Writer.Strict (MonadWriter)
import Data.Char (isAlpha, isAlphaNum, toLower)
import Data.Char (isAlpha, isAlphaNum, toLower, isSpace)
import Data.IORef (IORef, newIORef, readIORef)
import Data.List (intercalate, sortBy, isPrefixOf, isSuffixOf, nub)
import Data.Maybe (fromMaybe, mapMaybe)
Expand Down Expand Up @@ -555,7 +555,10 @@ instance Show SeqOp where
show (SeqFoldLeftI s) = "seq.foldli " ++ s

-- Note: This isn't part of SMTLib, we explicitly handle it
show (SBVReverse k) = "sbv.reverse[" ++ show k ++ "]"
show (SBVReverse k) = let sk = show k
ssk | any isSpace sk = '(' : sk ++ ")"
| True = sk
in "sbv.reverse @" ++ ssk ++ ""

-- | Set operations.
data SetOp = SetEqual
Expand Down

0 comments on commit 224b176

Please sign in to comment.