souffle  2.0.2-371-g6315b36
Public Member Functions | Private Attributes
souffle::Equivalence Class Reference

Equivalence class for variables in query command. More...

#include <ExplainProvenance.h>

Collaboration diagram for souffle::Equivalence:
Collaboration graph

Public Member Functions

 Equivalence (char t, std::string s, std::pair< size_t, size_t > idx)
 Constructor for Equvialence class. More...
 
 Equivalence (const Equivalence &o)=default
 Copy constructor. More...
 
const std::pair< size_t, size_t > & getFirstIdx () const
 Extract index of the first occurrence of the varible. More...
 
const std::vector< std::pair< size_t, size_t > > & getIndices () const
 Get indices of equivalent variables. More...
 
const std::string & getSymbol () const
 Get the symbol of variable. More...
 
char getType () const
 Get type of the variable of the equivalence class, 'i' for RamSigned, 's' for symbol 'u' for RamUnsigned, 'f' for RamFloat. More...
 
Equivalenceoperator= (const Equivalence &o)=default
 Copy assignment operator. More...
 
void push_back (std::pair< size_t, size_t > idx)
 Add index at the end of indices vector. More...
 
bool verify (const std::vector< tuple > &product) const
 Verify if elements at the indices are equivalent in the given product. More...
 
 ~Equivalence ()=default
 Destructor. More...
 

Private Attributes

std::vector< std::pair< size_t, size_t > > indices
 
std::string symbol
 
char type
 

Detailed Description

Equivalence class for variables in query command.

Definition at line 45 of file ExplainProvenance.h.

Constructor & Destructor Documentation

◆ ~Equivalence()

souffle::Equivalence::~Equivalence ( )
default

Destructor.

◆ Equivalence() [1/2]

souffle::Equivalence::Equivalence ( char  t,
std::string  s,
std::pair< size_t, size_t >  idx 
)
inline

Constructor for Equvialence class.

Parameters
t,typeof the variable
s,symbolof the variable
idx,firstoccurence of the variable

Definition at line 56 of file ExplainProvenance.h.

References indices.

◆ Equivalence() [2/2]

souffle::Equivalence::Equivalence ( const Equivalence o)
default

Copy constructor.

Member Function Documentation

◆ getFirstIdx()

const std::pair<size_t, size_t>& souffle::Equivalence::getFirstIdx ( ) const
inline

Extract index of the first occurrence of the varible.

Definition at line 83 of file ExplainProvenance.h.

90  {

◆ getIndices()

const std::vector<std::pair<size_t, size_t> >& souffle::Equivalence::getIndices ( ) const
inline

Get indices of equivalent variables.

Definition at line 88 of file ExplainProvenance.h.

90  {

References type.

◆ getSymbol()

const std::string& souffle::Equivalence::getSymbol ( ) const
inline

Get the symbol of variable.

Definition at line 101 of file ExplainProvenance.h.

106  {

◆ getType()

char souffle::Equivalence::getType ( ) const
inline

Get type of the variable of the equivalence class, 'i' for RamSigned, 's' for symbol 'u' for RamUnsigned, 'f' for RamFloat.

Definition at line 96 of file ExplainProvenance.h.

99  :
100  char type;

◆ operator=()

Equivalence& souffle::Equivalence::operator= ( const Equivalence o)
default

Copy assignment operator.

◆ push_back()

void souffle::Equivalence::push_back ( std::pair< size_t, size_t >  idx)
inline

Add index at the end of indices vector.

Definition at line 67 of file ExplainProvenance.h.

67  {
68  if (product[indices[i].first][indices[i].second] !=
69  product[indices[i - 1].first][indices[i - 1].second]) {

References i, and indices.

◆ verify()

bool souffle::Equivalence::verify ( const std::vector< tuple > &  product) const
inline

Verify if elements at the indices are equivalent in the given product.

Definition at line 72 of file ExplainProvenance.h.

77  {
78  return indices[0];
79  }
80 

Field Documentation

◆ indices

std::vector<std::pair<size_t, size_t> > souffle::Equivalence::indices
private

Definition at line 108 of file ExplainProvenance.h.

Referenced by Equivalence(), and push_back().

◆ symbol

std::string souffle::Equivalence::symbol
private

Definition at line 107 of file ExplainProvenance.h.

◆ type

char souffle::Equivalence::type
private

Definition at line 106 of file ExplainProvenance.h.

Referenced by getIndices().


The documentation for this class was generated from the following file:
souffle::Equivalence::type
char type
Definition: ExplainProvenance.h:106
i
size_t i
Definition: json11.h:663
souffle::Equivalence::indices
std::vector< std::pair< size_t, size_t > > indices
Definition: ExplainProvenance.h:108