* @param check whether we should check the type as we compute it
* (default: false)
*/
-Type ExprManager::getType(Expr e, bool check) throw (TypeCheckingException) {
+Type ExprManager::getType(Expr e, bool check)
+{
NodeManagerScope nms(d_nodeManager);
Type t;
try {
NodeManager* ExprManager::getNodeManager() const {
return d_nodeManager;
}
-
-Statistics ExprManager::getStatistics() const throw() {
+Statistics ExprManager::getStatistics() const
+{
return Statistics(*d_nodeManager->getStatisticsRegistry());
}
-SExpr ExprManager::getStatistic(const std::string& name) const throw() {
+SExpr ExprManager::getStatistic(const std::string& name) const
+{
return d_nodeManager->getStatisticsRegistry()->getStatistic(name);
}
SortConstructorType mkSortConstructor(const std::string& name,
size_t arity) const;
- /** Get the type of an expression */
- Type getType(Expr e, bool check = false)
- throw(TypeCheckingException);
+ /**
+ * Get the type of an expression.
+ *
+ * Throws a TypeCheckingException on failures or if a Type cannot be
+ * computed.
+ */
+ Type getType(Expr e, bool check = false);
/** Bits for use in mkVar() flags. */
enum {
Expr mkNullaryOperator( Type type, Kind k);
/** Get a reference to the statistics registry for this ExprManager */
- Statistics getStatistics() const throw();
+ Statistics getStatistics() const;
/** Get a reference to the statistics registry for this ExprManager */
- SExpr getStatistic(const std::string& name) const throw();
+ SExpr getStatistic(const std::string& name) const;
/**
* Flushes statistics for this ExprManager to a file descriptor. Safe to use
return Expr(d_exprManager, new Node(d_node->getOperator()));
}
-Type Expr::getType(bool check) const throw (TypeCheckingException) {
+Type Expr::getType(bool check) const
+{
ExprManagerScope ems(*this);
Assert(d_node != NULL, "Unexpected NULL expression pointer!");
PrettyCheckArgument(!d_node->isNull(), this,
d_node->toStream(out, depth, types, dag, language);
}
-Node Expr::getNode() const throw() {
- return *d_node;
-}
-
-TNode Expr::getTNode() const throw() {
- return *d_node;
-}
-
+Node Expr::getNode() const { return *d_node; }
+TNode Expr::getTNode() const { return *d_node; }
Expr Expr::notExpr() const {
Assert(d_exprManager != NULL,
"Don't have an expression manager for this expression!");
* @param check whether we should check the type as we compute it
* (default: false)
*/
- Type getType(bool check = false) const throw (TypeCheckingException);
+ Type getType(bool check = false) const;
/**
* Substitute "replacement" in for "e".
* Returns the actual internal node.
* @return the internal node
*/
- NodeTemplate<true> getNode() const throw();
+ NodeTemplate<true> getNode() const;
/**
* Returns the actual internal node as a TNode.
* @return the internal node
*/
- NodeTemplate<false> getTNode() const throw();
+ NodeTemplate<false> getTNode() const;
// Friend to access the actual internal expr information and private methods
friend class SmtEngine;
${getConst_instantiations}
-#line 557 "${template}"
+#line 549 "${template}"
inline size_t ExprHashFunction::operator()(CVC4::Expr e) const {
return (size_t) e.getId();
*/
void assignNodeValue(expr::NodeValue* ev);
- inline void assertTNodeNotExpired() const throw(AssertionException) {
+ // May throw an AssertionException if the Node is not live, i.e. the ref count
+ // is not positive.
+ inline void assertTNodeNotExpired() const
+ {
if(!ref_count) {
Assert( d_nv->d_rc > 0, "TNode pointing to an expired NodeValue" );
}
* @param check whether we should check the type as we compute it
* (default: false)
*/
- TypeNode getType(bool check = false) const
- throw (CVC4::TypeCheckingExceptionPrivate, CVC4::AssertionException);
+ TypeNode getType(bool check = false) const;
/**
* Substitution of Nodes.
template <bool ref_count>
TypeNode NodeTemplate<ref_count>::getType(bool check) const
- throw (CVC4::TypeCheckingExceptionPrivate, CVC4::AssertionException) {
+{
Assert( NodeManager::currentNM() != NULL,
"There is no current CVC4::NodeManager associated to this thread.\n"
"Perhaps a public-facing function is missing a NodeManagerScope ?" );
expr::NodeValue* constructNV() const;
#ifdef CVC4_DEBUG
- void maybeCheckType(const TNode n) const
- throw(TypeCheckingExceptionPrivate, AssertionException);
+ // Throws a TypeCheckingExceptionPrivate on a failure.
+ void maybeCheckType(const TNode n) const;
#else /* CVC4_DEBUG */
- inline void maybeCheckType(const TNode n) const throw() { }
+ // Do nothing if not in debug mode.
+ inline void maybeCheckType(const TNode n) const {}
#endif /* CVC4_DEBUG */
public:
#ifdef CVC4_DEBUG
template <unsigned nchild_thresh>
inline void NodeBuilder<nchild_thresh>::maybeCheckType(const TNode n) const
- throw(TypeCheckingExceptionPrivate, AssertionException) {
+{
/* force an immediate type check, if early type checking is
enabled and the current node isn't a variable or constant */
if( d_nm->getOptions()[options::earlyTypeChecking] ) {
} /* NodeManager::TopologicalSort() */
TypeNode NodeManager::getType(TNode n, bool check)
- throw(TypeCheckingExceptionPrivate, AssertionException) {
-
+{
// Many theories' type checkers call Node::getType() directly. This
// is incorrect, since "this" might not be the caller's curent node
// manager. Rather than force the individual typecheckers not to do
* @param check whether we should check the type as we compute it
* (default: false)
*/
- TypeNode getType(TNode n, bool check = false)
- throw(TypeCheckingExceptionPrivate, AssertionException);
+ TypeNode getType(TNode n, bool check = false);
/**
* Convert a node to an expression. Uses the ExprManager
std::pair< bool, std::ostream* > OstreamOpener::open(const std::string& optarg) const
- throw(OptionException)
{
if(optarg == "") {
std::stringstream ss;
* returns <true, stream> where stream is a ostream allocated by new.
* The caller is in this case the owner of the allocated memory.
*/
- std::pair<bool, std::ostream*> open(const std::string& name) const
- throw(OptionException);
+ std::pair<bool, std::ostream*> open(const std::string& name) const;
private:
const char* d_channelName;
/**
* Set the value of the given option by key.
+ *
+ * Throws OptionException or ModalException on failures.
*/
- void setOption(const std::string& key, const std::string& optionarg)
- throw(OptionException, ModalException);
-
+ void setOption(const std::string& key, const std::string& optionarg);
/** Get the value of the given option. Const access only. */
template <class T>
/**
* Gets the value of the given option by key and returns value as a string.
+ *
+ * Throws OptionException on failures, such as key not being the name of an
+ * option.
*/
- std::string getOption(const std::string& key) const
- throw(OptionException);
+ std::string getOption(const std::string& key) const;
// Get accessor functions.
InputLanguage getInputLanguage() const;
namespace CVC4 {
std::string Options::getOption(const std::string& key) const
- throw(OptionException) {
+{
Trace("options") << "SMT getOption(" << key << ")" << endl;
${smt_getoption_handlers}
namespace CVC4 {
void Options::setOption(const std::string& key, const std::string& optionarg)
- throw(OptionException, ModalException) {
+{
options::OptionsHandler* handler = d_handler;
Trace("options") << "SMT setOption(" << key << ", " << optionarg << ")" << endl;
return pCMM->newData(size);
}
-private:
-
+ private:
/**
* The destructor isn't actually defined. This declaration keeps
* the compiler from creating (wastefully) a default definition, and
* be allocated in a ContextMemoryManager, which doesn't call
* destructors.
*/
- ~Link() throw();
+ ~Link();
/**
* Just like the destructor, this is not defined. This ensures no