return d_inelig.find( n )==d_inelig.end();
}
+bool CegInstantiator::isCbqiKind(Kind k)
+{
+ if (quantifiers::TermUtil::isBoolConnective(k) || k == PLUS || k == GEQ
+ || k == EQUAL
+ || k == MULT
+ || k == NONLINEAR_MULT)
+ {
+ return true;
+ }
+ else
+ {
+ // CBQI typically works for satisfaction-complete theories
+ TheoryId t = kindToTheoryId(k);
+ return t == THEORY_BV || t == THEORY_DATATYPES || t == THEORY_BOOL;
+ }
+}
+
bool CegInstantiator::hasVariable( Node n, Node pv ) {
computeProgVars( n );
return d_prog_var[n].find( pv )!=d_prog_var[n].end();
bool useVtsInfinity() { return d_use_vts_inf; }
/** are we processing a nested quantified formula? */
bool hasNestedQuantification() { return d_is_nested_quant; }
+ /** Is k a kind for which counterexample-guided instantiation is possible?
+ *
+ * This typically corresponds to kinds that correspond to operators that
+ * have total interpretations and are a part of the signature of
+ * satisfaction complete theories (see Reynolds et al., CAV 2015).
+ */
+ static bool isCbqiKind(Kind k);
+
private:
/** quantified formula associated with this instantiator */
QuantifiersEngine* d_qe;
}
Trace("cegqi-arith-debug") << pv << " " << atom.getKind() << " " << val << std::endl;
}
- if( options::cbqiAll() ){
- // when not pure LIA/LRA, we must check whether the lhs contains pv
- if( TermUtil::containsTerm( val, pv ) ){
- Trace("cegqi-arith-debug") << "fail : contains bad term" << std::endl;
- return 0;
- }
+ // when not pure LIA/LRA, we must check whether the lhs contains pv
+ if (TermUtil::containsTerm(val, pv))
+ {
+ Trace("cegqi-arith-debug") << "fail : contains bad term" << std::endl;
+ return 0;
}
if( pvtn.isInteger() && ( ( !veq_c.isNull() && !veq_c.getType().isInteger() ) || !val.getType().isInteger() ) ){
//redo, split integer/non-integer parts
#include "theory/quantifiers/quantifiers_rewriter.h"
#include "theory/quantifiers/term_database.h"
#include "theory/quantifiers/term_util.h"
-#include "theory/quantifiers/ematching/trigger.h"
#include "theory/theory_engine.h"
using namespace std;
if( visited.find( n )==visited.end() ){
visited[n] = true;
if( n.getKind()!=BOUND_VARIABLE && TermUtil::hasBoundVarAttr( n ) ){
- if( !inst::Trigger::isCbqiKind( n.getKind() ) ){
+ if (!CegInstantiator::isCbqiKind(n.getKind()))
+ {
Trace("cbqi-debug2") << "Non-cbqi kind : " << n.getKind() << " in " << n << std::endl;
return true;
- }else if( n.getKind()==MULT && ( n.getNumChildren()!=2 || !n[0].isConst() ) ){
- Trace("cbqi-debug2") << "Non-linear arithmetic : " << n << std::endl;
- return true;
- }else if( n.getKind()==FORALL ){
+ }
+ else if (n.getKind() == FORALL || n.getKind() == CHOICE)
+ {
return hasNonCbqiOperator( n[1], visited );
}else{
for( unsigned i=0; i<n.getNumChildren(); i++ ){
bool Trigger::isRelationalTriggerKind( Kind k ) {
return k==EQUAL || k==GEQ;
}
-
-bool Trigger::isCbqiKind( Kind k ) {
- if( quantifiers::TermUtil::isBoolConnective( k ) || k==PLUS || k==GEQ || k==EQUAL || k==MULT ){
- return true;
- }else{
- //CBQI typically works for satisfaction-complete theories
- TheoryId t = kindToTheoryId( k );
- return t == THEORY_BV || t == THEORY_DATATYPES || t == THEORY_BOOL;
- }
-}
bool Trigger::isSimpleTrigger( Node n ){
Node t = n.getKind()==NOT ? n[0] : n;
static bool isRelationalTrigger( Node n );
/** Is k a relational trigger kind? */
static bool isRelationalTriggerKind( Kind k );
- /** Is k a kind for which counterexample-guided instantiation is possible?
- *
- * This typically corresponds to kinds that correspond to operators that
- * have total interpretations and are a part of the signature of
- * satisfaction complete theories (see Reynolds et al., CAV 2015).
- */
- static bool isCbqiKind( Kind k );
/** is n a simple trigger (see inst_match_generator.h)? */
static bool isSimpleTrigger( Node n );
/** is n a Boolean term trigger, e.g. ite( x, BV1, BV0 )? */
qbv-test-invert-concat-1.smt2 \
qbv-test-invert-sign-extend.smt2 \
clock-10.smt2 \
- lra-triv-gn.smt2
+ lra-triv-gn.smt2 \
+ cegqi-nl-simp.cvc \
+ cegqi-nl-sq.smt2
EXTRA_DIST = $(TESTS) \
bug291.smt2.expect
--- /dev/null
+% EXPECT: valid
+QUERY FORALL (x:INT) : EXISTS (y:INT) : (x*y=x) ;
--- /dev/null
+(set-logic NIA)
+(set-info :status unsat)
+(assert (not (exists ((?X Int)) (= (* ?X ?X) ?X))))
+(check-sat)
+(exit)