bddSymTab Class Reference

#include <bddSymTab.h>

Inheritance diagram for bddSymTab:

Inheritance graph
[legend]
Collaboration diagram for bddSymTab:

Collaboration graph
[legend]

Detailed Description

Symbol table for relations to support the binary encoding of values and attributes.

Each attribute has to be represented by some binary variables. The number of binary variables depends on the number of values in the value universe (the same for all attributes). 'mBitNr' is the number of binary variables, let's call them bits. 'getUniverseSize()-1' is the maximal of all encoded values. Cf. comments on top of class bddRelation for that. 'bddSymTab' is used in the following way: Initialize the symtab with a set of all the values of the universe. Attributes can be added and removed. Because the number of bits has to be assigned, the value universe has to stay fixed after the first use of the actual position, i.e. do not reinitialize the value set.

Definition at line 60 of file bddSymTab.h.

Public Member Functions

 bddSymTab ()
 ~bddSymTab ()
void initValueUniverse (set< string > &pValueUniverse)
 See comment on top of this class.
unsigned getBitNr () const
 See comment on top of this class.
unsigned getUniverseSize () const
 See comment on top of this class.
void setQuoted (const string pAttribute)
bool isQuoted (const string pAttribute) const
bool isValueGood (const string &pAttributeValue) const
 Checks if 'pAttributeValue' exists in symtab.
unsigned getAttributePos (const string &pAttribute) const
unsigned getValueNum (const string &pAttributeValue) const
 Return the number of value (pAttributeValue), i.e.
string getAttributeValue (unsigned pNum) const
void addAttribute (const string &pAttribute)
 The method changes this symbol table! Add attribute 'pAttribute' to SymTab.
void removeAttribute (const string &pAttribute)
 This method changes this symbol table! Remove attribute 'pAttribute' from SymTab.
void removeUserAttributes (const char pAttributePrefix)
 This method changes this symbol table! Remove all attributes from SymTab which do not start with 'pAttributePrefix'.
const map< unsigned, string > computeVariableOrder (const set< string > &pAttributes) const
void printValueNames (ostream &pS) const

Private Member Functions

void operator, (const bddSymTab &)
 It should not be allowed to use standard operators.
void operator= (const bddSymTab &)
 bddSymTab (const bddSymTab &)

Private Attributes

unsigned mBitNr
 Number of bits needed to encode the attribute ("bit width").
map< string, unsigned > mAttributes
 The position of the first bit in the binary encoded tupel for every attribute is given by 'getAttributePos()'.
map< unsigned, string > mPositions
 Reverse of the above. Simultaneously, this represents the varorder.
map< string, unsigned > mAttributeNumbers
 This symbol table handles only one value range for all attributes.
vector< string > mAttributeValues
 And the reverse mapping for output.
set< string > mIsQuoted
 The set of quoted values (in the RSF input file).


Constructor & Destructor Documentation

bddSymTab::bddSymTab ( const bddSymTab  )  [private]

bddSymTab::bddSymTab (  )  [inline]

Definition at line 95 of file bddSymTab.h.

bddSymTab::~bddSymTab (  )  [inline]

Definition at line 98 of file bddSymTab.h.


Member Function Documentation

void bddSymTab::operator, ( const bddSymTab  )  [private]

It should not be allowed to use standard operators.

void bddSymTab::operator= ( const bddSymTab  )  [private]

void bddSymTab::initValueUniverse ( set< string > &  pValueUniverse  )  [inline]

See comment on top of this class.

Assign the bit encodings.

Definition at line 107 of file bddSymTab.h.

References mAttributeNumbers, mAttributeValues, and mBitNr.

Referenced by crocopat().

Here is the caller graph for this function:

unsigned bddSymTab::getBitNr (  )  const [inline]

See comment on top of this class.

Definition at line 140 of file bddSymTab.h.

References mBitNr.

Referenced by bddRelation::exists(), getAttributePos(), bddRelation::getElement(), bddRelation::getTupleNr(), bddRelation::getTupleOf(), bddRelation::mkEqualPure(), bddRelation::mkRange(), bddRelation::printGraph(), bddRelation::printNodesPerVarId(), bddRelation::printRelation(), bddRelation::rename(), and bddRelation::testVars().

Here is the caller graph for this function:

unsigned bddSymTab::getUniverseSize (  )  const [inline]

See comment on top of this class.

Definition at line 145 of file bddSymTab.h.

References mAttributeValues.

Referenced by relTermExists::interpret(), relTermAttribute::interpret(), relPrintExprRelInfo::interpret(), relExprRegExTerm::interpret(), bddRelation::mkEqual(), bddRelation::mkLess(), and bddRelation::mkRange().

Here is the caller graph for this function:

void bddSymTab::setQuoted ( const string  pAttribute  )  [inline]

Definition at line 149 of file bddSymTab.h.

References mIsQuoted.

Referenced by file2vector().

Here is the caller graph for this function:

bool bddSymTab::isQuoted ( const string  pAttribute  )  const [inline]

Definition at line 153 of file bddSymTab.h.

References mIsQuoted.

Referenced by bddRelation::printRelation().

Here is the caller graph for this function:

bool bddSymTab::isValueGood ( const string &  pAttributeValue  )  const [inline]

Checks if 'pAttributeValue' exists in symtab.

Definition at line 158 of file bddSymTab.h.

References mAttributeNumbers.

Referenced by relExprRegExTerm::interpret(), and relExprRelVar::interpret().

