diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-03-30 16:29:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-30 16:29:23 -0500 |
commit | 6838885b1250e0abbb1b8d56e6b400a5d7f3ca95 (patch) | |
tree | 3c1a7417d471aeea531a36024a460d605cb5d5f1 /src/parser/cvc/Cvc.g | |
parent | 3ff70d61c111b70d5bf770669b0aa3f1d47a502e (diff) |
Support indexed operators re.loop and re.^ (#4167)
Towards support for the strings standard.
This modifies our interface so that we accept the SMT-LIB standard versions of re.loop and re.^. This means re.loop no longer accepts 3 arguments but 1 (with 2 indices).
This means we no longer accept re.loop with only a lower bound and no upper bound on the number of repetitions.
Also fixes #4161.
Diffstat (limited to 'src/parser/cvc/Cvc.g')
-rw-r--r-- | src/parser/cvc/Cvc.g | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/parser/cvc/Cvc.g b/src/parser/cvc/Cvc.g index 8b3b96cfd..7b3e1c4de 100644 --- a/src/parser/cvc/Cvc.g +++ b/src/parser/cvc/Cvc.g @@ -2074,8 +2074,11 @@ stringTerm[CVC4::api::Term& f] { f = MK_TERM(CVC4::api::REGEXP_OPT, f); } | REGEXP_RANGE_TOK LPAREN formula[f] COMMA formula[f2] RPAREN { f = MK_TERM(CVC4::api::REGEXP_RANGE, f, f2); } - | REGEXP_LOOP_TOK LPAREN formula[f] COMMA formula[f2] COMMA formula[f3] RPAREN - { f = MK_TERM(CVC4::api::REGEXP_LOOP, f, f2, f3); } + | REGEXP_LOOP_TOK LPAREN formula[f] COMMA lo=numeral COMMA hi=numeral RPAREN + { + api::Op lop = SOLVER->mkOp(CVC4::api::REGEXP_LOOP, lo, hi); + f = MK_TERM(lop, f); + } | REGEXP_COMPLEMENT_TOK LPAREN formula[f] RPAREN { f = MK_TERM(CVC4::api::REGEXP_COMPLEMENT, f); } | REGEXP_EMPTY_TOK |