diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-04-28 11:15:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-28 11:15:00 -0500 |
commit | 967332f464f3e26d43f05bb9c68a0be788337ef6 (patch) | |
tree | 561391457c65750a8e7fac9b6656a7e7e4176a69 /src/parser | |
parent | 8ea1603f55d940e56ab3cbee8177f06200228aaa (diff) |
Support the SMT-LIB Unicode string standard by default (#4378)
This PR merges --lang=smt2.6.1 and --lang=smt2.6 (default). It makes it so that 2.6 always expects the syntax of the string standard http://smtlib.cs.uiowa.edu/theories-UnicodeStrings.shtml.
I've updated the regressions so that the 2.6 benchmarks are now compliant with the standard. Some of the <=2.5 benchmarks I've updated to 2.6. Others I have left for now, in particular the ones that rely on special characters or ad-hoc escape sequences. The old formats will be supported in the release but removed shortly afterwards.
This PR is a prerequisite for the release, but not necessarily SMT-COMP (which will use --lang=smt2.6.1 if needed). Notice that we still do not have parsing support for str.replace_re or str.replace_re_all. This is required to be fully compliant.
Diffstat (limited to 'src/parser')
-rw-r--r-- | src/parser/parser.cpp | 3 | ||||
-rw-r--r-- | src/parser/parser.h | 2 | ||||
-rw-r--r-- | src/parser/smt2/smt2.cpp | 6 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp index 5dca92370..c860d14c7 100644 --- a/src/parser/parser.cpp +++ b/src/parser/parser.cpp @@ -895,8 +895,7 @@ std::vector<unsigned> Parser::processAdHocStringEsc(const std::string& s) Expr Parser::mkStringConstant(const std::string& s) { ExprManager* em = d_solver->getExprManager(); - if (em->getOptions().getInputLanguage() - == language::input::LANG_SMTLIB_V2_6_1) + if (language::isInputLang_smt2_6(em->getOptions().getInputLanguage())) { return d_solver->mkString(s, true).getExpr(); } diff --git a/src/parser/parser.h b/src/parser/parser.h index cd4105cd0..7941cfdd5 100644 --- a/src/parser/parser.h +++ b/src/parser/parser.h @@ -842,7 +842,7 @@ public: * * This makes the string constant based on the string s. This may involve * processing ad-hoc escape sequences (if the language is not - * SMT-LIB 2.6.1 or higher), or otherwise calling the solver to construct + * SMT-LIB 2.6 or higher), or otherwise calling the solver to construct * the string. */ Expr mkStringConstant(const std::string& s); diff --git a/src/parser/smt2/smt2.cpp b/src/parser/smt2/smt2.cpp index 6cba1ce19..3c30f5c49 100644 --- a/src/parser/smt2/smt2.cpp +++ b/src/parser/smt2/smt2.cpp @@ -166,8 +166,8 @@ void Smt2::addStringOperators() { addOperator(api::STRING_SUFFIX, "str.suffixof"); addOperator(api::STRING_FROM_CODE, "str.from_code"); addOperator(api::STRING_IS_DIGIT, "str.is_digit"); - // at the moment, we only use this syntax for smt2.6.1 - if (getLanguage() == language::input::LANG_SMTLIB_V2_6_1 + // at the moment, we only use this syntax for smt2.6 + if (getLanguage() == language::input::LANG_SMTLIB_V2_6 || getLanguage() == language::input::LANG_SYGUS_V2) { addOperator(api::STRING_ITOS, "str.from_int"); @@ -682,7 +682,7 @@ Command* Smt2::setLogic(std::string name, bool fromCommand) defineType("RegLan", d_solver->getRegExpSort()); defineType("Int", d_solver->getIntegerSort()); - if (getLanguage() == language::input::LANG_SMTLIB_V2_6_1 + if (getLanguage() == language::input::LANG_SMTLIB_V2_6 || getLanguage() == language::input::LANG_SYGUS_V2) { defineVar("re.none", d_solver->mkRegexpEmpty()); |