module Language.Fixpoint.Solver.Types where
import Language.Fixpoint.Misc (safeLookup)
import qualified Language.Fixpoint.Types as F
import qualified Data.HashMap.Strict as M
import GHC.Stack
type CId = Integer
type CSucc = CId -> [CId]
type CMap a = M.HashMap CId a
type KVRead = M.HashMap F.KVar [CId]
type DepEdge = (CId, CId, [CId])
data Slice = Slice { slKVarCs :: [CId]
, slConcCs :: [CId]
, slEdges :: [DepEdge]
} deriving (Eq, Show)
data CGraph = CGraph { gEdges :: [DepEdge]
, gRanks :: CMap Int
, gSucc :: CSucc
, gSccs :: Int
}
lookupCMap :: (?callStack :: CallStack) => CMap a -> CId -> a
lookupCMap rm i = safeLookup err i rm
where
err = "lookupCMap: cannot find info for " ++ show i