#include "theory/theory_engine.h"\r
#include "theory/quantifiers/options.h"\r
#include "theory/quantifiers/term_database.h"\r
+#include "theory/quantifiers/trigger.h"\r
\r
using namespace CVC4;\r
using namespace CVC4::kind;\r
}\r
\r
bool MatchGen::isHandledUfTerm( TNode n ) {\r
- return n.getKind()==APPLY_UF || n.getKind()==STORE || n.getKind()==SELECT ||\r
- n.getKind()==APPLY_CONSTRUCTOR || n.getKind()==APPLY_SELECTOR_TOTAL || n.getKind()==APPLY_TESTER;\r
+ //return n.getKind()==APPLY_UF || n.getKind()==STORE || n.getKind()==SELECT ||\r
+ // n.getKind()==APPLY_CONSTRUCTOR || n.getKind()==APPLY_SELECTOR_TOTAL || n.getKind()==APPLY_TESTER;\r
+ return inst::Trigger::isAtomicTriggerKind( n.getKind() ); \r
}\r
\r
Node MatchGen::getOperator( QuantConflictFind * p, Node n ) {\r
Node TermDb::getOperator( Node n ) {
//return n.getOperator();
-
- if( n.getKind()==SELECT || n.getKind()==STORE ){
+ Kind k = n.getKind();
+ if( k==SELECT || k==STORE || k==UNION || k==INTERSECTION || k==SUBSET || k==SETMINUS || k==MEMBER || k==SET_SINGLETON ){
//since it is parametric, use a particular one as op
- TypeNode tn1 = n[0].getType();
- TypeNode tn2 = n[1].getType();
+ TypeNode tn = n[0].getType();
Node op = n.getOperator();
- std::map< Node, std::map< TypeNode, std::map< TypeNode, Node > > >::iterator ito = d_par_op_map.find( op );
+ std::map< Node, std::map< TypeNode, Node > >::iterator ito = d_par_op_map.find( op );
if( ito!=d_par_op_map.end() ){
- std::map< TypeNode, std::map< TypeNode, Node > >::iterator it = ito->second.find( tn1 );
+ std::map< TypeNode, Node >::iterator it = ito->second.find( tn );
if( it!=ito->second.end() ){
- std::map< TypeNode, Node >::iterator it2 = it->second.find( tn2 );
- if( it2!=it->second.end() ){
- return it2->second;
- }
+ return it->second;
}
}
- d_par_op_map[op][tn1][tn2] = n;
+ d_par_op_map[op][tn] = n;
return n;
- }else if( inst::Trigger::isAtomicTrigger( n ) ){
+ }else if( inst::Trigger::isAtomicTriggerKind( k ) ){
return n.getOperator();
}else{
return Node::null();
std::hash_set< Node, NodeHashFunction > d_processed;
private:
/** select op map */
- std::map< Node, std::map< TypeNode, std::map< TypeNode, Node > > > d_par_op_map;
+ std::map< Node, std::map< TypeNode, Node > > d_par_op_map;
/** count number of ground terms per operator (user-context dependent) */
NodeIntMap d_op_ccount;
public:
void TheoryQuantifiers::check(Effort e) {
CodeTimer codeTimer(d_theoryTime);
- Debug("quantifiers-check") << "quantifiers::check(" << e << ")" << std::endl;
+ Trace("quantifiers-check") << "quantifiers::check(" << e << ")" << std::endl;
while(!done()) {
Node assertion = get();
- Debug("quantifiers-assert") << "quantifiers::assert(): " << assertion << std::endl;
+ Trace("quantifiers-assert") << "quantifiers::assert(): " << assertion << std::endl;
switch(assertion.getKind()) {
case kind::FORALL:
assertUniversal( assertion );
}
bool Trigger::isAtomicTrigger( Node n ){
- return ( n.getKind()==APPLY_UF && !n.getOperator().getAttribute(NoMatchAttribute()) ) || n.getKind()==SELECT || n.getKind()==STORE ||
- n.getKind()==APPLY_CONSTRUCTOR || n.getKind()==APPLY_SELECTOR_TOTAL || n.getKind()==APPLY_TESTER;
+ Kind k = n.getKind();
+ return ( k==APPLY_UF && !n.getOperator().getAttribute(NoMatchAttribute()) ) ||
+ ( k!=APPLY_UF && isAtomicTriggerKind( k ) );
}
+bool Trigger::isAtomicTriggerKind( Kind k ) {
+ return k==APPLY_UF || k==SELECT || k==STORE ||
+ k==APPLY_CONSTRUCTOR || k==APPLY_SELECTOR_TOTAL || k==APPLY_TESTER ||
+ k==UNION || k==INTERSECTION || k==SUBSET || k==SETMINUS || k==MEMBER || k==SET_SINGLETON;
+}
+
bool Trigger::isSimpleTrigger( Node n ){
if( isAtomicTrigger( n ) ){
for( int i=0; i<(int)n.getNumChildren(); i++ ){
static bool isUsableTrigger( std::vector< Node >& nodes, Node f );
static bool isUsableTrigger( Node n, Node f );
static bool isAtomicTrigger( Node n );
+ static bool isAtomicTriggerKind( Kind k );
static bool isSimpleTrigger( Node n );
/** get pattern arithmetic */
static bool isArithmeticTrigger( Node f, Node n, std::map< Node, Node >& coeffs );
delete d_internal;
}
+void TheorySets::setMasterEqualityEngine(eq::EqualityEngine* eq) {
+ d_internal->setMasterEqualityEngine(eq);
+}
+
void TheorySets::addSharedTerm(TNode n) {
d_internal->addSharedTerm(n);
}
~TheorySets();
+ void setMasterEqualityEngine(eq::EqualityEngine* eq);
+
void addSharedTerm(TNode);
void check(Effort);
}/* TheorySetsPropagate::propagate(TNode) */
+void TheorySetsPrivate::setMasterEqualityEngine(eq::EqualityEngine* eq) {
+ d_equalityEngine.setMasterEqualityEngine(eq);
+}
+
void TheorySetsPrivate::addSharedTerm(TNode n) {
Debug("sets") << "[sets] ThoerySetsPrivate::addSharedTerm( " << n << ")" << std::endl;
d_equalityEngine.addTriggerTerm(n, THEORY_SETS);
context::UserContext* u);
~TheorySetsPrivate();
+
+ void setMasterEqualityEngine(eq::EqualityEngine* eq);
void addSharedTerm(TNode);