| str[s,false]
{ expr = MK_CONST( ::CVC4::String(s) ); }
+ | RENOSTR_TOK
+ { std::vector< Expr > nvec; expr = MK_EXPR( CVC4::kind::REGEXP_EMPTY, nvec ); }
+
+ | REALLCHAR_TOK
+ { std::vector< Expr > nvec; expr = MK_EXPR( CVC4::kind::REGEXP_SIGMA, nvec ); }
+
| EMPTYSET_TOK
{ expr = MK_CONST( ::CVC4::EmptySet()); }
| STRREPL_TOK { $kind = CVC4::kind::STRING_STRREPL; }
| STRPREF_TOK { $kind = CVC4::kind::STRING_PREFIX; }
| STRSUFF_TOK { $kind = CVC4::kind::STRING_SUFFIX; }
- | STRITOS_TOK { $kind = CVC4::kind::STRING_ITOS; }
- | STRSTOI_TOK { $kind = CVC4::kind::STRING_STOI; }
+ | STRITOS_TOK { $kind = CVC4::kind::STRING_ITOS; }
+ | STRSTOI_TOK { $kind = CVC4::kind::STRING_STOI; }
| STRINRE_TOK { $kind = CVC4::kind::STRING_IN_REGEXP; }
| STRTORE_TOK { $kind = CVC4::kind::STRING_TO_REGEXP; }
| RECON_TOK { $kind = CVC4::kind::REGEXP_CONCAT; }
- | REUNION_TOK { $kind = CVC4::kind::REGEXP_UNION; }
+ | REUNION_TOK { $kind = CVC4::kind::REGEXP_UNION; }
| REINTER_TOK { $kind = CVC4::kind::REGEXP_INTER; }
| RESTAR_TOK { $kind = CVC4::kind::REGEXP_STAR; }
| REPLUS_TOK { $kind = CVC4::kind::REGEXP_PLUS; }
REPLUS_TOK : 're.+';
REOPT_TOK : 're.opt';
RERANGE_TOK : 're.range';
+RENOSTR_TOK : 're.nostr';
+REALLCHAR_TOK : 're.allchar';
SETUNION_TOK: 'union';
SETINT_TOK: 'intersection';
case kind::REGEXP_PLUS: out << "re.+ "; break;
case kind::REGEXP_OPT: out << "re.opt "; break;
case kind::REGEXP_RANGE: out << "re.range "; break;
+ case kind::REGEXP_EMPTY: out << "re.nostr "; break;
+ case kind::REGEXP_SIGMA: out << "re.allchar "; break;
// bv theory
case kind::BITVECTOR_CONCAT: out << "concat "; break;
}\r
default: {\r
Trace("strings-error") << "Unsupported term: " << mkString( r ) << " in delta of RegExp." << std::endl;\r
- AlwaysAssert( false );\r
+ Assert( false );\r
//return Node::null();\r
}\r
}\r
ret = 2;\r
}\r
break;*/\r
- default:\r
- //TODO: special sym: sigma, none, all\r
+ default: {\r
Trace("strings-error") << "Unsupported term: " << mkString( r ) << " in delta of RegExp." << std::endl;\r
//AlwaysAssert( false );\r
//return Node::null();\r
return false;\r
+ }\r
}\r
}\r
\r
}\r
default: {\r
Trace("strings-regexp") << "Unsupported term: " << r << " in simplifyNRegExp." << std::endl;\r
- AlwaysAssert( false, "Unsupported Term" );\r
+ Assert( false, "Unsupported Term" );\r
}\r
}\r
conc = Rewriter::rewrite( conc );\r
}\r
default: {\r
Trace("strings-regexp") << "Unsupported term: " << r << " in simplifyPRegExp." << std::endl;\r
- AlwaysAssert( false, "Unsupported Term" );\r
+ Assert( false, "Unsupported Term" );\r
}\r
}\r
conc = Rewriter::rewrite( conc );\r
void simplifyNRegExp( Node s, Node r, std::vector< Node > &new_nodes );\r
std::string niceChar( Node r );\r
int gcd ( int a, int b );\r
+ Node mkAllExceptOne( char c );\r
\r
public:\r
RegExpOpr();\r
bool checkConstRegExp( Node r );\r
void simplify(Node t, std::vector< Node > &new_nodes, bool polarity);\r
- Node mkAllExceptOne( char c );\r
Node complement( Node r );\r
int delta( Node r );\r
Node derivativeSingle( Node r, CVC4::String c );\r
break;
}
default: {
- Trace("strings-preprocess") << "Unsupported term: " << r << " in simplifyRegExp." << std::endl;
- AlwaysAssert( false, "Unsupported Term" );
+ Trace("strings-error") << "Unsupported term: " << r << " in simplifyRegExp." << std::endl;
+ Assert( false, "Unsupported Term" );
}
}
}
}
}
default: {
- Trace("strings-postrewrite") << "Unsupported term: " << r << " in testConstStringInRegExp." << std::endl;
- AlwaysAssert( false, "Unsupported Term" );
+ Trace("strings-error") << "Unsupported term: " << r << " in testConstStringInRegExp." << std::endl;
+ Assert( false, "Unsupported Term" );
return false;
}
}
std::ostream& operator <<(std::ostream& os, const RegExp& s) CVC4_PUBLIC;
-class CVC4_PUBLIC RegExpEmpty : public RegExp {
-public:
- RegExpEmpty() : RegExp(0) {}
-};
-
-class CVC4_PUBLIC RegExpSigma : public RegExp {
-public:
- RegExpSigma() : RegExp(2) {}
-};
-
}/* CVC4 namespace */
#endif /* __CVC4__REGEXP_H */