souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
42 class TranslationUnit;
47 class AuxiliaryArityAnalysis;
48 class FunctorAnalysis;
49 class PolymorphicObjectsAnalysis;
50 class RecursiveClausesAnalysis;
51 class TypeEnvironment;
118 assert(it !=
ramRels.end() &&
"relation not found");
119 return (*it).second.get();
148 std::map<std::string, Own<ram::Statement>>
ramSubs;
151 std::map<std::string, Own<ram::Relation>>
ramRels;
Own< ast::SipsMetric > sips
SIPS metric for reordering.
RamDomain getConstantRamRepresentation(const ast::Constant &constant)
Get ram representation of constant.
Own< ram::Statement > ramMain
RAM program.
Own< ram::Statement > translateNonRecursiveRelation(const ast::Relation &rel, const ast::analysis::RecursiveClausesAnalysis *recursiveClauses)
translate RAM code for the non-recursive clauses of the given relation.
const ast::analysis::AuxiliaryArityAnalysis * auxArityAnalysis
Auxiliary Arity Analysis.
std::map< std::string, Own< ram::Statement > > ramSubs
Subroutines.
void nameUnnamedVariables(ast::Clause *clause)
assigns names to unnamed variables such that enclosing constructs may be cloned without losing the va...
const ast::analysis::FunctorAnalysis * functorAnalysis
Functors' analysis.
std::string translateDeltaRelation(const ast::Relation *rel)
translate a temporary delta relation to a RAM relation for semi-naive evaluation
std::vector< std::map< std::string, std::string > > getInputDirectives(const ast::Relation *rel)
Abstract class for conditions and boolean values in RAM.
Defines a relation with a name, attributes, qualifiers, and internal representation.
Intermediate representation of a horn clause.
const ast::Program * program
AST program.
std::map< std::string, Own< ram::Relation > > ramRels
RAM relations.
std::string translateRelation(const ast::Atom *atom)
a utility to translate atoms to relations
Access element from the current tuple in a tuple environment.
An abstract class for arguments.
size_t getEvaluationArity(const ast::Atom *atom) const
determine the auxiliary for relations
const ast::analysis::FunctorAnalysis * getFunctorAnalysis() const
Translating a RAM program.
The program class consists of relations, clauses and types.
const ram::Relation * lookupRelation(const std::string &name) const
An abstract class for performing indexed operations.
Own< ram::Condition > translateConstraint(const ast::Literal *arg, const ValueIndex &index)
translate an AST constraint to a RAM condition
const ast::analysis::PolymorphicObjectsAnalysis * polyAnalysis
Polymorphic Objects Analysis.
A type environment is a set of types.
Translation unit class for the translation pipeline.
Own< ram::Statement > makeNegationSubproofSubroutine(const ast::Clause &clause)
translate RAM code for subroutine to get subproofs for non-existence of a tuple
Defines an abstract class for literals in a horn clause.
const ast::SipsMetric * getSipsMetric() const
const ast::analysis::TypeEnvironment * typeEnv
Type environment.
void translateProgram(const ast::TranslationUnit &translationUnit)
translate AST to RAM Program
static bool removeADTs(const ast::TranslationUnit &translationUnit)
replace ADTs with special records
static std::string getRelationName(const ast::QualifiedName &id)
converts the given relation identifier into a relation name
std::string translateNewRelation(const ast::Relation *rel)
translate a temporary new relation to a RAM relation for semi-naive evaluation
static Own< ram::TupleElement > makeRamTupleElement(const Location &loc)
create a RAM element access node
Own< ram::Statement > makeSubproofSubroutine(const ast::Clause &clause)
translate RAM code for subroutine to get subproofs
const ast::analysis::PolymorphicObjectsAnalysis * getPolymorphicObjectsAnalysis() const
Abstract class for RAM statements.
SymbolTable & getSymbolTable()
Return a symbol table.
const ast::analysis::AuxiliaryArityAnalysis * getAuxArityAnalysis() const
Main class for the AST->RAM translator.
Class for SIPS cost-metric functions Each subclass represents a different heuristic used for evaluati...
Own< ram::Expression > translateValue(const ast::Argument *arg, const ValueIndex &index)
translate an AST argument to a RAM value
const ast::analysis::IOTypeAnalysis * ioType
IO Type.
Determine the auxiliary arity for relations.
Analysis pass identifying clauses which are recursive.
Own< ram::TranslationUnit > translateUnit(ast::TranslationUnit &tu)
translates AST to translation unit
Own< ram::Expression > translateConstant(ast::Constant const &c)
translate RAM code for a constant value
Qualified Name class defines fully/partially qualified names to identify objects in components.
void rel(size_t limit, bool showLimit=true)
std::vector< std::map< std::string, std::string > > getOutputDirectives(const ast::Relation *rel)
Abstract class for describing scalar values in RAM.
Own< ram::Statement > translateRecursiveRelation(const std::set< const ast::Relation * > &scc, const ast::analysis::RecursiveClausesAnalysis *recursiveClauses)
translate RAM code for recursive relations in a strongly-connected component