SMTStabilizer API
Public API documentation for SMTStabilizer
Loading...
Searching...
No Matches
stabilizer::parser::NodeManager Class Reference

#include <dag.h>

Public Member Functions

 NodeManager ()
 
 ~NodeManager ()
 
std::shared_ptr< DAGNodegetNode (const size_t index) const
 
size_t getIndex (const std::shared_ptr< DAGNode > &node) const
 
size_t size () const
 
std::shared_ptr< DAGNodecreateNode (std::shared_ptr< Sort > sort, NODE_KIND kind, std::string name, std::vector< std::shared_ptr< DAGNode > > children)
 
std::shared_ptr< DAGNodecreateNode (std::shared_ptr< Sort > sort, NODE_KIND kind, std::string name)
 
std::shared_ptr< DAGNodecreateNode (std::shared_ptr< Sort > sort, NODE_KIND kind)
 
std::shared_ptr< DAGNodecreateNode (std::shared_ptr< Sort > sort)
 
std::shared_ptr< DAGNodecreateNode ()
 
std::shared_ptr< DAGNodecreateNode (NODE_KIND kind, std::string name)
 
std::shared_ptr< DAGNodecreateNode (NODE_KIND kind)
 
std::shared_ptr< DAGNodecreateNode (std::shared_ptr< Sort > sort, const Integer &v)
 
std::shared_ptr< DAGNodecreateNode (std::shared_ptr< Sort > sort, const Real &v)
 
std::shared_ptr< DAGNodecreateNode (std::shared_ptr< Sort > sort, const double &v)
 
std::shared_ptr< DAGNodecreateNode (std::shared_ptr< Sort > sort, const int &v)
 
std::shared_ptr< DAGNodecreateNode (std::shared_ptr< Sort > sort, const bool &v)
 
std::shared_ptr< DAGNodecreateNode (const std::string &n)
 
void clear ()
 

Static Public Member Functions

static std::shared_ptr< DAGNodegetNull ()
 
static std::shared_ptr< DAGNodegetUnknown ()
 
static std::shared_ptr< DAGNodegetTrue ()
 
static std::shared_ptr< DAGNodegetFalse ()
 
static std::shared_ptr< DAGNodegetE ()
 
static std::shared_ptr< DAGNodegetPi ()
 
static std::shared_ptr< DAGNodegetNaN ()
 
static std::shared_ptr< DAGNodegetEpsilon ()
 
static std::shared_ptr< DAGNodegetPosEpsilon ()
 
static std::shared_ptr< DAGNodegetNegEpsilon ()
 
static std::shared_ptr< DAGNodegetStrInf ()
 
static std::shared_ptr< DAGNodegetStrPosInf ()
 
static std::shared_ptr< DAGNodegetStrNegInf ()
 
static std::shared_ptr< DAGNodegetIntInf ()
 
static std::shared_ptr< DAGNodegetIntPosInf ()
 
static std::shared_ptr< DAGNodegetIntNegInf ()
 
static std::shared_ptr< DAGNodegetRealInf ()
 
static std::shared_ptr< DAGNodegetRealPosInf ()
 
static std::shared_ptr< DAGNodegetRealNegInf ()
 

Static Public Attributes

static const std::shared_ptr< DAGNodeNULL_NODE
 
static const std::shared_ptr< DAGNodeUNKNOWN_NODE
 
static const std::shared_ptr< DAGNodeERROR_NODE
 
static const std::shared_ptr< DAGNodeTRUE_NODE
 
static const std::shared_ptr< DAGNodeFALSE_NODE
 
static const std::shared_ptr< DAGNodeE_NODE
 
static const std::shared_ptr< DAGNodePI_NODE
 
static const std::shared_ptr< DAGNodeNAN_NODE
 
static const std::shared_ptr< DAGNodeEPSILON_NODE
 
static const std::shared_ptr< DAGNodePOS_EPSILON_NODE
 
static const std::shared_ptr< DAGNodeNEG_EPSILON_NODE
 
static const std::shared_ptr< DAGNodeSTR_INF_NODE
 
static const std::shared_ptr< DAGNodeSTR_POS_INF_NODE
 
static const std::shared_ptr< DAGNodeSTR_NEG_INF_NODE
 
static const std::shared_ptr< DAGNodeINT_INF_NODE
 
