Skip to content
Snippets Groups Projects
Commit d4bb1669 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

Fix Search2 and Types once again

parent e08c4189
No related branches found
No related tags found
No related merge requests found
......@@ -25,27 +25,6 @@ import Data.Aeson
import Protocol
import Search.Types
-- | (Statehash, Metadata)
data Vertex = Vertex
{ vertState :: StateHash
, vertABB :: Text -- ^ Basic block name
, vertFunc :: Text -- ^ Function name
}
instance Eq Vertex where
v1 == v2 = (vertState v1, vertABB v1) == (vertState v2, vertABB v2)
instance Ord Vertex where
compare v1 v2 = compare (vertState v1, vertABB v1) (vertState v2, vertABB v2)
data Edge = Edge
{ edgeTo :: Vertex
, edgeSyscall :: Maybe Text -- ^ Nothing if transition wasn't a syscall
}
deriving (Eq, Ord)
type Graph = Map Vertex (Set Edge)
type DecisionNumber = Int
type Decision = (Vertex, DecisionNumber)
......
module Search.Types
( Metadata(..)
, Vertex(..)
( Vertex(..)
, Edge(..)
, Graph
) where
......@@ -8,12 +8,15 @@ import Data.Text (Text)
import Data.Map (Map)
import Data.Set (Set)
import Protocol
-- | (Statehash, Metadata)
data Vertex = Vertex
{ vertState :: StateHash
, vertABB :: Text -- ^ Basic block name
, vertFunc :: Text -- ^ Function name
}
deriving (Show)
instance Eq Vertex where
v1 == v2 = (vertState v1, vertABB v1) == (vertState v2, vertABB v2)
......@@ -25,6 +28,6 @@ data Edge = Edge
{ edgeTo :: Vertex
, edgeSyscall :: Maybe Text -- ^ Nothing if transition wasn't a syscall
}
deriving (Eq, Ord)
deriving (Eq, Ord, Show)
type Graph = Map Vertex (Set Edge)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment