This fixes 2 issues with relevant domain type computation, the first involving arithmetic INST_CONSTANT that do not belong to the current quantified formula being solved for in a monomial sum, the second involving parametric datatype selectors.
Fixes #5635. Both benchmarks on that issue are unsolved (one timeout, one unknown) but throw no assertion failure.
<< std::endl;
}
Assert(terms[i].isNull()
- || terms[i].getType().isComparableTo(ftypes[i]));
+ || terms[i].getType().isComparableTo(ftypes[i]))
+ << "Incompatible type " << f << ", " << terms[i].getType()
+ << ", " << ftypes[i] << std::endl;
}
if (ie->addInstantiation(f, terms))
{
#include "theory/quantifiers/term_util.h"
#include "theory/quantifiers_engine.h"
-using namespace std;
-using namespace CVC4;
using namespace CVC4::kind;
-using namespace CVC4::context;
-using namespace CVC4::theory;
-using namespace CVC4::theory::quantifiers;
+
+namespace CVC4 {
+namespace theory {
+namespace quantifiers {
void RelevantDomain::RDomain::merge( RDomain * r ) {
Assert(!d_parent);
Node var2;
bool hasNonVar = false;
for( std::map< Node, Node >::iterator it = msum.begin(); it != msum.end(); ++it ){
- if( !it->first.isNull() && it->first.getKind()==INST_CONSTANT ){
+ if (!it->first.isNull() && it->first.getKind() == INST_CONSTANT
+ && tu->getInstConstAttr(it->first) == q)
+ {
if( var.isNull() ){
var = it->first;
}else if( var2.isNull() ){
}
}
+} // namespace quantifiers
+} // namespace theory
+} // namespace CVC4
//datatype operators may be parametric, always assume they are
if (k == SELECT || k == STORE || k == UNION || k == INTERSECTION
|| k == SUBSET || k == SETMINUS || k == MEMBER || k == SINGLETON
- || k == APPLY_SELECTOR_TOTAL || k == APPLY_TESTER || k == SEP_PTO
- || k == HO_APPLY || k == SEQ_NTH)
+ || k == APPLY_SELECTOR_TOTAL || k == APPLY_SELECTOR || k == APPLY_TESTER
+ || k == SEP_PTO || k == HO_APPLY || k == SEQ_NTH)
{
//since it is parametric, use a particular one as op
TypeNode tn = n[0].getType();