| 1 | {- | |
|---|
| 2 | Module : $Header$ |
|---|
| 3 | Description : devGraph rule that calls provers for specific logics |
|---|
| 4 | Copyright : (c) J. Gerken, T. Mossakowski, K. Luettich, Uni Bremen 2002-2006 |
|---|
| 5 | License : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt |
|---|
| 6 | Maintainer : till@informatik.uni-bremen.de |
|---|
| 7 | Stability : provisional |
|---|
| 8 | Portability : non-portable(Logic) |
|---|
| 9 | |
|---|
| 10 | devGraph rule that calls provers for specific logics |
|---|
| 11 | |
|---|
| 12 | Proof rule "basic inference" in the development graphs calculus. |
|---|
| 13 | Follows Sect. IV:4.4 of the CASL Reference Manual. |
|---|
| 14 | |
|---|
| 15 | References: |
|---|
| 16 | |
|---|
| 17 | T. Mossakowski, S. Autexier and D. Hutter: |
|---|
| 18 | Extending Development Graphs With Hiding. |
|---|
| 19 | H. Hussmann (ed.): Fundamental Approaches to Software Engineering 2001, |
|---|
| 20 | Lecture Notes in Computer Science 2029, p. 269-283, |
|---|
| 21 | Springer-Verlag 2001. |
|---|
| 22 | |
|---|
| 23 | -} |
|---|
| 24 | |
|---|
| 25 | module Proofs.InferBasic (basicInferenceNode, basicInferenceSubTree) where |
|---|
| 26 | |
|---|
| 27 | import Static.GTheory |
|---|
| 28 | import Static.DevGraph |
|---|
| 29 | import Proofs.DGFlattening(singleTree_flattening_dunions) |
|---|
| 30 | |
|---|
| 31 | import Proofs.EdgeUtils |
|---|
| 32 | import Proofs.AbstractState |
|---|
| 33 | import Proofs.TheoremHideShift |
|---|
| 34 | |
|---|
| 35 | import Common.ExtSign |
|---|
| 36 | import Common.LibName |
|---|
| 37 | import Common.Result |
|---|
| 38 | import Common.ResultT |
|---|
| 39 | import Common.AS_Annotation |
|---|
| 40 | |
|---|
| 41 | import Control.Monad.Trans |
|---|
| 42 | |
|---|
| 43 | import Logic.Logic |
|---|
| 44 | import Logic.Prover |
|---|
| 45 | import Logic.Grothendieck |
|---|
| 46 | import Logic.Comorphism |
|---|
| 47 | import Logic.Coerce |
|---|
| 48 | |
|---|
| 49 | import Comorphisms.KnownProvers |
|---|
| 50 | |
|---|
| 51 | import GUI.Utils |
|---|
| 52 | import GUI.ProofManagement |
|---|
| 53 | -- import GUI.History(CommandHistory, addProveToHist) |
|---|
| 54 | |
|---|
| 55 | import qualified Common.Lib.Graph as Tree |
|---|
| 56 | import Data.Graph.Inductive.Basic (elfilter) |
|---|
| 57 | import Data.Graph.Inductive.Graph |
|---|
| 58 | import Data.Maybe |
|---|
| 59 | import qualified Data.Map as Map |
|---|
| 60 | |
|---|
| 61 | getCFreeDefLinks :: DGraph -> Node |
|---|
| 62 | -> ([[LEdge DGLinkLab]], [[LEdge DGLinkLab]]) |
|---|
| 63 | getCFreeDefLinks dg tgt = |
|---|
| 64 | let isGlobalOrCFreeEdge = liftOr isGlobalEdge $ liftOr isFreeEdge isCofreeEdge |
|---|
| 65 | paths = map reverse $ Tree.getAllPathsTo tgt |
|---|
| 66 | $ elfilter (isGlobalOrCFreeEdge . dgl_type) $ dgBody dg |
|---|
| 67 | myfilter p = filter ( \ ((_, _, lbl) : _) -> p $ dgl_type lbl) |
|---|
| 68 | in (myfilter isFreeEdge paths, myfilter isCofreeEdge paths) |
|---|
| 69 | |
|---|
| 70 | mkFreeDefMor :: [Named sentence] -> morphism -> morphism |
|---|
| 71 | -> FreeDefMorphism sentence morphism |
|---|
| 72 | mkFreeDefMor sens m1 m2 = FreeDefMorphism |
|---|
| 73 | { freeDefMorphism = m1 |
|---|
| 74 | , pathFromFreeDef = m2 |
|---|
| 75 | , freeTheory = sens |
|---|
| 76 | , isCofree = False } |
|---|
| 77 | |
|---|
| 78 | getFreeDefMorphism :: Logic lid sublogics |
|---|
| 79 | basic_spec sentence symb_items symb_map_items |
|---|
| 80 | sign morphism symbol raw_symbol proof_tree => |
|---|
| 81 | lid -> LibEnv -> LIB_NAME -> DGraph -> [LEdge DGLinkLab] |
|---|
| 82 | -> Maybe (FreeDefMorphism sentence morphism) |
|---|
| 83 | getFreeDefMorphism lid libEnv ln dg path = case path of |
|---|
| 84 | [] -> error "getFreeDefMorphism" |
|---|
| 85 | (s, t, l) : rp -> do |
|---|
| 86 | gmor@(GMorphism cid _ _ fmor _) <- return $ dgl_morphism l |
|---|
| 87 | (_,(G_theory lidth (ExtSign _sign _) _ axs _)) <- |
|---|
| 88 | resultToMaybe $ computeTheory False libEnv ln s |
|---|
| 89 | if isHomogeneous gmor then do |
|---|
| 90 | cfmor <- coerceMorphism (targetLogic cid) lid "getFreeDefMorphism1" fmor |
|---|
| 91 | sens <- coerceSens lidth lid "getFreeDefMorphism4" (toNamedList axs) |
|---|
| 92 | case rp of |
|---|
| 93 | [] -> do |
|---|
| 94 | G_theory lid2 (ExtSign sig _) _ _ _ <- |
|---|
| 95 | return $ dgn_theory $ labDG dg t |
|---|
| 96 | sig2 <- coercePlainSign lid2 lid "getFreeDefMorphism2" sig |
|---|
| 97 | return $ mkFreeDefMor sens cfmor $ ide sig2 |
|---|
| 98 | _ -> do |
|---|
| 99 | pm@(GMorphism cid2 _ _ pmor _) <- calculateMorphismOfPath rp |
|---|
| 100 | if isHomogeneous pm then do |
|---|
| 101 | cpmor <- coerceMorphism (targetLogic cid2) lid |
|---|
| 102 | "getFreeDefMorphism3" pmor |
|---|
| 103 | return $ mkFreeDefMor sens cfmor cpmor |
|---|
| 104 | else Nothing |
|---|
| 105 | else Nothing |
|---|
| 106 | |
|---|
| 107 | getCFreeDefMorphs :: Logic lid sublogics |
|---|
| 108 | basic_spec sentence symb_items symb_map_items |
|---|
| 109 | sign morphism symbol raw_symbol proof_tree => |
|---|
| 110 | lid -> LibEnv -> LIB_NAME -> DGraph -> Node |
|---|
| 111 | -> [FreeDefMorphism sentence morphism] |
|---|
| 112 | getCFreeDefMorphs lid libEnv ln dg node = let |
|---|
| 113 | (frees, cofrees) = getCFreeDefLinks dg node |
|---|
| 114 | myget = catMaybes . map (getFreeDefMorphism lid libEnv ln dg) |
|---|
| 115 | mkCoFree m = m { isCofree = True } |
|---|
| 116 | in myget frees ++ map mkCoFree (myget cofrees) |
|---|
| 117 | |
|---|
| 118 | selectProver :: GetPName a => [(a, AnyComorphism)] |
|---|
| 119 | -> ResultT IO (a, AnyComorphism) |
|---|
| 120 | selectProver ps = case ps of |
|---|
| 121 | [] -> fail "No prover available" |
|---|
| 122 | [p] -> return p |
|---|
| 123 | _ -> do |
|---|
| 124 | sel <- lift $ listBox "Choose a translation to a prover-supported logic" |
|---|
| 125 | $ map (\ (aGN, cm) -> shows cm $ " (" ++ getPName aGN ++ ")") ps |
|---|
| 126 | i <- case sel of |
|---|
| 127 | Just j -> return j |
|---|
| 128 | _ -> fail "Proofs.Proofs: selection" |
|---|
| 129 | return $ ps !! i |
|---|
| 130 | |
|---|
| 131 | cons_check :: Logic lid sublogics |
|---|
| 132 | basic_spec sentence symb_items symb_map_items |
|---|
| 133 | sign morphism symbol raw_symbol proof_tree |
|---|
| 134 | => lid -> ConsChecker sign sentence sublogics morphism proof_tree |
|---|
| 135 | -> String -> TheoryMorphism sign sentence morphism proof_tree |
|---|
| 136 | -> [FreeDefMorphism sentence morphism] |
|---|
| 137 | -> IO([Proof_status proof_tree]) |
|---|
| 138 | cons_check _ c = |
|---|
| 139 | maybe (\ _ _ -> fail "proveGUI not implemented") id (proveGUI c) |
|---|
| 140 | |
|---|
| 141 | proveTheory :: Logic lid sublogics |
|---|
| 142 | basic_spec sentence symb_items symb_map_items |
|---|
| 143 | sign morphism symbol raw_symbol proof_tree |
|---|
| 144 | => lid -> Prover sign sentence morphism sublogics proof_tree |
|---|
| 145 | -> String -> Theory sign sentence proof_tree |
|---|
| 146 | -> [FreeDefMorphism sentence morphism] |
|---|
| 147 | -> IO([Proof_status proof_tree]) |
|---|
| 148 | proveTheory _ p = |
|---|
| 149 | maybe (\ _ _ -> fail "proveGUI not implemented") id (proveGUI p) |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | -- | applies basic inference to a given node |
|---|
| 153 | basicInferenceNode :: Bool -- ^ True = CheckConsistency; False = Prove |
|---|
| 154 | -> LogicGraph -> (LIB_NAME,Node) -> LIB_NAME |
|---|
| 155 | -> GUIMVar -> LibEnv |
|---|
| 156 | -- -> CommandHistory |
|---|
| 157 | -> IO (Result (LibEnv, Result G_theory)) |
|---|
| 158 | basicInferenceNode checkCons lg (ln, node) libname guiMVar libEnv |
|---|
| 159 | -- ch |
|---|
| 160 | = do |
|---|
| 161 | let dGraph = lookupDGraph libname libEnv |
|---|
| 162 | runResultT $ do |
|---|
| 163 | -- compute the theory of the node, and its name |
|---|
| 164 | -- may contain proved theorems |
|---|
| 165 | (libEnv', thForProof@(G_theory lid1 (ExtSign sign _) _ axs _)) <- |
|---|
| 166 | liftR $ computeTheory False libEnv ln node |
|---|
| 167 | let thName = shows (getLIB_ID ln) "_" |
|---|
| 168 | ++ getNameOfNode node dGraph |
|---|
| 169 | sublogic = sublogicOfTh thForProof |
|---|
| 170 | -- select a suitable translation and prover |
|---|
| 171 | |
|---|
| 172 | cms = filter hasModelExpansion $ findComorphismPaths lg sublogic |
|---|
| 173 | if checkCons then do |
|---|
| 174 | (G_cons_checker lid4 cc, Comorphism cid) <- |
|---|
| 175 | selectProver $ getConsCheckers cms |
|---|
| 176 | let lidT = targetLogic cid |
|---|
| 177 | lidS = sourceLogic cid |
|---|
| 178 | bTh'@(sign', _) <- coerceBasicTheory lid1 lidS "" |
|---|
| 179 | (sign, toNamedList axs) |
|---|
| 180 | -- Borrowing: translate theory |
|---|
| 181 | (sign'', sens'') <- liftR $ wrapMapTheory cid bTh' |
|---|
| 182 | incl <- liftR $ inclusion lidT (empty_signature lidT) sign'' |
|---|
| 183 | let mor = TheoryMorphism |
|---|
| 184 | { t_source = empty_theory lidT, |
|---|
| 185 | t_target = Theory sign'' (toThSens sens''), |
|---|
| 186 | t_morphism = incl } |
|---|
| 187 | cc' <- coerceConsChecker lid4 lidT "" cc |
|---|
| 188 | pts <- lift $ cons_check lidT cc' thName mor |
|---|
| 189 | $ getCFreeDefMorphs lidT libEnv' ln dGraph node |
|---|
| 190 | let resT = case pts of |
|---|
| 191 | [pt] -> case goalStatus pt of |
|---|
| 192 | Proved (Just True) -> let |
|---|
| 193 | Result ds ms = extractModel cid sign' $ proofTree pt |
|---|
| 194 | in case ms of |
|---|
| 195 | Nothing -> Result ds Nothing |
|---|
| 196 | Just (sign''', sens''') -> Result ds $ Just $ |
|---|
| 197 | G_theory lidS (mkExtSign sign''') startSigId |
|---|
| 198 | (toThSens sens''') startThId |
|---|
| 199 | st -> fail $ "prover status is: " ++ show st |
|---|
| 200 | _ -> fail "no unique cons checkers found" |
|---|
| 201 | -- ??? Borrowing to be implemented |
|---|
| 202 | return (libEnv', resT) |
|---|
| 203 | else do -- proving |
|---|
| 204 | -- get known Provers |
|---|
| 205 | |
|---|
| 206 | ----------------------------------------------------------------------------- |
|---|
| 207 | {- GOALS: |
|---|
| 208 | 1. Make a function that writes everything to files |
|---|
| 209 | 2. Add it to definition of ProverTemplate |
|---|
| 210 | 3. Implement it with BasicInference to avoid GUI stuff |
|---|
| 211 | 4. Add it to definition of IsaProve -} |
|---|
| 212 | let freedefs = getCFreeDefMorphs lid1 libEnv' ln dGraph node |
|---|
| 213 | kpMap <- liftR $ knownProversGUI |
|---|
| 214 | newTh <- ResultT $ |
|---|
| 215 | proofManagementGUI lid1 ProofActions { |
|---|
| 216 | proveF = (proveKnownPMap lg freedefs), |
|---|
| 217 | fineGrainedSelectionF = (proveFineGrainedSelect lg freedefs), |
|---|
| 218 | recalculateSublogicF = |
|---|
| 219 | recalculateSublogicAndSelectedTheory } |
|---|
| 220 | thName |
|---|
| 221 | (addHasInHidingWarning dGraph node) |
|---|
| 222 | thForProof |
|---|
| 223 | kpMap |
|---|
| 224 | (getProvers ProveGUI sublogic cms) |
|---|
| 225 | guiMVar |
|---|
| 226 | -- update the development graph |
|---|
| 227 | -- todo: throw out the stuff about edges |
|---|
| 228 | -- instead, mark proven things as proven in the node |
|---|
| 229 | -- TODO: Reimplement stuff |
|---|
| 230 | let oldContents = labDG dGraph node |
|---|
| 231 | newContents = oldContents{dgn_theory = newTh} |
|---|
| 232 | -- update the graph with the new node lab |
|---|
| 233 | nextDGraph = changeDGH dGraph $ SetNodeLab oldContents |
|---|
| 234 | (node, newContents) |
|---|
| 235 | return ( Map.insert libname nextDGraph libEnv' |
|---|
| 236 | , Result [] Nothing) |
|---|
| 237 | |
|---|
| 238 | -- | applies basic inference to a given node and whole import tree above |
|---|
| 239 | basicInferenceSubTree :: Bool -- ^ True = CheckConsistency; False = Prove |
|---|
| 240 | -> LogicGraph |
|---|
| 241 | -> (LIB_NAME,Node) |
|---|
| 242 | -> GUIMVar |
|---|
| 243 | -- -> CommandHistory |
|---|
| 244 | -> LibEnv |
|---|
| 245 | -> IO (Result (LibEnv, Result G_theory)) |
|---|
| 246 | basicInferenceSubTree checkCons lg (ln, node) guiMVar libEnv = do |
|---|
| 247 | let dGraph = lookupDGraph ln libEnv |
|---|
| 248 | runResultT $ do |
|---|
| 249 | -- compute the theory of the node, and its name |
|---|
| 250 | -- may contain proved theorems |
|---|
| 251 | (libEnv', thForProof@(G_theory lid1 (ExtSign sign _) _ axs _)) <- |
|---|
| 252 | liftR $ computeTheory False libEnv ln node |
|---|
| 253 | let thName = shows (getLIB_ID ln) "_" |
|---|
| 254 | ++ getNameOfNode node dGraph |
|---|
| 255 | sublogic = sublogicOfTh thForProof |
|---|
| 256 | -- select a suitable translation and prover |
|---|
| 257 | cms = filter hasModelExpansion $ findComorphismPaths lg sublogic |
|---|
| 258 | -- incoming nodes consideration |
|---|
| 259 | in_nds = map (\ (x,_,_) -> x) (innDG dGraph node) |
|---|
| 260 | in_labs = map (\ x -> (x,labDG dGraph x)) in_nds |
|---|
| 261 | in_theories = map (\ (x,y) -> (x,y,dgn_theory y)) in_labs |
|---|
| 262 | in_sublogics = map (\ (x,y,z) -> (x,y,z,sublogicOfTh z)) in_theories |
|---|
| 263 | in_cms = map (\ (x,y,z,t) -> |
|---|
| 264 | (x,y,z,filter (\ cm -> elem cm (propagateErrors isaComorphisms)) |
|---|
| 265 | $ findComorphismPaths lg t)) in_sublogics |
|---|
| 266 | in_changed = map (\ (x,y,z,t) -> case t of |
|---|
| 267 | [] -> return $ error "no comorphism's found" |
|---|
| 268 | hd : _ -> do |
|---|
| 269 | n_theory <- mapG_theory hd z |
|---|
| 270 | return $ SetNodeLab y (x,y {dgn_theory = n_theory})) in_cms |
|---|
| 271 | u_dGraph = changesDGH dGraph (map propagateErrors in_changed) |
|---|
| 272 | n_dGraph = groupHistory dGraph (DGRule "BasicInference-Conjectured") |
|---|
| 273 | u_dGraph |
|---|
| 274 | f_libEnv = propagateErrors $ singleTree_flattening_dunions |
|---|
| 275 | (Map.insert ln n_dGraph libEnv') ln node |
|---|
| 276 | f_dGraph = lookupDGraph ln f_libEnv |
|---|
| 277 | if checkCons then do |
|---|
| 278 | (G_cons_checker lid4 cc, Comorphism cid) <- |
|---|
| 279 | selectProver $ getConsCheckers cms |
|---|
| 280 | let lidT = targetLogic cid |
|---|
| 281 | lidS = sourceLogic cid |
|---|
| 282 | bTh'@(sign', _) <- coerceBasicTheory lid1 lidS "" |
|---|
| 283 | (sign, toNamedList axs) |
|---|
| 284 | -- Borrowing: translate theory |
|---|
| 285 | (sign'', sens'') <- liftR $ wrapMapTheory cid bTh' |
|---|
| 286 | incl <- liftR $ inclusion lidT (empty_signature lidT) sign'' |
|---|
| 287 | let mor = TheoryMorphism |
|---|
| 288 | { t_source = empty_theory lidT, |
|---|
| 289 | t_target = Theory sign'' (toThSens sens''), |
|---|
| 290 | t_morphism = incl } |
|---|
| 291 | cc' <- coerceConsChecker lid4 lidT "" cc |
|---|
| 292 | pts <- lift $ cons_check lidT cc' thName mor |
|---|
| 293 | $ getCFreeDefMorphs lidT f_libEnv ln f_dGraph node |
|---|
| 294 | let resT = case pts of |
|---|
| 295 | [pt] -> case goalStatus pt of |
|---|
| 296 | Proved (Just True) -> let |
|---|
| 297 | Result ds ms = extractModel cid sign' $ proofTree pt |
|---|
| 298 | in case ms of |
|---|
| 299 | Nothing -> Result ds Nothing |
|---|
| 300 | Just (sign''', sens''') -> Result ds $ Just $ |
|---|
| 301 | G_theory lidS (mkExtSign sign''') startSigId |
|---|
| 302 | (toThSens sens''') startThId |
|---|
| 303 | _ -> Result [] Nothing |
|---|
| 304 | _ -> Result [] Nothing |
|---|
| 305 | -- ??? to be implemented |
|---|
| 306 | return (f_libEnv, resT) |
|---|
| 307 | else do -- proving |
|---|
| 308 | -- get known Provers |
|---|
| 309 | let freedefs = getCFreeDefMorphs lid1 f_libEnv ln f_dGraph node |
|---|
| 310 | kpMap <- liftR $ knownProversGUI |
|---|
| 311 | newTh <- ResultT $ |
|---|
| 312 | proofManagementGUI lid1 ProofActions { |
|---|
| 313 | proveF = (proveKnownPMap lg freedefs), |
|---|
| 314 | fineGrainedSelectionF = (proveFineGrainedSelect lg freedefs), |
|---|
| 315 | recalculateSublogicF = |
|---|
| 316 | recalculateSublogicAndSelectedTheory } |
|---|
| 317 | thName |
|---|
| 318 | (addHasInHidingWarning f_dGraph node) |
|---|
| 319 | thForProof |
|---|
| 320 | kpMap |
|---|
| 321 | (getProvers ProveGUI sublogic cms) |
|---|
| 322 | guiMVar |
|---|
| 323 | -- update the development graph |
|---|
| 324 | -- todo: throw out the stuff about edges |
|---|
| 325 | -- instead, mark proven things as proven in the node |
|---|
| 326 | -- TODO: Reimplement stuff |
|---|
| 327 | let |
|---|
| 328 | oldContents = labDG f_dGraph node |
|---|
| 329 | newContents = oldContents{dgn_theory = newTh} |
|---|
| 330 | -- update the graph with the new node lab |
|---|
| 331 | nextDGraph = changeDGH f_dGraph $ SetNodeLab oldContents |
|---|
| 332 | (node, newContents) |
|---|
| 333 | return (Map.insert ln nextDGraph f_libEnv, Result [] Nothing) |
|---|
| 334 | |
|---|
| 335 | proveKnownPMap :: (Logic lid sublogics1 |
|---|
| 336 | basic_spec1 |
|---|
| 337 | sentence |
|---|
| 338 | symb_items1 |
|---|
| 339 | symb_map_items1 |
|---|
| 340 | sign1 |
|---|
| 341 | morphism1 |
|---|
| 342 | symbol1 |
|---|
| 343 | raw_symbol1 |
|---|
| 344 | proof_tree1) => |
|---|
| 345 | LogicGraph |
|---|
| 346 | -- -> CommandHistory |
|---|
| 347 | -> [FreeDefMorphism sentence morphism1] |
|---|
| 348 | -> ProofState lid sentence -> IO (Result (ProofState lid sentence)) |
|---|
| 349 | proveKnownPMap lg freedefs st = |
|---|
| 350 | maybe (proveFineGrainedSelect lg freedefs st) |
|---|
| 351 | (callProver st False freedefs) $ |
|---|
| 352 | lookupKnownProver st ProveGUI |
|---|
| 353 | |
|---|
| 354 | callProver :: (Logic lid sublogics1 |
|---|
| 355 | basic_spec1 |
|---|
| 356 | sentence |
|---|
| 357 | symb_items1 |
|---|
| 358 | symb_map_items1 |
|---|
| 359 | sign1 |
|---|
| 360 | morphism1 |
|---|
| 361 | symbol1 |
|---|
| 362 | raw_symbol1 |
|---|
| 363 | proof_tree1) => |
|---|
| 364 | ProofState lid sentence |
|---|
| 365 | -- -> CommandHistory |
|---|
| 366 | -> Bool -- indicates if a translation was chosen |
|---|
| 367 | -> [FreeDefMorphism sentence morphism1] |
|---|
| 368 | -> (G_prover,AnyComorphism) -> IO (Result (ProofState lid sentence)) |
|---|
| 369 | callProver st trans_chosen freedefs p_cm@(_,acm) = |
|---|
| 370 | runResultT $ do |
|---|
| 371 | G_theory_with_prover lid th p <- liftR $ prepareForProving st p_cm |
|---|
| 372 | let freedefs1 = maybe [] id $ |
|---|
| 373 | mapM (coerceFreeDefMorphism (logicId st) lid |
|---|
| 374 | "Logic.InferBasic: callProver") |
|---|
| 375 | freedefs |
|---|
| 376 | ps <- lift $ proveTheory lid p (theoryName st) th freedefs1 |
|---|
| 377 | -- lift $ putStrLn $ show ps |
|---|
| 378 | let st' = markProved acm lid ps st |
|---|
| 379 | -- lift $ addProveToHist ch st' |
|---|
| 380 | -- (if trans_chosen then Just p_cm else Nothing) ps |
|---|
| 381 | return st' |
|---|
| 382 | |
|---|
| 383 | proveFineGrainedSelect :: |
|---|
| 384 | (Logic lid sublogics1 |
|---|
| 385 | basic_spec1 |
|---|
| 386 | sentence |
|---|
| 387 | symb_items1 |
|---|
| 388 | symb_map_items1 |
|---|
| 389 | sign1 |
|---|
| 390 | morphism1 |
|---|
| 391 | symbol1 |
|---|
| 392 | raw_symbol1 |
|---|
| 393 | proof_tree1) => |
|---|
| 394 | LogicGraph -- -> CommandHistory |
|---|
| 395 | -> [FreeDefMorphism sentence morphism1] |
|---|
| 396 | -> ProofState lid sentence -> IO (Result (ProofState lid sentence)) |
|---|
| 397 | proveFineGrainedSelect lg freedefs st = |
|---|
| 398 | runResultT $ do |
|---|
| 399 | let sl = sublogicOfTheory st |
|---|
| 400 | cmsToProvers = |
|---|
| 401 | if sl == lastSublogic st |
|---|
| 402 | then comorphismsToProvers st |
|---|
| 403 | else getProvers ProveGUI sl $ |
|---|
| 404 | filter hasModelExpansion $ findComorphismPaths lg sl |
|---|
| 405 | pr <- selectProver cmsToProvers |
|---|
| 406 | ResultT $ callProver st{lastSublogic = sublogicOfTheory st, |
|---|
| 407 | comorphismsToProvers = cmsToProvers} True freedefs pr |
|---|