Changes needed for the bit-blasting floating-point solver which are outside of it's area and / or applicable independently.
/**
* Returns true if this node represents a variable
+ * @return true if variable
*/
inline bool isVar() const {
assertTNodeNotExpired();
}
Assert(nb.d_nvMaxChildren <= d_nvMaxChildren);
- Assert(nb.d_nv->nv_end() - nb.d_nv->nv_begin() <= d_nvMaxChildren, "realloced:%s, d_nvMax:%u, size:%u, nc:%u", realloced ? "true" : "false", d_nvMaxChildren, nb.d_nv->nv_end() - nb.d_nv->nv_begin(), nb.d_nv->getNumChildren());
+ Assert(nb.d_nv->nv_end() >= nb.d_nv->nv_begin());
+ Assert((size_t)(nb.d_nv->nv_end() - nb.d_nv->nv_begin()) <= d_nvMaxChildren, "realloced:%s, d_nvMax:%u, size:%u, nc:%u", realloced ? "true" : "false", d_nvMaxChildren, nb.d_nv->nv_end() - nb.d_nv->nv_begin(), nb.d_nv->getNumChildren());
std::copy(nb.d_nv->nv_begin(),
nb.d_nv->nv_end(),
d_nv->nv_begin());
TheoryModel* m = d_theoryEngine->getModel();
// Check individual theory assertions
- d_theoryEngine->checkTheoryAssertionsWithModel();
+ d_theoryEngine->checkTheoryAssertionsWithModel(hardFailure);
// Output the model
Notice() << *m;
for (size_t i = 2; i < children; ++i) {
if (!(n[i].getType(check) == firstOperand)) {
throw TypeCheckingExceptionPrivate(
- n, "floating-point test applied to mixed sorts");
+ n, "floating-point operation applied to mixed sorts");
}
}
}
d_attr_handle[ str ].push_back( t );
}
-void TheoryEngine::checkTheoryAssertionsWithModel() {
+void TheoryEngine::checkTheoryAssertionsWithModel(bool hardFailure) {
for(TheoryId theoryId = THEORY_FIRST; theoryId < THEORY_LAST; ++theoryId) {
Theory* theory = d_theoryTable[theoryId];
if(theory && d_logicInfo.isTheoryEnabled(theoryId)) {
ss << theoryId << " has an asserted fact that the model doesn't satisfy." << endl
<< "The fact: " << assertion << endl
<< "Model value: " << val << endl;
- InternalError(ss.str());
+ if(hardFailure) {
+ InternalError(ss.str());
+ }
}
}
}
* Check that the theory assertions are satisfied in the model.
* This function is called from the smt engine's checkModel routine.
*/
- void checkTheoryAssertionsWithModel();
+ void checkTheoryAssertionsWithModel(bool hardFailure);
private:
IntStat d_arithSubstitutionsAdded;