diff options
author | mudathirmahgoub <mudathirmahgoub@gmail.com> | 2020-09-22 16:59:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-22 16:59:41 -0500 |
commit | e4a29a6033ecc7ba5ec266f37e8f151f09ead020 (patch) | |
tree | 26dff55bd5121dc311185dcd3071a6e8751f9f5e /src/api/cvc4cppkind.h | |
parent | 524c879720779abc3bc529459da8734f2eb3e3ad (diff) |
Add skeleton for theory of bags (multisets) (#5100)
This PR adds initial headers and mostly empty source files for the theory of bags (multisets).
It acts as a basis for future commits.
It includes straightforward implementation for typing rules an enumerator for bags.
Diffstat (limited to 'src/api/cvc4cppkind.h')
-rw-r--r-- | src/api/cvc4cppkind.h | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/src/api/cvc4cppkind.h b/src/api/cvc4cppkind.h index 94a212fe5..5910ef1c9 100644 --- a/src/api/cvc4cppkind.h +++ b/src/api/cvc4cppkind.h @@ -1964,6 +1964,116 @@ enum CVC4_PUBLIC Kind : int32_t * mkTerm(Kind kind, Term child) */ IS_SINGLETON, + /* Bags ------------------------------------------------------------------ */ + /** + * Empty bag constant. + * Parameters: 1 + * -[1]: Sort of the bag elements + * Create with: + * mkEmptyBag(Sort sort) + */ + EMPTYBAG, + /** + * Bag max union. + * Parameters: 2 + * -[1]..[2]: Terms of bag sort + * Create with: + * mkTerm(Kind kind, Term child1, Term child2) + * mkTerm(Kind kind, const std::vector<Term>& children) + */ + UNION_MAX, + /** + * Bag disjoint union (sum). + * Parameters: 2 + * -[1]..[2]: Terms of bag sort + * Create with: + * mkTerm(Kind kind, Term child1, Term child2) + * mkTerm(Kind kind, const std::vector<Term>& children) + */ + UNION_DISJOINT, + /** + * Bag intersection (min). + * Parameters: 2 + * -[1]..[2]: Terms of bag sort + * Create with: + * mkTerm(Kind kind, Term child1, Term child2) + * mkTerm(Kind kind, const std::vector<Term>& children) + */ + INTERSECTION_MIN, + /** + * Bag difference subtract (subtracts multiplicities of the second from the + * first). + * Parameters: 2 + * -[1]..[2]: Terms of bag sort + * Create with: + * mkTerm(Kind kind, Term child1, Term child2) + * mkTerm(Kind kind, const std::vector<Term>& children) + */ + DIFFERENCE_SUBTRACT, + /** + * Bag difference 2 (removes shared elements in the two bags). + * Parameters: 2 + * -[1]..[2]: Terms of bag sort + * Create with: + * mkTerm(Kind kind, Term child1, Term child2) + * mkTerm(Kind kind, const std::vector<Term>& children) + */ + DIFFERENCE_REMOVE, + /** + * Bag is included (first multiplicities <= second multiplicities). + * Parameters: 2 + * -[1]..[2]: Terms of set sort + * Create with: + * mkTerm(Kind kind, Term child1, Term child2) + * mkTerm(Kind kind, const std::vector<Term>& children) + */ + BAG_IS_INCLUDED, + /** + * Element multiplicity in a bag + * Parameters: 2 + * -[1]..[2]: Terms of bag sort (Bag E), [1] an element of sort E + * Create with: + * mkTerm(Kind kind, Term child1, Term child2) + * mkTerm(Kind kind, const std::vector<Term>& children) + */ + BAG_COUNT, + /** + * The bag of the single element given as a parameter. + * Parameters: 1 + * -[1]: Single element + * Create with: + * mkTerm(Kind kind, Term child) + */ + MK_BAG, + /** + * Bag cardinality. + * Parameters: 1 + * -[1]: Bag to determine the cardinality of + * Create with: + * mkTerm(Kind kind, Term child) + */ + BAG_CARD, + /** + * Returns an element from a given bag. + * If a bag A = {(x,n)} where n is the multiplicity, then the term (choose A) + * is equivalent to the term x. + * If the bag is empty, then (choose A) is an arbitrary value. + * If the bag contains distinct elements, then (choose A) will + * deterministically return an element in A. + * Parameters: 1 + * -[1]: Term of bag sort + * Create with: + * mkTerm(Kind kind, Term child) + */ + BAG_CHOOSE, + /** + * Bag is_singleton predicate (single element with multiplicity exactly one). + * Parameters: 1 + * -[1]: Term of bag sort, is [1] a singleton bag? + * Create with: + * mkTerm(Kind kind, Term child) + */ + BAG_IS_SINGLETON, /* Strings --------------------------------------------------------------- */ @@ -2664,6 +2774,8 @@ enum CVC4_PUBLIC Kind : int32_t SELECTOR_TYPE, /* set type, takes as parameter the type of the elements */ SET_TYPE, + /* bag type, takes as parameter the type of the elements */ + BAG_TYPE, /* sort tag */ SORT_TAG, /* specifies types of user-declared 'uninterpreted' sorts */ |