diff options
author | Aina Niemetz <aina.niemetz@gmail.com> | 2019-03-18 15:05:00 -0700 |
---|---|---|
committer | Aina Niemetz <aina.niemetz@gmail.com> | 2019-03-18 17:26:29 -0700 |
commit | a4f76da78653e80c28740b2ad4bf3929110d5a25 (patch) | |
tree | 6bf777ff332d8a9e760ce98d0a7e88752929bfd1 /src/api | |
parent | 7e3457b0e16cacef456287ae761c5293be1209d5 (diff) |
New C++: Remove redundant mkVar function.
s
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/cvc4cpp.cpp | 20 | ||||
-rw-r--r-- | src/api/cvc4cpp.h | 11 |
2 files changed, 5 insertions, 26 deletions
diff --git a/src/api/cvc4cpp.cpp b/src/api/cvc4cpp.cpp index 9d56bb88a..032326c26 100644 --- a/src/api/cvc4cpp.cpp +++ b/src/api/cvc4cpp.cpp @@ -2392,27 +2392,13 @@ Term Solver::mkFloatingPoint(uint32_t exp, uint32_t sig, Term val) const /* Create variables */ /* -------------------------------------------------------------------------- */ -Term Solver::mkVar(const std::string& symbol, Sort sort) const +Term Solver::mkVar(Sort sort, const std::string& symbol) const { try { CVC4_API_ARG_CHECK_EXPECTED(!sort.isNull(), sort) << "non-null sort"; - Term res = d_exprMgr->mkVar(symbol, *sort.d_type); - (void)res.d_expr->getType(true); /* kick off type checking */ - return res; - } - catch (const CVC4::TypeCheckingException& e) - { - throw CVC4ApiException(e.getMessage()); - } -} - -Term Solver::mkVar(Sort sort) const -{ - try - { - CVC4_API_ARG_CHECK_EXPECTED(!sort.isNull(), sort) << "non-null sort"; - Term res = d_exprMgr->mkVar(*sort.d_type); + Term res = symbol.empty() ? d_exprMgr->mkVar(*sort.d_type) + : d_exprMgr->mkVar(symbol, *sort.d_type); (void)res.d_expr->getType(true); /* kick off type checking */ return res; } diff --git a/src/api/cvc4cpp.h b/src/api/cvc4cpp.h index 2c266b11d..3999dd2ed 100644 --- a/src/api/cvc4cpp.h +++ b/src/api/cvc4cpp.h @@ -2167,18 +2167,11 @@ class CVC4_PUBLIC Solver /** * Create variable. - * @param symbol the name of the variable - * @param sort the sort of the variable - * @return the variable - */ - Term mkVar(const std::string& symbol, Sort sort) const; - - /** - * Create variable. * @param sort the sort of the variable + * @param symbol the name of the variable * @return the variable */ - Term mkVar(Sort sort) const; + Term mkVar(Sort sort, const std::string& symbol = std::string()) const; /** * Create bound variable. |