diff options
author | Kshitij Bansal <kshitij@cs.nyu.edu> | 2015-11-03 04:47:30 -0500 |
---|---|---|
committer | Kshitij Bansal <kshitij@cs.nyu.edu> | 2016-04-09 14:35:28 -0400 |
commit | 2039eab2d76cf5f4cfe44680f5325f44a4fc5a99 (patch) | |
tree | 05ac95009f3aa77a2fa7d41501aa1179d5b73b66 /src/parser | |
parent | 67623ee1e6d62b36cb598c28ad9b871b6957a9dd (diff) |
cardinality operation for finite sets (based on my thesis / ijcar16 paper)
Some further cleanup/fixes pending
This is squash of 39 commits (kbansal/card branch + cleanup):
* add card operator
* local reasoning
* towards graph building
* first implementation
* close cardinality terms
* model building
* more
* more
* more
* Add aggressive sets rewriting.
* Recursively aggressive rewrite sets.
* Fix
* incomplete card2 implementation
* ...
* Avoid using auto in sets.
* fix merge
* more
* ...
* more
* ...
* Fixed for loops
* Slight modification to computeRelevantTerms
* more
* ..
* more
* ...
* mv empty set lemma generation to later point
* more options/reordering
* debug related
* more trace
* ...
* fix merge_nodes, models
* rm warnigns
* fix compile errors
* warning
* bug fixes/cleanup
* mroe fixes
* cleanup
* ...
Diffstat (limited to 'src/parser')
-rw-r--r-- | src/parser/cvc/Cvc.g | 5 | ||||
-rw-r--r-- | src/parser/smt2/smt2.cpp | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/parser/cvc/Cvc.g b/src/parser/cvc/Cvc.g index 4a8f7eb7b..470fc5253 100644 --- a/src/parser/cvc/Cvc.g +++ b/src/parser/cvc/Cvc.g @@ -1985,6 +1985,11 @@ simpleTerm[CVC4::Expr& f] } } + /* set cardinality literal */ + | BAR BAR formula[f] { args.push_back(f); } BAR BAR + { f = MK_EXPR(kind::CARD, args[0]); + } + /* array literals */ | ARRAY_TOK /* { PARSER_STATE->pushScope(); } */ LPAREN restrictedType[t, CHECK_DECLARED] OF_TOK restrictedType[t2, CHECK_DECLARED] diff --git a/src/parser/smt2/smt2.cpp b/src/parser/smt2/smt2.cpp index 55fb4f60d..ebad90583 100644 --- a/src/parser/smt2/smt2.cpp +++ b/src/parser/smt2/smt2.cpp @@ -226,6 +226,7 @@ void Smt2::addTheory(Theory theory) { addOperator(kind::MEMBER, "member"); addOperator(kind::SINGLETON, "singleton"); addOperator(kind::INSERT, "insert"); + addOperator(kind::CARD, "card"); break; case THEORY_DATATYPES: |