GtkConsistencyChecker.hs revision f7979553279960e35a3e191e5bdf1bb077304e7b
9658657e918981d91c8647ed8c220464f10a6235Christian MaederModule : $Header$
b53688bfed888214b485cf76439d57262d80e0a7Christian MaederDescription : Gtk GUI for the consistency checker
e6d40133bc9f858308654afb1262b8b483ec5922Till MossakowskiCopyright : (c) Thiemo Wiedemeyer, Uni Bremen 2009
d5fe06af711a6912ae028ebf873eada4ee8733f8Christian MaederLicense : GPLv2 or higher, see LICENSE.txt
b53688bfed888214b485cf76439d57262d80e0a7Christian MaederMaintainer : raider@informatik.uni-bremen.de
3f69b6948966979163bdfe8331c38833d5d90ecdChristian MaederStability : provisional
b53688bfed888214b485cf76439d57262d80e0a7Christian MaederPortability : portable
b53688bfed888214b485cf76439d57262d80e0a7Christian MaederThis module provides a GUI for the consistency checker.
3143271856dbf456bd7acc1c07193173f886d986Christian Maederimport qualified GUI.Glade.NodeChecker as ConsistencyChecker
b53688bfed888214b485cf76439d57262d80e0a7Christian Maederimport Interfaces.GenericATPState (guiDefaultTimeLimit)
b53688bfed888214b485cf76439d57262d80e0a7Christian Maederimport Logic.Comorphism (AnyComorphism (..))
78e7910c3360f74f1db172d63d20bb07c64e56e3Christian Maederimport Comorphisms.LogicGraph (logicGraph)
c8a9d35be2207e0d4fbd26a2411e1ba17e3e4c96Christian Maederimport Control.Concurrent (forkIO, killThread)
3986813db69106b9bb1b62faa77532af42512a0cChristian Maederimport Control.Monad (foldM_, join, when)
46b1095ba983ce859e17c2a12f48b50583b7150cChristian Maederimport qualified Data.Map as Map
e982190515f83fe6615436530ebe89bb320770d6Christian Maederimport Data.List (findIndex, partition, sort)
08d506ebb78da1e8656a73a349492e042f4c9f72Christian Maederdata Finder = Finder { fName :: String
d27d203b3f42f0e0ecea00e3f19f55f66045bd96Christian Maeder , finder :: G_cons_checker
46b1095ba983ce859e17c2a12f48b50583b7150cChristian Maeder , comorphism :: [AnyComorphism]
38824a7dba4f7d82532afec67e0b594a5af5d76bChristian Maeder , selected :: Int }
38824a7dba4f7d82532afec67e0b594a5af5d76bChristian Maederinstance Eq Finder where
ec351e60425e2f99448cb44e933d3828f8025dddChristian Maeder (==) (Finder { fName = n1, comorphism = c1 })
56440c7ae61e7277a3494452d0165ee52e677b29Christian Maeder (Finder { fName = n2, comorphism = c2 }) = n1 == n2 && c1 == c2
ec351e60425e2f99448cb44e933d3828f8025dddChristian Maederdata FNode = FNode { name :: String
ec351e60425e2f99448cb44e933d3828f8025dddChristian Maeder , node :: LNode DGNodeLab
56440c7ae61e7277a3494452d0165ee52e677b29Christian Maeder , sublogic :: G_sublogics
9603ad7198b72e812688ad7970e4eac4b553837aKlaus Luettich , cStatus :: ConsistencyStatus }
b53688bfed888214b485cf76439d57262d80e0a7Christian Maeder-- | Get a markup string containing name and color
2dcec0e101ddd4169f5323462911e988337c2deeChristian Maederinstance Show FNode where
0b73fd9cab131c1b25b542007c98b5f8717b1d36Klaus Luettich show FNode { name = n, cStatus = s } =
9f08800df9da91d444560875167fbf7acb8396edChristian Maeder "<span color=\"" ++ cStatusToColor s ++ "\">" ++ cStatusToPrefix s ++ n ++
46b1095ba983ce859e17c2a12f48b50583b7150cChristian Maederinstance Eq FNode where
64c2422e1ba0691556a6639e959820add102315cChristian Maeder (==) f1 f2 = compare f1 f2 == EQ
b53688bfed888214b485cf76439d57262d80e0a7Christian Maederinstance Ord FNode where
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maeder compare (FNode { name = n1, cStatus = s1 })
865ae561becd3cb451d6280125886b3e03ddf0a4Hendrik Iben (FNode { name = n2, cStatus = s2 }) = case compare s1 s2 of
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maeder EQ -> compare n1 n2
63719301448519453f66383f4e583d9fd5b89ecbChristian MaedercStatusToColor :: ConsistencyStatus -> String
63719301448519453f66383f4e583d9fd5b89ecbChristian MaedercStatusToColor s = case sType s of
c2257f94016aeb9e5c3ff3d4d675a81f8f873f0dChristian Maeder CSUnchecked -> "black"
c2257f94016aeb9e5c3ff3d4d675a81f8f873f0dChristian Maeder CSConsistent -> "green"
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder CSInconsistent -> "red"
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder CSTimeout -> "blue"
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder CSError -> "darkred"
bbba6dd86153aacb0f662b182b128df0eb09fd54Christian MaedercStatusToPrefix :: ConsistencyStatus -> String
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian MaedercStatusToPrefix s = case sType s of
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder CSUnchecked -> "[ ] "
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maeder CSConsistent -> "[+] "
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder CSInconsistent -> "[-] "
fe4e6766a6e51cca3f8cc9632c25936af147d8b9Christian Maeder CSTimeout -> "[t] "
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder CSError -> "[f] "
ce900a84ed9d9882c64fccbd6300f6b0d67efa82Christian MaedercInvert :: ConsistencyStatus -> ConsistencyStatus
48a98aa04f4c2c1f5f8f79c007e1ff95e699b31aFlorian MossakowskicInvert cs = case sType cs of
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder CSConsistent -> ConsistencyStatus CSInconsistent (sMessage cs)
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder CSInconsistent -> ConsistencyStatus CSConsistent (sMessage cs)
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder-- | Displays the consistency checker window
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian MaedershowConsistencyChecker :: Maybe Int -> GInfo -> LibEnv -> IO (Result LibEnv)
63719301448519453f66383f4e583d9fd5b89ecbChristian MaedershowConsistencyChecker mn gi@(GInfo { libName = ln }) le =
08d506ebb78da1e8656a73a349492e042f4c9f72Christian Maeder Nothing -> showConsistencyCheckerMain mn gi le
08d506ebb78da1e8656a73a349492e042f4c9f72Christian Maeder Just n -> let
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder dg = lookupDGraph ln le
d27d203b3f42f0e0ecea00e3f19f55f66045bd96Christian Maeder lbl = labDG dg n
d27d203b3f42f0e0ecea00e3f19f55f66045bd96Christian Maeder in if case globalTheory lbl of
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder Just (G_theory _ _ _ sens _) -> Map.null sens
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder Nothing -> True
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder infoDialogExt "No sentences" $ "Node " ++
ab9b86500ed66416e1a7c01be54491ed72c7d633Christian Maeder getDGNodeName lbl
ab9b86500ed66416e1a7c01be54491ed72c7d633Christian Maeder ++ " has no sentences and is thus trivially consistent"
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder return $ return le
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder else showConsistencyCheckerMain mn gi le
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder-- | Displays the consistency checker window
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian MaedershowConsistencyCheckerMain :: Maybe Int -> GInfo -> LibEnv -> IO (Result LibEnv)
63719301448519453f66383f4e583d9fd5b89ecbChristian MaedershowConsistencyCheckerMain mn (GInfo { libName = ln }) le = do
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder wait <- newEmptyMVar
ab9b86500ed66416e1a7c01be54491ed72c7d633Christian Maeder showConsistencyCheckerAux wait mn ln le
ab9b86500ed66416e1a7c01be54491ed72c7d633Christian Maeder le' <- takeMVar wait
ab9b86500ed66416e1a7c01be54491ed72c7d633Christian Maeder return $ Result [] $ Just le'
ab9b86500ed66416e1a7c01be54491ed72c7d633Christian Maeder-- | Displays the consistency checker window
63719301448519453f66383f4e583d9fd5b89ecbChristian MaedershowConsistencyCheckerAux
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder :: MVar LibEnv -> Maybe Int -> LibName -> LibEnv -> IO ()
63719301448519453f66383f4e583d9fd5b89ecbChristian MaedershowConsistencyCheckerAux res mn ln le = postGUIAsync $ do
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder xml <- getGladeXML ConsistencyChecker.get
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder -- get objects
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder window <- xmlGetWidget xml castToWindow "NodeChecker"
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder btnClose <- xmlGetWidget xml castToButton "btnClose"
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder btnResults <- xmlGetWidget xml castToButton "btnResults"
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder -- get nodes view and buttons
ab9b86500ed66416e1a7c01be54491ed72c7d633Christian Maeder trvNodes <- xmlGetWidget xml castToTreeView "trvNodes"
ab9b86500ed66416e1a7c01be54491ed72c7d633Christian Maeder btnNodesAll <- xmlGetWidget xml castToButton "btnNodesAll"
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder btnNodesNone <- xmlGetWidget xml castToButton "btnNodesNone"
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder btnNodesInvert <- xmlGetWidget xml castToButton "btnNodesInvert"
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder btnNodesUnchecked <- xmlGetWidget xml castToButton "btnNodesUnchecked"
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder btnNodesTimeout <- xmlGetWidget xml castToButton "btnNodesTimeout"
ab9b86500ed66416e1a7c01be54491ed72c7d633Christian Maeder cbInclThms <- xmlGetWidget xml castToCheckButton "cbInclThms"
5382091fd2a705e6f026026e8a6adcd3607bdb9fChristian Maeder -- get checker view and buttons
38824a7dba4f7d82532afec67e0b594a5af5d76bChristian Maeder cbComorphism <- xmlGetWidget xml castToComboBox "cbComorphism"
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder lblSublogic <- xmlGetWidget xml castToLabel "lblSublogic"
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder sbTimeout <- xmlGetWidget xml castToSpinButton "sbTimeout"
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder btnCheck <- xmlGetWidget xml castToButton "btnCheck"
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder btnStop <- xmlGetWidget xml castToButton "btnStop"
38824a7dba4f7d82532afec67e0b594a5af5d76bChristian Maeder trvFinder <- xmlGetWidget xml castToTreeView "trvFinder"
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder windowSetTitle window "Consistency Checker"
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder spinButtonSetValue sbTimeout $ fromIntegral guiDefaultTimeLimit
38824a7dba4f7d82532afec67e0b594a5af5d76bChristian Maeder let widgets = [ toWidget sbTimeout
154be5bfac61cf5b61fd1571e7bfc2572c4b546aMihai Codescu , toWidget cbComorphism
154be5bfac61cf5b61fd1571e7bfc2572c4b546aMihai Codescu , toWidget lblSublogic ]
25662bf82f592e3268fddcc2c86e83c203b82e53Ewaryst Schulz checkWidgets = widgets ++ [ toWidget btnClose
21489db35f79507a68ee6e6926e01b8e8ea60c6bChristian Maeder , toWidget btnNodesAll
7fe976d9f9c4af1aa7636c568d9919859523de0aChristian Maeder , toWidget btnNodesNone
7fe976d9f9c4af1aa7636c568d9919859523de0aChristian Maeder , toWidget btnNodesInvert
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder , toWidget btnNodesUnchecked
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder , toWidget btnNodesTimeout
25662bf82f592e3268fddcc2c86e83c203b82e53Ewaryst Schulz , toWidget btnResults ]
154be5bfac61cf5b61fd1571e7bfc2572c4b546aMihai Codescu switch b = do
154be5bfac61cf5b61fd1571e7bfc2572c4b546aMihai Codescu widgetSetSensitive btnStop $ not b
7fe976d9f9c4af1aa7636c568d9919859523de0aChristian Maeder widgetSetSensitive btnCheck b
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder widgetSetSensitive btnStop False
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder widgetSetSensitive btnCheck False
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder threadId <- newEmptyMVar
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder wait <- newEmptyMVar
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder mView <- newEmptyMVar
38824a7dba4f7d82532afec67e0b594a5af5d76bChristian Maeder let dg = lookupDGraph ln le
38824a7dba4f7d82532afec67e0b594a5af5d76bChristian Maeder nodes = labNodesDG dg
38824a7dba4f7d82532afec67e0b594a5af5d76bChristian Maeder selNodes = partition (\ (FNode { node = (_, l)}) -> case globalTheory l of
38824a7dba4f7d82532afec67e0b594a5af5d76bChristian Maeder Just (G_theory _ _ _ sens _) -> Map.null sens
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder Nothing -> True)
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder sls = map sublogicOfTh $ mapMaybe (globalTheory . snd) nodes
38824a7dba4f7d82532afec67e0b594a5af5d76bChristian Maeder n2CS n = case getNodeConsStatus n of
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder ConsStatus _ pc thmls ->
ec351e60425e2f99448cb44e933d3828f8025dddChristian Maeder let t = showDoc thmls "" in case pc of
56440c7ae61e7277a3494452d0165ee52e677b29Christian Maeder Inconsistent -> ConsistencyStatus CSInconsistent t
56440c7ae61e7277a3494452d0165ee52e677b29Christian Maeder Cons -> ConsistencyStatus CSConsistent t
ec351e60425e2f99448cb44e933d3828f8025dddChristian Maeder _ -> ConsistencyStatus CSUnchecked t
ec351e60425e2f99448cb44e933d3828f8025dddChristian Maeder (emptyNodes, others) = selNodes
ec351e60425e2f99448cb44e933d3828f8025dddChristian Maeder $ map (\ (n@(_, l), s) -> FNode (getDGNodeName l) n s $ n2CS l)
ec351e60425e2f99448cb44e933d3828f8025dddChristian Maeder $ zip nodes sls
56440c7ae61e7277a3494452d0165ee52e677b29Christian Maeder -- setup data
ec351e60425e2f99448cb44e933d3828f8025dddChristian Maeder listNodes <- setListData trvNodes show $ sort others
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder listFinder <- setListData trvFinder fName []
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder -- setup comorphism combobox
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder comboBoxSetModelText cbComorphism
b085709d4b69dc84724000b7b917f348edfa932eChristian Maeder shC <- after cbComorphism changed
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder $ setSelectedComorphism trvFinder listFinder cbComorphism
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder -- setup view selection actions
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder let update = do
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder mf <- getSelectedSingle trvFinder listFinder
4067eba4f5605d9569d78085deb1a27f08ac34e2Christian Maeder updateComorphism trvFinder listFinder cbComorphism shC
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder widgetSetSensitive btnCheck $ isJust mf
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder setListSelectorSingle trvFinder update
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder let upd = updateNodes trvNodes listNodes
48a98aa04f4c2c1f5f8f79c007e1ff95e699b31aFlorian Mossakowski labelSetLabel lblSublogic $ show s
8865728716566f42fa73e7e0bc080ba3225df764Christian Maeder updateFinder trvFinder listFinder b s)
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder labelSetLabel lblSublogic "No sublogic"
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder listStoreClear listFinder
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder activate widgets False
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder widgetSetSensitive btnCheck False)
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder (activate widgets True >> widgetSetSensitive btnCheck True)
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder shN <- setListSelectorMultiple trvNodes btnNodesAll btnNodesNone
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder btnNodesInvert upd
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder let selectWithAux f u = do
78e7910c3360f74f1db172d63d20bb07c64e56e3Christian Maeder signalBlock shN
78e7910c3360f74f1db172d63d20bb07c64e56e3Christian Maeder sel <- treeViewGetSelection trvNodes
78e7910c3360f74f1db172d63d20bb07c64e56e3Christian Maeder treeSelectionSelectAll sel
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder rs <- treeSelectionGetSelectedRows sel
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder mapM_ ( \ ~p@(row : []) -> do
f6b2c6c33c635279973b8f378470da7dbb8ecee8Christian Maeder fn <- listStoreGetValue listNodes row
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder (if f fn then treeSelectionSelectPath else treeSelectionUnselectPath)
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder signalUnblock shN
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder selectWith f = selectWithAux $ f . cStatus
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder onClicked btnNodesUnchecked
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder $ selectWith (== ConsistencyStatus CSUnchecked "") upd
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder onClicked btnNodesTimeout $ selectWith (== ConsistencyStatus CSTimeout "") upd
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder onClicked btnResults $ showModelView mView "Models" listNodes emptyNodes
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder onClicked btnClose $ widgetDestroy window
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder onClicked btnStop $ takeMVar threadId >>= killThread >>= putMVar wait
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder onClicked btnCheck $ do
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder activate checkWidgets False
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder timeout <- spinButtonGetValueAsInt sbTimeout
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder inclThms <- toggleButtonGetActive cbInclThms
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder (updat, pexit) <- progressBar "Checking consistency" "please wait..."
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder nodes' <- getSelectedMultiple trvNodes listNodes
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder mf <- getSelectedSingle trvFinder listFinder
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder f <- case mf of
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder Nothing -> error "Consistency checker: internal error"
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder Just (_, f) -> return f
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder tid <- forkIO $ do
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder check False inclThms ln le dg f timeout listNodes updat nodes'
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder putMVar wait ()
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder putMVar threadId tid
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder takeMVar wait
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder postGUIAsync $ do
7688e20f844fe88f75c04016841ebb5e5e3d927fChristian Maeder tryTakeMVar threadId
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder showModelView mView "Results of consistency check" listNodes emptyNodes
9f08800df9da91d444560875167fbf7acb8396edChristian Maeder signalBlock shN
63719301448519453f66383f4e583d9fd5b89ecbChristian Maeder sortNodes trvNodes listNodes
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder signalUnblock shN
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder activate checkWidgets True
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder onDestroy window $ do
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder nodes' <- listStoreToList listNodes
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder let changes = foldl (\ cs (FNode { node = (i, l), cStatus = s }) ->
7688e20f844fe88f75c04016841ebb5e5e3d927fChristian Maeder if (\ st -> st /= CSConsistent && st /= CSInconsistent)
3143271856dbf456bd7acc1c07193173f886d986Christian Maeder $ sType s then cs
ce900a84ed9d9882c64fccbd6300f6b0d67efa82Christian Maeder let n = (i, if sType s == CSInconsistent then
ce900a84ed9d9882c64fccbd6300f6b0d67efa82Christian Maeder markNodeInconsistent "" l
ce900a84ed9d9882c64fccbd6300f6b0d67efa82Christian Maeder else markNodeConsistent "" l)
ce900a84ed9d9882c64fccbd6300f6b0d67efa82Christian Maeder in SetNodeLab l n : cs
ce900a84ed9d9882c64fccbd6300f6b0d67efa82Christian Maeder dg' = changesDGH dg changes
putMVar res $ Map.insert ln (groupHistory dg (DGRule "Consistency") dg') le
let new = Map.elems $ foldr (\ (cc, c) m ->
f = Map.findWithDefault (Finder n cc [] 0) n m
mergeFinder old new = let m' = Map.fromList $ map (\ f -> (fName f, f)) new in
Map.elems $ foldl (\ m (Finder { fName = n, comorphism = cc, selected = i}) ->
case Map.lookup n m of
Map.insert n (f { selected = fromMaybe 0 $ findIndex (== c) cc' }) m
xml <- getGladeXML ConsistencyChecker.get