souffle
2.0.2-371-g6315b36
|
Analysis pass computing a topologically sorted strongly connected component (SCC) graph. More...
#include <TopologicallySortedSCCGraph.h>
Public Member Functions | |
size_t | indexOfScc (const size_t scc) const |
std::set< size_t > | indexOfScc (const std::set< size_t > &sccs) const |
const std::vector< size_t > & | order () const |
void | print (std::ostream &os) const override |
Output topologically sorted strongly connected component graph in text format. More... | |
void | run (const TranslationUnit &translationUnit) override |
run analysis for a Ast translation unit More... | |
size_t | sccOfIndex (const size_t index) const |
TopologicallySortedSCCGraphAnalysis () | |
Public Member Functions inherited from souffle::ast::analysis::Analysis | |
Analysis (std::string identifier) | |
virtual const std::string & | getName () const |
get name of the analysis More... | |
virtual | ~Analysis ()=default |
Static Public Attributes | |
static constexpr const char * | name = "topological-scc-graph" |
Private Member Functions | |
void | computeTopologicalOrdering (size_t scc, std::vector< bool > &visited) |
Recursive component for the forwards algorithm computing the topological ordering of the SCCs. More... | |
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 ordered SCCs. More... | |
Private Attributes | |
SCCGraphAnalysis * | sccGraph = nullptr |
The strongly connected component (SCC) graph. More... | |
std::vector< size_t > | sccOrder |
The final topological ordering of the SCCs. More... | |
Additional Inherited Members | |
Protected Attributes inherited from souffle::ast::analysis::Analysis | |
const std::string | identifier |
Analysis pass computing a topologically sorted strongly connected component (SCC) graph.
Definition at line 49 of file TopologicallySortedSCCGraph.h.
|
inline |
|
private |
Recursive component for the forwards algorithm computing the topological ordering of the SCCs.
Definition at line 77 of file TopologicallySortedSCCGraph.cpp.
Referenced by run().
|
inline |
Definition at line 65 of file TopologicallySortedSCCGraph.h.
|
inline |
Definition at line 71 of file TopologicallySortedSCCGraph.h.
|
inline |
Definition at line 57 of file TopologicallySortedSCCGraph.h.
References sccOrder.
Referenced by souffle::ast::analysis::RelationScheduleAnalysis::run().
|
overridevirtual |
Output topologically sorted strongly connected component graph in text format.
Reimplemented from souffle::ast::analysis::Analysis.
Definition at line 159 of file TopologicallySortedSCCGraph.cpp.
|
overridevirtual |
run analysis for a Ast translation unit
Implements souffle::ast::analysis::Analysis.
Definition at line 135 of file TopologicallySortedSCCGraph.cpp.
References computeTopologicalOrdering(), souffle::ast::analysis::SCCGraphAnalysis::getPredecessorSCCs(), souffle::ast::analysis::SCCGraphAnalysis::getSuccessorSCCs(), sccGraph, and sccOrder.
|
inline |
Definition at line 61 of file TopologicallySortedSCCGraph.h.
|
private |
Calculate the topological ordering cost of a permutation of as of yet unordered SCCs using the ordered SCCs.
Returns -1 if the given vector is not a valid topological ordering.
Definition at line 39 of file TopologicallySortedSCCGraph.cpp.
References souffle::ast::analysis::SCCGraphAnalysis::getPredecessorSCCs(), souffle::ast::analysis::SCCGraphAnalysis::getSuccessorSCCs(), and sccGraph.
|
staticconstexpr |
Definition at line 51 of file TopologicallySortedSCCGraph.h.
|
private |
The strongly connected component (SCC) graph.
Definition at line 84 of file TopologicallySortedSCCGraph.h.
Referenced by run(), and topologicalOrderingCost().
|
private |
The final topological ordering of the SCCs.
Definition at line 87 of file TopologicallySortedSCCGraph.h.
Referenced by order(), run(), and TopologicallySortedSCCGraphAnalysis().