souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
32 class TranslationUnit;
36 class SCCGraphAnalysis;
41 class TopologicallySortedSCCGraphAnalysis :
public Analysis {
43 static constexpr
const char*
name =
"topological-scc-graph";
47 void run(
const TranslationUnit& translationUnit)
override;
49 const std::vector<size_t>&
order()
const {
60 return (
size_t)std::distance(
sccOrder.begin(), it);
63 std::set<size_t>
indexOfScc(
const std::set<size_t>& sccs)
const {
64 std::set<size_t> indices;
65 for (
const auto scc : sccs) {
72 void print(std::ostream& os)
const override;
static constexpr const char * name
Analysis(std::string identifier)
const std::vector< size_t > & order() const
SCCGraphAnalysis * sccGraph
The strongly connected component (SCC) graph.
void print(std::ostream &os) const override
Output topologically sorted strongly connected component graph in text format.
TopologicallySortedSCCGraphAnalysis()
size_t sccOfIndex(const size_t index) const
std::vector< size_t > sccOrder
The final topological ordering of the SCCs.
int topologicalOrderingCost(const std::vector< size_t > &permutationOfSCCs) const
Calculate the topological ordering cost of a permutation of as of yet unordered SCCs using the ordere...
Analysis pass computing the strongly connected component (SCC) graph for the datalog program.
size_t indexOfScc(const size_t scc) const
void computeTopologicalOrdering(size_t scc, std::vector< bool > &visited)
Recursive component for the forwards algorithm computing the topological ordering of the SCCs.
void run(const TranslationUnit &translationUnit) override
run analysis for a Ast translation unit