Removing more miscellaneous throw specifiers. Also fixing the spelling of amount in several places.
}
void Solver::setNotify(Notify* toNotify) { d_notify = toNotify; }
-
-bool Solver::withinBudget(uint64_t ammount) const {
+bool Solver::withinBudget(uint64_t amount) const
+{
AlwaysAssert(d_notify);
- d_notify->spendResource(ammount);
+ d_notify->spendResource(amount);
d_notify->safePoint(0);
return !asynch_interrupt &&
*/
virtual void notify(vec<Lit>& learnt) = 0;
- virtual void spendResource(unsigned ammount) = 0;
- virtual void safePoint(unsigned ammount) = 0;
+ virtual void spendResource(unsigned amount) = 0;
+ virtual void safePoint(unsigned amount) = 0;
};
//=================================================================================================
CRef reason (Var x) const;
int level (Var x) const;
double progressEstimate () const; // DELETE THIS ?? IT'S NOT VERY USEFUL ...
- bool withinBudget (uint64_t ammount) const;
+ bool withinBudget (uint64_t amount) const;
// Static helpers:
//
else if (to[cr].has_extra()) to[cr].calcAbstraction();
}
-inline bool Solver::withinBudget(uint64_t ammount) const {
+inline bool Solver::withinBudget(uint64_t amount) const
+{
Assert (proxy);
// spendResource sets async_interrupt or throws UnsafeInterruptException
// depending on whether hard-limit is enabled
- proxy->spendResource(ammount);
+ proxy->spendResource(amount);
bool within_budget = !asynch_interrupt &&
(conflict_budget < 0 || conflicts < (uint64_t)conflict_budget) &&
bool PropEngine::isRunning() const {
return d_inCheckSat;
}
-
-void PropEngine::interrupt() throw(ModalException) {
+void PropEngine::interrupt()
+{
if(! d_inCheckSat) {
return;
}
Debug("prop") << "interrupt()" << endl;
}
-void PropEngine::spendResource(unsigned ammount) throw (UnsafeInterruptException) {
- d_resourceManager->spendResource(ammount);
+void PropEngine::spendResource(unsigned amount)
+{
+ d_resourceManager->spendResource(amount);
}
bool PropEngine::properExplanation(TNode node, TNode expl) const {
/**
* Interrupt a running solver (cause a timeout).
+ *
+ * Can potentially throw a ModalException.
*/
- void interrupt() throw(ModalException);
+ void interrupt();
/**
* Informs the ResourceManager that a resource has been spent. If out of
* resources, can throw an UnsafeInterruptException exception.
*/
- void spendResource(unsigned ammount) throw (UnsafeInterruptException);
+ void spendResource(unsigned amount);
/**
* For debugging. Return true if "expl" is a well-formed
* Notify about a learnt clause.
*/
virtual void notify(SatClause& clause) = 0;
- virtual void spendResource(unsigned ammount) = 0;
- virtual void safePoint(unsigned ammount) = 0;
+ virtual void spendResource(unsigned amount) = 0;
+ virtual void safePoint(unsigned amount) = 0;
};/* class BVSatSolverInterface::Notify */
#endif /* CVC4_REPLAY */
}
-void TheoryProxy::spendResource(unsigned ammount) {
- d_theoryEngine->spendResource(ammount);
+void TheoryProxy::spendResource(unsigned amount)
+{
+ d_theoryEngine->spendResource(amount);
}
bool TheoryProxy::isDecisionRelevant(SatVariable var) {
void logDecision(SatLiteral lit);
- void spendResource(unsigned ammount);
+ void spendResource(unsigned amount);
bool isDecisionEngineDone();
CommandSequence* d_commands;
#endif /* CVC4_PORTFOLIO */
-public:
- CVC4dumpstream() throw()
+ public:
+ CVC4dumpstream()
#if defined(CVC4_DUMPING) && !defined(CVC4_MUZZLE) && defined(CVC4_PORTFOLIO)
- : d_os(NULL), d_commands(NULL)
+ : d_os(NULL), d_commands(NULL)
#elif defined(CVC4_DUMPING) && !defined(CVC4_MUZZLE)
- : d_os(NULL)
+ : d_os(NULL)
#elif defined(CVC4_PORTFOLIO)
- : d_commands(NULL)
+ : d_commands(NULL)
#endif /* CVC4_PORTFOLIO */
{ }
- CVC4dumpstream(std::ostream& os, CommandSequence& commands) throw()
+ CVC4dumpstream(std::ostream& os, CommandSequence& commands)
#if defined(CVC4_DUMPING) && !defined(CVC4_MUZZLE) && defined(CVC4_PORTFOLIO)
- : d_os(&os), d_commands(&commands)
+ : d_os(&os), d_commands(&commands)
#elif defined(CVC4_DUMPING) && !defined(CVC4_MUZZLE)
- : d_os(&os)
+ : d_os(&os)
#elif defined(CVC4_PORTFOLIO)
- : d_commands(&commands)
+ : d_commands(&commands)
#endif /* CVC4_PORTFOLIO */
{ }
, d_lazyBB(lbv)
{}
- bool notify(prop::SatLiteral lit);
- void notify(prop::SatClause& clause);
- void spendResource(unsigned ammount);
- void safePoint(unsigned ammount);
+ bool notify(prop::SatLiteral lit) override;
+ void notify(prop::SatClause& clause) override;
+ void spendResource(unsigned amount) override;
+ void safePoint(unsigned amount) override;
};
TheoryBV *d_bv;
class MinisatEmptyNotify : public prop::BVSatSolverInterface::Notify {
public:
MinisatEmptyNotify() {}
- bool notify(prop::SatLiteral lit) { return true; }
- void notify(prop::SatClause& clause) { }
- void spendResource(unsigned ammount) {
- NodeManager::currentResourceManager()->spendResource(ammount);
+ bool notify(prop::SatLiteral lit) override { return true; }
+ void notify(prop::SatClause& clause) override {}
+ void spendResource(unsigned amount) override
+ {
+ NodeManager::currentResourceManager()->spendResource(amount);
}
- void safePoint(unsigned ammount) {}
+ void safePoint(unsigned amount) override {}
};
}
}
-void TLazyBitblaster::MinisatNotify::spendResource(unsigned ammount) {
- d_bv->spendResource(ammount);
+void TLazyBitblaster::MinisatNotify::spendResource(unsigned amount)
+{
+ d_bv->spendResource(amount);
}
-void TLazyBitblaster::MinisatNotify::safePoint(unsigned ammount) {
- d_bv->d_out->safePoint(ammount);
+void TLazyBitblaster::MinisatNotify::safePoint(unsigned amount)
+{
+ d_bv->d_out->safePoint(amount);
}
}
}
-void TheoryBV::spendResource(unsigned ammount) throw(UnsafeInterruptException) {
- getOutputChannel().spendResource(ammount);
+void TheoryBV::spendResource(unsigned amount)
+{
+ getOutputChannel().spendResource(amount);
}
TheoryBV::Statistics::Statistics(const std::string &name):
Statistics d_statistics;
- void spendResource(unsigned ammount) throw(UnsafeInterruptException);
+ void spendResource(unsigned amount);
/**
* Return the uninterpreted function symbol corresponding to division-by-zero
} else if (low < extendee_size && high >= extendee_size) {
// if extract overlaps sign extend and extendee
Node low_extract = utils::mkExtract(extendee, extendee_size - 1, low);
- unsigned new_ammount = high - extendee_size + 1;
- resultNode = utils::mkSignExtend(low_extract, new_ammount);
+ unsigned new_amount = high - extendee_size + 1;
+ resultNode = utils::mkSignExtend(low_extract, new_amount);
} else {
// extract only over sign extend
Assert (low >= extendee_size);
if (!node[1].isConst()) return false;
TNode extract = node[0];
TNode c = node[1];
- unsigned ammount = utils::getSize(c);
-
- if (utils::getSize(node) != utils::getSize(extract[0])) return false;
- if (c != utils::mkConst(ammount, 0)) return false;
+ unsigned amount = utils::getSize(c);
+
+ if (utils::getSize(node) != utils::getSize(extract[0])) return false;
+ if (c != utils::mkZero(amount)) return false;
unsigned low = utils::getExtractLow(extract);
if (low != 0) return false;
unsigned high = utils::getExtractHigh(extract);
- if (high + ammount + 1 != utils::getSize(node)) return false;
+ if (high + amount + 1 != utils::getSize(node)) return false;
return true;
}
Debug("bv-rewrite") << "RewriteRule<ConcatToMult>(" << node << ")" << std::endl;
unsigned size = utils::getSize(node);
Node factor = node[0][0];
- Assert(utils::getSize(factor) == utils::getSize(node));
- BitVector ammount = BitVector(size, utils::getSize(node[1]));
- Node coef = utils::mkConst(BitVector(size, 1u).leftShift(ammount));
+ Assert(utils::getSize(factor) == utils::getSize(node));
+ BitVector amount = BitVector(size, utils::getSize(node[1]));
+ Node coef = utils::mkConst(BitVector(size, 1u).leftShift(amount));
return utils::mkNode(kind::BITVECTOR_MULT, factor, coef);
}
template<> inline
Node RewriteRule<MergeSignExtend>::apply(TNode node) {
Debug("bv-rewrite") << "RewriteRule<MergeSignExtend>(" << node << ")" << std::endl;
- unsigned ammount1 = node.getOperator().getConst<BitVectorSignExtend>().signExtendAmount;
+ unsigned amount1 =
+ node.getOperator().getConst<BitVectorSignExtend>().signExtendAmount;
NodeManager* nm = NodeManager::currentNM();
if (node[0].getKind() == kind::BITVECTOR_ZERO_EXTEND) {
- unsigned ammount2 = node[0].getOperator().getConst<BitVectorZeroExtend>().zeroExtendAmount;
- if (ammount2 == 0) {
+ unsigned amount2 =
+ node[0].getOperator().getConst<BitVectorZeroExtend>().zeroExtendAmount;
+ if (amount2 == 0)
+ {
NodeBuilder<> nb(kind::BITVECTOR_SIGN_EXTEND);
- Node op = nm->mkConst<BitVectorSignExtend>(BitVectorSignExtend(ammount1));
+ Node op = nm->mkConst<BitVectorSignExtend>(BitVectorSignExtend(amount1));
nb << op << node[0][0];
Node res = nb;
return res;
}
NodeBuilder<> nb(kind::BITVECTOR_ZERO_EXTEND);
- Node op = nm->mkConst<BitVectorZeroExtend>(BitVectorZeroExtend(ammount1 + ammount2));
+ Node op = nm->mkConst<BitVectorZeroExtend>(
+ BitVectorZeroExtend(amount1 + amount2));
nb << op << node[0][0];
Node res = nb;
return res;
}
Assert (node[0].getKind() == kind::BITVECTOR_SIGN_EXTEND);
- unsigned ammount2 = node[0].getOperator().getConst<BitVectorSignExtend>().signExtendAmount;
- NodeBuilder<> nb(kind::BITVECTOR_SIGN_EXTEND);
- Node op = nm->mkConst<BitVectorSignExtend>(BitVectorSignExtend(ammount1+ ammount2));
- nb << op << node[0][0];
- Node res = nb;
- return res;
+ unsigned amount2 =
+ node[0].getOperator().getConst<BitVectorSignExtend>().signExtendAmount;
+ return utils::mkSignExtend(node[0][0], amount1 + amount2);
}
/**
return NodeManager::currentNM()->mkNode(kind::XOR, node1, node2);
}
-
-inline Node mkSignExtend(TNode node, unsigned ammount) {
- NodeManager* nm = NodeManager::currentNM();
- Node signExtendOp = nm->mkConst<BitVectorSignExtend>(BitVectorSignExtend(ammount));
+inline Node mkSignExtend(TNode node, unsigned amount)
+{
+ NodeManager* nm = NodeManager::currentNM();
+ Node signExtendOp =
+ nm->mkConst<BitVectorSignExtend>(BitVectorSignExtend(amount));
return nm->mkNode(signExtendOp, node);
}
}
}
-LogicInfo::LogicInfo(std::string logicString) throw(IllegalArgumentException)
+LogicInfo::LogicInfo(std::string logicString)
: d_logicString(""),
d_theories(THEORY_LAST, false),
d_sharingTheories(0),
lock();
}
-LogicInfo::LogicInfo(const char* logicString) throw(IllegalArgumentException)
+LogicInfo::LogicInfo(const char* logicString)
: d_logicString(""),
d_theories(THEORY_LAST, false),
d_sharingTheories(0),
return d_logicString;
}
-void LogicInfo::setLogicString(std::string logicString) throw(IllegalArgumentException) {
+void LogicInfo::setLogicString(std::string logicString)
+{
PrettyCheckArgument(!d_locked, *this,
"This LogicInfo is locked, and cannot be modified");
for(TheoryId id = THEORY_FIRST; id < THEORY_LAST; ++id) {
* Throws an IllegalArgumentException if the logic string cannot
* be interpreted.
*/
- LogicInfo(std::string logicString) throw(IllegalArgumentException);
+ LogicInfo(std::string logicString);
/**
* Construct a LogicInfo from an SMT-LIB-like logic string.
* Throws an IllegalArgumentException if the logic string cannot
* be interpreted.
*/
- LogicInfo(const char* logicString) throw(IllegalArgumentException);
+ LogicInfo(const char* logicString);
// ACCESSORS
* Throws an IllegalArgumentException if the string can't be
* interpreted.
*/
- void setLogicString(std::string logicString) throw(IllegalArgumentException);
+ void setLogicString(std::string logicString);
/**
* Enable all functionality. All theories, plus quantifiers, will be
/**
* Get the value of the pre-rewrite cache.
*/
- static Node getPreRewriteCache(TNode node) throw() {
+ static Node getPreRewriteCache(TNode node)
+ {
Node cache;
if (node.hasAttribute(pre_rewrite())) {
node.getAttribute(pre_rewrite(), cache);
/**
* Set the value of the pre-rewrite cache.
*/
- static void setPreRewriteCache(TNode node, TNode cache) throw() {
+ static void setPreRewriteCache(TNode node, TNode cache)
+ {
Trace("rewriter") << "setting pre-rewrite of " << node << " to " << cache << std::endl;
Assert(!cache.isNull());
if (node == cache) {
* Get the value of the post-rewrite cache.
* none).
*/
- static Node getPostRewriteCache(TNode node) throw() {
+ static Node getPostRewriteCache(TNode node)
+ {
Node cache;
if (node.hasAttribute(post_rewrite())) {
node.getAttribute(post_rewrite(), cache);
/**
* Set the value of the post-rewrite cache. v cannot be a null Node.
*/
- static void setPostRewriteCache(TNode node, TNode cache) throw() {
+ static void setPostRewriteCache(TNode node, TNode cache)
+ {
Assert(!cache.isNull());
Trace("rewriter") << "setting rewrite of " << node << " to " << cache << std::endl;
if (node == cache) {
return os;
}/* ostream& operator<<(ostream&, Theory::Effort) */
-
-Theory::Theory(TheoryId id, context::Context* satContext,
- context::UserContext* userContext, OutputChannel& out,
- Valuation valuation, const LogicInfo& logicInfo,
- std::string name) throw()
- : d_id(id)
- , d_instanceName(name)
- , d_satContext(satContext)
- , d_userContext(userContext)
- , d_logicInfo(logicInfo)
- , d_facts(satContext)
- , d_factsHead(satContext, 0)
- , d_sharedTermsIndex(satContext, 0)
- , d_careGraph(NULL)
- , d_quantEngine(NULL)
- , d_extTheory(NULL)
- , d_checkTime(getFullInstanceName() + "::checkTime")
- , d_computeCareGraphTime(getFullInstanceName() + "::computeCareGraphTime")
- , d_sharedTerms(satContext)
- , d_out(&out)
- , d_valuation(valuation)
- , d_proofsEnabled(false)
+Theory::Theory(TheoryId id,
+ context::Context* satContext,
+ context::UserContext* userContext,
+ OutputChannel& out,
+ Valuation valuation,
+ const LogicInfo& logicInfo,
+ std::string name)
+ : d_id(id),
+ d_instanceName(name),
+ d_satContext(satContext),
+ d_userContext(userContext),
+ d_logicInfo(logicInfo),
+ d_facts(satContext),
+ d_factsHead(satContext, 0),
+ d_sharedTermsIndex(satContext, 0),
+ d_careGraph(NULL),
+ d_quantEngine(NULL),
+ d_extTheory(NULL),
+ d_checkTime(getFullInstanceName() + "::checkTime"),
+ d_computeCareGraphTime(getFullInstanceName() + "::computeCareGraphTime"),
+ d_sharedTerms(satContext),
+ d_out(&out),
+ d_valuation(valuation),
+ d_proofsEnabled(false)
{
smtStatisticsRegistry()->registerStat(&d_checkTime);
smtStatisticsRegistry()->registerStat(&d_computeCareGraphTime);
* The pair <id, instance> is assumed to uniquely identify this Theory
* w.r.t. the SmtEngine.
*/
- Theory(TheoryId id, context::Context* satContext,
- context::UserContext* userContext, OutputChannel& out,
- Valuation valuation, const LogicInfo& logicInfo,
- std::string instance = "") throw(); // taking : No default.
+ Theory(TheoryId id,
+ context::Context* satContext,
+ context::UserContext* userContext,
+ OutputChannel& out,
+ Valuation valuation,
+ const LogicInfo& logicInfo,
+ std::string instance = ""); // taking : No default.
/**
* This is called at shutdown time by the TheoryEngine, just before
return node.getNumChildren() == 0 || theoryOf(node) != theoryId;
}
- /**
- * Returns true if the assertFact queue is empty
- */
- bool done() const throw() {
- return d_factsHead == d_facts.size();
- }
-
+ /** Returns true if the assertFact queue is empty*/
+ bool done() const { return d_factsHead == d_facts.size(); }
/**
* Destructs a Theory.
*/
smtStatisticsRegistry()->unregisterStat(&d_arithSubstitutionsAdded);
}
-void TheoryEngine::interrupt() throw(ModalException) {
- d_interrupted = true;
-}
-
+void TheoryEngine::interrupt() { d_interrupted = true; }
void TheoryEngine::preRegister(TNode preprocessed) {
Debug("theory") << "TheoryEngine::preRegister( " << preprocessed << ")" << std::endl;
}
}
-void TheoryEngine::spendResource(unsigned ammount) {
- d_resourceManager->spendResource(ammount);
+void TheoryEngine::spendResource(unsigned amount)
+{
+ d_resourceManager->spendResource(amount);
}
void TheoryEngine::enableTheoryAlternative(const std::string& name){
/** Destroys a theory engine */
~TheoryEngine();
- void interrupt() throw(ModalException);
- /**
- * "Spend" a resource during a search or preprocessing.
- */
+ void interrupt();
+
+ /** "Spend" a resource during a search or preprocessing.*/
void spendResource(unsigned amount);
/**
d_eeContext->push();
}
-TheoryModel::~TheoryModel() throw() {
+TheoryModel::~TheoryModel()
+{
d_eeContext->pop();
delete d_equalityEngine;
delete d_eeContext;
/** The amount of resource used. */
uint64_t d_cumulativeResourceUsed;
- /** The ammount of resource used during this call. */
+ /** The amount of resource used during this call. */
uint64_t d_thisCallResourceUsed;
/**
- * The ammount of resource budget for this call (min between per call
+ * The amount of resource budget for this call (min between per call
* budget and left-over cumulative budget.
*/
uint64_t d_thisCallTimeBudget;