20 #ifndef __CVC4__REGEXP_H
21 #define __CVC4__REGEXP_H
34 std::vector<unsigned int> d_str;
36 bool isVecSame(
const std::vector<unsigned int> &a,
const std::vector<unsigned int> &b)
const {
37 if(a.size() != b.size())
return false;
39 for(
unsigned int i=0; i<a.size(); ++i)
40 if(a[i] != b[i])
return false;
49 for(
unsigned int i=0; i<s.size(); ++i) {
50 d_str.push_back( convertCharToUnsignedInt(s[i]) );
55 for(
unsigned int i=0,len=strlen(s); i<len; ++i) {
56 d_str.push_back( convertCharToUnsignedInt(s[i]) );
61 d_str.push_back( convertCharToUnsignedInt(c) );
64 String(
const std::vector<unsigned int> &s) : d_str(s) { }
69 if(
this != &y) d_str = y.d_str;
74 return isVecSame(d_str, y.d_str);
78 return ! ( isVecSame(d_str, y.d_str) );
82 std::vector<unsigned int> ret_vec(d_str);
83 ret_vec.insert( ret_vec.end(), other.d_str.begin(), other.d_str.end() );
87 bool operator <(
const String& y)
const {
88 if(d_str.size() != y.d_str.size())
return d_str.size() < y.d_str.size();
90 for(
unsigned int i=0; i<d_str.size(); ++i)
91 if(d_str[i] != y.d_str[i])
return d_str[i] < y.d_str[i];
97 bool operator >(
const String& y)
const {
98 if(d_str.size() != y.d_str.size())
return d_str.size() > y.d_str.size();
100 for(
unsigned int i=0; i<d_str.size(); ++i)
101 if(d_str[i] != y.d_str[i])
return d_str[i] > y.d_str[i];
107 bool operator <=(
const String& y)
const {
108 if(d_str.size() != y.d_str.size())
return d_str.size() < y.d_str.size();
110 for(
unsigned int i=0; i<d_str.size(); ++i)
111 if(d_str[i] != y.d_str[i])
return d_str[i] < y.d_str[i];
117 bool operator >=(
const String& y)
const {
118 if(d_str.size() != y.d_str.size())
return d_str.size() > y.d_str.size();
120 for(
unsigned int i=0; i<d_str.size(); ++i)
121 if(d_str[i] != y.d_str[i])
return d_str[i] > y.d_str[i];
128 for(
unsigned int i=0; i<n; ++i)
129 if(d_str[i] != y.d_str[i])
return false;
135 return ( d_str.size() == 0 );
138 unsigned int operator[] (
const unsigned int i)
const {
147 for(
unsigned int i=0; i<d_str.size(); ++i) {
148 str += convertUnsignedIntToChar( d_str[i] );
159 return convertUnsignedIntToChar( d_str[0] );
163 if(d_str.size() > 1) {
164 unsigned int f = d_str[0];
165 for(
unsigned i=1; i<d_str.size(); ++i) {
166 if(f != d_str[i])
return false;
173 int id_x = d_str.size() - 1;
174 int id_y = y.d_str.size() - 1;
175 while(id_x>=0 && id_y>=0) {
176 if(d_str[id_x] != y.d_str[id_y]) {
182 c = id_x == -1 ? ( - (id_y+1) ) : (id_x + 1);
187 std::vector<unsigned int> ret_vec;
188 std::vector<unsigned int>::const_iterator itr = d_str.begin() + i;
190 ret_vec.insert(ret_vec.end(), itr, d_str.end());
194 std::vector<unsigned int> ret_vec;
195 std::vector<unsigned int>::const_iterator itr = d_str.begin() + i;
199 ret_vec.insert( ret_vec.end(), itr, itr + j );
207 return (
unsigned int)(i<0 ? i+256 : i);
211 return (
char)(ii>=256 ? ii-256 : ii);
214 char c = convertUnsignedIntToChar( i );
215 return isprint( (
int)c );
232 return os <<
"\"" << s.
toString() <<
"\"";
249 if(
this != &y) d_str = y.d_str;
254 return d_str == y.d_str ;
258 return d_str != y.d_str ;
262 return String(d_str + other.d_str);
266 return d_str < y.d_str;
270 return d_str > y.d_str ;
273 bool operator <=(
const RegExp& y)
const {
274 return d_str <= y.d_str;
277 bool operator >=(
const RegExp& y)
const {
278 return d_str >= y.d_str ;
288 for (
size_t i = 0; i < d_str.length(); ++i) {
289 h = (h << 5) + d_str[i];
bool strncmp(const String &y, unsigned int n) const
std::string toString() const
std::string toString() const
[[ Add one-line brief description here ]]
This is CVC4 release version For build and installation please see the INSTALL file included with this distribution This first official release of CVC4 is the result of more than three years of efforts by researchers at New York University and The University of Iowa The project leaders are Clark please refer to the AUTHORS file in the source distribution CVC4 is a tool for determining the satisfiability of a first order formula modulo a first order CVC CVC3 but does not directly incorporate code from any previous version CVC4 is intended to be an open and extensible SMT engine It can be used as a stand alone tool or as a library It has been designed to increase the performance and reduce the memory overhead of its predecessors It is written entirely in C and is released under a free software see the INSTALL file that comes with this distribution We recommend that you visit our CVC4 tutorials online please write to the cvc users cs nyu edu mailing list *if you need to report a bug with CVC4
String concat(const String &other) const
size_t operator()(const RegExp &s) const
RegExp(const std::string s)
size_t operator()(const ::CVC4::String &s) const
Macros that should be defined everywhere during the building of the libraries and driver binary...
String concat(const RegExp &other) const
String substr(unsigned i, unsigned j) const
Hash function for the RegExp constants.
String(const std::vector< unsigned int > &s)
std::ostream & operator<<(std::ostream &out, ModelFormatMode mode)
static bool isPrintable(unsigned int i)
static char convertUnsignedIntToChar(unsigned int i)
bool operator!=(enum Result::Sat s, const Result &r)
bool tailcmp(const String &y, int &c) const
bool operator==(enum Result::Sat s, const Result &r)
String substr(unsigned i) const
String(const std::string &s)
static unsigned int convertCharToUnsignedInt(char c)
bool isEmptyString() const
char getFirstChar() const