Local.hs revision 9603ad7198b72e812688ad7970e4eac4b553837a
0095c7efbddd0ffeed6aaf8ec015346be161d819Till MossakowskiModule : $Header$
0095c7efbddd0ffeed6aaf8ec015346be161d819Till MossakowskiCopyright : (c) Jorina F. Gerken, Till Mossakowski, Uni Bremen 2002-2004
e687bd70d6e6c98d82b239e01fef4a60de6739f4Till MossakowskiLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill MossakowskiMaintainer : jfgerken@tzi.de
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill MossakowskiStability : provisional
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill MossakowskiPortability : non-portable(Logic)
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill Mossakowskilocal proofs in development graphs.
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill Mossakowski Follows Sect. IV:4.4 of the CASL Reference Manual.
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill MossakowskiOrder of rule application: try to use local links induced by %implies
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill Mossakowskifor subsumption proofs (such that the %implied formulas need not be
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill Mossakowskimodule Proofs.Local (localInference, locDecomp) where
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill Mossakowskiimport qualified Common.Lib.Map as Map
e687bd70d6e6c98d82b239e01fef4a60de6739f4Till Mossakowskiimport qualified Common.OrderedMap as OMap
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu-- --------------------
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu-- local decomposition
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu-- --------------------
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu{- a merge of the rules local subsumption, local decomposition I and
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu local decomposition II -}
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu-- applies this merge of rules to all unproven localThm edges if possible
37bca994f215449238dd0c8308a94a83ae184d38Mihai CodesculocDecomp :: ProofStatus -> ProofStatus
37bca994f215449238dd0c8308a94a83ae184d38Mihai CodesculocDecomp proofStatus@(ln,libEnv,_) =
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu let dgraph = lookupDGraph ln proofStatus
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu localThmEdges = filter isUnprovenLocalThm (labEdges dgraph)
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu (nextDGraph, nextHistoryElem) =
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu locDecompAux libEnv ln dgraph ([],[]) localThmEdges
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu in mkResultProofStatus proofStatus nextDGraph nextHistoryElem
37bca994f215449238dd0c8308a94a83ae184d38Mihai Codescu{- auxiliary function for locDecomp (above)
e687bd70d6e6c98d82b239e01fef4a60de6739f4Till Mossakowski actual implementation -}
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill MossakowskilocDecompAux :: LibEnv -> LIB_NAME -> DGraph -> ([DGRule],[DGChange])
be408ef9713fbbbaf7bde82618f7d3f204fe806cTill Mossakowski -> [LEdge DGLinkLab] -> (DGraph,([DGRule],[DGChange]))
da955132262baab309a50fdffe228c9efe68251dCui JianlocDecompAux _ _ dgraph historyElement [] = (dgraph, historyElement)
e687bd70d6e6c98d82b239e01fef4a60de6739f4Till MossakowskilocDecompAux libEnv ln dgraph (rules,changes)
e687bd70d6e6c98d82b239e01fef4a60de6739f4Till Mossakowski (ledge@(src, tgt, edgeLab) : list) =
e687bd70d6e6c98d82b239e01fef4a60de6739f4Till Mossakowski if (null proofBasis && not (isIdentityEdge ledge libEnv dgraph))
7474388b4c2236f8ab2327289555000268c7901aTill Mossakowski locDecompAux libEnv ln dgraph (rules, changes) list
7474388b4c2236f8ab2327289555000268c7901aTill Mossakowski if isDuplicate newEdge dgraph changes
7474388b4c2236f8ab2327289555000268c7901aTill Mossakowski then locDecompAux libEnv ln auxGraph
e687bd70d6e6c98d82b239e01fef4a60de6739f4Till Mossakowski (newRules, DeleteEdge ledge : changes) list
da955132262baab309a50fdffe228c9efe68251dCui Jian else locDecompAux libEnv ln newGraph (newRules,newChanges) list
99249aeda5fac6f8f0b2316ca357bac898af1928Christian Maeder morphism = dgl_morphism edgeLab
e687bd70d6e6c98d82b239e01fef4a60de6739f4Till Mossakowski allPaths = getAllLocGlobPathsBetween dgraph src tgt
e687bd70d6e6c98d82b239e01fef4a60de6739f4Till Mossakowski th = computeLocalTheory libEnv (ln, src)
4918e2f622cfb96f9a57b7617cd18ca7e4f8b5d4Christian Maeder pathsWithoutEdgeItself = [ path | path <- allPaths, notElem ledge path ]
let goals = OMap.filter isAxiom sensSrc
in if OMap.null goals
newLibEnv = Map.adjust adjMap ln libEnv