package mopsa
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=37966e98ffeebcedc09bd6e9b2b81f69
sha512=40d4d826c25f680766c07eccbabdf5e8a4fa023016e8a164e4e4f6b3781c8484dc4df437055721dfd19b9db8fb7fe3b61236c4833186d346fc7204a68d01eaaa
doc/mopsa.mopsa_utils/Mopsa_utils/Containers/GraphSig/index.html
Module Containers.GraphSig
A simple graph library to represent control-flow graphs.
We actually use an oriented hyper-graph structure: an edge connects a set of (source) nodes to a set of (destination) nodes. Equivalently, this can be seen as a bipartite graph where nodes and edges correspond to the two node partitions.
Nodes model program locations, where an invariant can be stored. Edges model transfer functions for basic blocks. An edge can have several source nodes, to model control-flow joins at the entry of basic blocks. It is also possible to model joins by having several edges incoming into the same node. An edge can have several destination nodes, to model conditionals with several outputs from a basic block. Alternatively, several edges outgoing from the same node can be used to model conditionals. We use "ports" to distinguish and classify between the different source and destination nodes of an edge. Ports carry tags. It is possible to have a node connected to the same edge several times, either on equal or different ports.
Nodes and edges have unique identifiers, ordered to serve as map keys. Each node and edge has a mutable data field of polymorphic type. However, data attached to nodes and edges can also be maintained outside of the graph structure, using hash-tables or maps from identifiers to the actual data.
Graphs are mutable to make it easier to construct them. It is expected that, after creation in the front-end, graphs remain unmodified (except maybe for the data fields).
Ordered, hashable data types
module type ID_TYPE = sig ... end
Data-type that can be used both in sets, maps, and hash-tables.
Nested lists
Nested lists of nodes are used to represent herarchical decompositions into strongly connected components.
Parameter signature
module type P = sig ... end
Graph signature
module type S = sig ... end