diff options
author | Tim King <taking@cs.nyu.edu> | 2012-05-15 19:01:19 +0000 |
---|---|---|
committer | Tim King <taking@cs.nyu.edu> | 2012-05-15 19:01:19 +0000 |
commit | 488ae3f42d9d3e06978e11a42d1d47e76072f797 (patch) | |
tree | f466859889ceee9947e20d695fd35f99065277f8 /src/printer | |
parent | fe2088f892af594765fc50d8cc9f2b4f87286b7c (diff) |
This commit removes the CONST_INTEGER kind from nodes. This code comes from the branch arithmetic/remove_const_int.
Diffstat (limited to 'src/printer')
-rw-r--r-- | src/printer/cvc/cvc_printer.cpp | 7 | ||||
-rw-r--r-- | src/printer/smt2/smt2_printer.cpp | 13 |
2 files changed, 3 insertions, 17 deletions
diff --git a/src/printer/cvc/cvc_printer.cpp b/src/printer/cvc/cvc_printer.cpp index 857513fa3..1f147479d 100644 --- a/src/printer/cvc/cvc_printer.cpp +++ b/src/printer/cvc/cvc_printer.cpp @@ -94,18 +94,13 @@ void CvcPrinter::toStream(std::ostream& out, TNode n, int depth, bool types, boo break; case kind::CONST_RATIONAL: { const Rational& rat = n.getConst<Rational>(); - if(rat.getDenominator() == 1) { + if(rat.isIntegral()) { out << rat.getNumerator(); } else { out << '(' << rat.getNumerator() << '/' << rat.getDenominator() << ')'; } break; } - case kind::CONST_INTEGER: { - const Integer& num = n.getConst<Integer>(); - out << num; - break; - } case kind::CONST_PSEUDOBOOLEAN: { const Pseudoboolean& num = n.getConst<Pseudoboolean>(); out << num; diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index 03422c162..2b686441a 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -100,25 +100,16 @@ void Smt2Printer::toStream(std::ostream& out, TNode n, case kind::BUILTIN: out << smtKindString(n.getConst<Kind>()); break; - case kind::CONST_INTEGER: { - Integer i = n.getConst<Integer>(); - if(i < 0) { - out << "(- " << -i << ')'; - } else { - out << i; - } - break; - } case kind::CONST_RATIONAL: { Rational r = n.getConst<Rational>(); if(r < 0) { - if(r.getDenominator() == 1) { + if(r.isIntegral()) { out << "(- " << -r << ')'; } else { out << "(- (/ " << (-r).getNumerator() << ' ' << (-r).getDenominator() << "))"; } } else { - if(r.getDenominator() == 1) { + if(r.isIntegral()) { out << r; } else { out << "(/ " << r.getNumerator() << ' ' << r.getDenominator() << ')'; |