Changeset 12779

Show
Ignore:
Timestamp:
04.11.2009 03:14:21 (3 weeks ago)
Author:
raider
Message:

changed selection mode of list for gtk. removed old files. implemented gtk prover gui, is working now, but still has some bugs (interactive test 3 is not working). added some datatypes for prover windows to gtk utils.

Location:
trunk/GUI
Files:
2 removed
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/GUI/Glade/ConsistencyChecker.glade

    r12754 r12779  
    277277                            <property name="label" translatable="yes">No sublogic</property> 
    278278                            <property name="use_markup">True</property> 
     279                            <property name="selectable">True</property> 
     280                            <property name="max_width_chars">30</property> 
    279281                          </widget> 
    280282                        </child> 
     
    293295                  </widget> 
    294296                  <packing> 
     297                    <property name="expand">False</property> 
    295298                    <property name="position">1</property> 
    296299                  </packing> 
     
    311314                            <property name="visible">True</property> 
    312315                            <property name="xalign">0</property> 
     316                            <property name="yalign">0</property> 
    313317                            <property name="label" translatable="yes">No path selected</property> 
    314                             <property name="wrap">True</property> 
    315318                            <property name="selectable">True</property> 
    316319                          </widget> 
     
    330333                  </widget> 
    331334                  <packing> 
     335                    <property name="expand">False</property> 
    332336                    <property name="position">2</property> 
    333337                  </packing> 
  • trunk/GUI/Glade/GenericATP.glade

    r12754 r12779  
    9090                                    <property name="can_focus">True</property> 
    9191                                    <property name="invisible_char">&#x25CF;</property> 
    92                                     <property name="adjustment">20 0 40 1 0 0</property> 
     92                                    <property name="adjustment">20 1 3600 1 0 0</property> 
    9393                                  </widget> 
    9494                                  <packing> 
     
    148148                                <property name="can_focus">True</property> 
    149149                                <property name="receives_default">False</property> 
    150                                 <property name="active">True</property> 
    151150                                <property name="draw_indicator">True</property> 
    152151                              </widget> 
  • trunk/GUI/Glade/ProverGUI.glade

    r12754 r12779  
    241241                            <property name="label" translatable="yes">No sublogic given</property> 
    242242                            <property name="use_markup">True</property> 
     243                            <property name="selectable">True</property> 
    243244                          </widget> 
    244245                        </child> 
     
    277278                            <property name="visible">True</property> 
    278279                            <property name="xalign">0</property> 
     280                            <property name="yalign">0</property> 
    279281                            <property name="label" translatable="yes">No path selected</property> 
    280                             <property name="wrap">True</property> 
    281282                            <property name="selectable">True</property> 
    282283                          </widget> 
  • trunk/GUI/GtkConsistencyChecker.hs

    r12755 r12779  
    5151import Data.Maybe 
    5252 
    53 data Finder = Finder { fname :: String 
     53data Finder = Finder { fName :: String 
    5454                     , finder :: G_cons_checker 
    55                      , comorphs :: [AnyComorphism] 
     55                     , comorphism :: [AnyComorphism] 
    5656                     , selected :: Int } 
    5757 
     
    125125  spinButtonSetValue sbTimeout $ fromIntegral guiDefaultTimeLimit 
    126126 
    127   let widgets = [ toWidget trvFinder 
    128                 , toWidget btnFineGrained 
     127  let widgets = [ toWidget btnFineGrained 
    129128                , toWidget sbTimeout 
    130129                , toWidget lblComorphism 
    131                 , toWidget lblSublogic 
    132                 ] 
     130                , toWidget lblSublogic ] 
    133131      checkWidgets = widgets ++ [ toWidget btnClose 
    134                                 , toWidget trvNodes 
    135132                                , toWidget btnNodesAll 
    136133                                , toWidget btnNodesNone 
     
    138135                                , toWidget btnNodesUnchecked 
    139136                                , toWidget btnNodesTimeout 
    140                                 , toWidget btnResults 
    141                                 ] 
     137                                , toWidget btnResults ] 
    142138      switch b = do 
    143139        widgetSetSensitive btnStop $ not b 
     
    167163    $ map (\ (n@(_,l),s) -> FNode (getDGNodeName l) n s CSUnchecked) 
    168164    $ zip nodes sls 
    169   listFinder <- setListData trvFinder fname [] 
     165  listFinder <- setListData trvFinder fName [] 
    170166 
    171167  -- setup view selection actions 
    172   let update = do mf <- getSelectedSingle trvFinder listFinder 
    173                   case mf of 
    174                     Just (_,f) -> do 
    175                       case comorphs f !! selected f of 
    176                         Comorphism cid -> 
    177                           let cName = language_name cid 
    178                               dName = drop 1 $ dropWhile (/= ';') cName 
    179                           in labelSetLabel lblComorphism 
    180                             $ if null dName then "identity" else dName 
    181                       widgetSetSensitive btnCheck True 
    182                     Nothing -> do 
    183                       labelSetLabel lblComorphism "No path selected" 
    184                       widgetSetSensitive btnCheck False 
     168  let update = do 
     169        mf <- getSelectedSingle trvFinder listFinder 
     170        case mf of 
     171          Just (_,f) -> do 
     172            case comorphism f !! selected f of 
     173              Comorphism cid ->let cN = language_name cid 
     174                                   dN = drop 1 $ dropWhile (/= ';') cN in 
     175                labelSetLabel lblComorphism $ if null dN then "identity" else dN 
     176            widgetSetSensitive btnCheck True 
     177          Nothing -> do 
     178            labelSetLabel lblComorphism "No path selected" 
     179            widgetSetSensitive btnCheck False 
    185180  setListSelectorSingle trvFinder update 
    186181 
    187   selection <- setListSelectorMultiple trvNodes btnNodesAll btnNodesNone 
    188                  btnNodesInvert $ updateNodes trvNodes listNodes 
    189                                     (\ s -> do 
    190                                        labelSetLabel lblSublogic $ show s 
    191                                        updateFinder trvFinder listFinder s) 
    192                                     (do labelSetLabel lblSublogic "No sublogic" 
    193                                         listStoreClear listFinder 
    194                                         activate widgets False 
    195                                         widgetSetSensitive btnCheck False) 
    196                                     (do activate widgets True 
    197                                         widgetSetSensitive btnCheck False) 
     182  setListSelectorMultiple trvNodes btnNodesAll btnNodesNone btnNodesInvert 
     183    $ updateNodes trvNodes listNodes 
     184    (\ s -> do labelSetLabel lblSublogic $ show s 
     185               updateFinder trvFinder listFinder s) 
     186    (do labelSetLabel lblSublogic "No sublogic" 
     187        listStoreClear listFinder 
     188        activate widgets False 
     189        widgetSetSensitive btnCheck False) 
     190    (do activate widgets True; widgetSetSensitive btnCheck False) 
    198191 
    199192  -- bindings 
    200193  let selectWith f = do 
    201         mModel <- treeViewGetModel trvNodes 
    202         case mModel of 
    203           Nothing -> return () 
    204           Just m -> do 
    205             writeIORef selection [] 
    206             selector <- treeViewGetSelection trvNodes 
    207             treeModelForeach m $ \ iter -> do 
    208               path@(row:[]) <- treeModelGetPath m iter 
    209               (FNode { status = s }) <- listStoreGetValue listNodes row 
    210               if f s then do 
    211                   treeSelectionSelectIter selector iter 
    212                   modifyIORef selection (path:) 
    213                 else treeSelectionUnselectIter selector iter 
    214               return False 
     194        model <- treeViewGetModel trvNodes 
     195        sel <- treeViewGetSelection trvNodes 
     196        treeModelForeach (fromJust model) $ \ i -> do 
     197          (row:[]) <- treeModelGetPath (fromJust model) i 
     198          (FNode { status = s }) <- listStoreGetValue listNodes row 
     199          (if f s then treeSelectionSelectIter else treeSelectionUnselectIter) 
     200            sel i 
     201          return False 
    215202 
    216203  onClicked btnNodesUnchecked $ selectWith (== CSUnchecked) 
     
    276263                  let n = getPName cc 
    277264                      f = Map.findWithDefault (Finder n cc [] 0) n m in 
    278                   Map.insert n (f { comorphs = c : comorphs f}) m 
     265                  Map.insert n (f { comorphism = c : comorphism f}) m 
    279266                ) Map.empty 
    280267                $ getConsCheckers $ findComorphismPaths logicGraph sl) 
     
    287274check :: LibName -> LibEnv -> DGraph -> Finder -> Int 
    288275      -> (Double -> String -> IO ()) -> [(Int,FNode)] -> IO [(Int, FNode)] 
    289 check ln le dg (Finder { finder = cc, comorphs = cs, selected = i}) timeout 
     276check ln le dg (Finder { finder = cc, comorphism = cs, selected = i}) timeout 
    290277      update nodes = do 
    291278  let count' = fromIntegral $ length nodes 
     
    306293               (\ (n,_,c) -> n ++ ": " ++ show c) $ concatMap expand paths 
    307294      case ret of 
    308         Just (_,(n,_,c)) -> case findIndex ((n ==) . fname) paths of 
    309           Just i -> let f = paths !! i in case findIndex (c ==) $ comorphs f of 
    310             Just i' -> do 
    311               listStoreSetValue list i $ f { selected = i' } 
    312               treeSelectionSelectPath selector [i] 
    313               unlock 
    314             Nothing -> return () 
     295        Just (_,(n,_,c)) -> case findIndex ((n ==) . fName) paths of 
     296          Just i -> let f = paths !! i in 
     297            case findIndex (c ==) $ comorphism f of 
     298              Just i' -> do 
     299                listStoreSetValue list i $ f { selected = i' } 
     300                treeSelectionSelectPath selector [i] 
     301                unlock 
     302              Nothing -> return () 
    315303          Nothing -> return () 
    316304        Nothing -> return () 
    317305 
    318306expand :: Finder -> [(String, G_cons_checker, AnyComorphism)] 
    319 expand (Finder { fname = n, finder = cc, comorphs = cs }) = 
     307expand (Finder { fName = n, finder = cc, comorphism = cs }) = 
    320308  map (\ c -> (n,cc,c)) cs 
    321309 
  • trunk/GUI/GtkGenericATP.hs

    r12755 r12779  
    1212-} 
    1313 
    14 module GUI.GtkGenericATP (genericATPgui) where 
     14module GUI.GtkGenericATP ( genericATPgui ) where 
    1515 
    1616import Graphics.UI.Gtk 
     
    3636 
    3737import Logic.Prover 
    38  
    39 data Goal = Goal { name :: String 
    40                  , status :: GStatus } 
    41  
    42 data GStatus = GOpen 
    43              | GTimeout 
    44              | GDisproved 
    45              | GInconsistent 
    46              | GProved 
    47                deriving (Eq, Ord) 
    48  
    49 instance Show Goal where 
    50   show (Goal { name = n, status = s }) = spanString s $ statusToPrefix s ++ n 
    51  
    52 statusToColor :: GStatus -> String 
    53 statusToColor s = case s of 
    54   GOpen         -> "black" 
    55   GProved       -> "green" 
    56   GDisproved    -> "red" 
    57   GTimeout      -> "blue" 
    58   GInconsistent -> "orange" 
    59  
    60 statusToPrefix :: GStatus -> String 
    61 statusToPrefix s = case s of 
    62   GOpen         -> "[ ] " 
    63   GProved       -> "[+] " 
    64   GDisproved    -> "[-] " 
    65   GTimeout      -> "[t] " 
    66   GInconsistent -> "[*] " 
    67  
    68 spanString :: GStatus -> String -> String 
    69 spanString s m = "<span color=\"" ++ statusToColor s ++ "\">" ++ m ++ "</span>" 
    70  
    71 instance Show GStatus where 
    72   show GProved       = spanString GProved       "Proved" 
    73   show GInconsistent = spanString GInconsistent "Proved (Theory inconsistent!)" 
    74   show GDisproved    = spanString GDisproved    "Disproved" 
    75   show GOpen         = spanString GOpen         "Open" 
    76   show GTimeout      = spanString GTimeout      "Open (Timeout!)" 
    7738 
    7839genericATPgui :: (Ord proof_tree, Ord sentence) 
     
    11778    windowSetTitle window $ prName ++ ": " ++ thName 
    11879 
    119     let widgets = [ toWidget trvGoals        , toWidget btnClose 
     80    let widgets = [ toWidget btnClose        , toWidget btnShowDetails 
    12081                  , toWidget btnHelp         , toWidget btnSaveConfig 
    12182                  , toWidget sbTimeout       , toWidget entryOptions 
    12283                  , toWidget cbIncludeProven , toWidget btnProveSelected 
    12384                  , toWidget btnProveSelected, toWidget btnProveAll 
    124                   , toWidget lblStatus       , toWidget trvAxioms 
    125                   , toWidget btnSaveProblem  , toWidget btnShowDetails 
    126                   ] 
     85                  , toWidget lblStatus       , toWidget btnSaveProblem ] 
    12786        switch = activate widgets 
    12887        switchAll b = do 
     
    14099 
    141100    -- setting up lists 
    142     listGoals <- setListData trvGoals show $ 
    143       map (\ g -> let n = AS_Anno.senAttr g 
    144                       cfg = Map.findWithDefault (error "Config not found!") n 
    145                               $ configsMap initState 
    146                   in Goal { name = n 
    147                           , status = toGStatus cfg }) initGoals 
     101    listGoals <- setListData trvGoals show $ toGoals initState 
    148102    listAxioms <- setListData trvAxioms id [] 
    149103 
     
    161115      -- setting new selected goal 
    162116      mSelected <- getSelectedSingle trvGoals listGoals 
    163       let s = maybe s' (\ (_, Goal { name = n }) -> s' { currentGoal = Just n}) 
     117      let s = maybe s' (\ (_, Goal { gName = n }) -> s' { currentGoal = Just n}) 
    164118                    mSelected 
    165119      putMVar stateMVar s 
     
    221175 
    222176    -- show details of selected goal 
    223     onClicked btnStop $ tryTakeMVar threadId >>=maybe (return ()) killThread 
     177    onClicked btnStop $ do 
     178      tryTakeMVar threadId >>=maybe (return ()) killThread 
     179      putMVar threadId tid' 
    224180 
    225181    -- show details of selected goal 
     
    277233                ATPError m -> errorDialog "Error" m 
    278234                _ -> return () 
    279               postGUISync $ do 
     235              postGUIAsync $ do 
    280236                let progress = fromIntegral gPSF / fromIntegral numGoals 
    281237                if cont then updat progress $ AS_Anno.senAttr $ fromJust nextSen 
     
    286242                s' <- readMVar stateMVar 
    287243                update' s' 
    288                 return cont) 
     244              return cont) 
    289245        updat 0 firstGoalName 
    290246        switchAll False 
     
    367323  let newGoals = goalsList s 
    368324      oldGoals = foldl (\ gs g -> (g, length gs):gs) [] oldGoals' 
    369   mapM_ (\ g -> do 
    370       let n = AS_Anno.senAttr g 
    371           (g', idx) = fromMaybe (error "Goal not found!") 
    372                         $ find (\ (Goal { name = n' }, _) -> n == n') oldGoals 
    373           cfg = Map.findWithDefault (error "Config not found!") n $ configsMap s 
    374       listStoreSetValue listGoals idx $ g' { status = toGStatus cfg } 
     325  mapM_ (\ g' -> do 
     326      let n = AS_Anno.senAttr g' 
     327          (g, idx) = fromMaybe (error "Goal not found!") 
     328                        $ find (\ (Goal { gName = n' }, _) -> n == n') oldGoals 
     329          c = Map.findWithDefault (error "Config not found!") n $ configsMap s 
     330      listStoreSetValue listGoals idx $ g { gStatus = genericConfigToGStatus c } 
    375331    ) newGoals 
    376332 
     
    378334  selected <- getSelectedSingle trvGoals listGoals 
    379335  case selected of 
    380     Just (_, Goal { name = n, status = stat }) -> do 
     336    Just (_, Goal { gName = n, gStatus = stat }) -> do 
    381337      let cfg = Map.findWithDefault (error "GUI.GenericATP.updateDisplay") n 
    382338                  $ configsMap s 
     
    396352setExtraOpts opts c = c { extraOpts = opts } 
    397353 
    398 -- | Converts a ProofStatus into a GStatus 
    399 toGStatus :: GenericConfig proof_tree -> GStatus 
    400 toGStatus cfg = case goalStatus $ proofStatus cfg of 
    401   Proved (Just True) -> GProved 
    402   Proved _           -> GInconsistent 
    403   Disproved          -> GDisproved 
    404   Open _             -> if timeLimitExceeded cfg then GTimeout else GOpen 
     354toGoals :: GenericState sign sentence proof_tree pst -> [Goal] 
     355toGoals s = map (\ g -> 
     356  let n = AS_Anno.senAttr g 
     357      c = Map.findWithDefault (error "Config not found!") n $ configsMap s 
     358  in Goal { gName = n, gStatus = genericConfigToGStatus c }) $ goalsList s 
  • trunk/GUI/GtkProverGUI.hs

    r12754 r12779  
    1212-} 
    1313 
    14 module GUI.GtkProverGUI 
    15   (showProverGUI) 
    16   where 
     14module GUI.GtkProverGUI ( showProverGUI ) where 
    1715 
    1816import Graphics.UI.Gtk 
     
    2119import GUI.GtkUtils 
    2220import qualified GUI.Glade.ProverGUI as ProverGUI 
     21import GUI.HTkProofDetails -- not implemented in Gtk 
    2322 
    2423import Common.AS_Annotation as AS_Anno 
    2524import qualified Common.Doc as Pretty 
    26 import qualified Common.Result as Result 
     25import Common.Result 
    2726import qualified Common.OrderedMap as OMap 
    2827import Common.ExtSign 
    2928 
     29import Control.Monad ((<=<)) 
    3030import Control.Concurrent.MVar 
    3131 
     
    4040import Static.GTheory 
    4141 
    42 import Monad (when) 
    43  
    44 import Data.IORef 
    4542import qualified Data.Map as Map 
    4643import Data.List 
     44import Data.Maybe ( fromJust, fromMaybe, isJust ) 
     45 
     46data GProver = GProver { pName :: String 
     47                       , prover :: G_prover 
     48                       , comorphism :: [AnyComorphism] 
     49                       , selected :: Int } 
    4750 
    4851{- ProverGUI -} 
    4952 
    5053-- | Displays the consistency checker window 
    51 showProverGUI :: 
    52   (Logic lid sublogics basic_spec sentence symb_items symb_map_items 
    53          sign morphism symbol raw_symbol proof_tree) 
     54showProverGUI :: Logic lid sublogics basic_spec sentence symb_items 
     55                       symb_map_items sign morphism symbol raw_symbol proof_tree 
    5456  => lid 
    5557  -> ProofActions lid sentence -- ^ record of possible GUI actions 
     
    6062  -> [(G_prover,AnyComorphism)] -- ^ list of suitable comorphisms to provers 
    6163                                -- for sublogic of G_theory 
    62   -> IO (Result.Result G_theory) 
    63 showProverGUI lid prGuiAcs thName warningTxt th knownProvers comorphList = do 
     64  -> IO (Result G_theory) 
     65showProverGUI lid prGuiAcs thName warn th knownProvers comorphList = do 
    6466  initState <- (initialState lid thName th knownProvers comorphList 
    6567                >>= recalculateSublogicF prGuiAcs) 
     
    106108 
    107109    -- set list data 
    108     listProvers <- setListData trvProvers id $ Map.keys $ proversMap initState 
    109     listGoals <- setListData trvGoals id $ OMap.keys $ goalMap initState 
    110     listAxioms <- setListData trvAxioms id 
    111                     $ map (\ (k,s) -> if wasTheorem s then "(Th) " ++ k else k) 
    112                     $ OMap.toList axioms 
    113     listTheorems <- setListData trvTheorems (id) $ OMap.keys $ goalMap initState 
     110    listProvers <- setListData trvProvers pName [] 
     111    listGoals <- setListData trvGoals show $ toGoals initState 
     112    listAxioms <- setListData trvAxioms id $ toAxioms axioms 
     113    listTheorems <- setListData trvTheorems id $ toTheorem initState 
     114 
     115    let noProver = [ toWidget btnFineGrained 
     116                   , toWidget btnProve 
     117                   , toWidget lblComorphism 
     118                   , toWidget lblSublogic ] 
     119        noAxiom = [ toWidget btnAxiomsAll 
     120                  , toWidget btnAxiomsNone 
     121                  , toWidget btnAxiomsInvert 
     122                  , toWidget btnAxiomsFormer ] 
     123        noTheory = [ toWidget btnTheoremsAll 
     124                   , toWidget btnTheoremsNone 
     125                   , toWidget btnTheoremsInvert ] 
     126        noGoal = [ toWidget btnGoalsAll 
     127                 , toWidget btnGoalsNone 
     128                 , toWidget btnGoalsInvert 
     129                 , toWidget btnGoalsSelectOpen ] 
     130        prove = noProver ++ noAxiom ++ noTheory ++ noGoal ++ 
     131                [ toWidget btnShowTheory 
     132                , toWidget btnShowSelectedTheory 
     133                , toWidget btnClose 
     134                , toWidget btnProofDetails 
     135                , toWidget btnDisplay ] 
     136        update s' = do 
     137          s <- updateGoals trvGoals listGoals =<< 
     138               updateComorphism lblComorphism trvProvers listProvers =<< 
     139               updateProver trvProvers listProvers =<< 
     140               updateSublogic lblSublogic prGuiAcs knownProvers =<< 
     141               setSelectedGoals trvGoals listGoals =<< 
     142               setSelectedSens trvAxioms listAxioms trvTheorems listTheorems s' 
     143          activate noProver 
     144            (isJust (selectedProver s) && not (null $ selectedGoals s)) 
     145          return s 
     146 
     147    activate noGoal (not $ OMap.null $ goalMap initState) 
     148    activate noAxiom (not $ OMap.null axioms) 
     149    activate noTheory (not $ OMap.null $ goalMap initState) 
    114150 
    115151    -- setup provers list 
    116     setListSelectorSingle trvProvers $ modifyMVar_ state 
    117                                      $ selectProver trvProvers listProvers 
    118     setSelectedProver trvProvers initState 
    119  
    120     let update = updateStatusSublogic lblSublogic trvGoals listGoals trvAxioms 
    121                    listAxioms trvTheorems listTheorems trvProvers listProvers 
    122                    prGuiAcs knownProvers 
    123         action = modifyMVar_ state $ update 
     152    setListSelectorSingle trvProvers $ modifyMVar_ state $ 
     153      update <=< setSelectedProver trvProvers listProvers 
    124154 
    125155    -- setup goal list 
    126     selectedGoals' <- setListSelectorMultiple trvGoals btnGoalsAll btnGoalsNone 
    127                         btnGoalsInvert action 
    128     onClicked btnGoalsSelectOpen $ modifyMVar_ state $ (\ s -> do 
    129       (Just model) <- treeViewGetModel trvGoals 
    130       selector <- treeViewGetSelection trvGoals 
    131       let 
    132         isOpen st = 
    133           let thst = thmStatus st 
    134           in if null thst 
    135             then True 
    136             else case maximum $ map snd $ thst of 
     156    setListSelectorMultiple trvGoals btnGoalsAll btnGoalsNone btnGoalsInvert $ 
     157      modifyMVar_ state update 
     158 
     159    onClicked btnGoalsSelectOpen $ modifyMVar_ state $ \ s -> do 
     160      model <- treeViewGetModel trvGoals 
     161      sel <- treeViewGetSelection trvGoals 
     162      let isOpen st = let thst = thmStatus st in 
     163            null thst || case maximum $ map snd thst of 
    137164              BasicProof _ pst -> isOpenGoal $ goalStatus pst 
    138165              _ -> False 
    139         select iter = do 
    140           (row:[]) <- treeModelGetPath model iter 
    141           key <- listStoreGetValue listGoals row 
    142           if maybe (error "goal lookup") isOpen $ OMap.lookup key $ goalMap s 
    143             then do 
    144               modifyIORef selectedGoals' ((row:[]):) 
    145               treeSelectionSelectIter selector iter 
    146             else treeSelectionUnselectIter selector iter 
    147           return False 
    148       writeIORef selectedGoals' [] 
    149       treeModelForeach model select 
    150       s' <- update s 
    151       return s') 
     166      treeModelForeach (fromJust model) $ \ i -> do 
     167        (row:[]) <- treeModelGetPath (fromJust model) i 
     168        key <- listStoreGetValue listGoals row 
     169        (if isOpen $ fromJust $ OMap.lookup (gName key) $ goalMap s 
     170          then treeSelectionSelectIter else treeSelectionUnselectIter) sel i 
     171        return False 
     172      update s 
    152173 
    153174    -- setup axioms list 
    154     selectedAxioms <- setListSelectorMultiple trvAxioms btnAxiomsAll 
    155                         btnAxiomsNone btnAxiomsInvert action 
    156     onClicked btnAxiomsFormer $ modifyMVar_ state $ (\ s -> do 
     175    setListSelectorMultiple trvAxioms btnAxiomsAll btnAxiomsNone btnAxiomsInvert 
     176      $ modifyMVar_ state update 
     177    onClicked btnAxiomsFormer $ modifyMVar_ state $ \ s -> do 
    157178      aM <- axiomMap s 
    158       (Just model) <- treeViewGetModel trvAxioms 
    159       selector <- treeViewGetSelection trvAxioms 
    160       let 
    161         isNotFormerTheorem st = not $ wasTheorem st 
    162         select iter = do 
    163           (row:[]) <- treeModelGetPath model iter 
    164           key <- listStoreGetValue listAxioms row 
    165           k <- case stripPrefix "(Th) " key of 
    166             Just k -> return k 
    167             Nothing -> return key 
    168           if maybe (error "axiom lookup") isNotFormerTheorem $ OMap.lookup k aM 
    169             then do 
    170               modifyIORef selectedAxioms ((row:[]):) 
    171               treeSelectionSelectIter selector iter 
    172             else treeSelectionUnselectIter selector iter 
    173           return False 
    174       writeIORef selectedAxioms [] 
    175       treeModelForeach model select 
    176       s' <- update s 
    177       return s') 
     179      model <- treeViewGetModel trvAxioms 
     180      sel <- treeViewGetSelection trvAxioms 
     181      treeModelForeach (fromJust model) $ \ i -> do 
     182        (row:[]) <- treeModelGetPath (fromJust model) i 
     183        key <- listStoreGetValue listAxioms row 
     184        k <- case stripPrefix "(Th) " key of 
     185          Just k -> return k 
     186          Nothing -> return key 
     187        (if not $ wasTheorem $ fromJust $ OMap.lookup k aM 
     188          then treeSelectionSelectIter else treeSelectionUnselectIter) sel i 
     189        return False 
     190      update s 
     191 
     192    modifyMVar_ state $ update <=< updateProver trvProvers listProvers 
    178193 
    179194    -- setup theorems list 
    180195    setListSelectorMultiple trvTheorems btnTheoremsAll btnTheoremsNone 
    181                             btnTheoremsInvert action 
     196                            btnTheoremsInvert $ modifyMVar_ state update 
    182197 
    183198    -- button bindings 
     
    185200 
    186201    onClicked btnShowTheory $ 
    187       displayTheoryWithWarning "Theory" thName warningTxt th 
     202      displayTheoryWithWarning "Theory" thName warn th 
    188203 
    189204    onClicked btnShowSelectedTheory $ do 
    190205      s <- readMVar state 
    191       displayTheoryWithWarning "Selected Theory" thName warningTxt 
    192                                (selectedTheory s) 
    193  
    194     onClicked btnDisplay $ do 
     206      displayTheoryWithWarning "Selected Theory" thName warn $ selectedTheory s 
     207 
     208    onClicked btnDisplay $ readMVar state >>= displayGoals 
     209 
     210    onClicked btnProofDetails $ do 
    195211      s <- readMVar state 
    196       displayGoals s 
    197  
    198     onClicked btnProofDetails $ return () 
    199  
    200     onClicked btnProve $ return () 
    201  
    202     onClicked btnFineGrained $ forkIO_ $ modifyMVar_ state $ (\ s -> do 
    203       let s' = s { proverRunning = True } 
    204       prState <- update s' 
    205       Result.Result ds ms'' <- fineGrainedSelectionF prGuiAcs prState 
    206       s'' <- case ms'' of 
    207         Nothing -> do 
    208           -- Is error needed? 
    209           --errorDialog "Error" (showRelDiags 2 ds) 
    210           return s' 
    211         Just res -> return res 
    212       return s'' { proverRunning = False 
    213                  , accDiags = accDiags s'' ++ ds }) 
     212      forkIO_ $ doShowProofDetails s 
     213 
     214    onClicked btnProve $ do 
     215      activate prove False 
     216      forkIOWithPostProcessing (readMVar state >>= proveF prGuiAcs) 
     217        $ \ (Result ds ms) -> do 
     218            s <- case ms of 
     219              Nothing -> do 
     220                errorDialog "Error" (showRelDiags 2 ds) 
     221                takeMVar state 
     222              Just res -> do 
     223                takeMVar state 
     224                return res 
     225            activate prove True 
     226            putMVar state =<< update s { proverRunning = False 
     227                                       , accDiags = accDiags s ++ ds} 
     228 
     229    onClicked btnFineGrained $ modifyMVar_ state $ \ s -> do 
     230      mp <- fineGrainedSelection trvProvers listProvers 
     231      update <=< updateProver trvProvers listProvers 
     232        $ maybe s (\ p -> s { selectedProver = Just $ pName p }) mp 
    214233 
    215234    onDestroy window $ putMVar wait () 
     
    218237 
    219238  _ <- takeMVar wait 
    220   return $ Result.Result { Result.diags = [] 
    221                          , Result.maybeResult = Nothing } 
     239  s <- takeMVar state 
     240  case theory s of 
     241    G_theory lidT sigT indT sensT _ -> do 
     242      gMap <- coerceThSens (logicId s) lidT "ProverGUI last coerce" $ goalMap s 
     243      return Result { diags = accDiags s 
     244                    , maybeResult = Just $ G_theory lidT sigT indT 
     245                                             (Map.union sensT gMap) startThId } 
    222246 
    223247-- | Called whenever the button "Display" is clicked. 
    224 displayGoals :: 
    225   (Logic lid sublogics basic_spec sentence symb_items symb_map_items 
    226          sign morphism symbol raw_symbol proof_tree) 
    227   => ProofState lid sentence 
    228   -> IO () 
     248displayGoals :: Logic lid sublogics basic_spec sentence symb_items 
     249                      symb_map_items sign morphism symbol raw_symbol proof_tree 
     250             => ProofState lid sentence -> IO () 
    229251displayGoals s = case theory s of 
    230252  G_theory lid1 (ExtSign sig1 _) _ _ _ -> do 
    231253    let thName = theoryName s 
    232         goalsText s' = show $ Pretty.vsep $ 
    233                        map (print_named lid1 . 
    234                             AS_Anno.mapNamed (simplify_sen lid1 sig1)) $ 
    235                        toNamedList s' 
     254        goalsText = show . Pretty.vsep 
     255          . map (print_named lid1 . AS_Anno.mapNamed (simplify_sen lid1 sig1)) 
     256          . toNamedList 
    236257        sens = selectedGoalMap s 
    237258    sens' <- coerceThSens (logicId s) lid1 "" sens 
     
    239260             $ Just (thName ++ "-goals.txt") 
    240261 
    241 setSelectedProver :: 
    242      TreeView 
    243   -> ProofState lid sentence 
    244   -> IO () 
    245 setSelectedProver view s = do 
     262fineGrainedSelection :: TreeView -> ListStore GProver -> IO (Maybe GProver) 
     263fineGrainedSelection view list = do 
     264  ps <- listStoreToList list 
    246265  selector <- treeViewGetSelection view 
    247   let ind = case selectedProver s of 
    248               Just sp -> findIndex (==sp) $ Map.keys (proversMap s) 
    249               Nothing -> Nothing 
    250   maybe (return ()) (\i -> treeSelectionSelectPath selector [i]) ind 
    251  
    252 updateStatusSublogic :: 
    253      Label -- ^ sublogic label 
    254   -> TreeView -- ^ goals list 
    255   -> ListStore String -- ^ goals list 
    256   -> TreeView -- ^ axioms list 
    257   -> ListStore String -- ^ axioms list store 
    258   -> TreeView -- ^ theorems list 
    259   -> ListStore String -- ^ theorems list store 
    260   -> TreeView -- ^ provers list 
    261   -> ListStore String -- ^ provers list store 
    262   -> ProofActions lid sentence -- ^ record of possible GUI actions 
    263   -> KnownProvers.KnownProversMap -- ^ map of known provers 
    264   -> ProofState lid sentence 
    265   -> IO (ProofState lid sentence) 
    266 updateStatusSublogic lbl gls listGls axs listAxs ths listThs prs listPrs 
    267   prGuiAcs knownProvers s' = do 
    268   s'' <- updateStateGetSelectedSens axs listAxs ths listThs s' 
    269   s''' <- updateStateGetSelectedGoals gls listGls s'' 
    270   s <- recalculateSublogicF prGuiAcs $ (s''' {proversMap = knownProvers}) 
    271   setSublogic lbl $ show $ sublogicOfTheory s 
    272   when (Map.keys (proversMap s') /= Map.keys (proversMap s)) 
    273        (do updateListData listPrs $ Map.keys $ proversMap s' 
    274            setSelectedProver prs s) 
    275   return s{ selectedProver = 
    276               maybe Nothing (\ sp -> find (==sp) $ Map.keys (proversMap s)) 
    277                     (selectedProver s) } 
    278  
    279 updateStateGetSelectedGoals :: 
    280      TreeView 
    281   -> ListStore String 
    282   -> ProofState lid sentence 
    283   -> IO (ProofState lid sentence) 
    284 updateStateGetSelectedGoals view listGoals s = do 
    285   selector <- treeViewGetSelection view 
    286   rows <- treeSelectionGetSelectedRows selector 
    287   goals <- mapM (\ (row:[]) -> listStoreGetValue listGoals row) rows 
    288   return s { selectedGoals = goals } 
    289  
    290 updateStateGetSelectedSens :: 
    291      TreeView -- ^ axioms listbox 
    292   -> ListStore String 
    293   -> TreeView -- ^ theorems listbox 
    294   -> ListStore String 
    295   -> ProofState lid sentence 
    296   -> IO (ProofState lid sentence) 
    297 updateStateGetSelectedSens axs listAxs ths listThs s = do 
    298   selectorAxs <- treeViewGetSelection axs 
    299   selectorThs <- treeViewGetSelection ths 
    300   rowsAxs <- treeSelectionGetSelectedRows selectorAxs 
    301   rowsThs <- treeSelectionGetSelectedRows selectorThs 
    302   axioms <- mapM (\ (row:[]) -> listStoreGetValue listAxs row) rowsAxs 
    303   theorems <- mapM (\ (row:[]) -> listStoreGetValue listThs row) rowsThs 
    304   return s { includedAxioms   = axioms 
    305            , includedTheorems = theorems } 
     266  if null ps then error "Cant make selection without sublogic!" 
     267    else do 
     268      ret <- listChoiceAux "Choose a translation" 
     269               (\ (n,_,c) -> n ++ ": " ++ show c) $ concatMap expand ps 
     270      case ret of 
     271        Just (_,(n,_,c)) -> case findIndex ((n ==) . pName) ps of 
     272          Just i -> let p = ps !! i in case findIndex (c ==) $ comorphism p of 
     273            Just i' -> do 
     274              let p' = p { selected = i' } 
     275              listStoreSetValue list i p' 
     276              treeSelectionSelectPath selector [i] 
     277              return $ Just p' 
     278            Nothing -> error "can't find selected comorphism" 
     279          Nothing -> error "can't find selected prover" 
     280        Nothing -> return Nothing 
     281 
     282expand :: GProver -> [(String, G_prover, AnyComorphism)] 
     283expand (GProver { pName = n, prover = p, comorphism = cs }) = 
     284  map (\ c -> (n, p, c)) cs 
     285 
     286updateSublogic :: Label -> ProofActions lid sentence 
     287               -> KnownProvers.KnownProversMap -> ProofState lid sentence 
     288               -> IO (ProofState lid sentence) 
     289updateSublogic lbl prGuiAcs knownProvers s' = do 
     290  s <- recalculateSublogicF prGuiAcs s' { proversMap = knownProvers } 
     291  labelSetLabel lbl $ show $ sublogicOfTheory s 
     292  return s 
     293 
     294updateComorphism :: Label -> TreeView -> ListStore GProver 
     295                 -> ProofState lid sentence -> IO (ProofState lid sentence) 
     296updateComorphism lbl trvProvers listProvers s = do 
     297  mprover <- getSelectedSingle trvProvers listProvers 
     298  case mprover of 
     299    Just (_, p) -> case comorphism p !! selected p of 
     300      Comorphism cid -> let dN = drop 1 $ dropWhile (/= ';') $ language_name cid 
     301        in labelSetLabel lbl $ if null dN then "identity" else dN 
     302    Nothing -> return () 
     303  return s 
     304 
     305updateProver :: TreeView -> ListStore GProver -> ProofState lid sentence 
     306             -> IO (ProofState lid sentence) 
     307updateProver trvProvers listProvers s = do 
     308  let new = toProvers s 
     309  old <- listStoreToList listProvers 
     310  let prvs = map (\ p -> case find ((pName p ==) . pName) old of 
     311          Nothing -> p 
     312          Just p' -> let oldC = comorphism p' !! selected p' in 
     313            p { selected = fromMaybe 0 $ findIndex (== oldC) $ comorphism p } 
     314        ) new 
     315      selFirst = do 
     316        selectFirst trvProvers 
     317        setSelectedProver trvProvers listProvers s 
     318  updateListData listProvers prvs 
     319  case selectedProver s of 
     320    Just p -> case findIndex ((p ==) . pName) prvs of 
     321      Just i -> do 
     322        sel <- treeViewGetSelection trvProvers 
     323        treeSelectionSelectPath sel [i] 
     324        return s 
     325      Nothing -> selFirst 
     326    Nothing -> selFirst 
     327 
     328updateGoals :: TreeView -> ListStore Goal -> ProofState lid sentence 
     329            -> IO (ProofState lid sentence) 
     330updateGoals trvGoals listGoals s = do 
     331  updateListData listGoals $ toGoals s 
     332  model <- treeViewGetModel trvGoals 
     333  sel <- treeViewGetSelection trvGoals 
     334  treeModelForeach (fromJust model) $ \ i -> do 
     335    (row:[]) <- treeModelGetPath (fromJust model) i 
     336    g <- listStoreGetValue listGoals row 
     337    (if any (gName g ==) $ selectedGoals s 
     338      then treeSelectionSelectIter else treeSelectionUnselectIter) sel i 
     339    return False 
     340  return s 
     341 
     342setSelectedGoals :: TreeView -> ListStore Goal -> ProofState lid sentence 
     343                 -> IO (ProofState lid sentence) 
     344setSelectedGoals trvGoals listGoals s = do 
     345  goals <- getSelectedMultiple trvGoals listGoals 
     346  return s { selectedGoals = map (gName . snd) goals } 
     347 
     348setSelectedSens :: TreeView -> ListStore String -> TreeView -> ListStore String 
     349                -> ProofState lid sentence -> IO (ProofState lid sentence) 
     350setSelectedSens axs listAxs ths listThs s = do 
     351  axioms <- getSelectedMultiple axs listAxs 
     352  theorems <- getSelectedMultiple ths listThs 
     353  return s { includedAxioms   = map snd axioms 
     354           , includedTheorems = map snd theorems } 
    306355 
    307356-- | Called whenever a prover is selected from the "Pick Theorem Prover" list. 
    308 selectProver :: 
    309      TreeView 
    310   -> ListStore String 
    311   -> ProofState lid sentence 
    312   -> IO (ProofState lid sentence) 
    313 selectProver view listPrs s = do 
    314   selector <- treeViewGetSelection view 
    315   ((row:[]):[]) <- treeSelectionGetSelectedRows selector 
    316   prover <- listStoreGetValue listPrs row 
    317   return s { selectedProver = Just prover } 
    318  
    319 -- | Called to set sublogic label 
    320 setSublogic :: Label -> String -> IO () 
    321 setSublogic label text = labelSetLabel label $ "<b>" ++ text ++ "</b>" 
    322  
     357setSelectedProver :: TreeView -> ListStore GProver -> ProofState lid sentence 
     358                  -> IO (ProofState lid sentence) 
     359setSelectedProver trvProvers listProvers s = do 
     360  mprover <- getSelectedSingle trvProvers listProvers 
     361  return s { selectedProver = maybe Nothing (Just . pName . snd) mprover } 
     362 
     363toAxioms :: ThSens sentence (AnyComorphism, BasicProof) -> [String] 
     364toAxioms = 
     365  map (\ (k,s) -> if wasTheorem s then "(Th) " ++ k else k) . OMap.toList 
     366 
     367toGoals :: ProofState lid sentence -> [Goal] 
     368toGoals = map toGoal . OMap.toList . goalMap 
     369  where toGoal (n, st) = let ts = thmStatus st in 
     370          Goal { gName = n 
     371               , gStatus = if null ts then GOpen 
     372                           else basicProofToGStatus $ maximum $ map snd ts } 
     373 
     374toTheorem :: ProofState lid sentence -> [String] 
     375toTheorem = OMap.keys . goalMap 
     376 
     377toProvers :: ProofState lid sentence -> [GProver] 
     378toProvers = Map.elems . foldr (\ (p', c) m -> 
     379    let n = getPName p' 
     380        p = Map.findWithDefault (GProver n p' [] 0) n m in 
     381    Map.insert n (p { comorphism = c : comorphism p}) m 
     382  ) Map.empty . comorphismsToProvers 
  • trunk/GUI/GtkUtils.hs

    r12754 r12779  
    7272 
    7373  , activate 
     74 
     75  -- * Datatypes and functions for prover 
     76  , Goal (..) 
     77  , GStatus (..) 
     78  , proofStatusToGStatus 
     79  , basicProofToGStatus 
     80  , genericConfigToGStatus 
    7481  ) 
    7582  where 
     
    8087import qualified GUI.Glade.Utils as Utils 
    8188 
    82 import Static.GTheory (G_theory) 
     89import Static.GTheory 
     90 
    8391import Common.DocUtils (showDoc) 
    8492 
     
    9199import System.IO (hFlush, hClose, hPutStr, openTempFile) 
    92100 
    93 import Data.IORef 
     101import Logic.Prover 
     102 
     103import Interfaces.GenericATPState 
    94104 
    95105-- | Returns a GladeXML Object of a xmlstring. 
     
    501511-- | Setup list with multiple selection 
    502512setListSelectorMultiple :: TreeView -> Button -> Button -> Button -> IO () 
    503                         -> IO (IORef [TreePath]) 
     513                        -> IO () 
    504514setListSelectorMultiple view btnAll btnNone btnInvert action = do 
    505515  selector <- treeViewGetSelection view 
    506516  treeSelectionSetMode selector SelectionMultiple 
    507   ioRefSelection <- newIORef ([] :: [TreePath]) 
    508517 
    509518  -- setup selector 
    510   onCursorChanged view $ do 
    511     s' <- treeSelectionGetSelectedRows selector 
    512     s <- readIORef ioRefSelection 
    513     let newSelection = [ x | x <- s', notElem x s] 
    514                     ++ [ x | x <- s, notElem x s'] 
    515     writeIORef ioRefSelection newSelection 
    516     treeSelectionUnselectAll selector 
    517     mapM_ (treeSelectionSelectPath selector) newSelection 
    518     action 
     519  onCursorChanged view action 
    519520 
    520521  treeSelectionSelectAll selector 
    521522 
    522523  -- setup buttons 
    523   onClicked btnAll $ do selectAll view ioRefSelection; action 
    524   onClicked btnNone $ do selectNone view ioRefSelection; action 
    525   onClicked btnInvert $ do selectInvert view ioRefSelection; action 
    526  
    527   return ioRefSelection 
     524  onClicked btnAll $ do selectAll view; action 
     525  onClicked btnNone $ do selectNone view; action 
     526  onClicked btnInvert $ do selectInvert view; action 
     527  return () 
    528528 
    529529-- | Selects the first item if possible 
     
    542542          path <- treeModelGetPath model iter 
    543543          treeViewSetCursor view path Nothing 
     544 
     545-- | Select all rows 
     546selectAll :: TreeView -> IO () 
     547selectAll view = treeViewGetSelection view >>= treeSelectionSelectAll 
     548 
     549-- | Deselect all rows 
     550selectNone :: TreeView -> IO () 
     551selectNone view = treeViewGetSelection view >>= treeSelectionUnselectAll 
     552 
     553-- | Invert selection of list 
     554selectInvert :: TreeView -> IO () 
     555selectInvert view = do 
     556  sel <- treeViewGetSelection view 
     557  selected <- treeSelectionGetSelectedRows sel 
     558  treeSelectionSelectAll sel 
     559  rows <- treeSelectionGetSelectedRows sel 
     560  mapM_ (\ row -> (if elem row selected 
     561      then treeSelectionUnselectPath else treeSelectionSelectPath) sel row 
     562    ) rows 
    544563 
    545564-- | Get selected item 
     
    571590  return $ zip rows items 
    572591 
    573 -- | Select all rows 
    574 selectAll :: TreeView -> IORef [TreePath] -> IO () 
    575 selectAll view ioRefSelection = do 
    576   selector <- treeViewGetSelection view 
    577   treeSelectionSelectAll selector 
    578   s <- treeSelectionGetSelectedRows selector 
    579   writeIORef ioRefSelection s 
    580  
    581 -- | Deselect all rows 
    582 selectNone :: TreeView -> IORef [TreePath] -> IO () 
    583 selectNone view ioRefSelection = do 
    584   selector <- treeViewGetSelection view 
    585   treeSelectionUnselectAll selector 
    586   writeIORef ioRefSelection [] 
    587  
    588 -- | Invert selection of list 
    589 selectInvert :: TreeView -> IORef [TreePath] -> IO () 
    590 selectInvert view ioRefSelection = do 
    591   selector <- treeViewGetSelection view 
    592   old <- treeSelectionGetSelectedRows selector 
    593   treeSelectionSelectAll selector 
    594   mapM_ (treeSelectionUnselectPath selector) old 
    595   new <- treeSelectionGetSelectedRows selector 
    596   writeIORef ioRefSelection new 
    597  
    598592-- | Sets data of list 
    599593setListData :: TreeView -> (a -> String) -> [a] -> IO (ListStore a) 
     
    619613activate :: [Widget] -> Bool -> IO () 
    620614activate widgets active = mapM_ (\ w -> widgetSetSensitive w active) widgets 
     615 
     616 
     617-- * Datatypes and functions for prover 
     618 
     619data Goal = Goal { gName :: String 
     620                 , gStatus :: GStatus } 
     621 
     622data GStatus = GOpen 
     623             | GTimeout 
     624             | GDisproved 
     625             | GInconsistent 
     626             | GProved 
     627             | GGuessed 
     628             | GConjectured 
     629             | GHandwritten 
     630               deriving (Eq, Ord) 
     631 
     632instance Show Goal where 
     633  show (Goal { gName = n, gStatus = s }) = spanString s $ statusToPrefix s ++ n 
     634 
     635statusToColor :: GStatus -> String 
     636statusToColor s = case s of 
     637  GOpen         -> "black" 
     638  GProved       -> "green" 
     639  GDisproved    -> "red" 
     640  GTimeout      -> "blue" 
     641  GInconsistent -> "orange" 
     642  GGuessed      -> "darkgreen" 
     643  GConjectured  -> "darkgreen" 
     644  GHandwritten  -> "darkgreen" 
     645 
     646statusToPrefix :: GStatus -> String 
     647statusToPrefix s = case s of 
     648  GOpen         -> "[ ] " 
     649  GProved       -> "[+] " 
     650  GDisproved    -> "[-] " 
     651  GTimeout      -> "[t] " 
     652  GInconsistent -> "[*] " 
     653  GGuessed      -> "[.] " 
     654  GConjectured  -> "[:] " 
     655  GHandwritten  -> "[/] " 
     656 
     657spanString :: GStatus -> String -> String 
     658spanString s m = "<span color=\"" ++ statusToColor s ++ "\">" ++ m ++ "</span>" 
     659 
     660instance Show GStatus where 
     661  show GProved       = spanString GProved       "Proved" 
     662  show GInconsistent = spanString GInconsistent "Proved by contradiction" 
     663  show GDisproved    = spanString GDisproved    "Disproved" 
     664  show GOpen         = spanString GOpen         "Open" 
     665  show GTimeout      = spanString GTimeout      "Open (Timeout!)" 
     666  show GGuessed      = spanString GGuessed      "Guessed" 
     667  show GConjectured  = spanString GConjectured  "Conjectured" 
     668  show GHandwritten  = spanString GHandwritten  "Handwritten" 
     669 
     670-- | Converts a ProofStatus into a GStatus 
     671proofStatusToGStatus :: forall a . ProofStatus a -> GStatus 
     672proofStatusToGStatus p = case goalStatus p  of 
     673  Proved (Just True) -> GProved 
     674  Proved _           -> GInconsistent 
     675  Disproved          -> GDisproved 
     676  Open _             -> GOpen 
     677 
     678-- | Converts a BasicProof into a GStatus 
     679basicProofToGStatus :: BasicProof -> GStatus 
     680basicProofToGStatus p = case p of 
     681  BasicProof _ st -> proofStatusToGStatus st 
     682  Guessed         -> GGuessed 
     683  Conjectured     -> GConjectured 
     684  Handwritten     -> GHandwritten 
     685 
     686-- | Converts a GenericConfig into a GStatus 
     687genericConfigToGStatus :: GenericConfig a -> GStatus 
     688genericConfigToGStatus cfg = case proofStatusToGStatus $ proofStatus cfg of 
     689  GOpen -> if timeLimitExceeded cfg then GTimeout else GOpen 
     690  s     -> s 
  • trunk/GUI/HTkGenericATP.hs

    r12754 r12779  
    8686-} 
    8787statusProvedButInconsistent :: (ProofStatusColour, String) 
    88 statusProvedButInconsistent = (Brown, "Proved (Theory inconsistent!)") 
     88statusProvedButInconsistent = (Brown, "Proved by contradiction") 
    8989 
    9090{- |