summaryrefslogtreecommitdiff
path: root/src/parser/parser.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-03-12 16:57:42 -0500
committerGitHub <noreply@github.com>2020-03-12 16:57:42 -0500
commitef71fc3405900226557dc634dcf69f1a0738fea2 (patch)
treed7394240230050c1a99bb2e42588891600a6b154 /src/parser/parser.cpp
parentdd84f87edba9b0cde271fe7000208c5f8f97b890 (diff)
Convert most instances of dataypes in parsers to the new API (#4054)
I am still accessing Expr-level Datatypes for the sygus v1/v2 parsers (within smt2). This will be addressed in two ways in the future: (1) The sygus v1 parser will be deleted, (2) The sygus v2 parser will be updated to use a "Grammar" object as an extension of the new API, which will hide all calls to the underlying datatype. (See https://github.com/abdoo8080/CVC4/tree/sygus-api). FYI @abdoo8080 . Note I've renamed "mkMutualDatatypeTypes" to "bindMutualDatatypeTypes" to be more accurate and follow the updated name conventions in the parser. The next step will be to handle parametric datatypes, which are not specifically addressed by this PR.
Diffstat (limited to 'src/parser/parser.cpp')
-rw-r--r--src/parser/parser.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp
index e9a037d6e..b36f36a93 100644
--- a/src/parser/parser.cpp
+++ b/src/parser/parser.cpp
@@ -394,19 +394,12 @@ bool Parser::isUnresolvedType(const std::string& name) {
return d_unresolved.find(getSort(name)) != d_unresolved.end();
}
-std::vector<api::Sort> Parser::mkMutualDatatypeTypes(
- std::vector<Datatype>& datatypes, bool doOverload, uint32_t flags)
+std::vector<api::Sort> Parser::bindMutualDatatypeTypes(
+ std::vector<api::DatatypeDecl>& datatypes, bool doOverload)
{
try {
- std::set<Type> tset = api::sortSetToTypes(d_unresolved);
- std::vector<DatatypeType> dtypes =
- d_solver->getExprManager()->mkMutualDatatypeTypes(
- datatypes, tset, flags);
- std::vector<api::Sort> types;
- for (unsigned i = 0, dtsize = dtypes.size(); i < dtsize; i++)
- {
- types.push_back(api::Sort(dtypes[i]));
- }
+ std::vector<api::Sort> types =
+ d_solver->mkDatatypeSorts(datatypes, d_unresolved);
assert(datatypes.size() == types.size());
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback