souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Protected Attributes
souffle::ram::AbstractExistenceCheck Class Reference

Abstract existence check for a tuple in a relation. More...

#include <AbstractExistenceCheck.h>

Inheritance diagram for souffle::ram::AbstractExistenceCheck:
Inheritance graph
Collaboration diagram for souffle::ram::AbstractExistenceCheck:
Collaboration graph

Public Member Functions

 AbstractExistenceCheck (std::string rel, VecOwn< Expression > vals)
 
void apply (const NodeMapper &map) override
 Apply the mapper to all child nodes. More...
 
std::vector< const Node * > getChildNodes () const override
 Obtain list of all embedded child nodes. More...
 
const std::string & getRelation () const
 Get relation. More...
 
const std::vector< Expression * > getValues () const
 Get arguments of the tuple/pattern A null pointer element in the vector denotes an unspecified pattern for a tuple element. More...
 
- Public Member Functions inherited from souffle::ram::Condition
Conditionclone () const override=0
 Create a clone (i.e. More...
 
- Public Member Functions inherited from souffle::ram::Node
bool operator!= (const Node &other) const
 Inequality check for two RAM nodes. More...
 
bool operator== (const Node &other) const
 Equivalence check for two RAM nodes. More...
 
virtual void rewrite (const Node *oldNode, Own< Node > newNode)
 Rewrite a child node. More...
 
virtual ~Node ()=default
 

Protected Member Functions

bool equal (const Node &node) const override
 Equality check for two RAM nodes. More...
 
void print (std::ostream &os) const override
 Print RAM node. More...
 

Protected Attributes

const std::string relation
 Relation. More...
 
VecOwn< Expressionvalues
 Search tuple. More...
 

Detailed Description

Abstract existence check for a tuple in a relation.

Definition at line 47 of file AbstractExistenceCheck.h.

Constructor & Destructor Documentation

◆ AbstractExistenceCheck()

souffle::ram::AbstractExistenceCheck::AbstractExistenceCheck ( std::string  rel,
VecOwn< Expression vals 
)
inline

Definition at line 49 of file AbstractExistenceCheck.h.

50  {
51  return relation;
52  }
53 
54  /**

References relation.

Member Function Documentation

◆ apply()

void souffle::ram::AbstractExistenceCheck::apply ( const NodeMapper )
inlineoverridevirtual

Apply the mapper to all child nodes.

Reimplemented from souffle::ram::Node.

Definition at line 78 of file AbstractExistenceCheck.h.

78  {
79  os << "(" << join(values, ",") << ") ∈ " << relation;
80  }
81 
82  bool equal(const Node& node) const override {

References souffle::join(), relation, and values.

Here is the call graph for this function:

◆ equal()

bool souffle::ram::AbstractExistenceCheck::equal ( const Node ) const
inlineoverrideprotectedvirtual

Equality check for two RAM nodes.

Default action is that nothing needs to be checked.

Reimplemented from souffle::ram::Node.

Definition at line 89 of file AbstractExistenceCheck.h.

◆ getChildNodes()

std::vector<const Node*> souffle::ram::AbstractExistenceCheck::getChildNodes ( ) const
inlineoverridevirtual

Obtain list of all embedded child nodes.

Reimplemented from souffle::ram::Node.

Definition at line 70 of file AbstractExistenceCheck.h.

71  {
72  for (auto& val : values) {
73  val = map(std::move(val));
74  }
75  }
76 

References souffle::map(), and values.

Here is the call graph for this function:

◆ getRelation()

const std::string& souffle::ram::AbstractExistenceCheck::getRelation ( ) const
inline

Get relation.

Definition at line 57 of file AbstractExistenceCheck.h.

59  {

References souffle::toPtrVector(), and values.

Here is the call graph for this function:

◆ getValues()

const std::vector<Expression*> souffle::ram::AbstractExistenceCheck::getValues ( ) const
inline

Get arguments of the tuple/pattern A null pointer element in the vector denotes an unspecified pattern for a tuple element.

Definition at line 66 of file AbstractExistenceCheck.h.

71  {

◆ print()

void souffle::ram::AbstractExistenceCheck::print ( std::ostream &  out) const
inlineoverrideprotectedvirtual

Print RAM node.

Implements souffle::ram::Node.

Reimplemented in souffle::ram::ProvenanceExistenceCheck.

Definition at line 85 of file AbstractExistenceCheck.h.

Referenced by souffle::ram::ProvenanceExistenceCheck::clone().

Field Documentation

◆ relation

const std::string souffle::ram::AbstractExistenceCheck::relation
protected

Relation.

Definition at line 95 of file AbstractExistenceCheck.h.

Referenced by AbstractExistenceCheck(), and apply().

◆ values

VecOwn<Expression> souffle::ram::AbstractExistenceCheck::values
protected

Search tuple.

Definition at line 98 of file AbstractExistenceCheck.h.

Referenced by apply(), getChildNodes(), and getRelation().


The documentation for this class was generated from the following file:
souffle::map
auto map(const std::vector< A > &xs, F &&f)
Applies a function to each element of a vector and returns the results.
Definition: ContainerUtil.h:158
souffle::join
detail::joined_sequence< Iter, Printer > join(const Iter &a, const Iter &b, const std::string &sep, const Printer &p)
Creates an object to be forwarded to some output stream for printing sequences of elements interspers...
Definition: StreamUtil.h:175
souffle::ram::AbstractExistenceCheck::relation
const std::string relation
Relation.
Definition: AbstractExistenceCheck.h:95
souffle::ram::AbstractExistenceCheck::values
VecOwn< Expression > values
Search tuple.
Definition: AbstractExistenceCheck.h:98
souffle::ram::AbstractExistenceCheck::equal
bool equal(const Node &node) const override
Equality check for two RAM nodes.
Definition: AbstractExistenceCheck.h:89