Skip to content

Commit

Permalink
Remove dead code for converting between ConcreteVal/IndexLit
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Jun 13, 2024
1 parent 418ad73 commit 7e997e6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
23 changes: 0 additions & 23 deletions what4/src/What4/Concrete.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ module What4.Concrete
, fromConcreteString
, fromConcreteBV
, fromConcreteComplex

, fromIndexLit
, toIndexLit
) where

import qualified Data.List as List
Expand All @@ -64,7 +61,6 @@ import Data.Parameterized.TH.GADT
import Data.Parameterized.TraversableFC

import What4.BaseTypes
import What4.IndexLit
import What4.Utils.Complex
import What4.Utils.StringLiteral

Expand Down Expand Up @@ -122,25 +118,6 @@ concreteType = \case
ConcreteStruct xs -> BaseStructRepr (fmapFC concreteType xs)
ConcreteArray idxTy def _ -> BaseArrayRepr idxTy (concreteType def)

fromIndexLit :: IndexLit tp -> ConcreteVal tp
fromIndexLit =
\case
IntIndexLit i -> ConcreteInteger i
BVIndexLit w bv -> ConcreteBV w bv

toIndexLit :: ConcreteVal tp -> Maybe (IndexLit tp)
toIndexLit = \case
ConcreteInteger i -> Just (IntIndexLit i)
ConcreteBV w bv -> Just (BVIndexLit w bv)
-- Explicitly match all constructors to get a warning if we add one
ConcreteBool{} -> Nothing
ConcreteReal{} -> Nothing
ConcreteFloat{} -> Nothing
ConcreteString{} -> Nothing
ConcreteComplex{} -> Nothing
ConcreteStruct{} -> Nothing
ConcreteArray{} -> Nothing

$(return [])

instance TestEquality ConcreteVal where
Expand Down
2 changes: 0 additions & 2 deletions what4/src/What4/Expr/GroundEval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import LibBF (BigFloat)
import qualified LibBF as BF

import What4.BaseTypes
import What4.Concrete (ConcreteVal(..), fromIndexLit, toIndexLit)
import What4.Interface
import qualified What4.SemiRing as SR
import qualified What4.SpecialFunctions as SFn
Expand All @@ -73,7 +72,6 @@ import What4.Utils.Arithmetic ( roundAway )
import What4.Utils.Complex
import What4.Utils.FloatHelpers
import What4.Utils.StringLiteral
import Data.Functor.Product (Product(Pair))


type family GroundValue (tp :: BaseType) where
Expand Down

0 comments on commit 7e997e6

Please sign in to comment.