summaryrefslogtreecommitdiff
path: root/src/parser
diff options
context:
space:
mode:
authormudathirmahgoub <mudathir-mahgoubyahia@uiowa.edu>2020-03-30 09:04:52 -0500
committerGitHub <noreply@github.com>2020-03-30 09:04:52 -0500
commit0060de329173c0b75c02778d003371f59cc11eff (patch)
tree92bec1579d0301a4c91e45c349c381a9bd2f1b17 /src/parser
parent01b257084a0a8ee70bff32e011704330d1544c01 (diff)
Frontend support for the choice operator (#4175)
Added the operator choice to Smt2.g and Cvc.g. Removed the unused parameter hasBoundVars from TheoryModel::getModelValue
Diffstat (limited to 'src/parser')
-rw-r--r--src/parser/cvc/Cvc.g6
-rw-r--r--src/parser/smt2/Smt2.g2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/parser/cvc/Cvc.g b/src/parser/cvc/Cvc.g
index 033389610..8b3b96cfd 100644
--- a/src/parser/cvc/Cvc.g
+++ b/src/parser/cvc/Cvc.g
@@ -114,6 +114,7 @@ tokens {
FORALL_TOK = 'FORALL';
EXISTS_TOK = 'EXISTS';
+ CHOICE_TOK = 'CHOICE';
PATTERN_TOK = 'PATTERN';
LAMBDA_TOK = 'LAMBDA';
@@ -343,7 +344,8 @@ int getOperatorPrecedence(int type) {
case IMPLIES_TOK: return 30;// right-to-left
case IFF_TOK: return 31;
case FORALL_TOK:
- case EXISTS_TOK: return 32;
+ case EXISTS_TOK:
+ case CHOICE_TOK: return 32;
case ASSIGN_TOK:
case IN_TOK: return 33;
@@ -1465,7 +1467,7 @@ prefixFormula[CVC4::api::Term& f]
api::Term ipl;
}
/* quantifiers */
- : ( FORALL_TOK { k = api::FORALL; } | EXISTS_TOK { k = api::EXISTS; } )
+ : ( FORALL_TOK { k = api::FORALL; } | EXISTS_TOK { k = api::EXISTS; } | CHOICE_TOK { k = api::CHOICE; } )
{ PARSER_STATE->pushScope(); } LPAREN
boundVarDecl[ids,t]
{ for(std::vector<std::string>::const_iterator i = ids.begin(); i != ids.end(); ++i) {
diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g
index 0c42678aa..d0a73ce6a 100644
--- a/src/parser/smt2/Smt2.g
+++ b/src/parser/smt2/Smt2.g
@@ -2312,6 +2312,7 @@ quantOp[CVC4::api::Kind& kind]
}
: EXISTS_TOK { $kind = api::EXISTS; }
| FORALL_TOK { $kind = api::FORALL; }
+ | CHOICE_TOK { $kind = api::CHOICE; }
;
/**
@@ -2682,6 +2683,7 @@ ATTRIBUTE_INST_LEVEL : ':quant-inst-max-level';
// operators (NOTE: theory symbols go here)
EXISTS_TOK : 'exists';
FORALL_TOK : 'forall';
+CHOICE_TOK : { !PARSER_STATE->strictModeEnabled() }? 'choice';
EMP_TOK : { PARSER_STATE->isTheoryEnabled(theory::THEORY_SEP) }? 'emp';
TUPLE_CONST_TOK: { PARSER_STATE->isTheoryEnabled(theory::THEORY_DATATYPES) }? 'mkTuple';
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback