for( unsigned i=0; i<d_regexp_memberships.size(); i++ ) {
//check regular expression membership
Node assertion = d_regexp_memberships[i];
+ Trace("regexp-debug") << "Check : " << assertion << " " << (d_regexp_ucached.find(assertion) == d_regexp_ucached.end()) << " " << (d_regexp_ccached.find(assertion) == d_regexp_ccached.end()) << std::endl;
if( d_regexp_ucached.find(assertion) == d_regexp_ucached.end()
&& d_regexp_ccached.find(assertion) == d_regexp_ccached.end() ) {
Trace("strings-regexp") << "We have regular expression assertion : " << assertion << std::endl;
}
if( polarity ) {
- flag = checkPDerivative(x, r, atom, addedLemma, processed, cprocessed, rnfexp);
+ flag = checkPDerivative(x, r, atom, addedLemma, rnfexp);
if(options::stringOpt2() && flag) {
if(d_regexp_opr.checkConstRegExp(r) && x.getKind()==kind::STRING_CONCAT) {
std::vector< std::pair< Node, Node > > vec_can;
if( addedLemma ) {
if( !d_conflict ){
for( unsigned i=0; i<processed.size(); i++ ) {
+ Trace("strings-regexp") << "...add " << processed[i] << " to u-cache." << std::endl;
d_regexp_ucached.insert(processed[i]);
}
for( unsigned i=0; i<cprocessed.size(); i++ ) {
+ Trace("strings-regexp") << "...add " << cprocessed[i] << " to c-cache." << std::endl;
d_regexp_ccached.insert(cprocessed[i]);
}
}
}
}
-bool TheoryStrings::checkPDerivative(Node x, Node r, Node atom, bool &addedLemma,
- std::vector< Node > &processed, std::vector< Node > &cprocessed, std::vector< Node > &nf_exp) {
+bool TheoryStrings::checkPDerivative( Node x, Node r, Node atom, bool &addedLemma, std::vector< Node > &nf_exp ) {
Node antnf = mkExplain(nf_exp);
sREant = Rewriter::rewrite(NodeManager::currentNM()->mkNode(kind::AND, sREant, antnf));
if(deriveRegExp( x, r, sREant )) {
addedLemma = true;
- processed.push_back( atom );
+ d_regexp_ccached.insert(atom);
return false;
}
}
std::map< Node, std::vector< Node > > &XinR_with_exps);
void checkMemberships();
bool checkMemberships2();
- bool checkPDerivative( Node x, Node r, Node atom, bool &addedLemma,
- std::vector< Node > &processed, std::vector< Node > &cprocessed,
- std::vector< Node > &nf_exp);
+ bool checkPDerivative( Node x, Node r, Node atom, bool &addedLemma, std::vector< Node > &nf_exp);
//check contains
void checkPosContains( std::vector< Node >& posContains );
void checkNegContains( std::vector< Node >& negContains );
--- /dev/null
+(set-logic QF_S)
+(set-option :strings-exp true)
+(set-info :status unsat)
+
+(declare-const buff String)
+(declare-const pass_mem String)
+(assert (= (str.len buff) 4))
+(assert (= (str.len pass_mem) 1))
+
+(assert (str.in.re (str.++ buff pass_mem) (re.+ (str.to.re "A"))))
+
+(assert (str.contains buff "<"))
+
+(check-sat)