souffle
2.0.2-371-g6315b36
|
Relation wrapper used internally in the generated Datalog program. More...
#include <CompiledSouffle.h>
Data Structures | |
class | iterator_wrapper |
Public Types | |
using | AttrStrSeq = std::array< const char *, Arity > |
using | TupleType = Tuple< RamDomain, Arity > |
Public Types inherited from souffle::Relation | |
using | arity_type = uint32_t |
Public Member Functions | |
iterator | begin () const override |
Return an iterator pointing to the first tuple of the relation. More... | |
bool | contains (const tuple &arg) const override |
Check whether a tuple exists in a relation. More... | |
iterator | end () const override |
Return an iterator pointing to next to the last tuple of the relation. More... | |
arity_type | getArity () const override |
Return the arity of a relation. More... | |
const char * | getAttrName (size_t arg) const override |
Get the attribute name of a relation at the column specified by the parameter. More... | |
const char * | getAttrType (size_t arg) const override |
Get the attribute type of a relation at the column specified by the parameter. More... | |
arity_type | getAuxiliaryArity () const override |
Return the number of auxiliary attributes. More... | |
std::string | getName () const override |
Get the name of a relation. More... | |
SymbolTable & | getSymbolTable () const override |
Get the symbol table of a relation. More... | |
void | insert (const tuple &arg) override |
Insert a new tuple into the relation. More... | |
void | purge () override |
Eliminate all the tuples in relation. More... | |
RelationWrapper (uint32_t id, RelType &r, SouffleProgram &p, std::string name, const AttrStrSeq &t, const AttrStrSeq &n, arity_type numAuxAttribs) | |
std::size_t | size () const override |
Get the number of tuples in a relation. More... | |
Public Member Functions inherited from souffle::Relation | |
arity_type | getPrimaryArity () const |
Return the number of non-auxiliary attributes. More... | |
std::string | getSignature () |
Get the signature of a relation. More... | |
virtual | ~Relation ()=default |
Destructor. More... | |
Static Public Attributes | |
static constexpr arity_type | Arity = RelType::Arity |
Private Attributes | |
AttrStrSeq | attrNames |
AttrStrSeq | attrTypes |
const uint32_t | id |
std::string | name |
const arity_type | numAuxAttribs |
SouffleProgram & | program |
RelType & | relation |
Relation wrapper used internally in the generated Datalog program.
Definition at line 80 of file CompiledSouffle.h.
using souffle::RelationWrapper< RelType >::AttrStrSeq = std::array<const char*, Arity> |
Definition at line 84 of file CompiledSouffle.h.
using souffle::RelationWrapper< RelType >::TupleType = Tuple<RamDomain, Arity> |
Definition at line 83 of file CompiledSouffle.h.
|
inline |
Definition at line 126 of file CompiledSouffle.h.
|
inlineoverridevirtual |
Return an iterator pointing to the first tuple of the relation.
This iterator is used to access the tuples of the relation.
Implements souffle::Relation.
Definition at line 131 of file CompiledSouffle.h.
|
inlineoverridevirtual |
Check whether a tuple exists in a relation.
The definition of contains has to be defined by the child class of relation class.
t | Reference to a tuple object |
Implements souffle::Relation.
Definition at line 147 of file CompiledSouffle.h.
|
inlineoverridevirtual |
Return an iterator pointing to next to the last tuple of the relation.
Implements souffle::Relation.
Definition at line 134 of file CompiledSouffle.h.
|
inlineoverridevirtual |
Return the arity of a relation.
For example for a tuple (1 2) the arity is 2 and for a tuple (1 2 3) the arity is 3.
arity_type
) Implements souffle::Relation.
Definition at line 169 of file CompiledSouffle.h.
References souffle::SouffleProgram::getSymbolTable(), and souffle::RelationWrapper< RelType >::program.
|
inlineoverridevirtual |
Get the attribute name of a relation at the column specified by the parameter.
The attribute name is the name given to the type by the user in the .decl statement. For example, for ".decl edge (node1:Node, node2:Node)", the attribute names are node1 and node2.
The | index of the column starting starting from 0 (size_t) |
Implements souffle::Relation.
Definition at line 165 of file CompiledSouffle.h.
|
inlineoverridevirtual |
Get the attribute type of a relation at the column specified by the parameter.
The attribute type is in the form "<primitive type>:<type name>". <primitive type> can be s, f, u, or i standing for symbol, float, unsigned, and integer respectively, which are the primitive types in Souffle. <type name> is the name given by the user in the Souffle program
The | index of the column starting starting from 0 (size_t) |
Implements souffle::Relation.
Definition at line 161 of file CompiledSouffle.h.
|
inlineoverridevirtual |
Return the number of auxiliary attributes.
Auxiliary attributes are used for provenance and and other alternative evaluation strategies. They are stored as the last attributes of a tuple.
arity_type
) Implements souffle::Relation.
Definition at line 172 of file CompiledSouffle.h.
|
inlineoverridevirtual |
Get the name of a relation.
Implements souffle::Relation.
Definition at line 158 of file CompiledSouffle.h.
|
inlineoverridevirtual |
Get the symbol table of a relation.
The symbols in a tuple to be stored into a relation are stored and assigned with a number in a table called symbol table. For example, to insert ("John","Student") to a relation, "John" and "Student" are stored in symbol table and they are assigned with number say 0 and 1. After this, instead of inserting ("John","Student"), (0, 1) is inserted. When accessing this tuple, 0 and 1 will be looked up in the table and replaced by "John" and "Student". This is done so to save memory space if same symbols are inserted many times. Symbol table has many rows where each row contains a symbol and its corresponding assigned number.
Implements souffle::Relation.
Definition at line 175 of file CompiledSouffle.h.
|
inlineoverridevirtual |
Insert a new tuple into the relation.
The definition of insert function has to be defined by the child class of relation class.
t | Reference to a tuple class object |
Implements souffle::Relation.
Definition at line 138 of file CompiledSouffle.h.
|
inlineoverridevirtual |
Eliminate all the tuples in relation.
Implements souffle::Relation.
Definition at line 180 of file CompiledSouffle.h.
References souffle::t_nullaries::Arity, and souffle::t_nullaries::data.
|
inlineoverridevirtual |
Get the number of tuples in a relation.
Implements souffle::Relation.
Definition at line 155 of file CompiledSouffle.h.
References souffle::RelationWrapper< RelType >::Arity, and souffle::RelationWrapper< RelType >::attrTypes.
|
staticconstexpr |
Definition at line 82 of file CompiledSouffle.h.
Referenced by souffle::getInstance(), and souffle::RelationWrapper< RelType >::size().
|
private |
Definition at line 91 of file CompiledSouffle.h.
|
private |
Definition at line 90 of file CompiledSouffle.h.
Referenced by souffle::RelationWrapper< RelType >::size().
|
private |
Definition at line 92 of file CompiledSouffle.h.
|
private |
Definition at line 89 of file CompiledSouffle.h.
|
private |
Definition at line 93 of file CompiledSouffle.h.
|
private |
Definition at line 88 of file CompiledSouffle.h.
Referenced by souffle::RelationWrapper< RelType >::getArity().
|
private |
Definition at line 87 of file CompiledSouffle.h.