static const std::shared_ptr< DAGNodeINT_POS_INF_NODE
 
static const std::shared_ptr< DAGNodeINT_NEG_INF_NODE
 
static const std::shared_ptr< DAGNodeREAL_INF_NODE
 
static const std::shared_ptr< DAGNodeREAL_POS_INF_NODE
 
static const std::shared_ptr< DAGNodeREAL_NEG_INF_NODE
 

Private Member Functions

void initializeStaticNodes ()
 
std::shared_ptr< DAGNodeinsertNodeToBucket (const std::shared_ptr< DAGNode > &node)
 

Private Attributes

std::vector< std::shared_ptr< DAGNode > > nodes
 
std::array< std::unordered_map< size_t, std::vector< std::pair< std::shared_ptr< DAGNode >, size_t > > >, NUM_KINDSnode_buckets
 
size_t static_node_count = 0
 

Detailed Description

Definition at line 1197 of file dag.h.

Constructor & Destructor Documentation

◆ NodeManager()

stabilizer::parser::NodeManager::NodeManager ( )

◆ ~NodeManager()

stabilizer::parser::NodeManager::~NodeManager ( )

Definition at line 1078 of file dag.cpp.

References clear().

Member Function Documentation

◆ clear()

void stabilizer::parser::NodeManager::clear ( )

Definition at line 1100 of file dag.cpp.

References node_buckets, nodes, and static_node_count.

Referenced by ~NodeManager().

