summaryrefslogtreecommitdiff
path: root/src/api/cvc4cpp.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-03-05 16:16:15 -0600
committerGitHub <noreply@github.com>2020-03-05 16:16:15 -0600
commit500f85f9c664001b84a90f4836bbb9577b871e29 (patch)
treebe92a8a20267fe7d381ba1a6cf6c9477825776bf /src/api/cvc4cpp.cpp
parent50f82fac417bc5b27ecaeb34d4e8034339c5982f (diff)
Migrate a majority of the functionality in parsers to the new API (#3838)
This PR migrates a majority of the functionality of the parsers (cvc, tptp, smt2/sygus) to the new API. The main omitted functionality not addressed in this PR is the datatypes. Largely, the Expr-level Datatype is still used throughout. Remaining tasks: Migrate the Datatypes to the new API in cvc/smt2. Eliminate the use of ExprManager::mkVar (with flags for DEFINED/GLOBAL). For the latter, I have made a utility function in Parser::mkVar that captures all calls to this function. Notice that the existing mkVar/mkBoundVar/mkDefinedFun have been renamed to the more fitting names bindVar/bindBoundVar/bindDefinedFun etc. Note: this PR contains no major code changes, each line of code should roughly correspond one-to-one with the changed version. This fixes CVC4/cvc4-projects#77, fixes CVC4/cvc4-projects#78, fixes CVC4/cvc4-projects#80, fixes CVC4/cvc4-projects#85.
Diffstat (limited to 'src/api/cvc4cpp.cpp')
-rw-r--r--src/api/cvc4cpp.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/api/cvc4cpp.cpp b/src/api/cvc4cpp.cpp
index 0d24139e8..63ebdbea6 100644
--- a/src/api/cvc4cpp.cpp
+++ b/src/api/cvc4cpp.cpp
@@ -2410,7 +2410,8 @@ Term Solver::mkTermInternal(Kind kind, const std::vector<Term>& children) const
std::vector<Expr> echildren = termVectorToExprs(children);
CVC4::Kind k = extToIntKind(kind);
- Assert(isDefinedIntKind(k));
+ Assert(isDefinedIntKind(k))
+ << "Not a defined internal kind : " << k << " " << kind;
Term res;
if (echildren.size() > 2)
@@ -2988,7 +2989,7 @@ Term Solver::mkConstArray(Sort sort, Term val) const
CVC4_API_SOLVER_TRY_CATCH_BEGIN;
CVC4_API_ARG_CHECK_NOT_NULL(val);
CVC4_API_CHECK(sort.isArray()) << "Not an array sort.";
- CVC4_API_CHECK(sort.getArrayElementSort() == val.getSort())
+ CVC4_API_CHECK(sort.getArrayElementSort().isComparableTo(val.getSort()))
<< "Value does not match element sort.";
Term res = mkValHelper<CVC4::ArrayStoreAll>(
CVC4::ArrayStoreAll(*sort.d_type, *val.d_expr));
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback