souffle
2.0.2-371-g6315b36
|
Namespaces | |
test | |
Data Structures | |
class | AddNullariesToAtomlessAggregatesTransformer |
Transformation pass to add artificial nullary atom (+Tautology()) to aggregate bodies that have no atoms. More... | |
class | ComponentChecker |
class | ComponentInstantiationTransformer |
class | ConditionalTransformer |
Transformer that executes a sub-transformer iff a condition holds. More... | |
class | DebugReporter |
Transformation pass which wraps another transformation pass and generates a debug report section for the stage after applying the wrapped transformer, and adds it to the translation unit's debug report. More... | |
class | ExecutionPlanChecker |
class | FixpointTransformer |
Transformer that repeatedly executes a sub-transformer until no changes are made. More... | |
class | FoldAnonymousRecords |
Transformation pass that removes (binary) constraints on the anonymous records. More... | |
class | GroundedTermsChecker |
class | GroundWitnessesTransformer |
Apply a grounding so that the witness of a selection aggregate (min/max) can be transferred to the outer scope. More... | |
class | InlineRelationsTransformer |
Transformation pass to inline marked relations. More... | |
class | IOAttributesTransformer |
Transformation pass to set attribute names and types in IO operations. More... | |
class | IODefaultsTransformer |
Transformation pass to set defaults for IO operations. More... | |
class | MagicSetTransformer |
Magic Set Transformation. More... | |
class | MaterializeAggregationQueriesTransformer |
Transformation pass to create artificial relations for bodies of aggregation functions consisting of more than a single atom. More... | |
class | MaterializeSingletonAggregationTransformer |
Replaces literals containing single-valued aggregates with a synthesised relation. More... | |
class | MetaTransformer |
Transformer that coordinates other sub-transformations. More... | |
class | MinimiseProgramTransformer |
Transformation pass to remove equivalent rules. More... | |
class | NameUnnamedVariablesTransformer |
Transformation pass to replace unnamed variables with singletons. More... | |
class | NormaliseMultiResultFunctorsTransformer |
Uniquely names all appearances of ranges. More... | |
class | NullableVector |
class | NullTransformer |
Transformer that does absolutely nothing. More... | |
class | PartitionBodyLiteralsTransformer |
Transformation pass to move literals into new clauses if they are independent of remaining literals. More... | |
class | PipelineTransformer |
Transformer that holds an arbitrary number of sub-transformations. More... | |
class | PragmaChecker |
class | ProvenanceTransformer |
Transformation pass to add provenance information. More... | |
class | ReduceExistentialsTransformer |
Transformation pass to reduce unnecessary computation for relations that only appear in the form A(_,...,_). More... | |
class | RemoveBooleanConstraintsTransformer |
Transformation pass to remove constant boolean constraints Should be called after any transformation that may generate boolean constraints. More... | |
class | RemoveEmptyRelationsTransformer |
Transformation pass to remove all empty relations and rules that use empty relations. More... | |
class | RemoveRedundantRelationsTransformer |
Transformation pass to remove relations which are redundant (do not contribute to output). More... | |
class | RemoveRedundantSumsTransformer |
Transformation pass to remove expressions of the form sum k : { ... More... | |
class | RemoveRelationCopiesTransformer |
Transformation pass to replaces copy of relations by their origin. More... | |
class | ReorderLiteralsTransformer |
Transformation pass to reorder body literals. More... | |
class | ReplaceSingletonVariablesTransformer |
Transformation pass to replace singleton variables with unnamed variables. More... | |
class | ResolveAliasesTransformer |
Transformation pass to eliminate grounded aliases. More... | |
class | ResolveAnonymousRecordAliasesTransformer |
Transformer resolving aliases for anonymous records. More... | |
class | SemanticChecker |
struct | SemanticCheckerImpl |
class | SimplifyAggregateTargetExpressionTransformer |
Transformation pass to rename aggregation variables to make them unique. More... | |
class | Transformer |
class | TypeChecker |
class | TypeCheckerImpl |
class | TypeDeclarationChecker |
class | UniqueAggregationVariablesTransformer |
Transformation pass to rename aggregation variables to make them unique. More... | |
class | WhileTransformer |
Transformer that repeatedly executes a sub-transformer while a condition is met. More... | |
Functions | |
Argument * | combineAggregators (std::vector< Aggregator * > aggrs, std::string fun) |
std::vector< std::vector< Literal * > > | combineNegatedLiterals (std::vector< std::vector< Literal * >> litGroups) |
Return the negated version of a disjunction of conjunctions. More... | |
bool | containsInlinedAtom (const Program &program, const Clause &clause) |
Checks if a given clause contains an atom that should be inlined. More... | |
std::vector< QualifiedName > | findInlineCycle (const PrecedenceGraphAnalysis &precedenceGraph, std::map< const Relation *, const Relation * > &origins, const Relation *current, RelationSet &unvisited, RelationSet &visiting, RelationSet &visited) |
Find a cycle consisting entirely of inlined relations. More... | |
std::vector< std::vector< Literal * > > | formNegatedLiterals (Program &program, Atom *atom) |
Forms the bodies that will replace the negation of a given inlined atom. More... | |
NullableVector< Argument * > | getInlinedArgument (Program &program, const Argument *arg) |
Returns a vector of arguments that should replace the given argument after one step of inlining. More... | |
NullableVector< Atom * > | getInlinedAtom (Program &program, Atom &atom) |
Returns a vector of atoms that should replace the given atom after one step of inlining. More... | |
std::vector< Clause * > | getInlinedClause (Program &program, const Clause &clause) |
Returns a list of clauses that should replace the given clause after one step of inlining. More... | |
NullableVector< std::vector< Literal * > > | getInlinedLiteral (Program &program, Literal *lit) |
Tries to perform a single step of inlining on the given literal. More... | |
std::pair< NullableVector< Literal * >, std::vector< BinaryConstraint * > > | inlineBodyLiterals (Atom *atom, Clause *atomInlineClause) |
Inlines the given atom based on a given clause. More... | |
Own< Relation > | makeInfoRelation (Clause &originalClause, size_t originalClauseNum, TranslationUnit &translationUnit) |
QualifiedName | makeRelationName (const QualifiedName &orig, const std::string &type, int num=-1) |
Helper functions. More... | |
bool | nameInlinedUnderscores (Program &program) |
Removes all underscores in all atoms of inlined relations. More... | |
Literal * | negateLiteral (Literal *lit) |
Returns the negated version of a given literal. More... | |
bool | normaliseInlinedHeads (Program &program) |
Replace constants in the head of inlined clauses with (constrained) variables. More... | |
bool | reduceSubstitution (std::vector< std::pair< Argument *, Argument * >> &sub) |
Reduces a vector of substitutions. More... | |
void | renameVariables (Argument *arg) |
Renames all variables in a given argument uniquely. More... | |
void | transformEqrelRelation (Program &program, Relation &rel) |
Transform eqrel relations to explicitly define equivalence relations. More... | |
NullableVector< std::pair< Argument *, Argument * > > | unifyAtoms (Atom *first, Atom *second) |
Returns the nullable vector of substitutions needed to unify the two given atoms. More... | |
static const std::vector< SrcLocation > | usesInvalidWitness (TranslationUnit &tu, const Clause &clause, const Aggregator &aggregate) |
A witness is considered "invalid" if it is trying to export a witness out of a count, sum, or mean aggregate. More... | |
using souffle::ast::transform::AdornDatabaseTransformer = typedef MagicSetTransformer::AdornDatabaseTransformer |
Definition at line 62 of file MagicSet.cpp.
using souffle::ast::transform::LabelDatabaseTransformer = typedef MagicSetTransformer::LabelDatabaseTransformer |
Definition at line 61 of file MagicSet.cpp.
using souffle::ast::transform::MagicSetCoreTransformer = typedef MagicSetTransformer::MagicSetCoreTransformer |
Definition at line 63 of file MagicSet.cpp.
using souffle::ast::transform::NegativeLabellingTransformer = typedef MagicSetTransformer::LabelDatabaseTransformer::NegativeLabellingTransformer |
Definition at line 66 of file MagicSet.cpp.
using souffle::ast::transform::NormaliseDatabaseTransformer = typedef MagicSetTransformer::NormaliseDatabaseTransformer |
Definition at line 60 of file MagicSet.cpp.
using souffle::ast::transform::PositiveLabellingTransformer = typedef MagicSetTransformer::LabelDatabaseTransformer::PositiveLabellingTransformer |
Definition at line 68 of file MagicSet.cpp.
Argument* souffle::ast::transform::combineAggregators | ( | std::vector< Aggregator * > | aggrs, |
std::string | fun | ||
) |
std::vector<std::vector<Literal*> > souffle::ast::transform::combineNegatedLiterals | ( | std::vector< std::vector< Literal * >> | litGroups | ) |
Return the negated version of a disjunction of conjunctions.
E.g. (a1(x) ^ a2(x) ^ ...) v (b1(x) ^ b2(x) ^ ...) –into-> (!a1(x) ^ !b1(x)) v (!a2(x) ^ !b2(x)) v ...
Definition at line 385 of file InlineRelations.cpp.
bool souffle::ast::transform::containsInlinedAtom | ( | const Program & | program, |
const Clause & | clause | ||
) |
Checks if a given clause contains an atom that should be inlined.
Definition at line 202 of file InlineRelations.cpp.
std::vector<QualifiedName> souffle::ast::transform::findInlineCycle | ( | const PrecedenceGraphAnalysis & | precedenceGraph, |
std::map< const Relation *, const Relation * > & | origins, | ||
const Relation * | current, | ||
RelationSet & | unvisited, | ||
RelationSet & | visiting, | ||
RelationSet & | visited | ||
) |
Find a cycle consisting entirely of inlined relations.
If no cycle exists, then an empty vector is returned.
Definition at line 713 of file SemanticChecker.cpp.
std::vector<std::vector<Literal*> > souffle::ast::transform::formNegatedLiterals | ( | Program & | program, |
Atom * | atom | ||
) |
Forms the bodies that will replace the negation of a given inlined atom.
E.g. a(x) <- (a11(x), a12(x)) ; (a21(x), a22(x)) => !a(x) <- (!a11(x), !a21(x)) ; (!a11(x), !a22(x)) ; ... Essentially, produce every combination (m_1 ^ m_2 ^ ...) where m_i is the negation of a literal in the ith rule of a.
Definition at line 440 of file InlineRelations.cpp.
References inlineBodyLiterals().
NullableVector<Argument*> souffle::ast::transform::getInlinedArgument | ( | Program & | program, |
const Argument * | arg | ||
) |
Returns a vector of arguments that should replace the given argument after one step of inlining.
Note: This function is currently generalised to perform any required inlining within aggregators as well, making it simple to extend to this later on if desired (and the semantic check is removed).
Definition at line 543 of file InlineRelations.cpp.
References souffle::clone(), combineAggregators(), souffle::COUNT, souffle::fatal(), souffle::FMAX, souffle::FMIN, souffle::FSUM, getInlinedLiteral(), i, j, souffle::MAX, souffle::MEAN, souffle::MIN, souffle::SUM, souffle::UMAX, souffle::UMIN, UNREACHABLE_BAD_CASE_ANALYSIS, and souffle::USUM.
Referenced by getInlinedAtom().
NullableVector<Atom*> souffle::ast::transform::getInlinedAtom | ( | Program & | program, |
Atom & | atom | ||
) |
Returns a vector of atoms that should replace the given atom after one step of inlining.
Assumes the relation the atom belongs to is not inlined itself.
Definition at line 729 of file InlineRelations.cpp.
References souffle::clone(), getInlinedArgument(), i, and j.
Referenced by getInlinedLiteral().
std::vector<Clause*> souffle::ast::transform::getInlinedClause | ( | Program & | program, |
const Clause & | clause | ||
) |
Returns a list of clauses that should replace the given clause after one step of inlining.
If no inlining can occur, the list will only contain a clone of the original clause.
Definition at line 911 of file InlineRelations.cpp.
NullableVector< std::vector< Literal * > > souffle::ast::transform::getInlinedLiteral | ( | Program & | program, |
Literal * | lit | ||
) |
Tries to perform a single step of inlining on the given literal.
Returns a pair of nullable vectors (v, w) such that:
Definition at line 785 of file InlineRelations.cpp.
References souffle::ast::getClauses(), getInlinedAtom(), souffle::ast::getRelation(), souffle::INLINE, inlineBodyLiterals(), and rel().
Referenced by getInlinedArgument().
std::pair<NullableVector<Literal*>, std::vector<BinaryConstraint*> > souffle::ast::transform::inlineBodyLiterals | ( | Atom * | atom, |
Clause * | atomInlineClause | ||
) |
Inlines the given atom based on a given clause.
Returns the vector of replacement literals and the necessary constraints. If unification is unsuccessful, the vector of literals is marked as invalid.
Definition at line 304 of file InlineRelations.cpp.
Referenced by formNegatedLiterals(), and getInlinedLiteral().
Own<Relation> souffle::ast::transform::makeInfoRelation | ( | Clause & | originalClause, |
size_t | originalClauseNum, | ||
TranslationUnit & | translationUnit | ||
) |
Definition at line 78 of file Provenance.cpp.
|
inline |
bool souffle::ast::transform::nameInlinedUnderscores | ( | Program & | program | ) |
Removes all underscores in all atoms of inlined relations.
Definition at line 146 of file InlineRelations.cpp.
Returns the negated version of a given literal.
Definition at line 365 of file InlineRelations.cpp.
bool souffle::ast::transform::normaliseInlinedHeads | ( | Program & | program | ) |
Replace constants in the head of inlined clauses with (constrained) variables.
Definition at line 93 of file InlineRelations.cpp.
bool souffle::ast::transform::reduceSubstitution | ( | std::vector< std::pair< Argument *, Argument * >> & | sub | ) |
Reduces a vector of substitutions.
Returns false only if matched argument pairs are found to be incompatible.
Definition at line 219 of file InlineRelations.cpp.
References i, lhs, rhs, and souffle::ast::analysis::sub().
void souffle::ast::transform::renameVariables | ( | Argument * | arg | ) |
Renames all variables in a given argument uniquely.
Definition at line 494 of file InlineRelations.cpp.
Transform eqrel relations to explicitly define equivalence relations.
Definition at line 203 of file Provenance.cpp.
NullableVector<std::pair<Argument*, Argument*> > souffle::ast::transform::unifyAtoms | ( | Atom * | first, |
Atom * | second | ||
) |
Returns the nullable vector of substitutions needed to unify the two given atoms.
If unification is not successful, the returned vector is marked as invalid. Assumes that the atoms are both of the same relation.
Definition at line 278 of file InlineRelations.cpp.
References i.
|
static |
A witness is considered "invalid" if it is trying to export a witness out of a count, sum, or mean aggregate.
However we need to be careful: Sometimes a witness variables occurs within the body of a count, sum, or mean aggregate, but this is valid, because the witness actually belongs to an inner min or max aggregate.
We just need to check that that witness only occurs on this level.
Definition at line 647 of file SemanticChecker.cpp.