diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2021-05-26 07:30:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-26 14:30:17 +0000 |
commit | a24d6c8cf774f971a3eff62f73b2558b01b04440 (patch) | |
tree | 5c8f1054bd8da3b56eb501409a205081294eee06 /src/printer | |
parent | 7440f0568b99842d87cb1f86eec21aed9f46b92a (diff) |
More precise includes of `Node` constants (#6617)
We store constants, e.g., BitVector and Rational, in our node infrastructure. As a result, we were indirectly including some headers in almost all files, e.g., the GMP headers. This commit changes that by forward-declaring the classes for the constants. As a result, we have to include headers like util/rational.h explicitly when we use Rational but it saves about 3 minutes in compile time (CPU time).
The commit changes RoundingMode from an enum to an enum class such that it can be forward declared.
Diffstat (limited to 'src/printer')
-rw-r--r-- | src/printer/cvc/cvc_printer.cpp | 8 | ||||
-rw-r--r-- | src/printer/smt2/smt2_printer.cpp | 32 |
2 files changed, 35 insertions, 5 deletions
diff --git a/src/printer/cvc/cvc_printer.cpp b/src/printer/cvc/cvc_printer.cpp index 42dfea308..be6cdd907 100644 --- a/src/printer/cvc/cvc_printer.cpp +++ b/src/printer/cvc/cvc_printer.cpp @@ -23,9 +23,13 @@ #include <typeinfo> #include <vector> +#include "expr/array_store_all.h" +#include "expr/ascription_type.h" +#include "expr/datatype_index.h" #include "expr/dtype.h" #include "expr/dtype_cons.h" #include "expr/dtype_selector.h" +#include "expr/emptyset.h" #include "expr/node_manager_attributes.h" // for VarNameAttr #include "expr/node_visitor.h" #include "expr/sequence.h" @@ -38,6 +42,10 @@ #include "theory/arrays/theory_arrays_rewriter.h" #include "theory/substitutions.h" #include "theory/theory_model.h" +#include "util/bitvector.h" +#include "util/divisible.h" +#include "util/rational.h" +#include "util/string.h" using namespace std; diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index 2b1f16931..2163167a6 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -22,11 +22,17 @@ #include <vector> #include "api/cpp/cvc5.h" +#include "expr/array_store_all.h" +#include "expr/ascription_type.h" +#include "expr/datatype_index.h" #include "expr/dtype.h" #include "expr/dtype_cons.h" +#include "expr/emptybag.h" +#include "expr/emptyset.h" #include "expr/node_manager_attributes.h" #include "expr/node_visitor.h" #include "expr/sequence.h" +#include "expr/uninterpreted_constant.h" #include "options/bv_options.h" #include "options/language.h" #include "options/printer_options.h" @@ -39,9 +45,17 @@ #include "smt_util/boolean_simplification.h" #include "theory/arrays/theory_arrays_rewriter.h" #include "theory/datatypes/sygus_datatype_utils.h" +#include "theory/datatypes/tuple_project_op.h" #include "theory/quantifiers/quantifiers_attributes.h" #include "theory/theory_model.h" +#include "util/bitvector.h" +#include "util/divisible.h" +#include "util/floatingpoint.h" +#include "util/iand.h" +#include "util/indexed_root_predicate.h" +#include "util/regexp.h" #include "util/smt2_quote_string.h" +#include "util/string.h" using namespace std; @@ -201,11 +215,19 @@ void Smt2Printer::toStream(std::ostream& out, } case kind::CONST_ROUNDINGMODE: switch (n.getConst<RoundingMode>()) { - case ROUND_NEAREST_TIES_TO_EVEN: out << "roundNearestTiesToEven"; break; - case ROUND_NEAREST_TIES_TO_AWAY: out << "roundNearestTiesToAway"; break; - case ROUND_TOWARD_POSITIVE: out << "roundTowardPositive"; break; - case ROUND_TOWARD_NEGATIVE: out << "roundTowardNegative"; break; - case ROUND_TOWARD_ZERO: out << "roundTowardZero"; break; + case RoundingMode::ROUND_NEAREST_TIES_TO_EVEN: + out << "roundNearestTiesToEven"; + break; + case RoundingMode::ROUND_NEAREST_TIES_TO_AWAY: + out << "roundNearestTiesToAway"; + break; + case RoundingMode::ROUND_TOWARD_POSITIVE: + out << "roundTowardPositive"; + break; + case RoundingMode::ROUND_TOWARD_NEGATIVE: + out << "roundTowardNegative"; + break; + case RoundingMode::ROUND_TOWARD_ZERO: out << "roundTowardZero"; break; default: Unreachable() << "Invalid value of rounding mode constant (" << n.getConst<RoundingMode>() << ")"; |