blob: 021128150fbffaf6983c7d8742fa684a4b25036c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
module Grasp.Types (
GraspProgram(..),
nodesWithName,
normalise,
iso
) where
import Data.Graph.Inductive.Graph( Node, LNode, LEdge, (&) )
import qualified Data.Graph.Inductive.Graph as Graph
import Data.Graph.Inductive.Tree
import Data.List
type GraspProgram = Gr String String
instance (Ord a, Ord b) => Eq (Gr a b) where
a == b = ((sort . Graph.labNodes $ a) == (sort . Graph.labNodes $ b)) &&
((sort . Graph.labEdges $ a) == (sort . Graph.labEdges $ b))
nodesWithName :: GraspProgram -> String -> [LNode String]
nodesWithName g s = []
normalise :: GraspProgram -> GraspProgram
normalise g = Graph.mkGraph [] []
iso :: GraspProgram -> GraspProgram -> Bool
iso a b = (normalise a) == (normalise b)
|