summaryrefslogtreecommitdiff
path: root/src/parser/cvc/Cvc.g
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2019-12-23 17:18:19 -0600
committerAndres Noetzli <andres.noetzli@gmail.com>2019-12-23 15:18:19 -0800
commitb3471b719f1cd031d35e9a431027088b0dec156b (patch)
treebc5e55a278f9e927471ce99146e9fdc992bc716b /src/parser/cvc/Cvc.g
parentf5ca3e5d09b457ac21b10793eb5d1efe3fbe40f6 (diff)
Initial support for string reverse (#3581)
Type rules, parsing and printing, basic rewriting including constant evaluation, reduction for string reverse (`str.rev`). Also improves support in a few places for tolower/toupper.
Diffstat (limited to 'src/parser/cvc/Cvc.g')
-rw-r--r--src/parser/cvc/Cvc.g9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/parser/cvc/Cvc.g b/src/parser/cvc/Cvc.g
index e4849aae6..2dceba768 100644
--- a/src/parser/cvc/Cvc.g
+++ b/src/parser/cvc/Cvc.g
@@ -227,6 +227,9 @@ tokens {
STRING_STOI_TOK = 'STRING_TO_INTEGER';
STRING_ITOS_TOK = 'INTEGER_TO_STRING';
STRING_TO_REGEXP_TOK = 'STRING_TO_REGEXP';
+ STRING_TOLOWER_TOK = 'TOLOWER';
+ STRING_TOUPPER_TOK = 'TOUPPER';
+ STRING_REV_TOK = 'REVERSE';
REGEXP_CONCAT_TOK = 'RE_CONCAT';
REGEXP_UNION_TOK = 'RE_UNION';
REGEXP_INTER_TOK = 'RE_INTER';
@@ -2038,6 +2041,12 @@ stringTerm[CVC4::Expr& f]
{ f = MK_EXPR(CVC4::kind::STRING_ITOS, f); }
| STRING_TO_REGEXP_TOK LPAREN formula[f] RPAREN
{ f = MK_EXPR(CVC4::kind::STRING_TO_REGEXP, f); }
+ | STRING_TOLOWER_TOK LPAREN formula[f] RPAREN
+ { f = MK_EXPR(CVC4::kind::STRING_TOLOWER, f); }
+ | STRING_TOUPPER_TOK LPAREN formula[f] RPAREN
+ { f = MK_EXPR(CVC4::kind::STRING_TOUPPER, f); }
+ | STRING_REV_TOK LPAREN formula[f] RPAREN
+ { f = MK_EXPR(CVC4::kind::STRING_REV, f); }
| REGEXP_CONCAT_TOK LPAREN formula[f] { args.push_back(f); }
( COMMA formula[f2] { args.push_back(f2); } )+ RPAREN
{ f = MK_EXPR(CVC4::kind::REGEXP_CONCAT, args); }
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback