Changeset 12742
- Timestamp:
- 27.10.2009 15:43:56 (4 weeks ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
GUI/GraphLogic.hs (modified) (3 diffs)
-
GUI/GraphMenu.hs (modified) (5 diffs)
-
Static/DevGraph.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/GUI/GraphLogic.hs
r12730 r12742 169 169 -> ([GA.NodeId], [(GA.NodeId, GA.NodeId, DGEdgeType, Bool)]) 170 170 hideNodesAux dg ignoreEdges = 171 let nodes = selectNodesByType dg [DGNodeType { nonRefType = NonRefType 172 { isProvenCons = True 173 , isInternalSpec = True} 174 , isLocallyEmpty = True}] 171 let nodes = selectNodesByType dg 172 (\ n -> isInternalSpec n && isProvenNode n && isProvenCons n) 175 173 edges = getCompressedEdges dg nodes ignoreEdges 176 174 in (nodes, edges) … … 219 217 220 218 -- | selects all nodes of a type with outgoing edges 221 selectNodesByType :: DGraph -> [DGNodeType]-> [Node]219 selectNodesByType :: DGraph -> (DGNodeType -> Bool) -> [Node] 222 220 selectNodesByType dg types = 223 filter (\ n -> (not .null $ outDG dg n) && filterInUnproven dg n) $ map fst224 $ filter ( \ (_, n) -> elem (getRealDGNodeType n) types) $ labNodesDG dg221 filter (\ n -> not (null $ outDG dg n) && filterInUnproven dg n) $ map fst 222 $ filter (types . getRealDGNodeType . snd) $ labNodesDG dg 225 223 226 224 filterInUnproven :: DGraph -> Node -> Bool … … 241 239 -- | innDG with filter of not shown edges 242 240 fInnDG :: [EdgeId] -> DGraph -> Node -> [LEdge DGLinkLab] 243 fInnDG ignore dg = filter (\ (_,_,l) -> elem (dgl_id l) ignore) . innDG dg241 fInnDG ignore dg = filter (\ (_,_,l) -> notElem (dgl_id l) ignore) . innDG dg 244 242 245 243 -- | outDG with filter of not shown edges 246 244 fOutDG :: [EdgeId] -> DGraph -> Node -> [LEdge DGLinkLab] 247 fOutDG ignore dg = filter (\ (_,_,l) -> elem (dgl_id l) ignore) . outDG dg245 fOutDG ignore dg = filter (\ (_,_,l) -> notElem (dgl_id l) ignore) . outDG dg 248 246 249 247 -- | returns a list of compressed edges -
trunk/GUI/GraphMenu.hs
r12740 r12742 57 57 )] 58 58 nodeTypes opts = map 59 ( (\ (n, s) -> if isLocallyEmpty n then -- Add color 60 case nonRefType n of 61 NonRefType { isProvenCons = False } 62 -> (n, s, getColor opts Yellow False True) 63 _ -> (n, s, getColor opts Green True False) 64 else case nonRefType n of 65 RefType -> (n, s, getColor opts Coral False False) 66 t -> (n, s, getColor opts Coral False $ isProvenCons t) 67 ) 68 . (\ n -> case nonRefType n of -- Add shape 69 RefType -> (n, Box) 70 NonRefType {} -> (n, Ellipse) 71 ) 59 ((\ (n, s) -> if isProvenNode n then -- Add color 60 if isProvenCons n 61 then (n, s, getColor opts Green True False) 62 else (n, s, getColor opts Yellow False True) 63 else (n, s, getColor opts Coral False $ isProvenCons n)) 64 . \ n -> (n, if isRefType n then Box else Ellipse) -- Add shape 72 65 ) listDGNodeTypes 73 66 … … 292 285 (\ (n, s, c) -> 293 286 ( n 294 , case nonRefType n of 295 RefType -> createLocalMenuNodeTypeDgRef s c gInfo cGraph showLib 296 NonRefType { isInternalSpec = True } 297 -> createLocalMenuNodeTypeInternal s c gInfo 298 NonRefType { isInternalSpec = False } 299 -> createLocalMenuNodeTypeSpec s c gInfo 300 ) 301 ) $ nodeTypes opts 287 , if isRefType n 288 then createLocalMenuNodeTypeDgRef s c gInfo cGraph showLib 289 else if isInternalSpec n 290 then createLocalMenuNodeTypeInternal s c gInfo 291 else createLocalMenuNodeTypeSpec s c gInfo)) $ nodeTypes opts 302 292 303 293 -- | the edge types (share strings to avoid typos) … … 445 435 446 436 createLocalEdgeMenu :: GInfo -> LocalMenu GA.EdgeValue 447 createLocalEdgeMenu gInfo = LocalMenu $ Menu (Just "short edge menu") 448 [createLocalMenuButtonShowEdgeInfo gInfo] 437 createLocalEdgeMenu = LocalMenu . createLocalMenuButtonShowEdgeInfo 449 438 450 439 createLocalEdgeMenuConsEdge :: GInfo -> LocalMenu GA.EdgeValue … … 468 457 createLocalMenuValueTitleShowConservativity = ValueTitle 469 458 (\ (_, _, maybeLEdge) -> case maybeLEdge of 470 Just (_, _,edgelab) -> case dgl_type edgelab of459 Just (_, _, edgelab) -> case dgl_type edgelab of 471 460 ScopedLink _ _ (ConsStatus c cp status) -> return (showCons c cp status) 472 461 _ -> return "" … … 486 475 | otherwise = do 487 476 dir <- getCurrentDirectory 488 return $ dir ++ '/' :f ++ ".hpf"477 return $ dir ++ '/' : f ++ ".hpf" 489 478 490 479 -
trunk/Static/DevGraph.hs
r12615 r12742 170 170 hasOpenGoals = hasSenKind (\ s -> not (isAxiom s) && not (isProvenSenStatus s)) 171 171 172 -- | check if the node has an internal name (wrong for DGRef!)172 -- | check if the node has an internal name 173 173 isInternalNode :: DGNodeLab -> Bool 174 isInternalNode l@DGNodeLab {dgn_name = n} = not (isDGRef l) &&isInternal n174 isInternalNode DGNodeLab {dgn_name = n} = isInternal n 175 175 176 176 getNodeConsStatus :: DGNodeLab -> ConsStatus … … 200 200 201 201 data DGNodeType = DGNodeType 202 { nonRefType :: NonRefType 203 , isLocallyEmpty :: Bool } 204 deriving (Eq, Ord, Show) 205 206 data NonRefType = 207 RefType 208 | NonRefType { isProvenCons :: Bool 209 , isInternalSpec :: Bool } 202 { isRefType :: Bool 203 , isProvenNode :: Bool 204 , isProvenCons :: Bool 205 , isInternalSpec :: Bool } 210 206 deriving (Eq, Ord, Show) 211 207 … … 213 209 getRealDGNodeType :: DGNodeLab -> DGNodeType 214 210 getRealDGNodeType dgnlab = DGNodeType 215 { nonRefType = if isDGRef dgnlab then RefType else 216 NonRefType { isProvenCons = not $ hasOpenNodeConsStatus False dgnlab 217 , isInternalSpec = isInternalNode dgnlab } 218 , isLocallyEmpty = not $ hasOpenGoals dgnlab 219 } 211 { isRefType = isDGRef dgnlab 212 , isProvenNode = not $ hasOpenGoals dgnlab 213 , isProvenCons = not $ hasOpenNodeConsStatus False dgnlab 214 , isInternalSpec = isInternalNode dgnlab } 220 215 221 216 -- | Creates a list with all DGNodeType types 222 217 listDGNodeTypes :: [DGNodeType] 223 listDGNodeTypes = 224 [ DGNodeType { nonRefType = ref, isLocallyEmpty = isEmpty' } 225 | ref <- RefType : 226 [ NonRefType { isProvenCons = proven, isInternalSpec = spec } 227 | proven <- [True, False] 228 , spec <- [True, False] 229 ] 230 , isEmpty' <- [True, False] 231 ] 218 listDGNodeTypes = let bs = [False, True] in 219 [ DGNodeType 220 { isRefType = ref 221 , isProvenNode = isEmpty' 222 , isProvenCons = proven 223 , isInternalSpec = spec } 224 | ref <- bs 225 , isEmpty' <- bs 226 , proven <- bs 227 , spec <- bs ] 232 228 233 229 -- ** edge label types