◆ createNode() [1/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( )

Definition at line 1233 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [2/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( const std::string &  n)

Definition at line 1279 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [3/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( NODE_KIND  kind)

Definition at line 1244 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [4/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( NODE_KIND  kind,
std::string  name 
)

Definition at line 1238 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [5/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( std::shared_ptr< Sort sort)

Definition at line 1228 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [6/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( std::shared_ptr< Sort sort,
const bool &  v 
)

Definition at line 1273 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [7/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( std::shared_ptr< Sort sort,
const double &  v 
)

Definition at line 1261 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [8/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( std::shared_ptr< Sort sort,
const int &  v 
)

Definition at line 1267 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [9/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( std::shared_ptr< Sort sort,
const Integer v 
)

Definition at line 1249 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [10/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( std::shared_ptr< Sort sort,
const Real v 
)

Definition at line 1255 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [11/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( std::shared_ptr< Sort sort,
NODE_KIND  kind 
)

Definition at line 1222 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [12/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( std::shared_ptr< Sort sort,
NODE_KIND  kind,
std::string  name 
)

Definition at line 1215 of file dag.cpp.

References insertNodeToBucket().

◆ createNode() [13/13]

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::createNode ( std::shared_ptr< Sort sort,
NODE_KIND  kind,
std::string  name,
std::vector< std::shared_ptr< DAGNode > >  children 
)

Definition at line 1204 of file dag.cpp.

References insertNodeToBucket().

◆ getE()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getE ( )
inlinestatic

Definition at line 1247 of file dag.h.

References E_NODE.

◆ getEpsilon()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getEpsilon ( )
inlinestatic

Definition at line 1250 of file dag.h.

References EPSILON_NODE.

◆ getFalse()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getFalse ( )
inlinestatic

Definition at line 1246 of file dag.h.

References FALSE_NODE.

◆ getIndex()

size_t stabilizer::parser::NodeManager::getIndex ( const std::shared_ptr< DAGNode > &  node) const

Definition at line 1083 of file dag.cpp.

References node_buckets.

◆ getIntInf()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getIntInf ( )
inlinestatic

Definition at line 1258 of file dag.h.

References INT_INF_NODE.

◆ getIntNegInf()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getIntNegInf ( )
inlinestatic

Definition at line 1260 of file dag.h.

References INT_NEG_INF_NODE.

◆ getIntPosInf()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getIntPosInf ( )
inlinestatic

Definition at line 1259 of file dag.h.

References INT_POS_INF_NODE.

◆ getNaN()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getNaN ( )
inlinestatic

Definition at line 1249 of file dag.h.

References NAN_NODE.

◆ getNegEpsilon()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getNegEpsilon ( )
inlinestatic

Definition at line 1252 of file dag.h.

References NEG_EPSILON_NODE.

◆ getNode()

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getNode ( const size_t  index) const

Definition at line 1080 of file dag.cpp.

References nodes.

◆ getNull()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getNull ( )
inlinestatic

Definition at line 1243 of file dag.h.

References NULL_NODE.

◆ getPi()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getPi ( )
inlinestatic

Definition at line 1248 of file dag.h.

References PI_NODE.

◆ getPosEpsilon()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getPosEpsilon ( )
inlinestatic

Definition at line 1251 of file dag.h.

References POS_EPSILON_NODE.

◆ getRealInf()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getRealInf ( )
inlinestatic

Definition at line 1261 of file dag.h.

References REAL_INF_NODE.

◆ getRealNegInf()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getRealNegInf ( )
inlinestatic

Definition at line 1263 of file dag.h.

References REAL_NEG_INF_NODE.

◆ getRealPosInf()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getRealPosInf ( )
inlinestatic

Definition at line 1262 of file dag.h.

References REAL_POS_INF_NODE.

◆ getStrInf()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getStrInf ( )
inlinestatic

Definition at line 1255 of file dag.h.

References STR_INF_NODE.

◆ getStrNegInf()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getStrNegInf ( )
inlinestatic

Definition at line 1257 of file dag.h.

References STR_NEG_INF_NODE.

◆ getStrPosInf()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getStrPosInf ( )
inlinestatic

Definition at line 1256 of file dag.h.

References STR_POS_INF_NODE.

◆ getTrue()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getTrue ( )
inlinestatic

Definition at line 1245 of file dag.h.

References TRUE_NODE.

◆ getUnknown()

static std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::getUnknown ( )
inlinestatic

Definition at line 1244 of file dag.h.

References UNKNOWN_NODE.

◆ initializeStaticNodes()

◆ insertNodeToBucket()

std::shared_ptr< DAGNode > stabilizer::parser::NodeManager::insertNodeToBucket ( const std::shared_ptr< DAGNode > &  node)
private

◆ size()

size_t stabilizer::parser::NodeManager::size ( ) const

Definition at line 1098 of file dag.cpp.

References nodes.

Member Data Documentation

◆ E_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::E_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>("e")

Definition at line 1279 of file dag.h.

Referenced by getE(), initializeStaticNodes(), stabilizer::parser::Parser::mkConstReal(), and stabilizer::parser::Parser::mkE().

◆ EPSILON_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::EPSILON_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>("EPSILON")

Definition at line 1293 of file dag.h.

Referenced by getEpsilon(), initializeStaticNodes(), and stabilizer::parser::Parser::mkEpsilon().

◆ ERROR_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::ERROR_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::NULL_SORT, NODE_KIND::NT_ERROR, "error")
static const std::shared_ptr< Sort > NULL_SORT
Definition sort.h:384

Definition at line 1273 of file dag.h.

Referenced by initializeStaticNodes().

◆ FALSE_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::FALSE_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>("false")

Definition at line 1277 of file dag.h.

Referenced by getFalse(), initializeStaticNodes(), and stabilizer::parser::Parser::mkFalse().

◆ INT_INF_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::INT_INF_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::INT_SORT, NODE_KIND::NT_INFINITY, "INF")
static const std::shared_ptr< Sort > INT_SORT
Definition sort.h:390

Definition at line 1315 of file dag.h.

Referenced by getIntInf(), initializeStaticNodes(), and stabilizer::parser::Parser::mkInfinity().

◆ INT_NEG_INF_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::INT_NEG_INF_NODE
inlinestatic
Initial value:

Definition at line 1321 of file dag.h.

Referenced by getIntNegInf(), initializeStaticNodes(), and stabilizer::parser::Parser::mkNegInfinity().

◆ INT_POS_INF_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::INT_POS_INF_NODE
inlinestatic
Initial value:

Definition at line 1317 of file dag.h.

Referenced by getIntPosInf(), initializeStaticNodes(), and stabilizer::parser::Parser::mkPosInfinity().

◆ NAN_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::NAN_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>("NaN")

Definition at line 1291 of file dag.h.

Referenced by getNaN(), initializeStaticNodes(), stabilizer::parser::Parser::mkNaN(), and stabilizer::parser::Parser::rewrite().

◆ NEG_EPSILON_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::NEG_EPSILON_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::EXT_SORT,
"-EPSILON")
static const std::shared_ptr< Sort > EXT_SORT
Definition sort.h:402

Definition at line 1299 of file dag.h.

Referenced by getNegEpsilon(), initializeStaticNodes(), and stabilizer::parser::Parser::mkNegEpsilon().

◆ node_buckets

std::array< std::unordered_map< size_t, std::vector<std::pair<std::shared_ptr<DAGNode>, size_t> > >, NUM_KINDS> stabilizer::parser::NodeManager::node_buckets
private

Definition at line 1206 of file dag.h.

Referenced by clear(), getIndex(), insertNodeToBucket(), and NodeManager().

◆ nodes

std::vector<std::shared_ptr<DAGNode> > stabilizer::parser::NodeManager::nodes
private

Definition at line 1199 of file dag.h.

Referenced by clear(), getNode(), initializeStaticNodes(), insertNodeToBucket(), NodeManager(), and size().

◆ NULL_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::NULL_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>("NULL")

Definition at line 1267 of file dag.h.

Referenced by getNull(), stabilizer::parser::Parser::getVariable(), initializeStaticNodes(), stabilizer::parser::Parser::mkFuncDec(), and stabilizer::parser::Parser::parseQuant().

◆ PI_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::PI_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>("pi")

Definition at line 1281 of file dag.h.

Referenced by getPi(), initializeStaticNodes(), stabilizer::parser::Parser::mkConstReal(), and stabilizer::parser::Parser::mkPi().

◆ POS_EPSILON_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::POS_EPSILON_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::EXT_SORT,
"+EPSILON")

Definition at line 1295 of file dag.h.

Referenced by getPosEpsilon(), initializeStaticNodes(), and stabilizer::parser::Parser::mkPosEpsilon().

◆ REAL_INF_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::REAL_INF_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::REAL_SORT, NODE_KIND::NT_INFINITY, "INF")
static const std::shared_ptr< Sort > REAL_SORT
Definition sort.h:392

Definition at line 1325 of file dag.h.

Referenced by getRealInf(), initializeStaticNodes(), and stabilizer::parser::Parser::mkInfinity().

◆ REAL_NEG_INF_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::REAL_NEG_INF_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::REAL_SORT,
"-INF")

Definition at line 1331 of file dag.h.

Referenced by getRealNegInf(), initializeStaticNodes(), and stabilizer::parser::Parser::mkNegInfinity().

◆ REAL_POS_INF_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::REAL_POS_INF_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::REAL_SORT,
"+INF")

Definition at line 1327 of file dag.h.

Referenced by getRealPosInf(), initializeStaticNodes(), and stabilizer::parser::Parser::mkPosInfinity().

◆ static_node_count

size_t stabilizer::parser::NodeManager::static_node_count = 0
private

Definition at line 1208 of file dag.h.

Referenced by clear(), and initializeStaticNodes().

◆ STR_INF_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::STR_INF_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::STR_SORT, NODE_KIND::NT_INFINITY, "INF")
static const std::shared_ptr< Sort > STR_SORT
Definition sort.h:398

Definition at line 1305 of file dag.h.

Referenced by getStrInf(), initializeStaticNodes(), and stabilizer::parser::Parser::mkInfinity().

◆ STR_NEG_INF_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::STR_NEG_INF_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::STR_SORT,
"-INF")

Definition at line 1311 of file dag.h.

Referenced by getStrNegInf(), initializeStaticNodes(), and stabilizer::parser::Parser::mkNegInfinity().

◆ STR_POS_INF_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::STR_POS_INF_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::STR_SORT,
"+INF")

Definition at line 1307 of file dag.h.

Referenced by getStrPosInf(), initializeStaticNodes(), and stabilizer::parser::Parser::mkPosInfinity().

◆ TRUE_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::TRUE_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>("true")

Definition at line 1275 of file dag.h.

Referenced by getTrue(), initializeStaticNodes(), and stabilizer::parser::Parser::mkTrue().

◆ UNKNOWN_NODE

const std::shared_ptr<DAGNode> stabilizer::parser::NodeManager::UNKNOWN_NODE
inlinestatic
Initial value:
=
std::make_shared<DAGNode>(SortManager::UNKNOWN_SORT,
"unknown")
static const std::shared_ptr< Sort > UNKNOWN_SORT
Definition sort.h:386

Definition at line 1269 of file dag.h.

Referenced by getUnknown(), initializeStaticNodes(), and stabilizer::parser::Parser::mkUnknown().


The documentation for this class was generated from the following files: