Trace("smt") << "SmtEngine::checkSat(" << e << ") => " << r << endl;
// Check that SAT results generate a model correctly.
- if(options::checkModels()){
+ if(options::checkModels()) {
if(r.asSatisfiabilityResult().isSat() == Result::SAT ||
(r.isUnknown() && r.whyUnknown() == Result::INCOMPLETE) ){
checkModel(/* hard failure iff */ ! r.isUnknown());
Trace("smt") << "SMT query(" << e << ") ==> " << r << endl;
// Check that SAT results generate a model correctly.
- if(options::checkModels()){
+ if(options::checkModels()) {
if(r.asSatisfiabilityResult().isSat() == Result::SAT ||
(r.isUnknown() && r.whyUnknown() == Result::INCOMPLETE) ){
checkModel(/* hard failure iff */ ! r.isUnknown());
children.push_back(val);
}
Node val = Rewriter::rewrite(NodeManager::currentNM()->mkNode(n.getKind(), children));
+ if(val.getKind() == kind::CARDINALITY_CONSTRAINT) {
+ val = NodeManager::currentNM()->mkConst(getCardinality(val[0].getType().toType()).getFiniteCardinality() <= val[1].getConst<Rational>().getNumerator());
+ }
Assert(hasBoundVars || val.isConst());
return val;
}
d_attr_handle[ str ].push_back( t );
}
-void TheoryEngine::checkTheoryAssertionsWithModel()
-{
- for (TheoryId theoryId = THEORY_FIRST; theoryId < THEORY_LAST; ++theoryId) {
- Theory* theory = d_theoryTable[theoryId];
- if (theory && d_logicInfo.isTheoryEnabled(theoryId)) {
- if (theoryId == THEORY_QUANTIFIERS || theoryId == THEORY_REWRITERULES) {
- continue;
- }
- context::CDList<Assertion>::const_iterator it = theory->facts_begin(), it_end = theory->facts_end();
- for (unsigned i = 0; it != it_end; ++ it, ++i) {
- Node assertion = (*it).assertion;
- Node val = getModel()->getValue(assertion);
- Assert(val == d_true);
+void TheoryEngine::checkTheoryAssertionsWithModel() {
+ for(TheoryId theoryId = THEORY_FIRST; theoryId < THEORY_LAST; ++theoryId) {
+ if(theoryId != THEORY_REWRITERULES) {
+ Theory* theory = d_theoryTable[theoryId];
+ if(theory && d_logicInfo.isTheoryEnabled(theoryId)) {
+ for(context::CDList<Assertion>::const_iterator it = theory->facts_begin(),
+ it_end = theory->facts_end();
+ it != it_end;
+ ++it) {
+ Node assertion = (*it).assertion;
+ Node val = getModel()->getValue(assertion);
+ Assert(val == d_true);
+ }
}
}
}