From 2c6b35d8ce7dcacd2f13bcdd5365629ee315dc8d Mon Sep 17 00:00:00 2001 From: Abdalrhman Mohamed <32971963+abdoo8080@users.noreply.github.com> Date: Sat, 28 Mar 2020 11:41:22 -0500 Subject: [PATCH] Stop printing datatype declaration for Sygus V1 grammar. (#4168) --- src/parser/parser.h | 3 +++ src/parser/smt2/Smt2.g | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/parser/parser.h b/src/parser/parser.h index d6c0e0e15..72e175a58 100644 --- a/src/parser/parser.h +++ b/src/parser/parser.h @@ -273,6 +273,9 @@ public: return d_input; } + /** Get unresolved sorts */ + inline std::set& getUnresolvedSorts() { return d_unresolved; } + /** Deletes and replaces the current parser input. */ void setInput(Input* input) { delete d_input; diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 69f21acb7..0c42678aa 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -782,8 +782,24 @@ sygusGrammarV1[CVC4::api::Sort & ret, Debug("parser-sygus") << " " << i << " : " << datatypes[i].getName() << std::endl; } - std::vector datatypeTypes = - PARSER_STATE->bindMutualDatatypeTypes(datatypes, false); + + std::vector dtypes; + dtypes.reserve(ndatatypes); + + for (api::DatatypeDecl i : datatypes) + { + dtypes.push_back(i.getDatatype()); + } + + std::set tset = + api::sortSetToTypes(PARSER_STATE->getUnresolvedSorts()); + + std::vector datatypeTypes = + SOLVER->getExprManager()->mkMutualDatatypeTypes( + dtypes, tset, ExprManager::DATATYPE_FLAG_PLACEHOLDER); + + PARSER_STATE->getUnresolvedSorts().clear(); + ret = datatypeTypes[0]; }; -- 2.30.2