package mopsa
Install
Dune Dependency
Authors
Maintainers
Sources
md5=fdee20e988343751de440b4f6b67c0f4
sha512=f5cbf1328785d3f5ce40155dada2d95e5de5cce4f084ea30cfb04d1ab10cc9403a26cfb3fa55d0f9da72244482130fdb89c286a9aed0d640bba46b7c00e09500
doc/containers/Containers/GraphSig/index.html
Module Containers.GraphSig
Source
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
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.