Here is the caller graph for this function:

unsigned bddSymTab::getAttributePos ( const string &  pAttribute  )  const [inline]

Definition at line 164 of file bddSymTab.h.

References getBitNr(), and mAttributes.

Referenced by computeVariableOrder(), bddRelation::exists(), bddRelation::getTupleOf(), relStrExprElem::interpret(), relStmtFor::interpret(), relNumExprUnOp::interpret(), relExprClosure::interpret(), bddRelation::mkAttributeValue(), bddRelation::mkEqual(), bddRelation::mkLess(), bddRelation::printRelation(), bddRelation::rename(), and bddRelation::testVars().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned bddSymTab::getValueNum ( const string &  pAttributeValue  )  const [inline]

Return the number of value (pAttributeValue), i.e.

its internal representation.

Definition at line 175 of file bddSymTab.h.

References mAttributeNumbers.

Referenced by relStmtFor::interpret(), relNumExprUnOp::interpret(), and bddRelation::mkAttributeValue().

Here is the caller graph for this function:

string bddSymTab::getAttributeValue ( unsigned  pNum  )  const [inline]

Definition at line 185 of file bddSymTab.h.

References mAttributeValues.

Referenced by bddRelation::getElement(), and bddRelation::printRelation().

Here is the caller graph for this function:

void bddSymTab::addAttribute ( const string &  pAttribute  )  [inline]

The method changes this symbol table! Add attribute 'pAttribute' to SymTab.

Definition at line 196 of file bddSymTab.h.

References mAttributes, and mPositions.

Referenced by crocopat(), relStmtAssign::interpret(), relExprRegExTerm::interpret(), relExprClosure::interpret(), and relExprRelVar::interpret().

Here is the caller graph for this function:

void bddSymTab::removeAttribute ( const string &  pAttribute  )  [inline]

This method changes this symbol table! Remove attribute 'pAttribute' from SymTab.

Definition at line 220 of file bddSymTab.h.

References mAttributes, and mPositions.

Referenced by relExprClosure::interpret(), and removeUserAttributes().

Here is the caller graph for this function:

void bddSymTab::removeUserAttributes ( const char  pAttributePrefix  )  [inline]

This method changes this symbol table! Remove all attributes from SymTab which do not start with 'pAttributePrefix'.

Definition at line 231 of file bddSymTab.h.

References mPositions, and removeAttribute().

Referenced by relStmtFor::interpret(), relStmtWhile::interpret(), relStmtIf::interpret(), relStmtPrint::interpret(), relStmtAssignStr::interpret(), relStmtAssignNum::interpret(), relStmtAssign::interpret(), relPrintExprBDT::interpret(), relPrintExprGraph::interpret(), relPrintExprNodesPerVarId::interpret(), relPrintExprRelInfo::interpret(), relPrintExprValues::interpret(), relPrintExprInt::interpret(), and relPrintExprString::interpret().

Here is the call graph for this function:

Here is the caller graph for this function:

const map<unsigned,string> bddSymTab::computeVariableOrder ( const set< string > &  pAttributes  )  const [inline]

Definition at line 254 of file bddSymTab.h.

References getAttributePos().

Referenced by bddRelation::getTupleNr(), relPrintExprRelInfo::interpret(), relPrintExprValues::interpret(), relExprTupleOf::interpret(), relExprClosure::interpret(), bddRelation::printGraph(), and bddRelation::printNodesPerVarId().

Here is the call graph for this function:

Here is the caller graph for this function:

void bddSymTab::printValueNames ( ostream &  pS  )  const [inline]

Definition at line 268 of file bddSymTab.h.

References mAttributeNumbers, and mAttributeValues.


Field Documentation

unsigned bddSymTab::mBitNr [private]

Number of bits needed to encode the attribute ("bit width").

mBitNr is the smallest integer that is greater than log2(getUniverseSize()-1).

Definition at line 67 of file bddSymTab.h.

Referenced by getBitNr(), and initValueUniverse().

map<string, unsigned> bddSymTab::mAttributes [private]

The position of the first bit in the binary encoded tupel for every attribute is given by 'getAttributePos()'.

The following two maps just map the successive numbers.

Definition at line 72 of file bddSymTab.h.

Referenced by addAttribute(), getAttributePos(), and removeAttribute().

map<unsigned, string> bddSymTab::mPositions [private]

Reverse of the above. Simultaneously, this represents the varorder.

Definition at line 74 of file bddSymTab.h.

Referenced by addAttribute(), removeAttribute(), and removeUserAttributes().

map<string, unsigned> bddSymTab::mAttributeNumbers [private]

This symbol table handles only one value range for all attributes.

Values for attributes (Nominal scale to make the range 'dense'). It maps the name of a value within the application (string) to a number for internal representation of the value.

Definition at line 80 of file bddSymTab.h.

Referenced by getValueNum(), initValueUniverse(), isValueGood(), and printValueNames().

vector<string> bddSymTab::mAttributeValues [private]

And the reverse mapping for output.

Definition at line 82 of file bddSymTab.h.

Referenced by getAttributeValue(), getUniverseSize(), initValueUniverse(), and printValueNames().

set<string> bddSymTab::mIsQuoted [private]

The set of quoted values (in the RSF input file).

Definition at line 85 of file bddSymTab.h.

Referenced by isQuoted(), and setQuoted().


The documentation for this class was generated from the following file:
Generated on Fri Jun 6 22:22:36 2008 for CrocoPat by  doxygen 1.5.1