diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-07-05 03:01:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-05 03:01:17 +0100 |
commit | 858a8d518da98113edd6f32190fff837871bb542 (patch) | |
tree | c2b506532fcc73eb6e0c675d22555e4da3c1f99c /src/util/regexp.h | |
parent | 31944046f098066d852abcb947aa477a908caf11 (diff) | |
parent | 8494e02bf31a08a686e1cf990e512250a9210acc (diff) |
Merge branch 'master' into sygus2018stringsRewsygus2018stringsRew
Diffstat (limited to 'src/util/regexp.h')
-rw-r--r-- | src/util/regexp.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util/regexp.h b/src/util/regexp.h index e2d07111d..e91ca61e2 100644 --- a/src/util/regexp.h +++ b/src/util/regexp.h @@ -25,6 +25,7 @@ #include <ostream> #include <string> #include <vector> +#include "util/rational.h" namespace CVC4 { @@ -178,8 +179,14 @@ class CVC4_PUBLIC String { */ std::size_t roverlap(const String& y) const; + /** + * Returns true if this string corresponds in text to a number, for example + * this returns true for strings "7", "12", "004", "0" and false for strings + * "abc", "4a", "-4", "". + */ bool isNumber() const; - int toNumber() const; + /** Returns the corresponding rational for the text of this string. */ + Rational toNumber() const; const std::vector<unsigned>& getVec() const { return d_str; } /** is the unsigned a digit? |