souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
32 class FunctorDeclaration;
33 class IntrinsicFunctor;
39 class TranslationUnit;
54 std::string
pprint(
const Node& node);
63 std::vector<const Variable*>
getVariables(
const Node& root);
72 std::vector<const RecordInit*>
getRecords(
const Node& root);
80 template <
typename T,
typename C>
83 for (
auto& lit : clause.getBodyLiterals()) {
84 if (T* t =
dynamic_cast<T*
>(lit)) {
98 std::vector<Clause*>
getClauses(
const Program& program,
const QualifiedName& relationName);
107 std::vector<Clause*>
getClauses(
const Program& program,
const Relation&
rel);
116 Relation*
getRelation(
const Program& program,
const QualifiedName& name);
124 void removeRelation(TranslationUnit& tu,
const QualifiedName& name);
148 const Relation*
getAtomRelation(
const Atom* atom,
const Program* program);
156 const Relation*
getHeadRelation(
const Clause* clause,
const Program* program);
164 std::set<const Relation*>
getBodyRelations(
const Clause* clause,
const Program* program);
173 size_t getClauseNum(
const Program* program,
const Clause* clause);
183 const Program* program,
const Literal*& foundLiteral);
194 const Program* program,
const Literal*& foundLiteral);
207 bool isFact(
const Clause& clause);
213 bool isRule(
const Clause& clause);
244 Clause*
reorderAtoms(
const Clause* clause,
const std::vector<unsigned int>& newOrder);
264 bool renameAtoms(Node& node,
const std::map<QualifiedName, QualifiedName>& oldToNew);
Clause * cloneHead(const Clause *clause)
Returns a clause which contains head of the given clause.
void removeRelation(TranslationUnit &tu, const QualifiedName &name)
Remove relation and all its clauses from the program.
void removeRelationClauses(TranslationUnit &tu, const QualifiedName &name)
Removes the set of clauses with the given relation name.
Clause * reorderAtoms(const Clause *clause, const std::vector< unsigned int > &newOrder)
Reorders the atoms of a clause to be in the given order.
std::string pprint(const Node &node)
bool renameAtoms(Node &node, const std::map< QualifiedName, QualifiedName > &oldToNew)
Rename all atoms hat appear in a node to a given name.
size_t getClauseNum(const Program *program, const Clause *clause)
Returns the index of a clause within its relation, ignoring facts.
bool isDeltaRelation(const QualifiedName &name)
Returns whether the given atom is a delta relation.
bool isFact(const Clause &clause)
Returns whether the given clause is a fact.
std::vector< std::reference_wrapper< const IntrinsicFunctorInfo > > IntrinsicFunctors
bool isRecursiveClause(const Clause &clause)
Returns whether the given clause is recursive.
bool hasClauseWithNegatedRelation(const Relation *relation, const Relation *negRelation, const Program *program, const Literal *&foundLiteral)
Returns whether the given relation has any clauses which contain a negation of a specific relation.
bool hasClauseWithAggregatedRelation(const Relation *relation, const Relation *aggRelation, const Program *program, const Literal *&foundLiteral)
Returns whether the given relation has any clauses which contain an aggregation over of a specific re...
IntrinsicFunctors validOverloads(const analysis::TypeAnalysis &, const IntrinsicFunctor &)
Pick valid overloads for a functor, sorted by some measure of "preference".
Relation * getRelation(const Program &program, const QualifiedName &name)
Returns the relation with the given name in the program.
std::vector< T * > getBodyLiterals(const C &clause)
Returns literals of a particular type in the body of a clause.
const Relation * getHeadRelation(const Clause *clause, const Program *program)
Returns the relation referenced by the head of the given clause.
std::vector< Clause * > getClauses(const Program &program, const QualifiedName &relationName)
Returns a vector of clauses in the program describing the relation with the given name.
bool isProposition(const Atom *atom)
Returns whether the given atom is a propositon.
std::vector< const RecordInit * > getRecords(const Node &root)
Obtains a list of all records referenced within the AST rooted by the given root node.
void negateConstraintInPlace(Constraint &constraint)
Negate an ast constraint.
std::vector< const Variable * > getVariables(const Node &root)
Obtains a list of all variables referenced within the AST rooted by the given root node.
const Relation * getAtomRelation(const Atom *atom, const Program *program)
Returns the relation referenced by the given atom.
void removeRelationIOs(TranslationUnit &tu, const QualifiedName &name)
Removes the set of IOs with the given relation name.
void rel(size_t limit, bool showLimit=true)
std::set< const Relation * > getBodyRelations(const Clause *clause, const Program *program)
Returns the relations referenced in the body of the given clause.
bool isRule(const Clause &clause)
Returns whether the given clause is a rule.