diff options
author | mudathirmahgoub <mudathirmahgoub@gmail.com> | 2021-01-08 10:07:50 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 10:07:50 -0600 |
commit | 63d27f031f8942607d869080d0e2cfb6078d40b1 (patch) | |
tree | 0a29a6479a38d700a824951e343334c5d02d0183 /src/api | |
parent | 819eedc38031d3befb9c3e855bbbfa0afa3bb3cc (diff) |
Add bags inference generator (#5731)
This PR adds inference generator for basic bag rules.
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/cvc4cpp.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/api/cvc4cpp.cpp b/src/api/cvc4cpp.cpp index b11a01628..49974d30d 100644 --- a/src/api/cvc4cpp.cpp +++ b/src/api/cvc4cpp.cpp @@ -3418,6 +3418,20 @@ Term Solver::mkTermHelper(Kind kind, const std::vector<Term>& children) const Node singleton = getNodeManager()->mkSingleton(type, *children[0].d_node); res = Term(this, singleton).getExpr(); } + else if (kind == api::MK_BAG) + { + // the type of the term is the same as the type of the internal node + // see Term::getSort() + TypeNode type = children[0].d_node->getType(); + // Internally NodeManager::mkBag needs a type argument + // to construct a bag, since there is no difference between + // integers and reals (both are Rationals). + // At the API, mkReal and mkInteger are different and therefore the + // element type can be used safely here. + Node bag = getNodeManager()->mkBag( + type, *children[0].d_node, *children[1].d_node); + res = Term(this, bag).getExpr(); + } else { res = d_exprMgr->mkExpr(k, echildren); |