{ \
if (d_exprStatistics[kind] == NULL) { \
stringstream statName; \
- statName << "CVC4::expr::count" << kind; \
+ statName << "expr::ExprManager::" << kind; \
d_exprStatistics[kind] = new IntStat(statName.str(), 0); \
StatisticsRegistry::registerStat(d_exprStatistics[kind]); \
} \
++ *(d_exprStatistics[kind]); \
- }
+ }
+ #define INC_STAT_VAR(type) \
+ { \
+ TypeNode* typeNode = Type::getTypeNode(type); \
+ TypeConstant type = typeNode->getKind() == kind::TYPE_CONSTANT ? typeNode->getConst<TypeConstant>() : LAST_TYPE; \
+ if (d_exprStatisticsVars[type] == NULL) { \
+ stringstream statName; \
+ if (type == LAST_TYPE) { \
+ statName << "expr::ExprManager::VARIABLE:Parametrized type"; \
+ } else { \
+ statName << "expr::ExprManager::VARIABLE:" << type; \
+ } \
+ d_exprStatisticsVars[type] = new IntStat(statName.str(), 0); \
+ StatisticsRegistry::registerStat(d_exprStatisticsVars[type]); \
+ } \
+ ++ *(d_exprStatisticsVars[type]); \
+ }
#else
#define INC_STAT(kind)
+ #define INC_STAT_VAR(type)
#endif
using namespace std;
for (unsigned i = 0; i < kind::LAST_KIND; ++ i) {
d_exprStatistics[i] = NULL;
}
+ for (unsigned i = 0; i < LAST_TYPE; ++ i) {
+ d_exprStatisticsVars[i] = NULL;
+ }
#endif
}
ExprManager::ExprManager(const Options& options) :
d_ctxt(new Context),
d_nodeManager(new NodeManager(d_ctxt, options)) {
-#ifdef CVC4_STATISTICS_ON
+#ifdef CVC4_STATISTICS_ON
+ for (unsigned i = 0; i < LAST_TYPE; ++ i) {
+ d_exprStatisticsVars[i] = NULL;
+ }
for (unsigned i = 0; i < kind::LAST_KIND; ++ i) {
d_exprStatistics[i] = NULL;
}
delete d_exprStatistics[i];
}
}
+ for (unsigned i = 0; i < LAST_TYPE; ++ i) {
+ if (d_exprStatisticsVars[i] != NULL) {
+ StatisticsRegistry::unregisterStat(d_exprStatisticsVars[i]);
+ delete d_exprStatisticsVars[i];
+ }
+ }
#endif
}
NodeManagerScope nms(d_nodeManager);
Node* n = d_nodeManager->mkVarPtr(name, *type.d_typeNode);
Debug("nm") << "set " << name << " on " << *n << std::endl;
+ INC_STAT_VAR(type);
return Expr(this, n);
}
Expr ExprManager::mkVar(const Type& type) {
NodeManagerScope nms(d_nodeManager);
+ INC_STAT_VAR(type);
return Expr(this, d_nodeManager->mkVarPtr(*type.d_typeNode));
}
operator BITVECTOR_AND 2 "bitwise and"
operator BITVECTOR_OR 2 "bitwise or"
operator BITVECTOR_XOR 2 "bitwise xor"
-operator BITVECTOR_NOT 2 "bitwise not"
+operator BITVECTOR_NOT 1 "bitwise not"
operator BITVECTOR_NAND 2 "bitwise nand"
operator BITVECTOR_NOR 2 "bitwise nor"
operator BITVECTOR_XNOR 2 "bitwise xnor"