Copyright | (c) Till Mossakowski, Uni Bremen 2002-2006 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | till@informatik.uni-bremen.de |
Stability | provisional |
Portability | non-portable(Logic) |
Safe Haskell | None |
- types for structured specification analysis
- methods to check the type of an edge
- utility functions
- for node signatures
- accessing node label
- creating node content and label
- handle the lock of a node
- edge label equalities
- setting index maps
- looking up in index maps
- getting index maps and their maximal index
- lookup other graph parts
- lookup nodes by their names or other properties
- accessing the actual graph
- manipulate graph
- top-level functions
- test link types
- create link types
- link conservativity
- bottom up traversal
Central datastructures for development graphs Follows Sect. IV:4.2 of the CASL Reference Manual.
We also provide functions for constructing and modifying development graphs. However note that these changes need to be propagated to the GUI if they also shall be visible in the displayed development graph.
- data NodeSig = NodeSig {}
- data MaybeNode
- getMaybeNodes :: MaybeNode -> Set Node
- newtype Renamed = Renamed RENAMING
- data MaybeRestricted
- data DGOrigin
- = DGEmpty
- | DGBasic
- | DGBasicSpec (Maybe G_basic_spec) G_sign (Set G_symbol)
- | DGExtension
- | DGLogicCoercion
- | DGTranslation Renamed
- | DGUnion
- | DGRestriction MaybeRestricted (Set G_symbol)
- | DGRevealTranslation
- | DGFreeOrCofree FreeOrCofree
- | DGLocal
- | DGClosed
- | DGLogicQual
- | DGData
- | DGFormalParams
- | DGImports
- | DGInst IRI
- | DGFitSpec
- | DGFitView IRI
- | DGProof
- | DGNormalForm Node
- | DGintegratedSCC
- | DGFlattening
- | DGAlignment
- | DGTest
- data DGNodeInfo
- data DGNodeLab = DGNodeLab {
- dgn_name :: NodeName
- dgn_theory :: G_theory
- globalTheory :: Maybe G_theory
- labelHasHiding :: Bool
- labelHasFree :: Bool
- dgn_nf :: Maybe Node
- dgn_sigma :: Maybe GMorphism
- dgn_freenf :: Maybe Node
- dgn_phi :: Maybe GMorphism
- nodeInfo :: DGNodeInfo
- nodeMod :: NodeMod
- xnode :: Maybe XNode
- dgn_lock :: Maybe (MVar ())
- dgn_symbolpathlist :: G_symbolmap [SLinkPath]
- isDGRef :: DGNodeLab -> Bool
- sensWithKind :: (forall a. SenStatus a (AnyComorphism, BasicProof) -> Bool) -> G_theory -> [String]
- hasSenKind :: (forall a. SenStatus a (AnyComorphism, BasicProof) -> Bool) -> DGNodeLab -> Bool
- hasOpenGoals :: DGNodeLab -> Bool
- isInternalNode :: DGNodeLab -> Bool
- getNodeConsStatus :: DGNodeLab -> ConsStatus
- getNodeCons :: DGNodeLab -> Conservativity
- getNodeConservativity :: LNode DGNodeLab -> Conservativity
- hasOpenNodeConsStatus :: Bool -> DGNodeLab -> Bool
- markNodeConsistency :: Conservativity -> String -> DGNodeLab -> DGNodeLab
- markNodeConsistent :: String -> DGNodeLab -> DGNodeLab
- markNodeInconsistent :: String -> DGNodeLab -> DGNodeLab
- getRealDGNodeType :: DGNodeLab -> DGNodeType
- newtype Fitted = Fitted [G_mapping]
- data DGLinkOrigin
- = SeeTarget
- | SeeSource
- | TEST
- | DGLinkVerif
- | DGImpliesLink
- | DGLinkExtension
- | DGLinkTranslation
- | DGLinkClosedLenv
- | DGLinkImports
- | DGLinkMorph IRI
- | DGLinkInst IRI Fitted
- | DGLinkInstArg IRI
- | DGLinkView IRI Fitted
- | DGLinkAlign IRI
- | DGLinkFitView IRI
- | DGLinkFitViewImp IRI
- | DGLinkProof
- | DGLinkFlatteningUnion
- | DGLinkFlatteningRename
- | DGLinkRefinement IRI
- data DGLinkType
- thmLinkStatus :: DGLinkType -> Maybe ThmLinkStatus
- thmProofBasis :: DGLinkType -> ProofBasis
- updThmProofBasis :: DGLinkType -> ProofBasis -> DGLinkType
- data DGLinkLab = DGLink {}
- mkDGLink :: GMorphism -> DGLinkType -> DGLinkOrigin -> String -> EdgeId -> DGLinkLab
- nameDGLink :: String -> DGLinkLab -> DGLinkLab
- defDGLink :: GMorphism -> DGLinkType -> DGLinkOrigin -> DGLinkLab
- defDGLinkId :: GMorphism -> DGLinkType -> DGLinkOrigin -> EdgeId -> DGLinkLab
- globDefLink :: GMorphism -> DGLinkOrigin -> DGLinkLab
- getDGLinkType :: DGLinkLab -> String
- getHomEdgeType :: Bool -> Bool -> DGLinkType -> DGEdgeTypeModInc
- getRealDGLinkType :: DGLinkLab -> DGEdgeType
- getProofBasis :: DGLinkLab -> ProofBasis
- setProof :: ThmLinkStatus -> DGLinkType -> DGLinkType
- isProven :: DGLinkType -> Bool
- isGlobalEdge :: DGLinkType -> Bool
- isGlobalThm :: DGLinkType -> Bool
- isUnprovenGlobalThm :: DGLinkType -> Bool
- isLocalThm :: DGLinkType -> Bool
- isUnprovenLocalThm :: DGLinkType -> Bool
- isUnprovenHidingThm :: DGLinkType -> Bool
- isFreeEdge :: DGLinkType -> Bool
- isCofreeEdge :: DGLinkType -> Bool
- data GenSig = GenSig MaybeNode [NodeSig] MaybeNode
- getGenSigNodes :: GenSig -> Set Node
- data ExtGenSig = ExtGenSig {}
- getExtGenSigNodes :: ExtGenSig -> Set Node
- data ExtViewSig = ExtViewSig NodeSig GMorphism ExtGenSig
- getExtViewSigNodes :: ExtViewSig -> Set Node
- data UnitSig = UnitSig [NodeSig] NodeSig (Maybe NodeSig)
- getUnitSigNodes :: UnitSig -> Set Node
- data ImpUnitSigOrSig
- type StUnitCtx = Map IRI ImpUnitSigOrSig
- emptyStUnitCtx :: StUnitCtx
- type RefSigMap = Map IRI RefSig
- getSigMapNodes :: RefSigMap -> Set Node
- type BStContext = Map IRI RefSig
- getBStContextNodes :: BStContext -> Set Node
- data RefSig
- getRefSigNodes :: RefSig -> Set Node
- getPointerFromRef :: RefSig -> RTPointer
- setPointerInRef :: RefSig -> RTPointer -> RefSig
- setUnitSigInRef :: RefSig -> UnitSig -> RefSig
- getUnitSigFromRef :: RefSig -> Result UnitSig
- mkRefSigFromUnit :: UnitSig -> RefSig
- mkBotSigFromUnit :: UnitSig -> RefSig
- data BranchSig
- getBranchSigNodes :: BranchSig -> Set Node
- type RefStUnitCtx = Map IRI RefSig
- emptyRefStUnitCtx :: RefStUnitCtx
- matchesContext :: RefSigMap -> BStContext -> Bool
- equalSigs :: UnitSig -> UnitSig -> Bool
- namesMatchCtx :: [IRI] -> BStContext -> RefSigMap -> Bool
- modifyCtx :: [IRI] -> RefSigMap -> BStContext -> BStContext
- refSigComposition :: RefSig -> RefSig -> Result RefSig
- data GlobalEntry
- getGlobEntryNodes :: GlobalEntry -> Set Node
- data AlignSig
- type GlobalEnv = Map IRI GlobalEntry
- getGlobNodes :: GlobalEnv -> Set Node
- data DGChange
- data HistElem
- type ProofHistory = SizedList HistElem
- data RTNodeType
- data RTNodeLab = RTNodeLab {}
- data RTLinkType
- data RTLinkLab = RTLink {}
- addNodeRT :: DGraph -> UnitSig -> String -> (Node, DGraph)
- addSpecNodeRT :: DGraph -> UnitSig -> String -> (Node, DGraph)
- updateNodeNameRT :: DGraph -> Node -> Bool -> String -> DGraph
- updateSigRT :: DGraph -> Node -> UnitSig -> DGraph
- updateNodeNameSpecRT :: DGraph -> Node -> String -> DGraph
- addSubTree :: DGraph -> Maybe RTLeaves -> RTPointer -> (DGraph, RTPointer)
- copySubTree :: DGraph -> Node -> Maybe Node -> (DGraph, Map Node Node)
- copySubTreeN :: DGraph -> [Node] -> Map Node Node -> (DGraph, Map Node Node)
- copyNode :: Node -> (DGraph, Map Node Node) -> LNode RTLinkLab -> (DGraph, Map Node Node)
- addRefEdgeRT :: DGraph -> Node -> Node -> DGraph
- addEdgesToNodeRT :: DGraph -> [Node] -> Node -> DGraph
- data DiagNodeLab = DiagNode {}
- data DiagLinkLab = DiagLink {
- dl_morphism :: GMorphism
- dl_number :: Int
- data Diag = Diagram {}
- data DGraph = DGraph {
- globalAnnos :: GlobalAnnos
- optLibDefn :: Maybe LIB_DEFN
- globalEnv :: GlobalEnv
- dgBody :: Gr DGNodeLab DGLinkLab
- currentBaseTheory :: Maybe NodeSig
- refTree :: Gr RTNodeLab RTLinkLab
- specRoots :: Map String Node
- nameMap :: MapSet String Node
- archSpecDiags :: Map String Diag
- getNewEdgeId :: EdgeId
- allRefNodes :: Map (LibName, Node) Node
- sigMap :: Map SigId G_sign
- thMap :: Map ThId G_theory
- morMap :: Map MorId G_morphism
- proofHistory :: ProofHistory
- redoHistory :: ProofHistory
- emptyDG :: DGraph
- type LibEnv = Map LibName DGraph
- emptyLibEnv :: LibEnv
- emptyG_sign :: AnyLogic -> G_sign
- getMaybeSig :: MaybeNode -> G_sign
- getLogic :: MaybeNode -> AnyLogic
- getNodeLogic :: NodeSig -> AnyLogic
- dgn_origin :: DGNodeLab -> DGOrigin
- dgn_libname :: DGNodeLab -> LibName
- dgn_node :: DGNodeLab -> Node
- dgn_sign :: DGNodeLab -> G_sign
- getDGNodeName :: DGNodeLab -> String
- globOrLocTh :: DGNodeLab -> G_theory
- newConsNodeInfo :: DGOrigin -> Conservativity -> DGNodeInfo
- newNodeInfo :: DGOrigin -> DGNodeInfo
- newRefInfo :: LibName -> Node -> DGNodeInfo
- newInfoNodeLab :: NodeName -> DGNodeInfo -> G_theory -> DGNodeLab
- newNodeLab :: NodeName -> DGOrigin -> G_theory -> DGNodeLab
- treatNodeLock :: (MVar () -> a) -> DGNodeLab -> a
- tryLockLocal :: DGNodeLab -> IO Bool
- unlockLocal :: DGNodeLab -> IO ()
- hasLock :: DGNodeLab -> Bool
- eqDGLinkLabContent :: DGLinkLab -> DGLinkLab -> Bool
- eqDGLinkLabById :: DGLinkLab -> DGLinkLab -> Bool
- cpIndexMaps :: DGraph -> DGraph -> DGraph
- setSigMapDG :: Map SigId G_sign -> DGraph -> DGraph
- setThMapDG :: Map ThId G_theory -> DGraph -> DGraph
- setMorMapDG :: Map MorId G_morphism -> DGraph -> DGraph
- lookupSigMapDG :: SigId -> DGraph -> Maybe G_sign
- lookupThMapDG :: ThId -> DGraph -> Maybe G_theory
- lookupMorMapDG :: MorId -> DGraph -> Maybe G_morphism
- sigMapI :: DGraph -> (Map SigId G_sign, SigId)
- thMapI :: DGraph -> (Map ThId G_theory, ThId)
- morMapI :: DGraph -> (Map MorId G_morphism, MorId)
- lookupGlobalEnvDG :: IRI -> DGraph -> Maybe GlobalEntry
- lookupInAllRefNodesDG :: DGNodeInfo -> DGraph -> Maybe Node
- lookupNodeByName :: String -> DGraph -> [LNode DGNodeLab]
- lookupUniqueNodeByName :: String -> DGraph -> Maybe (LNode DGNodeLab)
- filterLocalNodesByName :: String -> DGraph -> [LNode DGNodeLab]
- filterRefNodesByName :: String -> LibName -> DGraph -> [LNode DGNodeLab]
- lookupLocalNodeByNameInEnv :: LibEnv -> String -> Maybe (DGraph, LNode DGNodeLab)
- lookupLocalNodeByName :: LibEnv -> DGraph -> String -> Maybe (DGraph, LNode DGNodeLab)
- lookupLocalNode :: LibEnv -> DGraph -> Node -> (DGraph, LNode DGNodeLab)
- lookupRefNode :: LibEnv -> LibName -> DGraph -> Node -> (LibName, DGraph, LNode DGNodeLab)
- lookupRefNodeM :: LibEnv -> Maybe LibName -> DGraph -> Node -> (Maybe LibName, DGraph, LNode DGNodeLab)
- getNewNodeDG :: DGraph -> Node
- labNodesDG :: DGraph -> [LNode DGNodeLab]
- labEdgesDG :: DGraph -> [LEdge DGLinkLab]
- isEmptyDG :: DGraph -> Bool
- gelemDG :: Node -> DGraph -> Bool
- innDG :: DGraph -> Node -> [LEdge DGLinkLab]
- outDG :: DGraph -> Node -> [LEdge DGLinkLab]
- nodesDG :: DGraph -> [Node]
- labDG :: DGraph -> Node -> DGNodeLab
- labRT :: DGraph -> Node -> RTNodeLab
- getNameOfNode :: Node -> DGraph -> String
- newNodesDG :: Int -> DGraph -> [Node]
- safeContextDG :: String -> DGraph -> Node -> Context DGNodeLab DGLinkLab
- labelNodeDG :: LNode DGNodeLab -> DGraph -> (DGraph, DGNodeLab)
- delNodeDG :: Node -> DGraph -> DGraph
- delNodesDG :: [Node] -> DGraph -> DGraph
- insNodeDG :: LNode DGNodeLab -> DGraph -> DGraph
- insLNodeDG :: LNode DGNodeLab -> DGraph -> DGraph
- insNodesDG :: [LNode DGNodeLab] -> DGraph -> DGraph
- delLEdgeDG :: LEdge DGLinkLab -> DGraph -> DGraph
- insInclEdgeDG :: LogicGraph -> DGraph -> NodeSig -> NodeSig -> Result DGraph
- insLEdgeDG :: LEdge DGLinkLab -> DGraph -> (LEdge DGLinkLab, DGraph)
- compareLinks :: DGLinkLab -> DGLinkLab -> Ordering
- insLEdgeNubDG :: LEdge DGLinkLab -> DGraph -> DGraph
- insEdgeAsIs :: LEdge DGLinkLab -> DGraph -> DGraph
- insEdgesDG :: [LEdge DGLinkLab] -> DGraph -> DGraph
- mkGraphDG :: [LNode DGNodeLab] -> [LEdge DGLinkLab] -> DGraph -> DGraph
- getDGLinksById :: EdgeId -> DGraph -> [LEdge DGLinkLab]
- lookupUniqueLink :: Monad m => Node -> EdgeId -> DGraph -> m (LEdge DGLinkLab)
- initLocking :: DGraph -> LNode DGNodeLab -> IO (DGraph, DGNodeLab)
- lookupDGraph :: LibName -> LibEnv -> DGraph
- computeLocalTheory :: Monad m => LibEnv -> LibName -> Node -> m G_theory
- computeLocalNodeTheory :: Monad m => LibEnv -> DGraph -> Node -> m G_theory
- computeLocalLabelTheory :: Monad m => LibEnv -> DGNodeLab -> m G_theory
- liftE :: (DGLinkType -> a) -> LEdge DGLinkLab -> a
- isGlobalDef :: DGLinkType -> Bool
- isLocalDef :: DGLinkType -> Bool
- isHidingDef :: DGLinkType -> Bool
- isDefEdge :: DGLinkType -> Bool
- isLocalEdge :: DGLinkType -> Bool
- isHidingEdge :: DGLinkType -> Bool
- hidingThm :: Node -> GMorphism -> DGLinkType
- globalThm :: DGLinkType
- localThm :: DGLinkType
- globalConsThm :: Conservativity -> DGLinkType
- localConsThm :: Conservativity -> DGLinkType
- localOrGlobalThm :: Scope -> Conservativity -> DGLinkType
- localOrGlobalDef :: Scope -> Conservativity -> DGLinkType
- globalConsDef :: Conservativity -> DGLinkType
- globalDef :: DGLinkType
- localDef :: DGLinkType
- getLinkConsStatus :: DGLinkType -> ConsStatus
- getEdgeConsStatus :: DGLinkLab -> ConsStatus
- getCons :: DGLinkType -> Conservativity
- getConservativity :: LEdge DGLinkLab -> Conservativity
- getConservativityOfPath :: [LEdge DGLinkLab] -> Conservativity
- getLibDepRel :: LibEnv -> Rel LibName
- getTopsortedLibs :: LibEnv -> [LibName]
- dependentLibs :: LibName -> LibEnv -> [LibName]
- topsortedNodes :: DGraph -> [LNode DGNodeLab]
- changedPendingEdges :: DGraph -> [LEdge DGLinkLab]
- changedLocalTheorems :: DGraph -> LNode DGNodeLab -> [LEdge DGLinkLab]
- duplicateDefEdges :: DGraph -> [Edge]
types for structured specification analysis
basic types
data NodeSig
Node with signature in a DG
data MaybeNode
NodeSig or possibly the empty sig in a logic (but since we want to avoid lots of vsacuous nodes with empty sig, we do not assign a real node in the DG here)
getMaybeNodes :: MaybeNode -> Set Node
newtype Renamed
a wrapper for renamings with a trivial Ord instance
data MaybeRestricted
a wrapper for restrictions with a trivial Ord instance
data DGOrigin
Data type indicating the origin of nodes and edges in the input language This is not used in the DG calculus, only may be used in the future for reconstruction of input and management of change.
data DGNodeInfo
node content or reference to another library's node
data DGNodeLab
node inscriptions in development graphs. Nothing entries indicate "not computed yet"
DGNodeLab | |
|
sensWithKind :: (forall a. SenStatus a (AnyComorphism, BasicProof) -> Bool) -> G_theory -> [String]
hasSenKind :: (forall a. SenStatus a (AnyComorphism, BasicProof) -> Bool) -> DGNodeLab -> Bool
hasOpenGoals :: DGNodeLab -> Bool
test if a given node label has local open goals
isInternalNode :: DGNodeLab -> Bool
check if the node has an internal name
getNodeConservativity :: LNode DGNodeLab -> Conservativity
returns the Conservativity if the given node has one, otherwise none
hasOpenNodeConsStatus :: Bool -> DGNodeLab -> Bool
test if a node conservativity is open, return input for refs or nodes with normal forms
markNodeConsistency :: Conservativity -> String -> DGNodeLab -> DGNodeLab
markNodeConsistent :: String -> DGNodeLab -> DGNodeLab
markNodeInconsistent :: String -> DGNodeLab -> DGNodeLab
getRealDGNodeType :: DGNodeLab -> DGNodeType
creates a DGNodeType from a DGNodeLab
newtype Fitted
a wrapper for fitting morphisms with a trivial Eq instance
data DGLinkOrigin
data DGLinkType
Link types of development graphs, Sect. IV:4.2 of the CASL Reference Manual explains them in depth.
thmLinkStatus :: DGLinkType -> Maybe ThmLinkStatus
extract theorem link status from link type
thmProofBasis :: DGLinkType -> ProofBasis
extract proof basis from link type
updThmProofBasis :: DGLinkType -> ProofBasis -> DGLinkType
data DGLinkLab
link inscriptions in development graphs
DGLink | |
|
mkDGLink :: GMorphism -> DGLinkType -> DGLinkOrigin -> String -> EdgeId -> DGLinkLab
nameDGLink :: String -> DGLinkLab -> DGLinkLab
name a link
defDGLink :: GMorphism -> DGLinkType -> DGLinkOrigin -> DGLinkLab
defDGLinkId :: GMorphism -> DGLinkType -> DGLinkOrigin -> EdgeId -> DGLinkLab
globDefLink :: GMorphism -> DGLinkOrigin -> DGLinkLab
getDGLinkType :: DGLinkLab -> String
describe the link type of the label
getHomEdgeType :: Bool -> Bool -> DGLinkType -> DGEdgeTypeModInc
getRealDGLinkType :: DGLinkLab -> DGEdgeType
creates a DGEdgeType from a DGLinkLab
getProofBasis :: DGLinkLab -> ProofBasis
return the proof basis of the given linklab
setProof :: ThmLinkStatus -> DGLinkType -> DGLinkType
set proof for theorem links
methods to check the type of an edge
isProven :: DGLinkType -> Bool
isGlobalEdge :: DGLinkType -> Bool
isGlobalThm :: DGLinkType -> Bool
isLocalThm :: DGLinkType -> Bool
isUnprovenLocalThm :: DGLinkType -> Bool
isFreeEdge :: DGLinkType -> Bool
isCofreeEdge :: DGLinkType -> Bool
types for global environments
data GenSig
import, formal parameters and united signature of formal params
getGenSigNodes :: GenSig -> Set Node
data ExtGenSig
genericity and body
getExtGenSigNodes :: ExtGenSig -> Set Node
data ExtViewSig
source, morphism, parameterized target
getExtViewSigNodes :: ExtViewSig -> Set Node
types for architectural and unit specification analysis (as defined for basic static semantics in Chap. III:5.1)
data UnitSig
getUnitSigNodes :: UnitSig -> Set Node
data ImpUnitSigOrSig
type StUnitCtx = Map IRI ImpUnitSigOrSig
getSigMapNodes :: RefSigMap -> Set Node
type BStContext = Map IRI RefSig
getBStContextNodes :: BStContext -> Set Node
data RefSig
getRefSigNodes :: RefSig -> Set Node
getPointerFromRef :: RefSig -> RTPointer
setPointerInRef :: RefSig -> RTPointer -> RefSig
setUnitSigInRef :: RefSig -> UnitSig -> RefSig
getUnitSigFromRef :: RefSig -> Result UnitSig
mkRefSigFromUnit :: UnitSig -> RefSig
mkBotSigFromUnit :: UnitSig -> RefSig
data BranchSig
getBranchSigNodes :: BranchSig -> Set Node
type RefStUnitCtx = Map IRI RefSig
matchesContext :: RefSigMap -> BStContext -> Bool
namesMatchCtx :: [IRI] -> BStContext -> RefSigMap -> Bool
modifyCtx :: [IRI] -> RefSigMap -> BStContext -> BStContext
refSigComposition :: RefSig -> RefSig -> Result RefSig
data GlobalEntry
an entry of the global environment
getGlobEntryNodes :: GlobalEntry -> Set Node
data AlignSig
type GlobalEnv = Map IRI GlobalEntry
getGlobNodes :: GlobalEnv -> Set Node
change and history types
data DGChange
the edit operations of the DGraph
type ProofHistory = SizedList HistElem
data RTNodeType
data RTNodeLab
data RTLinkType
data RTLinkLab
updateSigRT :: DGraph -> Node -> UnitSig -> DGraph
updateNodeNameSpecRT :: DGraph -> Node -> String -> DGraph
addRefEdgeRT :: DGraph -> Node -> Node -> DGraph
addEdgesToNodeRT :: DGraph -> [Node] -> Node -> DGraph
data DiagNodeLab
data DiagLinkLab
DiagLink | |
|
data Diag
data DGraph
the actual development graph with auxiliary information. A
G_sign
should be stored in sigMap
under its gSignSelfIdx
. The
same applies to G_morphism
with morMap
and gMorphismSelfIdx
resp. G_theory
with thMap
and gTheorySelfIdx
.
DGraph | |
|
an empty environment
utility functions
for node signatures
emptyG_sign :: AnyLogic -> G_sign
getMaybeSig :: MaybeNode -> G_sign
getNodeLogic :: NodeSig -> AnyLogic
accessing node label
dgn_origin :: DGNodeLab -> DGOrigin
get the origin of a non-reference node (partial)
dgn_libname :: DGNodeLab -> LibName
get the referenced library (partial)
getDGNodeName :: DGNodeLab -> String
gets the name of a development graph node as a string (total)
globOrLocTh :: DGNodeLab -> G_theory
get the global theory of a node or the local one if missing
creating node content and label
newConsNodeInfo :: DGOrigin -> Conservativity -> DGNodeInfo
create node info
newNodeInfo :: DGOrigin -> DGNodeInfo
create default content
newRefInfo :: LibName -> Node -> DGNodeInfo
create a reference node part
newInfoNodeLab :: NodeName -> DGNodeInfo -> G_theory -> DGNodeLab
create a new node label
newNodeLab :: NodeName -> DGOrigin -> G_theory -> DGNodeLab
create a new node label using newNodeInfo
and newInfoNodeLab
handle the lock of a node
treatNodeLock :: (MVar () -> a) -> DGNodeLab -> a
wrapper to access the maybe lock
tryLockLocal :: DGNodeLab -> IO Bool
Tries to acquire the local lock. Return False if already acquired.
unlockLocal :: DGNodeLab -> IO ()
Releases the local lock.
edge label equalities
eqDGLinkLabContent :: DGLinkLab -> DGLinkLab -> Bool
equality without comparing the edge ids
eqDGLinkLabById :: DGLinkLab -> DGLinkLab -> Bool
equality comparing ids only
setting index maps
cpIndexMaps :: DGraph -> DGraph -> DGraph
setMorMapDG :: Map MorId G_morphism -> DGraph -> DGraph
looking up in index maps
lookupSigMapDG :: SigId -> DGraph -> Maybe G_sign
lookupThMapDG :: ThId -> DGraph -> Maybe G_theory
lookupMorMapDG :: MorId -> DGraph -> Maybe G_morphism
getting index maps and their maximal index
lookup other graph parts
lookupGlobalEnvDG :: IRI -> DGraph -> Maybe GlobalEntry
lookupInAllRefNodesDG :: DGNodeInfo -> DGraph -> Maybe Node
lookup a reference node for a given libname and node
lookup nodes by their names or other properties
lookupNodeByName :: String -> DGraph -> [LNode DGNodeLab]
lookup a node in the graph by its name, using showName to convert nodenames.
filterLocalNodesByName :: String -> DGraph -> [LNode DGNodeLab]
filters all local nodes in the graph by their names, using showName
to convert nodenames. See also lookupNodeByName
.
filterRefNodesByName :: String -> LibName -> DGraph -> [LNode DGNodeLab]
filter all ref nodes in the graph by their names, using showName
to convert nodenames. See also lookupNodeByName
.
lookupLocalNodeByNameInEnv :: LibEnv -> String -> Maybe (DGraph, LNode DGNodeLab)
Given a LibEnv
we search each DGraph in it for a (maybe referenced) node
with the given name. We return the labeled node and the Graph where this node
resides as local node. See also lookupLocalNode
.
lookupLocalNodeByName :: LibEnv -> DGraph -> String -> Maybe (DGraph, LNode DGNodeLab)
We search only the given DGraph
for a (maybe referenced) node with the
given name. We return the labeled node and the Graph where this node resides
as local node. See also lookupLocalNode
.
lookupLocalNode :: LibEnv -> DGraph -> Node -> (DGraph, LNode DGNodeLab)
Given a Node and a DGraph
we follow the node to the graph where it is
defined as a local node.
lookupRefNode :: LibEnv -> LibName -> DGraph -> Node -> (LibName, DGraph, LNode DGNodeLab)
Given a Node and a DGraph
we follow the node to the graph where it is
defined .
lookupRefNodeM :: LibEnv -> Maybe LibName -> DGraph -> Node -> (Maybe LibName, DGraph, LNode DGNodeLab)
accessing the actual graph
getNewNodeDG :: DGraph -> Node
get the next available node id
labNodesDG :: DGraph -> [LNode DGNodeLab]
get all the nodes
labEdgesDG :: DGraph -> [LEdge DGLinkLab]
get all the edges
innDG :: DGraph -> Node -> [LEdge DGLinkLab]
get all the incoming ledges of the given node in a given DG
outDG :: DGraph -> Node -> [LEdge DGLinkLab]
get all the outgoing ledges of the given node in a given DG
getNameOfNode :: Node -> DGraph -> String
get the name of a node from the number of node
newNodesDG :: Int -> DGraph -> [Node]
gets the given number of new node-ids in a given DG.
safeContextDG :: String -> DGraph -> Node -> Context DGNodeLab DGLinkLab
get the context and throw input string as error message
manipulate graph
labelNodeDG :: LNode DGNodeLab -> DGraph -> (DGraph, DGNodeLab)
sets the node with new label and returns the new graph and the old label
delNodesDG :: [Node] -> DGraph -> DGraph
delete a list of nodes out of the given DG
insLNodeDG :: LNode DGNodeLab -> DGraph -> DGraph
inserts a lnode into a given DG
insNodesDG :: [LNode DGNodeLab] -> DGraph -> DGraph
insert a new node with the given node content into a given DGraph
delLEdgeDG :: LEdge DGLinkLab -> DGraph -> DGraph
delete a labeled edge out of the given DG
insInclEdgeDG :: LogicGraph -> DGraph -> NodeSig -> NodeSig -> Result DGraph
inserts an edge between two nodes, labelled with inclusion
insLEdgeDG :: LEdge DGLinkLab -> DGraph -> (LEdge DGLinkLab, DGraph)
insert a labeled edge into a given DG, return possibly new id of edge
compareLinks :: DGLinkLab -> DGLinkLab -> Ordering
insLEdgeNubDG :: LEdge DGLinkLab -> DGraph -> DGraph
tries to insert a labeled edge into a given DG, but if this edge already exists, then does nothing.
insEdgeAsIs :: LEdge DGLinkLab -> DGraph -> DGraph
inserts a new edge into the DGraph using it's own edgeId. ATTENTION: the caller must ensure that an edgeId is not used twice
insEdgesDG :: [LEdge DGLinkLab] -> DGraph -> DGraph
insert a list of labeled edge into a given DG
mkGraphDG :: [LNode DGNodeLab] -> [LEdge DGLinkLab] -> DGraph -> DGraph
merge a list of lnodes and ledges into a given DG
getDGLinksById :: EdgeId -> DGraph -> [LEdge DGLinkLab]
get links by id (inefficiently)
lookupUniqueLink :: Monad m => Node -> EdgeId -> DGraph -> m (LEdge DGLinkLab)
find a unique link given its source node and edgeId
top-level functions
initLocking :: DGraph -> LNode DGNodeLab -> IO (DGraph, DGNodeLab)
initializes the MVar for locking if nessesary
lookupDGraph :: LibName -> LibEnv -> DGraph
returns the DGraph that belongs to the given library name
computeLocalTheory :: Monad m => LibEnv -> LibName -> Node -> m G_theory
compute the theory of a given node. If this node is a DGRef, the referenced node is looked up first.
computeLocalLabelTheory :: Monad m => LibEnv -> DGNodeLab -> m G_theory
test link types
liftE :: (DGLinkType -> a) -> LEdge DGLinkLab -> a
isGlobalDef :: DGLinkType -> Bool
isLocalDef :: DGLinkType -> Bool
isHidingDef :: DGLinkType -> Bool
isDefEdge :: DGLinkType -> Bool
isLocalEdge :: DGLinkType -> Bool
isHidingEdge :: DGLinkType -> Bool
create link types
hidingThm :: Node -> GMorphism -> DGLinkType
localOrGlobalThm :: Scope -> Conservativity -> DGLinkType
localOrGlobalDef :: Scope -> Conservativity -> DGLinkType
link conservativity
getCons :: DGLinkType -> Conservativity
getConservativity :: LEdge DGLinkLab -> Conservativity
returns the Conservativity if the given edge has one, otherwise none
getConservativityOfPath :: [LEdge DGLinkLab] -> Conservativity
returns the conservativity of the given path
bottom up traversal
getLibDepRel :: LibEnv -> Rel LibName
Creates a LibName relation wrt dependencies via reference nodes
getTopsortedLibs :: LibEnv -> [LibName]
dependentLibs :: LibName -> LibEnv -> [LibName]
Get imported libs in topological order, i.e. lib(s) without imports first. The input lib-name will be last
topsortedNodes :: DGraph -> [LNode DGNodeLab]
changedPendingEdges :: DGraph -> [LEdge DGLinkLab]
duplicateDefEdges :: DGraph -> [Edge]