diff options
author | Abdalrhman Mohamed <32971963+abdoo8080@users.noreply.github.com> | 2020-02-17 08:58:42 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-17 08:58:42 -0600 |
commit | ed27cf0f854e014922f9690d967c5ff9aa73693c (patch) | |
tree | 42e1ffa003635a1a1b47dbb2ace29dce4dcdb88e /src/parser | |
parent | 6b6290e89632108f35dd24924ac62bb0d69e462a (diff) |
Support dumping Sygus commands. (#3763)
Diffstat (limited to 'src/parser')
-rw-r--r-- | src/parser/parser.cpp | 5 | ||||
-rw-r--r-- | src/parser/parser.h | 10 | ||||
-rw-r--r-- | src/parser/smt2/Smt2.g | 6 |
3 files changed, 15 insertions, 6 deletions
diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp index af193c04b..681b2a1c9 100644 --- a/src/parser/parser.cpp +++ b/src/parser/parser.cpp @@ -368,10 +368,11 @@ bool Parser::isUnresolvedType(const std::string& name) { } std::vector<DatatypeType> Parser::mkMutualDatatypeTypes( - std::vector<Datatype>& datatypes, bool doOverload) { + std::vector<Datatype>& datatypes, bool doOverload, uint32_t flags) +{ try { std::vector<DatatypeType> types = - getExprManager()->mkMutualDatatypeTypes(datatypes, d_unresolved); + getExprManager()->mkMutualDatatypeTypes(datatypes, d_unresolved, flags); assert(datatypes.size() == types.size()); diff --git a/src/parser/parser.h b/src/parser/parser.h index b0ef2328f..2317835ff 100644 --- a/src/parser/parser.h +++ b/src/parser/parser.h @@ -602,9 +602,15 @@ public: * For each symbol defined by the datatype, if a symbol with name already exists, * then if doOverload is true, we create overloaded operators. * else if doOverload is false, the existing expression is shadowed by the new expression. + * + * flags specify information about the datatype, e.g. whether it should be + * printed out as a definition in models or not + * (see enum in expr_manager_template.h). */ - std::vector<DatatypeType> - mkMutualDatatypeTypes(std::vector<Datatype>& datatypes, bool doOverload=false); + std::vector<DatatypeType> mkMutualDatatypeTypes( + std::vector<Datatype>& datatypes, + bool doOverload = false, + uint32_t flags = ExprManager::DATATYPE_FLAG_NONE); /** make flat function type * diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 90303dd40..3a6b444cc 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -784,7 +784,8 @@ sygusGrammarV1[CVC4::Type & ret, << std::endl; } std::vector<DatatypeType> datatypeTypes = - PARSER_STATE->mkMutualDatatypeTypes(datatypes); + PARSER_STATE->mkMutualDatatypeTypes( + datatypes, false, ExprManager::DATATYPE_FLAG_PLACEHOLDER); ret = datatypeTypes[0]; }; @@ -1068,7 +1069,8 @@ sygusGrammar[CVC4::Type & ret, // now, make the sygus datatype Trace("parser-sygus2") << "Make the sygus datatypes..." << std::endl; std::vector<DatatypeType> datatypeTypes = - PARSER_STATE->mkMutualDatatypeTypes(datatypes); + PARSER_STATE->mkMutualDatatypeTypes( + datatypes, false, ExprManager::DATATYPE_FLAG_PLACEHOLDER); // return is the first datatype ret = datatypeTypes[0]; } |