souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
35 class Relation :
public Node {
42 assert(this->attributeNames.size() ==
arity &&
"arity mismatch for attributes");
43 assert(this->attributeTypes.size() ==
arity &&
"arity mismatch for types");
44 for (std::size_t
i = 0;
i <
arity;
i++) {
45 assert(!this->attributeNames[
i].empty() &&
"no attribute name specified");
46 assert(!this->attributeTypes[
i].empty() &&
"no attribute type specified");
51 const std::string&
getName()
const {
77 return name.at(0) ==
'@';
92 return name < other.name;
100 void print(std::ostream& out)
const override {
104 for (
unsigned i = 1;
i <
arity;
i++) {
118 bool equal(
const Node& node)
const override {
119 assert(isA<Relation>(&node));
120 const auto& other =
static_cast<const Relation&
>(node);
131 const std::string
name;
const std::string name
Name of relation.
bool isNullary() const
Is nullary relation.
const size_t arity
Arity, i.e., number of attributes.
bool equal(const Node &node) const override
Equality check for two RAM nodes.
const std::vector< std::string > attributeNames
Name of attributes.
const std::vector< std::string > & getAttributeTypes() const
Get attribute types.
const size_t auxiliaryArity
Number of auxiliary attributes (e.g.
void print(std::ostream &out) const override
Print RAM node.
Relation(std::string name, size_t arity, size_t auxiliaryArity, std::vector< std::string > attributeNames, std::vector< std::string > attributeTypes, RelationRepresentation representation)
unsigned getArity() const
Get arity of relation.
const RelationRepresentation representation
Data-structure representation.
unsigned getAuxiliaryArity() const
Get number of auxiliary attributes.
An abstract class for performing indexed operations.
bool operator<(const Relation &other) const
Compare two relations via their name.
const std::vector< std::string > attributeTypes
Type of attributes.
const std::vector< std::string > & getAttributeNames() const
Get attribute names.
RelationRepresentation getRepresentation() const
Relation representation type.
const std::string & getName() const
Get name.
RelationRepresentation
Space of internal representations that a relation can have.
Relation * clone() const override
Create a clone (i.e.
bool isTemp() const
Is temporary relation (for semi-naive evaluation)