souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
38 Program& program = translationUnit.getProgram();
58 std::set<const Relation*> reached;
59 std::vector<const Relation*> worklist;
62 for (
const auto* cur : getBodyLiterals<Atom>(clause)) {
63 auto rel = relationDetail.getRelation(cur->getQualifiedName());
67 worklist.push_back(
rel);
71 while (!worklist.empty()) {
73 const Relation* cur = worklist.back();
82 if (!reached.insert(cur).second) {
87 for (
const Clause* cl : relationDetail.getClauses(cur)) {
88 for (
const Atom* at : getBodyLiterals<Atom>(*cl)) {
89 auto rel = relationDetail.getRelation(at->getQualifiedName());
93 worklist.push_back(
rel);
void run(const TranslationUnit &translationUnit) override
run analysis for a Ast translation unit
Defines a relation with a name, attributes, qualifiers, and internal representation.
Intermediate representation of a horn clause.
bool computeIsRecursive(const Clause &clause, const TranslationUnit &translationUnit) const
Determines whether the given clause is recursive within the given program.
Analysis pass mapping identifiers with relations and clauses.
The program class consists of relations, clauses and types.
std::set< const Clause * > recursiveClauses
void print(std::ostream &os) const override
print the analysis result in HTML format
Translation unit class for the translation pipeline.
const Relation * getHeadRelation(const Clause *clause, const Program *program)
Returns the relation referenced by the head of the given clause.
Analysis * getAnalysis() const
get analysis: analysis is generated on the fly if not present
void visitDepthFirst(const Node &root, Visitor< R, Ps... > &visitor, Args &... args)
A utility function visiting all nodes within the ast rooted by the given node recursively in a depth-...
void rel(size_t limit, bool showLimit=true)
Program & getProgram() const
Return the program.