diff options
Diffstat (limited to 'src/api/cvc4cpp.cpp')
-rw-r--r-- | src/api/cvc4cpp.cpp | 69 |
1 files changed, 65 insertions, 4 deletions
diff --git a/src/api/cvc4cpp.cpp b/src/api/cvc4cpp.cpp index 19d7840a8..bc696a057 100644 --- a/src/api/cvc4cpp.cpp +++ b/src/api/cvc4cpp.cpp @@ -95,6 +95,10 @@ std::string Result::getUnknownExplanation(void) const std::string Result::toString(void) const { return d_result->toString(); } +// !!! This is only temporarily available until the parser is fully migrated +// to the new API. !!! +CVC4::Result Result::getResult(void) const { return *d_result; } + std::ostream& operator<<(std::ostream& out, const Result& r) { out << r.toString(); @@ -801,6 +805,10 @@ std::string Sort::toString() const return d_type->toString(); } +// !!! This is only temporarily available until the parser is fully migrated +// to the new API. !!! +CVC4::Type Sort::getType(void) const { return *d_type; } + std::ostream& operator<<(std::ostream& out, const Sort& s) { out << s.toString(); @@ -942,6 +950,10 @@ Term::const_iterator Term::end() const return Term::const_iterator(new CVC4::Expr::const_iterator(d_expr->end())); } +// !!! This is only temporarily available until the parser is fully migrated +// to the new API. !!! +CVC4::Expr Term::getExpr(void) const { return *d_expr; } + std::ostream& operator<<(std::ostream& out, const Term& t) { out << t.toString(); @@ -1029,6 +1041,10 @@ bool OpTerm::isNull() const { return d_expr->isNull(); } std::string OpTerm::toString() const { return d_expr->toString(); } +// !!! This is only temporarily available until the parser is fully migrated +// to the new API. !!! +CVC4::Expr OpTerm::getExpr(void) const { return *d_expr; } + std::ostream& operator<<(std::ostream& out, const OpTerm& t) { out << t.toString(); @@ -1097,6 +1113,14 @@ std::string DatatypeConstructorDecl::toString() const return ss.str(); } +// !!! This is only temporarily available until the parser is fully migrated +// to the new API. !!! +CVC4::DatatypeConstructor DatatypeConstructorDecl::getDatatypeConstructor( + void) const +{ + return *d_ctor; +} + std::ostream& operator<<(std::ostream& out, const DatatypeConstructorDecl& ctordecl) { @@ -1146,6 +1170,10 @@ std::string DatatypeDecl::toString() const return ss.str(); } +// !!! This is only temporarily available until the parser is fully migrated +// to the new API. !!! +CVC4::Datatype DatatypeDecl::getDatatype(void) const { return *d_dtype; } + std::ostream& operator<<(std::ostream& out, const DatatypeSelectorDecl& stordecl) { @@ -1171,6 +1199,14 @@ std::string DatatypeSelector::toString() const return ss.str(); } +// !!! This is only temporarily available until the parser is fully migrated +// to the new API. !!! +CVC4::DatatypeConstructorArg DatatypeSelector::getDatatypeConstructorArg( + void) const +{ + return *d_stor; +} + std::ostream& operator<<(std::ostream& out, const DatatypeSelector& stor) { out << stor.toString(); @@ -1287,6 +1323,14 @@ std::string DatatypeConstructor::toString() const return ss.str(); } +// !!! This is only temporarily available until the parser is fully migrated +// to the new API. !!! +CVC4::DatatypeConstructor DatatypeConstructor::getDatatypeConstructor( + void) const +{ + return *d_ctor; +} + std::ostream& operator<<(std::ostream& out, const DatatypeConstructor& ctor) { out << ctor.toString(); @@ -1333,6 +1377,10 @@ Datatype::const_iterator Datatype::end() const return Datatype::const_iterator(*d_dtype, false); } +// !!! This is only temporarily available until the parser is fully migrated +// to the new API. !!! +CVC4::Datatype Datatype::getDatatype(void) const { return *d_dtype; } + Datatype::const_iterator::const_iterator(const CVC4::Datatype& dtype, bool begin) { @@ -1431,10 +1479,11 @@ size_t RoundingModeHashFunction::operator()(const RoundingMode& rm) const Solver::Solver(Options* opts) { - d_exprMgr = std::unique_ptr<ExprManager>( - opts == nullptr ? new ExprManager(Options()) : new ExprManager(*opts)); - d_smtEngine = std::unique_ptr<SmtEngine>(new SmtEngine(d_exprMgr.get())); - d_rng = std::unique_ptr<Random>(new Random((*opts)[options::seed])); + Options* o = opts == nullptr ? new Options() : opts; + d_exprMgr.reset(new ExprManager(*o)); + d_smtEngine.reset(new SmtEngine(d_exprMgr.get())); + d_rng.reset(new Random((*o)[options::seed])); + if (opts == nullptr) delete o; } Solver::~Solver() {} @@ -2777,5 +2826,17 @@ void Solver::setOption(const std::string& option, d_smtEngine->setOption(option, value); } +/** + * !!! This is only temporarily available until the parser is fully migrated to + * the new API. !!! + */ +ExprManager* Solver::getExprManager(void) const { return d_exprMgr.get(); } + +/** + * !!! This is only temporarily available until the parser is fully migrated to + * the new API. !!! + */ +SmtEngine* Solver::getSmtEngine(void) const { return d_smtEngine.get(); } + } // namespace api } // namespace CVC4 |