diff options
author | ajreynol <andrew.j.reynolds@gmail.com> | 2016-11-01 13:20:49 -0500 |
---|---|---|
committer | ajreynol <andrew.j.reynolds@gmail.com> | 2016-11-01 13:20:49 -0500 |
commit | 8e0fce94790249ff7aff84ff4500bb96e2ebb9e9 (patch) | |
tree | 25e65718cff712f13688e452ffc1d4b459cd7367 /src/printer/cvc | |
parent | 3506b13f4d298095e8405b32b05e838f17dbe809 (diff) |
Working memory leak free version, changes interface to pointers.
Diffstat (limited to 'src/printer/cvc')
-rw-r--r-- | src/printer/cvc/cvc_printer.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/printer/cvc/cvc_printer.cpp b/src/printer/cvc/cvc_printer.cpp index 550f87081..11cf7dd11 100644 --- a/src/printer/cvc/cvc_printer.cpp +++ b/src/printer/cvc/cvc_printer.cpp @@ -163,7 +163,7 @@ void CvcPrinter::toStream(std::ostream& out, TNode n, int depth, bool types, boo break; case kind::DATATYPE_TYPE: { - const Datatype& dt = n.getConst<Datatype>(); + const Datatype& dt = (NodeManager::currentNM()->getDatatypeForIndex( n.getConst< DatatypeIndexConstant >().getIndex() )); if( dt.isTuple() ){ out << '['; for (unsigned i = 0; i < dt[0].getNumArgs(); ++ i) { @@ -333,15 +333,17 @@ void CvcPrinter::toStream(std::ostream& out, TNode n, int depth, bool types, boo break; // DATATYPES - case kind::PARAMETRIC_DATATYPE: - out << n[0].getConst<Datatype>().getName() << '['; - for(unsigned i = 1; i < n.getNumChildren(); ++i) { - if(i > 1) { - out << ','; + case kind::PARAMETRIC_DATATYPE: { + const Datatype & dt = (NodeManager::currentNM()->getDatatypeForIndex( n[0].getConst< DatatypeIndexConstant >().getIndex() )); + out << dt.getName() << '['; + for(unsigned i = 1; i < n.getNumChildren(); ++i) { + if(i > 1) { + out << ','; + } + out << n[i]; } - out << n[i]; + out << ']'; } - out << ']'; return; break; case kind::APPLY_TYPE_ASCRIPTION: { |