From 8f7952bc092d252a4d0c04c87636c443536833b3 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Thu, 17 Mar 2022 19:00:56 +0100 Subject: [PATCH] Replace `Debug` by `Trace` (#7793) This PR replaces all usages of Debug() by Trace(), the same for similar methods like Debug.isOn(). Given that Debug is no longer used then, it is removed. --- src/base/output.cpp | 1 - src/base/output.h | 89 +-- src/context/cdhashmap.h | 21 - src/context/cdinsert_hashmap.h | 18 +- src/context/cdlist.h | 51 +- src/context/cdo.h | 7 +- src/context/cdqueue.h | 7 - src/context/context.cpp | 43 +- src/context/context.h | 3 - src/context/context_mm.cpp | 3 - src/decision/justify_stack.cpp | 2 +- src/expr/attribute_internals.h | 4 +- src/expr/dtype.cpp | 4 +- src/expr/node.cpp | 10 +- src/expr/node_algorithm.cpp | 2 +- src/expr/node_builder.cpp | 18 +- src/expr/node_builder.h | 2 +- src/expr/node_manager_template.cpp | 54 +- src/expr/node_manager_template.h | 16 +- src/expr/symbol_table.cpp | 26 +- src/expr/type_checker_template.cpp | 2 +- src/expr/type_matcher.cpp | 8 +- src/main/driver_unified.cpp | 1 - src/main/interactive_shell.cpp | 10 +- src/main/options_template.cpp | 34 +- src/options/options_handler.cpp | 18 +- src/parser/antlr_input.cpp | 12 +- src/parser/antlr_input.h | 2 +- src/parser/antlr_line_buffered_input.cpp | 2 +- src/parser/parser.cpp | 46 +- src/parser/smt2/Smt2.g | 38 +- src/parser/smt2/smt2.cpp | 54 +- src/parser/tptp/tptp.cpp | 18 +- src/preprocessing/passes/bool_to_bv.cpp | 20 +- src/preprocessing/passes/bv_to_bool.cpp | 16 +- src/preprocessing/passes/ite_simp.cpp | 12 +- src/preprocessing/passes/learned_rewrite.cpp | 4 +- src/preprocessing/passes/miplib_trick.cpp | 76 +-- src/preprocessing/passes/non_clausal_simp.cpp | 4 +- .../passes/pseudo_boolean_processor.cpp | 22 +- src/preprocessing/util/ite_utilities.cpp | 34 +- src/proof/conv_proof_generator.cpp | 2 +- src/proof/conv_seq_proof_generator.cpp | 2 +- src/proof/lazy_proof_chain.cpp | 4 +- src/proof/proof_checker.cpp | 8 +- src/proof/proof_ensure_closed.cpp | 6 +- src/proof/proof_node_manager.cpp | 2 +- src/proof/proof_node_updater.cpp | 2 +- src/proof/unsat_core.cpp | 4 +- src/prop/cryptominisat.cpp | 8 +- src/prop/minisat/core/Solver.cc | 128 ++--- src/prop/minisat/core/Solver.h | 2 +- src/prop/minisat/minisat.cpp | 2 +- src/prop/minisat/simp/SimpSolver.cc | 2 +- src/prop/opt_clauses_manager.cpp | 2 +- src/prop/proof_cnf_stream.cpp | 2 +- src/prop/proof_post_processor.cpp | 2 +- src/prop/prop_engine.cpp | 30 +- src/prop/prop_proof_manager.cpp | 4 +- src/prop/sat_proof_manager.cpp | 20 +- src/prop/theory_proxy.cpp | 10 +- src/smt/expand_definitions.cpp | 6 +- src/smt/model_core_builder.cpp | 2 +- src/smt/process_assertions.cpp | 24 +- src/smt/proof_final_callback.cpp | 2 +- src/smt/proof_manager.cpp | 4 +- src/smt/proof_post_processor.cpp | 14 +- src/smt/solver_engine_scope.cpp | 4 +- src/smt/term_formula_removal.cpp | 2 +- src/smt/unsat_core_manager.cpp | 2 +- src/theory/arith/approx_simplex.cpp | 316 +++++------ src/theory/arith/arith_ite_utils.cpp | 10 +- src/theory/arith/arith_static_learner.cpp | 18 +- src/theory/arith/attempt_solution_simplex.cpp | 4 +- src/theory/arith/branch_and_bound.cpp | 10 +- src/theory/arith/congruence_manager.cpp | 48 +- src/theory/arith/constraint.cpp | 208 +++---- src/theory/arith/cut_log.cpp | 36 +- src/theory/arith/dio_solver.cpp | 70 +-- src/theory/arith/dio_solver.h | 2 +- src/theory/arith/dual_simplex.cpp | 24 +- src/theory/arith/error_set.cpp | 20 +- src/theory/arith/fc_simplex.cpp | 88 +-- src/theory/arith/linear_equality.cpp | 128 ++--- src/theory/arith/matrix.h | 26 +- src/theory/arith/nl/coverings/cdcac.cpp | 10 +- src/theory/arith/nl/coverings/cdcac_utils.cpp | 4 +- .../arith/nl/coverings/lazard_evaluation.cpp | 2 +- src/theory/arith/nl/coverings_solver.cpp | 4 +- src/theory/arith/nl/equality_substitution.cpp | 4 +- src/theory/arith/nl/ext/constraint.cpp | 2 +- src/theory/arith/nl/ext/factoring_check.cpp | 2 +- .../arith/nl/ext/monomial_bounds_check.cpp | 6 +- src/theory/arith/nl/ext/monomial_check.cpp | 2 +- src/theory/arith/nl/iand_solver.cpp | 2 +- src/theory/arith/nl/nl_model.cpp | 12 +- src/theory/arith/nl/nonlinear_extension.cpp | 4 +- src/theory/arith/nl/pow2_solver.cpp | 2 +- .../transcendental/transcendental_solver.cpp | 4 +- .../transcendental/transcendental_state.cpp | 2 +- src/theory/arith/normal_form.cpp | 24 +- src/theory/arith/normal_form.h | 6 +- src/theory/arith/partial_model.cpp | 10 +- src/theory/arith/pp_rewrite_eq.cpp | 2 +- src/theory/arith/proof_checker.cpp | 42 +- src/theory/arith/rewriter/addition.cpp | 4 +- src/theory/arith/simplex.cpp | 10 +- src/theory/arith/soi_simplex.cpp | 86 +-- src/theory/arith/tableau.cpp | 6 +- src/theory/arith/tableau.h | 4 +- src/theory/arith/theory_arith.cpp | 6 +- src/theory/arith/theory_arith_private.cpp | 516 +++++++++--------- src/theory/arrays/array_info.cpp | 6 +- src/theory/arrays/theory_arrays.cpp | 58 +- src/theory/arrays/theory_arrays.h | 6 +- .../arrays/theory_arrays_type_rules.cpp | 4 +- src/theory/atom_requests.cpp | 6 +- src/theory/bags/theory_bags.cpp | 12 +- src/theory/booleans/circuit_propagator.cpp | 20 +- .../booleans/proof_circuit_propagator.cpp | 2 +- src/theory/booleans/theory_bool_rewriter.cpp | 24 +- .../booleans/theory_bool_type_rules.cpp | 6 +- .../bitblast/bitblast_strategies_template.h | 122 ++--- src/theory/bv/bv_solver_bitblast.cpp | 4 +- src/theory/bv/bv_solver_bitblast_internal.cpp | 2 +- src/theory/bv/theory_bv.cpp | 8 +- src/theory/bv/theory_bv_rewrite_rules.h | 6 +- ...ory_bv_rewrite_rules_constant_evaluation.h | 58 +- src/theory/bv/theory_bv_rewrite_rules_core.h | 26 +- .../theory_bv_rewrite_rules_normalization.h | 50 +- ...ry_bv_rewrite_rules_operator_elimination.h | 54 +- .../theory_bv_rewrite_rules_simplification.h | 108 ++-- src/theory/bv/theory_bv_rewriter.cpp | 12 +- src/theory/combination_care_graph.cpp | 4 +- src/theory/datatypes/sygus_datatype_utils.cpp | 2 +- src/theory/datatypes/sygus_extension.cpp | 16 +- src/theory/datatypes/theory_datatypes.cpp | 18 +- src/theory/datatypes/theory_datatypes.h | 4 +- .../datatypes/theory_datatypes_type_rules.cpp | 28 +- .../datatypes/theory_datatypes_utils.cpp | 2 +- src/theory/datatypes/type_enumerator.cpp | 50 +- src/theory/datatypes/type_enumerator.h | 2 +- src/theory/fp/theory_fp.cpp | 14 +- src/theory/fp/theory_fp_rewriter.cpp | 12 +- src/theory/model_manager.cpp | 2 +- .../candidate_rewrite_database.cpp | 2 +- .../quantifiers/candidate_rewrite_filter.cpp | 4 +- .../cegqi/ceg_arith_instantiator.cpp | 10 +- .../quantifiers/cegqi/ceg_bv_instantiator.cpp | 8 +- .../quantifiers/cegqi/ceg_instantiator.cpp | 6 +- .../quantifiers/cegqi/inst_strategy_cegqi.cpp | 12 +- .../quantifiers/cegqi/vts_term_cache.cpp | 2 +- .../quantifiers/conjecture_generator.cpp | 16 +- .../ematching/candidate_generator.cpp | 10 +- .../quantifiers/ematching/ho_trigger.cpp | 4 +- .../ematching/inst_match_generator_multi.cpp | 2 +- .../ematching/inst_match_generator_simple.cpp | 10 +- .../ematching/inst_strategy_e_matching.cpp | 12 +- .../inst_strategy_e_matching_user.cpp | 2 +- .../ematching/instantiation_engine.cpp | 8 +- .../ematching/pattern_term_selector.cpp | 2 +- src/theory/quantifiers/ematching/trigger.cpp | 8 +- src/theory/quantifiers/equality_query.cpp | 2 +- src/theory/quantifiers/extended_rewrite.cpp | 6 +- .../quantifiers/fmf/bounded_integers.cpp | 2 +- .../quantifiers/fmf/full_model_check.cpp | 8 +- src/theory/quantifiers/fmf/model_builder.cpp | 2 +- src/theory/quantifiers/fmf/model_engine.cpp | 20 +- src/theory/quantifiers/fun_def_evaluator.cpp | 2 +- src/theory/quantifiers/inst_match.cpp | 2 +- .../quantifiers/inst_strategy_enumerative.cpp | 4 +- src/theory/quantifiers/inst_strategy_pool.cpp | 4 +- src/theory/quantifiers/instantiate.cpp | 12 +- src/theory/quantifiers/lazy_trie.cpp | 2 +- .../quantifiers/quant_conflict_find.cpp | 166 +++--- src/theory/quantifiers/quant_conflict_find.h | 2 +- src/theory/quantifiers/quant_util.cpp | 8 +- .../quantifiers/quantifiers_registry.cpp | 4 +- .../quantifiers/quantifiers_rewriter.cpp | 2 +- src/theory/quantifiers/quantifiers_state.cpp | 2 +- src/theory/quantifiers/sygus/cegis.cpp | 8 +- .../sygus/cegis_core_connective.cpp | 4 +- src/theory/quantifiers/sygus/cegis_unif.cpp | 6 +- .../sygus/enum_stream_substitution.cpp | 24 +- .../quantifiers/sygus/enum_value_manager.cpp | 6 +- .../quantifiers/sygus/example_infer.cpp | 2 +- .../quantifiers/sygus/sygus_enumerator.cpp | 4 +- .../quantifiers/sygus/sygus_grammar_norm.cpp | 14 +- .../quantifiers/sygus/sygus_invariance.cpp | 2 +- .../quantifiers/sygus/sygus_process_conj.cpp | 4 +- .../quantifiers/sygus/sygus_repair_const.cpp | 6 +- src/theory/quantifiers/sygus/sygus_unif.cpp | 4 +- .../quantifiers/sygus/sygus_unif_io.cpp | 18 +- .../quantifiers/sygus/sygus_unif_rl.cpp | 14 +- .../quantifiers/sygus/sygus_unif_strat.cpp | 6 +- .../quantifiers/sygus/synth_conjecture.cpp | 10 +- src/theory/quantifiers/sygus/synth_engine.cpp | 2 +- src/theory/quantifiers/sygus/synth_verify.cpp | 2 +- .../quantifiers/sygus/term_database_sygus.cpp | 4 +- src/theory/quantifiers/sygus/type_info.cpp | 2 +- src/theory/quantifiers/sygus_sampler.cpp | 2 +- src/theory/quantifiers/term_database.cpp | 4 +- .../quantifiers/term_tuple_enumerator.cpp | 2 +- src/theory/quantifiers/theory_quantifiers.cpp | 10 +- .../theory_quantifiers_type_rules.cpp | 2 +- src/theory/quantifiers_engine.cpp | 14 +- src/theory/relevance_manager.cpp | 2 +- src/theory/rep_set.cpp | 12 +- src/theory/sep/theory_sep.cpp | 10 +- src/theory/sep/theory_sep.h | 6 +- src/theory/sets/cardinality_extension.cpp | 2 +- src/theory/sets/normal_form.h | 6 +- src/theory/sets/theory_sets.cpp | 8 +- src/theory/sets/theory_sets_private.cpp | 12 +- src/theory/sets/theory_sets_rels.cpp | 4 +- src/theory/shared_terms_database.cpp | 8 +- src/theory/sort_inference.cpp | 2 +- src/theory/strings/arith_entail.cpp | 2 +- src/theory/strings/array_core_solver.cpp | 6 +- src/theory/strings/base_solver.cpp | 4 +- src/theory/strings/core_solver.cpp | 16 +- src/theory/strings/extf_solver.cpp | 2 +- src/theory/strings/infer_proof_cons.cpp | 6 +- src/theory/strings/inference_manager.cpp | 6 +- src/theory/strings/regexp_operation.cpp | 6 +- src/theory/strings/solver_state.cpp | 2 +- src/theory/strings/theory_strings.cpp | 14 +- src/theory/strings/theory_strings.h | 10 +- src/theory/substitutions.cpp | 16 +- src/theory/term_registration_visitor.cpp | 26 +- src/theory/theory.cpp | 10 +- src/theory/theory_engine.cpp | 76 +-- src/theory/theory_engine.h | 2 +- src/theory/theory_model.cpp | 28 +- src/theory/theory_model_builder.cpp | 2 +- src/theory/theory_preprocessor.cpp | 2 +- src/theory/uf/cardinality_extension.cpp | 108 ++-- src/theory/uf/eq_proof.cpp | 4 +- src/theory/uf/equality_engine.cpp | 256 ++++----- src/theory/uf/proof_equality_engine.cpp | 4 +- src/theory/uf/symmetry_breaker.cpp | 182 +++--- src/theory/uf/symmetry_breaker.h | 2 +- src/theory/uf/theory_uf.cpp | 42 +- src/theory/uf/theory_uf.h | 6 +- src/theory/uf/theory_uf_rewriter.cpp | 2 +- src/util/resource_manager.cpp | 2 +- test/unit/node/attribute_white.cpp | 160 +++--- test/unit/parser/parser_black.cpp | 4 +- .../theory/theory_arith_rewriter_black.cpp | 1 - test/unit/util/datatype_black.cpp | 60 +- test/unit/util/output_black.cpp | 74 +-- 251 files changed, 2590 insertions(+), 2819 deletions(-) diff --git a/src/base/output.cpp b/src/base/output.cpp index ffbe6454c..75fbcd60e 100644 --- a/src/base/output.cpp +++ b/src/base/output.cpp @@ -29,7 +29,6 @@ NullC nullStream; const std::string Cvc5ostream::s_tab = " "; const int Cvc5ostream::s_indentIosIndex = std::ios_base::xalloc(); -DebugC DebugChannel(&std::cout); WarningC WarningChannel(&std::cerr); TraceC TraceChannel(&std::cout); diff --git a/src/base/output.h b/src/base/output.h index d51a13002..b0a311241 100644 --- a/src/base/output.h +++ b/src/base/output.h @@ -18,12 +18,14 @@ #ifndef CVC5__OUTPUT_H #define CVC5__OUTPUT_H +#include #include #include #include #include #include #include +#include #include "cvc5_export.h" @@ -37,7 +39,7 @@ std::ostream& operator<<(std::ostream& out, const std::pair& p) { /** * A utility class to provide (essentially) a "/dev/null" streambuf. * If debugging support is compiled in, but debugging for - * e.g. "parser" is off, then Debug("parser") returns a stream + * e.g. "parser" is off, then Trace("parser") returns a stream * attached to a null_streambuf instance so that output is directed to * the bit bucket. */ @@ -184,46 +186,6 @@ class NullC extern NullC nullStream CVC5_EXPORT; -/** The debug output class */ -class DebugC -{ - std::set d_tags; - std::ostream* d_os; - -public: - explicit DebugC(std::ostream* os) : d_os(os) {} - - Cvc5ostream operator()(const std::string& tag) const - { - if(!d_tags.empty() && d_tags.find(tag) != d_tags.end()) { - return Cvc5ostream(d_os); - } else { - return Cvc5ostream(); - } - } - - bool on(const std::string& tag) - { - d_tags.insert(tag); - return true; - } - bool off(const std::string& tag) - { - d_tags.erase(tag); - return false; - } - bool off() { d_tags.clear(); return false; } - - bool isOn(const std::string& tag) const - { - return d_tags.find(tag) != d_tags.end(); - } - - std::ostream& setStream(std::ostream* os) { d_os = os; return *os; } - std::ostream& getStream() const { return *d_os; } - std::ostream* getStreamPointer() const { return d_os; } -}; /* class DebugC */ - /** The warning output class */ class WarningC { @@ -263,14 +225,18 @@ public: class TraceC { std::ostream* d_os; - std::set d_tags; + std::vector d_tags; public: explicit TraceC(std::ostream* os) : d_os(os) {} - Cvc5ostream operator()(std::string tag) const + Cvc5ostream operator()() const + { + return Cvc5ostream(d_os); + } + Cvc5ostream operator()(const std::string& tag) const { - if(!d_tags.empty() && d_tags.find(tag) != d_tags.end()) { + if (isOn(tag)) { return Cvc5ostream(d_os); } else { return Cvc5ostream(); @@ -279,19 +245,25 @@ public: bool on(const std::string& tag) { - d_tags.insert(tag); + d_tags.emplace_back(tag); return true; } bool off(const std::string& tag) { - d_tags.erase(tag); + auto it = std::find(d_tags.begin(), d_tags.end(), tag); + if (it != d_tags.end()) + { + *it = d_tags.back(); + d_tags.pop_back(); + } return false; } - bool off() { d_tags.clear(); return false; } bool isOn(const std::string& tag) const { - return d_tags.find(tag) != d_tags.end(); + // This is faster than using std::set::find() or sorting the vector and + // using std::lower_bound. + return !d_tags.empty() && std::find(d_tags.begin(), d_tags.end(), tag) != d_tags.end(); } std::ostream& setStream(std::ostream* os) { d_os = os; return *d_os; } @@ -300,8 +272,6 @@ public: }; /* class TraceC */ -/** The debug output singleton */ -extern DebugC DebugChannel CVC5_EXPORT; /** The warning output singleton */ extern WarningC WarningChannel CVC5_EXPORT; /** The trace output singleton */ @@ -309,20 +279,15 @@ extern TraceC TraceChannel CVC5_EXPORT; #ifdef CVC5_MUZZLE -#define Debug ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::DebugChannel #define Warning \ ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::WarningChannel #define WarningOnce \ ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::WarningChannel -#define Trace ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::TraceChannel +#define TraceIsOn ::cvc5::__cvc5_true() ? false : ::cvc5::TraceChannel.isOn +#define Trace(tag) ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::TraceChannel() #else /* CVC5_MUZZLE */ -#if defined(CVC5_DEBUG) && defined(CVC5_TRACING) -#define Debug ::cvc5::DebugChannel -#else /* CVC5_DEBUG && CVC5_TRACING */ -#define Debug ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::DebugChannel -#endif /* CVC5_DEBUG && CVC5_TRACING */ #define Warning \ (!::cvc5::WarningChannel.isOn()) ? ::cvc5::nullStream : ::cvc5::WarningChannel #define WarningOnce \ @@ -331,17 +296,19 @@ extern TraceC TraceChannel CVC5_EXPORT; ? ::cvc5::nullStream \ : ::cvc5::WarningChannel #ifdef CVC5_TRACING -#define Trace ::cvc5::TraceChannel +#define TraceIsOn ::cvc5::TraceChannel.isOn +#define Trace(tag) !::cvc5::TraceChannel.isOn(tag) ? ::cvc5::nullStream : ::cvc5::TraceChannel() #else /* CVC5_TRACING */ -#define Trace ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::TraceChannel +#define TraceIsOn ::cvc5::__cvc5_true() ? false : ::cvc5::TraceChannel.isOn +#define Trace(tag) ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::TraceChannel() #endif /* CVC5_TRACING */ #endif /* CVC5_MUZZLE */ -// Disallow e.g. !Debug("foo").isOn() forms +// Disallow e.g. !Trace("foo").isOn() forms // because the ! will apply before the ? . // If a compiler error has directed you here, -// just parenthesize it e.g. !(Debug("foo").isOn()) +// just parenthesize it e.g. !(Trace("foo").isOn()) class __cvc5_true { CVC5_UNUSED void operator!(); diff --git a/src/context/cdhashmap.h b/src/context/cdhashmap.h index 63b166d61..464547bbb 100644 --- a/src/context/cdhashmap.h +++ b/src/context/cdhashmap.h @@ -151,8 +151,6 @@ class CDOhash_map : public ContextObj // FIXME multithreading if (d_map->d_first == this) { - Debug("gc") << "remove first-elem " << this << " from map " << d_map - << " with next-elem " << d_next << std::endl; if (d_next == this) { Assert(d_prev == this); @@ -163,15 +161,9 @@ class CDOhash_map : public ContextObj d_map->d_first = d_next; } } - else - { - Debug("gc") << "remove nonfirst-elem " << this << " from map " - << d_map << std::endl; - } d_next->d_prev = d_prev; d_prev->d_next = d_next; - Debug("gc") << "CDHashMap<> trash push_back " << this << std::endl; // this->deleteSelf(); enqueueToGarbageCollect(); } @@ -219,14 +211,9 @@ class CDOhash_map : public ContextObj if (first == NULL) { first = d_next = d_prev = this; - Debug("gc") << "add first-elem " << this << " to map " << d_map - << std::endl; } else { - Debug("gc") << "add nonfirst-elem " << this << " to map " << d_map - << " with first-elem " << first << "[" << first->d_prev << " " - << first->d_next << std::endl; d_prev = first->d_prev; d_next = first; d_prev->d_next = this; @@ -309,20 +296,12 @@ class CDHashMap : public ContextObj ~CDHashMap() { - Debug("gc") << "cdhashmap" << this << " disappearing, destroying..." - << std::endl; destroy(); - Debug("gc") << "cdhashmap" << this << " disappearing, done destroying" - << std::endl; clear(); } void clear() { - Debug("gc") << "clearing cdhashmap" << this << ", emptying trash" - << std::endl; - Debug("gc") << "done emptying trash for " << this << std::endl; - for (auto& key_element_pair : d_map) { // mark it as being a destruction (short-circuit restore()) diff --git a/src/context/cdinsert_hashmap.h b/src/context/cdinsert_hashmap.h index 2d4906ea4..4df2036e6 100644 --- a/src/context/cdinsert_hashmap.h +++ b/src/context/cdinsert_hashmap.h @@ -153,7 +153,7 @@ public: const Key& front = d_keys.front(); d_hashMap.erase(front); - Debug("TrailHashMap") <<"TrailHashMap pop_front " << size() << std::endl; + Trace("TrailHashMap") <<"TrailHashMap pop_front " << size() << std::endl; d_keys.pop_front(); } @@ -165,7 +165,7 @@ public: const Key& back = d_keys.back(); d_hashMap.erase(back); - Debug("TrailHashMap") <<"TrailHashMap pop_back " << size() << std::endl; + Trace("TrailHashMap") <<"TrailHashMap pop_back " << size() << std::endl; d_keys.pop_back(); } @@ -198,7 +198,7 @@ private: CDInsertHashMap(const CDInsertHashMap& l) : ContextObj(l), d_insertMap(nullptr), d_size(l.d_size) { - Debug("CDInsertHashMap") << "copy ctor: " << this + Trace("CDInsertHashMap") << "copy ctor: " << this << " from " << &l << " size " << d_size << std::endl; } @@ -214,11 +214,6 @@ private: ContextObj* save(ContextMemoryManager* pCMM) override { ContextObj* data = new(pCMM) CDInsertHashMap(*this); - Debug("CDInsertHashMap") << "save " << this - << " at level " << this->getContext()->getLevel() - << " size at " << this->d_size - << " d_list is " << this->d_insertMap - << " data:" << data << std::endl; return data; } protected: @@ -230,10 +225,6 @@ protected: */ void restore(ContextObj* data) override { - Debug("CDInsertHashMap") - << "restore " << this << " level " << this->getContext()->getLevel() - << " data == " << data << " d_insertMap == " << this->d_insertMap - << std::endl; size_t oldSize = ((CDInsertHashMap*)data)->d_size; // The size to restore to. @@ -241,9 +232,6 @@ protected: d_insertMap->pop_to_size(restoreSize); d_size = restoreSize; Assert(d_insertMap->size() == d_size); - Debug("CDInsertHashMap") - << "restore " << this << " level " << this->getContext()->getLevel() - << " size back to " << this->d_size << std::endl; } public: diff --git a/src/context/cdlist.h b/src/context/cdlist.h index 997dbc924..574c452b8 100644 --- a/src/context/cdlist.h +++ b/src/context/cdlist.h @@ -110,7 +110,7 @@ private: d_cleanUp(l.d_cleanUp), d_allocator(l.d_allocator) { - Debug("cdlist") << "copy ctor: " << this << " from " << &l << " size " + Trace("cdlist") << "copy ctor: " << this << " from " << &l << " size " << d_size << std::endl; } CDList& operator=(const CDList& l) = delete; @@ -122,15 +122,11 @@ private: * allocated space. */ void grow() { - Debug("cdlist") << "grow " << this << " " << getContext()->getLevel() - << ": grow? " << d_size << " " << d_sizeAlloc << std::endl; if (d_size != d_sizeAlloc) { // If there is still unused allocated space return; } - Debug("cdlist") << "grow " << this << " " << getContext()->getLevel() - << ": grow!" << std::endl; const size_t maxSize = std::allocator_traits::max_size(d_allocator); @@ -138,9 +134,6 @@ private: { // Allocate an initial list if one does not yet exist d_sizeAlloc = INITIAL_SIZE; - Debug("cdlist") << "initial grow of cdlist " << this - << " level " << getContext()->getLevel() - << " to " << d_sizeAlloc << std::endl; if (d_sizeAlloc > maxSize) { d_sizeAlloc = maxSize; @@ -164,11 +157,6 @@ private: } T* newList = std::allocator_traits::allocate(d_allocator, newSize); - Debug("cdlist") << "2x grow of cdlist " << this - << " level " << getContext()->getLevel() - << " to " << newSize - << " (from " << d_list - << " to " << newList << ")" << std::endl; if (newList == nullptr) { throw std::bad_alloc(); @@ -191,12 +179,6 @@ private: ContextObj* save(ContextMemoryManager* pCMM) override { ContextObj* data = new(pCMM) CDList(*this); - Debug("cdlist") << "save " << this - << " at level " << this->getContext()->getLevel() - << " size at " << this->d_size - << " sizeAlloc at " << this->d_sizeAlloc - << " d_list is " << this->d_list - << " data:" << data << std::endl; return data; } @@ -208,15 +190,7 @@ protected: */ void restore(ContextObj* data) override { - Debug("cdlist") << "restore " << this << " level " - << this->getContext()->getLevel() << " data == " << data - << " call dtor == " << this->d_callDestructor - << " d_list == " << this->d_list << std::endl; truncateList(((CDList*)data)->d_size); - Debug("cdlist") << "restore " << this << " level " - << this->getContext()->getLevel() << " size back to " - << this->d_size << " sizeAlloc at " << this->d_sizeAlloc - << std::endl; } /** @@ -297,7 +271,7 @@ protected: * to avoid this issue. */ void push_back(const T& data) { - Debug("cdlist") << "push_back " << this + Trace("cdlist") << "push_back " << this << " " << getContext()->getLevel() << ": make-current, " << "d_list == " << d_list << std::endl; @@ -305,20 +279,9 @@ protected: grow(); Assert(d_size < d_sizeAlloc); - Debug("cdlist") << "push_back " << this - << " " << getContext()->getLevel() - << ": construct! at " << d_list - << "[" << d_size << "] == " << &d_list[d_size] - << std::endl; std::allocator_traits::construct( d_allocator, &d_list[d_size], data); - Debug("cdlist") << "push_back " << this - << " " << getContext()->getLevel() - << ": done..." << std::endl; ++d_size; - Debug("cdlist") << "push_back " << this - << " " << getContext()->getLevel() - << ": size now " << d_size << std::endl; } /** @@ -329,24 +292,16 @@ protected: template void emplace_back(Args&&... args) { - Debug("cdlist") << "emplace_back " << this << " " + Trace("cdlist") << "emplace_back " << this << " " << getContext()->getLevel() << ": make-current, " << "d_list == " << d_list << std::endl; makeCurrent(); grow(); Assert(d_size < d_sizeAlloc); - Debug("cdlist") << "emplace_back " << this << " " - << getContext()->getLevel() << ": construct! at " << d_list - << "[" << d_size << "] == " << &d_list[d_size] << std::endl; std::allocator_traits::construct( d_allocator, &d_list[d_size], std::forward(args)...); - Debug("cdlist") << "emplace_back " << this << " " - << getContext()->getLevel() << ": done..." << std::endl; ++d_size; - Debug("cdlist") << "emplace_back " << this << " " - << getContext()->getLevel() << ": size now " << d_size - << std::endl; } /** diff --git a/src/context/cdo.h b/src/context/cdo.h index f73a3ae1f..f239703a9 100644 --- a/src/context/cdo.h +++ b/src/context/cdo.h @@ -56,10 +56,7 @@ protected: */ ContextObj* save(ContextMemoryManager* pCMM) override { - Debug("context") << "save cdo " << this; - ContextObj* p = new(pCMM) CDO(*this); - Debug("context") << " to " << p << std::endl; - return p; + return new (pCMM) CDO(*this); } /** @@ -68,10 +65,8 @@ protected: */ void restore(ContextObj* pContextObj) override { - //Debug("context") << "restore cdo " << this; CDO* p = static_cast*>(pContextObj); d_data = p->d_data; - //Debug("context") << " to " << get() << std::endl; // Explicitly call destructor as it will not otherwise get called. p->d_data.~T(); } diff --git a/src/context/cdqueue.h b/src/context/cdqueue.h index b95890a01..405553cd9 100644 --- a/src/context/cdqueue.h +++ b/src/context/cdqueue.h @@ -65,13 +65,6 @@ protected: // We save the d_size in d_lastsave and we should never destruct below this // indices before the corresponding restore. d_lastsave = ParentType::d_size; - Debug("cdqueue") << "save " << this - << " at level " << this->getContext()->getLevel() - << " size at " << this->d_size - << " iter at " << this->d_iter - << " lastsave at " << this->d_lastsave - << " d_list is " << this->d_list - << " data:" << data << std::endl; return data; } diff --git a/src/context/context.cpp b/src/context/context.cpp index 71f77f3ae..774d92084 100644 --- a/src/context/context.cpp +++ b/src/context/context.cpp @@ -135,17 +135,9 @@ void Context::addNotifyObjPost(ContextNotifyObj* pCNO) { void ContextObj::update() { - Debug("context") << "before update(" << this << "):" << std::endl - << "context is " << getContext() << std::endl - << *getContext() << std::endl; - // Call save() to save the information in the current object ContextObj* pContextObjSaved = save(d_pScope->getCMM()); - Debug("context") << "in update(" << this << ") with restore " - << pContextObjSaved << ": waypoint 1" << std::endl - << *getContext() << std::endl; - // Check that base class data was saved Assert((pContextObjSaved->d_pContextObjNext == d_pContextObjNext && pContextObjSaved->d_ppContextObjPrev == d_ppContextObjPrev @@ -155,27 +147,10 @@ void ContextObj::update() // Link the "saved" object in place of this ContextObj in the scope // we're moving it FROM. - Debug("context") << "in update(" << this - << "): next() == " << next() << std::endl; if(next() != NULL) { - Debug("context") << "in update(" << this - << "): next()->prev() == " << next()->prev() << std::endl; next()->prev() = &pContextObjSaved->next(); - Debug("context") << "in update(" << this - << "): next()->prev() is now " - << next()->prev() << std::endl; } - Debug("context") << "in update(" << this - << "): prev() == " << prev() << std::endl; - Debug("context") << "in update(" << this - << "): *prev() == " << *prev() << std::endl; *prev() = pContextObjSaved; - Debug("context") << "in update(" << this - << "): *prev() is now " << *prev() << std::endl; - - Debug("context") << "in update(" << this << ") with restore " - << pContextObjSaved << ": waypoint 3" << std::endl - << *getContext() << std::endl; // Update Scope pointer to current top Scope d_pScope = d_pScope->getContext()->getTopScope(); @@ -186,10 +161,6 @@ void ContextObj::update() // Insert object into the list of objects that need to be restored when this // Scope is popped. d_pScope->addToChain(this); - - Debug("context") << "after update(" << this << ") with restore " - << pContextObjSaved << ":" << std::endl - << *getContext() << std::endl; } ContextObj* ContextObj::restoreAndContinue() @@ -205,7 +176,7 @@ ContextObj* ContextObj::restoreAndContinue() // Assert(d_pScope == d_pScope->getContext()->getBottomScope()) << // "Expected bottom scope"; - Debug("context") << "NULL restore object! " << this << std::endl; + Trace("context") << "NULL restore object! " << this << std::endl; pContextObjNext = d_pContextObjNext; d_pScope = nullptr; @@ -244,7 +215,7 @@ void ContextObj::destroy() Assert(d_pScope != nullptr); /* Context can be big and complicated, so we only want to process this output * if we're really going to use it. (Same goes below.) */ - Debug("context") << "before destroy " << this << " (level " << getLevel() + Trace("context") << "before destroy " << this << " (level " << getLevel() << "):" << std::endl << *getContext() << std::endl; for (;;) @@ -262,13 +233,9 @@ void ContextObj::destroy() { break; } - Debug("context") << "in destroy " << this << ", restore object is " - << d_pContextObjRestore << " at level " - << d_pContextObjRestore->getLevel() << ":" << std::endl - << *getContext() << std::endl; restoreAndContinue(); } - Debug("context") << "after destroy " << this << ":" << std::endl + Trace("context") << "after destroy " << this << ":" << std::endl << *getContext() << std::endl; } @@ -280,7 +247,7 @@ ContextObj::ContextObj(Context* pContext) : d_ppContextObjPrev(NULL) { Assert(pContext != NULL) << "NULL context pointer"; - Debug("context") << "create new ContextObj(" << this << " inCMM=false)" << std::endl; + Trace("context") << "create new ContextObj(" << this << " inCMM=false)" << std::endl; d_pScope = pContext->getBottomScope(); d_pScope->addToChain(this); } @@ -293,7 +260,7 @@ ContextObj::ContextObj(bool allocatedInCMM, Context* pContext) : d_ppContextObjPrev(NULL) { Assert(pContext != NULL) << "NULL context pointer"; - Debug("context") << "create new ContextObj(" << this << " inCMM=" << allocatedInCMM << ")" << std::endl; + Trace("context") << "create new ContextObj(" << this << " inCMM=" << allocatedInCMM << ")" << std::endl; if(allocatedInCMM) { d_pScope = pContext->getTopScope(); } else { diff --git a/src/context/context.h b/src/context/context.h index e0f3f88e3..7b59c946e 100644 --- a/src/context/context.h +++ b/src/context/context.h @@ -314,7 +314,6 @@ class Scope { */ static void* operator new(size_t size, ContextMemoryManager* pCMM) { - Trace("context_mm") << "Scope::new " << size << " in " << pCMM << std::endl; return pCMM->newData(size); } @@ -577,7 +576,6 @@ class ContextObj { * to be done using the restore method. */ static void* operator new(size_t size, ContextMemoryManager* pCMM) { - Trace("context_mm") << "Context::new " << size << " in " << pCMM << std::endl; return pCMM->newData(size); } @@ -640,7 +638,6 @@ class ContextObj { * ContextMemoryManager as an argument. */ void deleteSelf() { - Debug("context") << "deleteSelf(" << this << ") " << typeid(*this).name() << std::endl; this->~ContextObj(); ::operator delete(this); } diff --git a/src/context/context_mm.cpp b/src/context/context_mm.cpp index 9df5c357d..24f8879d9 100644 --- a/src/context/context_mm.cpp +++ b/src/context/context_mm.cpp @@ -108,9 +108,6 @@ void* ContextMemoryManager::newData(size_t size) { AlwaysAssert(d_nextFree <= d_endChunk) << "Request is bigger than memory chunk size"; } - Debug("context") << "ContextMemoryManager::newData(" << size - << ") returning " << res << " at level " - << d_chunkList.size() << std::endl; #ifdef CVC5_VALGRIND VALGRIND_MEMPOOL_ALLOC(this, static_cast(res), size); diff --git a/src/decision/justify_stack.cpp b/src/decision/justify_stack.cpp index 53350e2f6..1d7a85277 100644 --- a/src/decision/justify_stack.cpp +++ b/src/decision/justify_stack.cpp @@ -55,7 +55,7 @@ JustifyInfo* JustifyStack::getCurrent() void JustifyStack::pushToStack(TNode n, prop::SatValue desiredVal) { - if (Trace.isOn("jh-stack")) + if (TraceIsOn("jh-stack")) { for (size_t i = 0, ssize = d_stackSizeValid.get(); i < ssize; i++) { diff --git a/src/expr/attribute_internals.h b/src/expr/attribute_internals.h index 2ae216d3c..1589349ad 100644 --- a/src/expr/attribute_internals.h +++ b/src/expr/attribute_internals.h @@ -289,7 +289,7 @@ public: return BitIterator(); } /* - Debug.printf("boolattr", + Trace.printf("boolattr", "underlying word at 0x%p looks like 0x%016llx, bit is %u\n", &(*i).second, (uint64_t)((*i).second), @@ -313,7 +313,7 @@ public: return ConstBitIterator(); } /* - Debug.printf("boolattr", + Trace.printf("boolattr", "underlying word at 0x%p looks like 0x%016llx, bit is %u\n", &(*i).second, (uint64_t)((*i).second), diff --git a/src/expr/dtype.cpp b/src/expr/dtype.cpp index 4902b1562..cf51a5e0c 100644 --- a/src/expr/dtype.cpp +++ b/src/expr/dtype.cpp @@ -363,7 +363,7 @@ bool DType::isRecursiveSingleton(TypeNode t) const if (computeCardinalityRecSingleton(t, processing, d_cardUAssume[t])) { d_cardRecSingleton[t] = 1; - if (Trace.isOn("dt-card")) + if (TraceIsOn("dt-card")) { Trace("dt-card") << "DType " << getName() << " is recursive singleton, dependent upon " @@ -712,7 +712,7 @@ bool DType::hasNestedRecursion() const std::unordered_set types; std::map processed; getAlienSubfieldTypes(types, processed, false); - if (Trace.isOn("datatypes-init")) + if (TraceIsOn("datatypes-init")) { Trace("datatypes-init") << "Alien subfield types: " << std::endl; for (const TypeNode& t : types) diff --git a/src/expr/node.cpp b/src/expr/node.cpp index 00a530227..a19da6191 100644 --- a/src/expr/node.cpp +++ b/src/expr/node.cpp @@ -80,25 +80,25 @@ typedef expr::Attribute IsConstComputedAttr; template bool NodeTemplate::isConst() const { assertTNodeNotExpired(); - Debug("isConst") << "Node::isConst() for: " << *this << std::endl; + Trace("isConst") << "Node::isConst() for: " << *this << std::endl; if(isNull()) { return false; } switch(getMetaKind()) { case kind::metakind::CONSTANT: - Debug("isConst") << "Node::isConst() returning true, it's a CONSTANT" << std::endl; + Trace("isConst") << "Node::isConst() returning true, it's a CONSTANT" << std::endl; return true; case kind::metakind::VARIABLE: - Debug("isConst") << "Node::isConst() returning false, it's a VARIABLE" << std::endl; + Trace("isConst") << "Node::isConst() returning false, it's a VARIABLE" << std::endl; return false; default: if(getAttribute(IsConstComputedAttr())) { bool bval = getAttribute(IsConstAttr()); - Debug("isConst") << "Node::isConst() returning cached value " << (bval ? "true" : "false") << " for: " << *this << std::endl; + Trace("isConst") << "Node::isConst() returning cached value " << (bval ? "true" : "false") << " for: " << *this << std::endl; return bval; } else { bool bval = expr::TypeChecker::computeIsConst(NodeManager::currentNM(), *this); - Debug("isConst") << "Node::isConst() computed value " << (bval ? "true" : "false") << " for: " << *this << std::endl; + Trace("isConst") << "Node::isConst() computed value " << (bval ? "true" : "false") << " for: " << *this << std::endl; const_cast< NodeTemplate* >(this)->setAttribute(IsConstAttr(), bval); const_cast< NodeTemplate* >(this)->setAttribute(IsConstComputedAttr(), true); return bval; diff --git a/src/expr/node_algorithm.cpp b/src/expr/node_algorithm.cpp index 7a23d67c9..7f0f74815 100644 --- a/src/expr/node_algorithm.cpp +++ b/src/expr/node_algorithm.cpp @@ -274,7 +274,7 @@ bool hasBoundVar(TNode n) } n.setAttribute(HasBoundVarAttr(), hasBv); n.setAttribute(HasBoundVarComputedAttr(), true); - Debug("bva") << n << " has bva : " << n.getAttribute(HasBoundVarAttr()) + Trace("bva") << n << " has bva : " << n.getAttribute(HasBoundVarAttr()) << std::endl; return hasBv; } diff --git a/src/expr/node_builder.cpp b/src/expr/node_builder.cpp index 042e4442d..904157cb0 100644 --- a/src/expr/node_builder.cpp +++ b/src/expr/node_builder.cpp @@ -418,11 +418,11 @@ expr::NodeValue* NodeBuilder::constructNV() nv->d_id = d_nm->next_id++; // FIXME multithreading nv->d_rc = 0; setUsed(); - if (Debug.isOn("gc")) + if (TraceIsOn("gc")) { - Debug("gc") << "creating node value " << nv << " [" << nv->d_id << "]: "; - nv->printAst(Debug("gc")); - Debug("gc") << std::endl; + Trace("gc") << "creating node value " << nv << " [" << nv->d_id << "]: "; + nv->printAst(Trace("gc")); + Trace("gc") << std::endl; } return nv; } @@ -509,12 +509,12 @@ expr::NodeValue* NodeBuilder::constructNV() // poolNv = nv; d_nm->poolInsert(nv); - if (Debug.isOn("gc")) + if (TraceIsOn("gc")) { - Debug("gc") << "creating node value " << nv << " [" << nv->d_id + Trace("gc") << "creating node value " << nv << " [" << nv->d_id << "]: "; - nv->printAst(Debug("gc")); - Debug("gc") << std::endl; + nv->printAst(Trace("gc")); + Trace("gc") << std::endl; } return nv; } @@ -564,7 +564,7 @@ expr::NodeValue* NodeBuilder::constructNV() // poolNv = nv; d_nm->poolInsert(nv); - Debug("gc") << "creating node value " << nv << " [" << nv->d_id + Trace("gc") << "creating node value " << nv << " [" << nv->d_id << "]: " << *nv << "\n"; return nv; } diff --git a/src/expr/node_builder.h b/src/expr/node_builder.h index a7da518ab..c782d7870 100644 --- a/src/expr/node_builder.h +++ b/src/expr/node_builder.h @@ -103,7 +103,7 @@ * NOTE IN 1(b) AND 2(b) THAT we can NOT create Node wrapper * temporary for the NodeValue in the NodeBuilder::operator Node() * member function. If we create a temporary (for example by writing - * Debug("builder") << Node(nv) << endl), the NodeValue will have its + * Trace("builder") << Node(nv) << endl), the NodeValue will have its * reference count incremented from zero to one, then decremented, * which makes it eligible for collection before the builder has even * returned it! So this is a no-no. diff --git a/src/expr/node_manager_template.cpp b/src/expr/node_manager_template.cpp index e07b84273..05f84248c 100644 --- a/src/expr/node_manager_template.cpp +++ b/src/expr/node_manager_template.cpp @@ -61,12 +61,12 @@ struct ScopedBool { ScopedBool(bool& value) : d_value(value) { - Debug("gc") << ">> setting ScopedBool\n"; + Trace("gc") << ">> setting ScopedBool\n"; d_value = true; } ~ScopedBool() { - Debug("gc") << "<< clearing ScopedBool\n"; + Trace("gc") << "<< clearing ScopedBool\n"; d_value = false; } }; @@ -81,11 +81,11 @@ struct NVReclaim { NVReclaim(NodeValue*& deletionField) : d_deletionField(deletionField) { - Debug("gc") << ">> setting NVRECLAIM field\n"; + Trace("gc") << ">> setting NVRECLAIM field\n"; } ~NVReclaim() { - Debug("gc") << "<< clearing NVRECLAIM field\n"; + Trace("gc") << "<< clearing NVRECLAIM field\n"; d_deletionField = NULL; } }; @@ -269,7 +269,7 @@ NodeManager::~NodeManager() NodeValue* greatest_maxed_out = order.back(); order.pop_back(); Assert(greatest_maxed_out->HasMaximizedReferenceCount()); - Debug("gc") << "Force zombify " << greatest_maxed_out << std::endl; + Trace("gc") << "Force zombify " << greatest_maxed_out << std::endl; greatest_maxed_out->d_rc = 0; markForDeletion(greatest_maxed_out); } @@ -284,18 +284,18 @@ NodeManager::~NodeManager() poolRemove(&expr::NodeValue::null()); } - if (Debug.isOn("gc:leaks")) + if (TraceIsOn("gc:leaks")) { - Debug("gc:leaks") << "still in pool:" << endl; + Trace("gc:leaks") << "still in pool:" << endl; for (NodeValuePool::const_iterator i = d_nodeValuePool.begin(), iend = d_nodeValuePool.end(); i != iend; ++i) { - Debug("gc:leaks") << " " << *i << " id=" << (*i)->d_id + Trace("gc:leaks") << " " << *i << " id=" << (*i)->d_id << " rc=" << (*i)->d_rc << " " << **i << endl; } - Debug("gc:leaks") << ":end:" << endl; + Trace("gc:leaks") << ":end:" << endl; } // defensive coding, in case destruction-order issues pop up (they often do) @@ -316,7 +316,7 @@ void NodeManager::reclaimZombies() // FIXME multithreading Assert(!d_attrManager->inGarbageCollection()); - Debug("gc") << "reclaiming " << d_zombies.size() << " zombie(s)!\n"; + Trace("gc") << "reclaiming " << d_zombies.size() << " zombie(s)!\n"; // during reclamation, reclaimZombies() is never supposed to be called Assert(!d_inReclaimZombies) @@ -367,12 +367,12 @@ void NodeManager::reclaimZombies() // collect ONLY IF still zero if (nv->d_rc == 0) { - if (Debug.isOn("gc")) + if (TraceIsOn("gc")) { - Debug("gc") << "deleting node value " << nv << " [" << nv->d_id + Trace("gc") << "deleting node value " << nv << " [" << nv->d_id << "]: "; - nv->printAst(Debug("gc")); - Debug("gc") << endl; + nv->printAst(Trace("gc")); + Trace("gc") << endl; } // remove from the pool @@ -441,7 +441,7 @@ std::vector NodeManager::TopologicalSort( { NodeValue* current = stack.back().second; const bool visited_children = stack.back().first; - Debug("gc") << "Topological sort " << current << " " << visited_children + Trace("gc") << "Topological sort " << current << " " << visited_children << std::endl; if (visited_children) { @@ -477,7 +477,7 @@ TypeNode NodeManager::getType(TNode n, bool check) bool hasType = getAttribute(n, TypeAttr(), typeNode); bool needsCheck = check && !getAttribute(n, TypeCheckedAttr()); - Debug("getType") << this << " getting type for " << &n << " " << n + Trace("getType") << this << " getting type for " << &n << " " << n << ", check=" << check << ", needsCheck = " << needsCheck << ", hasType = " << hasType << endl; @@ -536,7 +536,7 @@ TypeNode NodeManager::getType(TNode n, bool check) /* The check should have happened, if we asked for it. */ Assert(!check || getAttribute(n, TypeCheckedAttr())); - Debug("getType") << "type of " << &n << " " << n << " is " << typeNode + Trace("getType") << "type of " << &n << " " << n << " is " << typeNode << endl; return typeNode; } @@ -545,7 +545,7 @@ TypeNode NodeManager::mkBagType(TypeNode elementType) { CheckArgument( !elementType.isNull(), elementType, "unexpected NULL element type"); - Debug("bags") << "making bags type " << elementType << std::endl; + Trace("bags") << "making bags type " << elementType << std::endl; return mkTypeNode(kind::BAG_TYPE, elementType); } @@ -764,7 +764,7 @@ TypeNode NodeManager::TupleTypeCache::getTupleType(NodeManager* nm, } dt.addConstructor(c); d_data = nm->mkDatatypeType(dt); - Debug("tuprec-debug") << "Return type : " << d_data << std::endl; + Trace("tuprec-debug") << "Return type : " << d_data << std::endl; } return d_data; } @@ -800,7 +800,7 @@ TypeNode NodeManager::RecTypeCache::getRecordType(NodeManager* nm, } dt.addConstructor(c); d_data = nm->mkDatatypeType(dt); - Debug("tuprec-debug") << "Return type : " << d_data << std::endl; + Trace("tuprec-debug") << "Return type : " << d_data << std::endl; } return d_data; } @@ -844,16 +844,16 @@ TypeNode NodeManager::mkFunctionType(const std::vector& argTypes, TypeNode NodeManager::mkTupleType(const std::vector& types) { std::vector ts; - Debug("tuprec-debug") << "Make tuple type : "; + Trace("tuprec-debug") << "Make tuple type : "; for (unsigned i = 0; i < types.size(); ++i) { CheckArgument(!types[i].isFunctionLike(), types, "cannot put function-like types in tuples"); ts.push_back(types[i]); - Debug("tuprec-debug") << types[i] << " "; + Trace("tuprec-debug") << types[i] << " "; } - Debug("tuprec-debug") << std::endl; + Trace("tuprec-debug") << std::endl; return d_tt_cache.getTupleType(this, ts); } @@ -1213,11 +1213,11 @@ NodeClass NodeManager::mkConstInternal(Kind k, const T& val) new (&nv->d_children) T(val); poolInsert(nv); - if (Debug.isOn("gc")) + if (TraceIsOn("gc")) { - Debug("gc") << "creating node value " << nv << " [" << nv->d_id << "]: "; - nv->printAst(Debug("gc")); - Debug("gc") << std::endl; + Trace("gc") << "creating node value " << nv << " [" << nv->d_id << "]: "; + nv->printAst(Trace("gc")); + Trace("gc") << std::endl; } return NodeClass(nv); diff --git a/src/expr/node_manager_template.h b/src/expr/node_manager_template.h index 94e746410..9db31d87c 100644 --- a/src/expr/node_manager_template.h +++ b/src/expr/node_manager_template.h @@ -936,12 +936,12 @@ class NodeManager // if d_reclaiming is set, make sure we don't call // reclaimZombies(), because it's already running. - if (Debug.isOn("gc")) + if (TraceIsOn("gc")) { - Debug("gc") << "zombifying node value " << nv << " [" << nv->d_id + Trace("gc") << "zombifying node value " << nv << " [" << nv->d_id << "]: "; - nv->printAst(Debug("gc")); - Debug("gc") << (d_inReclaimZombies ? " [CURRENTLY-RECLAIMING]" : "") + nv->printAst(Trace("gc")); + Trace("gc") << (d_inReclaimZombies ? " [CURRENTLY-RECLAIMING]" : "") << std::endl; } @@ -969,9 +969,9 @@ class NodeManager inline void markRefCountMaxedOut(expr::NodeValue* nv) { Assert(nv->HasMaximizedReferenceCount()); - if (Debug.isOn("gc")) + if (TraceIsOn("gc")) { - Debug("gc") << "marking node value " << nv << " [" << nv->d_id + Trace("gc") << "marking node value " << nv << " [" << nv->d_id << "]: as maxed out" << std::endl; } d_maxedOut.push_back(nv); @@ -1077,7 +1077,7 @@ inline TypeNode NodeManager::mkArrayType(TypeNode indexType, "unexpected NULL index type"); CheckArgument(!constituentType.isNull(), constituentType, "unexpected NULL constituent type"); - Debug("arrays") << "making array type " << indexType << " " + Trace("arrays") << "making array type " << indexType << " " << constituentType << std::endl; return mkTypeNode(kind::ARRAY_TYPE, indexType, constituentType); } @@ -1085,7 +1085,7 @@ inline TypeNode NodeManager::mkArrayType(TypeNode indexType, inline TypeNode NodeManager::mkSetType(TypeNode elementType) { CheckArgument(!elementType.isNull(), elementType, "unexpected NULL element type"); - Debug("sets") << "making sets type " << elementType << std::endl; + Trace("sets") << "making sets type " << elementType << std::endl; return mkTypeNode(kind::SET_TYPE, elementType); } diff --git a/src/expr/symbol_table.cpp b/src/expr/symbol_table.cpp index c74548d97..66b690a89 100644 --- a/src/expr/symbol_table.cpp +++ b/src/expr/symbol_table.cpp @@ -441,15 +441,15 @@ void SymbolTable::Implementation::bindType(const string& name, const vector& params, api::Sort t) { - if (Debug.isOn("sort")) { - Debug("sort") << "bindType(" << name << ", ["; + if (TraceIsOn("sort")) { + Trace("sort") << "bindType(" << name << ", ["; if (params.size() > 0) { copy(params.begin(), params.end() - 1, - ostream_iterator(Debug("sort"), ", ")); - Debug("sort") << params.back(); + ostream_iterator(Trace("sort"), ", ")); + Trace("sort") << params.back(); } - Debug("sort") << "], " << t << ")" << endl; + Trace("sort") << "], " << t << ")" << endl; } d_typeMap.insert(name, make_pair(params, t)); @@ -490,20 +490,20 @@ api::Sort SymbolTable::Implementation::lookupType( return p.second.instantiate(params); } bool isSortConstructor = p.second.isSortConstructor(); - if (Debug.isOn("sort")) + if (TraceIsOn("sort")) { - Debug("sort") << "instantiating using a sort " + Trace("sort") << "instantiating using a sort " << (isSortConstructor ? "constructor" : "substitution") << std::endl; - Debug("sort") << "have formals ["; + Trace("sort") << "have formals ["; copy(p.first.begin(), p.first.end() - 1, - ostream_iterator(Debug("sort"), ", ")); - Debug("sort") << p.first.back() << "]" << std::endl << "parameters ["; + ostream_iterator(Trace("sort"), ", ")); + Trace("sort") << p.first.back() << "]" << std::endl << "parameters ["; copy(params.begin(), params.end() - 1, - ostream_iterator(Debug("sort"), ", ")); - Debug("sort") << params.back() << "]" << endl + ostream_iterator(Trace("sort"), ", ")); + Trace("sort") << params.back() << "]" << endl << "type ctor " << name << std::endl << "type is " << p.second << std::endl; } @@ -511,7 +511,7 @@ api::Sort SymbolTable::Implementation::lookupType( ? p.second.instantiate(params) : p.second.substitute(p.first, params); - Debug("sort") << "instance is " << instantiation << std::endl; + Trace("sort") << "instance is " << instantiation << std::endl; return instantiation; } diff --git a/src/expr/type_checker_template.cpp b/src/expr/type_checker_template.cpp index af9b9b876..47adb17b1 100644 --- a/src/expr/type_checker_template.cpp +++ b/src/expr/type_checker_template.cpp @@ -47,7 +47,7 @@ ${typerules} // clang-format on default: - Debug("getType") << "FAILURE" << std::endl; + Trace("getType") << "FAILURE" << std::endl; Unhandled() << " " << n.getKind(); } diff --git a/src/expr/type_matcher.cpp b/src/expr/type_matcher.cpp index df6639b78..cd244df14 100644 --- a/src/expr/type_matcher.cpp +++ b/src/expr/type_matcher.cpp @@ -27,12 +27,12 @@ void TypeMatcher::addTypesFromDatatype(TypeNode dt) { std::vector argTypes = dt.getParamTypes(); addTypes(argTypes); - Debug("typecheck-idt") << "instantiating matcher for " << dt << std::endl; + Trace("typecheck-idt") << "instantiating matcher for " << dt << std::endl; for (unsigned i = 0, narg = argTypes.size(); i < narg; ++i) { if (dt.isParameterInstantiatedDatatype(i)) { - Debug("typecheck-idt") + Trace("typecheck-idt") << "++ instantiate param " << i << " : " << d_types[i] << std::endl; d_match[i] = d_types[i]; } @@ -55,7 +55,7 @@ void TypeMatcher::addTypes(const std::vector& types) bool TypeMatcher::doMatching(TypeNode pattern, TypeNode tn) { - Debug("typecheck-idt") << "doMatching() : " << pattern << " : " << tn + Trace("typecheck-idt") << "doMatching() : " << pattern << " : " << tn << std::endl; std::vector::iterator i = std::find(d_types.begin(), d_types.end(), pattern); @@ -64,7 +64,7 @@ bool TypeMatcher::doMatching(TypeNode pattern, TypeNode tn) size_t index = i - d_types.begin(); if (!d_match[index].isNull()) { - Debug("typecheck-idt") + Trace("typecheck-idt") << "check subtype " << tn << " " << d_match[index] << std::endl; TypeNode tnn = TypeNode::leastCommonTypeNode(tn, d_match[index]); // recognize subtype relation diff --git a/src/main/driver_unified.cpp b/src/main/driver_unified.cpp index 49ddfbc29..f104f3fa7 100644 --- a/src/main/driver_unified.cpp +++ b/src/main/driver_unified.cpp @@ -146,7 +146,6 @@ int runCvc5(int argc, char* argv[], std::unique_ptr& solver) // Determine which messages to show based on smtcomp_mode and verbosity if(Configuration::isMuzzledBuild()) { - DebugChannel.setStream(&cvc5::null_os); TraceChannel.setStream(&cvc5::null_os); WarningChannel.setStream(&cvc5::null_os); } diff --git a/src/main/interactive_shell.cpp b/src/main/interactive_shell.cpp index 1a0795ddc..b6ded9b94 100644 --- a/src/main/interactive_shell.cpp +++ b/src/main/interactive_shell.cpp @@ -220,7 +220,7 @@ restart: string input = ""; while(true) { - Debug("interactive") << "Input now '" << input << line << "'" << endl + Trace("interactive") << "Input now '" << input << line << "'" << endl << flush; Assert(!(d_in.fail() && !d_in.eof()) || line.empty()); @@ -264,7 +264,7 @@ restart: /* Extract the newline delimiter from the stream too */ int c CVC5_UNUSED = d_in.get(); Assert(c == '\n'); - Debug("interactive") << "Next char is '" << (char)c << "'" << endl + Trace("interactive") << "Next char is '" << (char)c << "'" << endl << flush; } @@ -296,7 +296,7 @@ restart: } } else { /* No continuation, we're done. */ - Debug("interactive") << "Leaving input loop." << endl << flush; + Trace("interactive") << "Leaving input loop." << endl << flush; break; } } @@ -382,8 +382,8 @@ restart: #if HAVE_LIBEDITLINE char** commandCompletion(const char* text, int start, int end) { - Debug("rl") << "text: " << text << endl; - Debug("rl") << "start: " << start << " end: " << end << endl; + Trace("rl") << "text: " << text << endl; + Trace("rl") << "start: " << start << " end: " << end << endl; return rl_completion_matches(text, commandGenerator); } diff --git a/src/main/options_template.cpp b/src/main/options_template.cpp index 3d0e1ccf9..eedf4e04c 100644 --- a/src/main/options_template.cpp +++ b/src/main/options_template.cpp @@ -123,14 +123,14 @@ void parseInternal(api::Solver& solver, std::vector& nonoptions) { Assert(argv != nullptr); - if (Debug.isOn("options")) + if (TraceIsOn("options")) { - Debug("options") << "starting a new parseInternal with " << argc + Trace("options") << "starting a new parseInternal with " << argc << " arguments" << std::endl; for (int i = 0; i < argc; ++i) { Assert(argv[i] != nullptr); - Debug("options") << " argv[" << i << "] = " << argv[i] << std::endl; + Trace("options") << " argv[" << i << "] = " << argv[i] << std::endl; } } @@ -159,17 +159,17 @@ void parseInternal(api::Solver& solver, // non-option. if (main_optind > 0 && main_optind < argc && argv[main_optind][0] != '-') { - Debug("options") << "enqueueing " << argv[main_optind] + Trace("options") << "enqueueing " << argv[main_optind] << " as a non-option." << std::endl; nonoptions.push_back(argv[main_optind]); ++main_optind; continue; } - Debug("options") << "[ before, main_optind == " << main_optind << " ]" + Trace("options") << "[ before, main_optind == " << main_optind << " ]" << std::endl; - Debug("options") << "[ before, optind == " << optind << " ]" << std::endl; - Debug("options") << "[ argc == " << argc << ", argv == " << argv << " ]" + Trace("options") << "[ before, optind == " << optind << " ]" << std::endl; + Trace("options") << "[ argc == " << argc << ", argv == " << argv << " ]" << std::endl; // clang-format off int c = getopt_long(argc, argv, @@ -179,7 +179,7 @@ void parseInternal(api::Solver& solver, main_optind = optind; - Debug("options") << "[ got " << int(c) << " (" << char(c) << ") ]" + Trace("options") << "[ got " << int(c) << " (" << char(c) << ") ]" << "[ next option will be at pos: " << optind << " ]" << std::endl; @@ -194,12 +194,12 @@ void parseInternal(api::Solver& solver, if (c == -1) { - if (Debug.isOn("options")) + if (TraceIsOn("options")) { - Debug("options") << "done with option parsing" << std::endl; + Trace("options") << "done with option parsing" << std::endl; for (int index = optind; index < argc; ++index) { - Debug("options") << "remaining " << argv[index] << std::endl; + Trace("options") << "remaining " << argv[index] << std::endl; } } break; @@ -208,7 +208,7 @@ void parseInternal(api::Solver& solver, std::string option = argv[old_optind == 0 ? 1 : old_optind]; std::string optionarg = (optarg == nullptr) ? "" : optarg; - Debug("preemptGetopt") << "processing option " << c << " (`" << char(c) + Trace("preemptGetopt") << "processing option " << c << " (`" << char(c) << "'), " << option << std::endl; switch (c) @@ -229,7 +229,7 @@ void parseInternal(api::Solver& solver, } } - Debug("options") << "got " << nonoptions.size() << " non-option arguments." + Trace("options") << "got " << nonoptions.size() << " non-option arguments." << std::endl; } @@ -252,9 +252,9 @@ std::vector parse(api::Solver& solver, // To debug options parsing, you may prefer to simply uncomment this // and recompile. Debug flags have not been parsed yet so these have // not been set. - // DebugChannel.on("options"); + // TraceChannel.on("options"); - Debug("options") << "argv == " << argv << std::endl; + Trace("options") << "argv == " << argv << std::endl; // Find the base name of the program. const char* x = strrchr(progName, '/'); @@ -266,11 +266,11 @@ std::vector parse(api::Solver& solver, std::vector nonoptions; parseInternal(solver, argc, argv, nonoptions); - if (Debug.isOn("options")) + if (TraceIsOn("options")) { for (const auto& no : nonoptions) { - Debug("options") << "nonoptions " << no << std::endl; + Trace("options") << "nonoptions " << no << std::endl; } } diff --git a/src/options/options_handler.cpp b/src/options/options_handler.cpp index fc699b403..82bb6af76 100644 --- a/src/options/options_handler.cpp +++ b/src/options/options_handler.cpp @@ -107,9 +107,8 @@ OptionsHandler::OptionsHandler(Options* options) : d_options(options) { } void OptionsHandler::setErrStream(const std::string& flag, const ManagedErr& me) { - Debug.setStream(me); Warning.setStream(me); - Trace.setStream(me); + TraceChannel.setStream(me); } Language OptionsHandler::stringToLanguage(const std::string& flag, @@ -165,7 +164,6 @@ void OptionsHandler::applyOutputLanguage(const std::string& flag, Language lang) void OptionsHandler::setVerbosity(const std::string& flag, int value) { if(Configuration::isMuzzledBuild()) { - DebugChannel.setStream(&cvc5::null_os); TraceChannel.setStream(&cvc5::null_os); WarningChannel.setStream(&cvc5::null_os); } else { @@ -250,7 +248,7 @@ void OptionsHandler::enableTraceTag(const std::string& flag, } for (const auto& tag: tags) { - Trace.on(tag); + TraceChannel.on(tag); } } @@ -281,8 +279,7 @@ void OptionsHandler::enableDebugTag(const std::string& flag, optarg, Configuration::getTraceTags())); } - Debug.on(optarg); - Trace.on(optarg); + TraceChannel.on(optarg); } void OptionsHandler::enableOutputTag(const std::string& flag, @@ -296,8 +293,7 @@ void OptionsHandler::enableOutputTag(const std::string& flag, void OptionsHandler::setPrintSuccess(const std::string& flag, bool value) { - Debug.getStream() << Command::printsuccess(value); - Trace.getStream() << Command::printsuccess(value); + TraceChannel.getStream() << Command::printsuccess(value); Warning.getStream() << Command::printsuccess(value); *d_options->base.out << Command::printsuccess(value); } @@ -364,16 +360,14 @@ void OptionsHandler::checkBvSatSolver(const std::string& flag, SatSolverMode m) void OptionsHandler::setDefaultExprDepth(const std::string& flag, int64_t depth) { ioutils::setDefaultNodeDepth(depth); - ioutils::applyNodeDepth(Debug.getStream(), depth); - ioutils::applyNodeDepth(Trace.getStream(), depth); + ioutils::applyNodeDepth(TraceChannel.getStream(), depth); ioutils::applyNodeDepth(Warning.getStream(), depth); } void OptionsHandler::setDefaultDagThresh(const std::string& flag, int64_t dag) { ioutils::setDefaultDagThresh(dag); - ioutils::applyDagThresh(Debug.getStream(), dag); - ioutils::applyDagThresh(Trace.getStream(), dag); + ioutils::applyDagThresh(TraceChannel.getStream(), dag); ioutils::applyDagThresh(Warning.getStream(), dag); } diff --git a/src/parser/antlr_input.cpp b/src/parser/antlr_input.cpp index 1402ed7bb..a45b20201 100644 --- a/src/parser/antlr_input.cpp +++ b/src/parser/antlr_input.cpp @@ -374,9 +374,9 @@ std::string parseErrorHelper(const char* lineStart, // we found the right place string word = slice.substr(caretPos, (caretPosOrig - caretPos + 1)); size_t matchLoc = wholeWordMatch(message, word, isSimpleChar); - Debug("friendlyparser") << "[friendlyparser] matchLoc = " << matchLoc << endl; + Trace("friendlyparser") << "[friendlyparser] matchLoc = " << matchLoc << endl; if( matchLoc != string::npos ) { - Debug("friendlyparser") << "[friendlyparser] Feeling good." << std::endl; + Trace("friendlyparser") << "[friendlyparser] Feeling good." << std::endl; } } } else { @@ -397,10 +397,10 @@ std::string parseErrorHelper(const char* lineStart, } string word = slice.substr(nearestWordSt, (nearestWordEn - nearestWordSt + 1)); size_t matchLoc = wholeWordMatch(message, word, isSimpleChar); - Debug("friendlyparser") << "[friendlyparser] nearest word = " << word << std::endl; - Debug("friendlyparser") << "[friendlyparser] matchLoc = " << matchLoc << endl; + Trace("friendlyparser") << "[friendlyparser] nearest word = " << word << std::endl; + Trace("friendlyparser") << "[friendlyparser] matchLoc = " << matchLoc << endl; if( matchLoc != string::npos ) { - Debug("friendlyparser") << "[friendlyparser] strong evidence that caret should be at " + Trace("friendlyparser") << "[friendlyparser] strong evidence that caret should be at " << nearestWordSt << std::endl; foundCaretPos = true; } @@ -438,7 +438,7 @@ void AntlrInput::parseError(const std::string& message, bool eofException) d_lexer->getCharPositionInLine(d_lexer), message); - Debug("parser") << "Throwing exception: " + Trace("parser") << "Throwing exception: " << (const char*)d_lexer->rec->state->tokSource->fileName->chars << ":" << d_lexer->getLine(d_lexer) << "." << d_lexer->getCharPositionInLine(d_lexer) << ": " diff --git a/src/parser/antlr_input.h b/src/parser/antlr_input.h index 10306822e..d7fb2fd11 100644 --- a/src/parser/antlr_input.h +++ b/src/parser/antlr_input.h @@ -220,7 +220,7 @@ inline std::string AntlrInput::tokenText(pANTLR3_COMMON_TOKEN token) { /* start and end are boundary pointers. The text is a string * of (end-start+1) bytes beginning at start. */ std::string txt( (const char *)start, end-start+1 ); - Debug("parser-extra") << "tokenText: start=" << start << std::endl + Trace("parser-extra") << "tokenText: start=" << start << std::endl << "end=" << end << std::endl << "txt='" << txt << "'" << std::endl; return txt; diff --git a/src/parser/antlr_line_buffered_input.cpp b/src/parser/antlr_line_buffered_input.cpp index 0657f6c7e..c04ee8fb8 100644 --- a/src/parser/antlr_line_buffered_input.cpp +++ b/src/parser/antlr_line_buffered_input.cpp @@ -268,7 +268,7 @@ static void bufferedInputConsume(pANTLR3_INT_STREAM is) { input->charPositionInLine = 0; input->currentLine = line_buffered_input->line_buffer->getPtr( input->line, input->charPositionInLine); - Debug("pipe") << "-- newline!" << std::endl; + Trace("pipe") << "-- newline!" << std::endl; } input->nextChar = line_buffered_input->line_buffer->getPtr( diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp index 6c04a3ad6..9969602c4 100644 --- a/src/parser/parser.cpp +++ b/src/parser/parser.cpp @@ -204,7 +204,7 @@ api::Term Parser::bindVar(const std::string& name, const api::Sort& type, bool doOverload) { - Debug("parser") << "bindVar(" << name << ", " << type << ")" << std::endl; + Trace("parser") << "bindVar(" << name << ", " << type << ")" << std::endl; api::Term expr = d_solver->mkConst(type, name); defineVar(name, expr, doOverload); return expr; @@ -212,7 +212,7 @@ api::Term Parser::bindVar(const std::string& name, api::Term Parser::bindBoundVar(const std::string& name, const api::Sort& type) { - Debug("parser") << "bindBoundVar(" << name << ", " << type << ")" + Trace("parser") << "bindBoundVar(" << name << ", " << type << ")" << std::endl; api::Term expr = d_solver->mkVar(type, name); defineVar(name, expr); @@ -255,7 +255,7 @@ void Parser::defineVar(const std::string& name, const api::Term& val, bool doOverload) { - Debug("parser") << "defineVar( " << name << " := " << val << ")" << std::endl; + Trace("parser") << "defineVar( " << name << " := " << val << ")" << std::endl; if (!d_symtab->bind(name, val, doOverload)) { std::stringstream ss; @@ -291,23 +291,23 @@ void Parser::defineParameterizedType(const std::string& name, const std::vector& params, const api::Sort& type) { - if (Debug.isOn("parser")) { - Debug("parser") << "defineParameterizedType(" << name << ", " + if (TraceIsOn("parser")) { + Trace("parser") << "defineParameterizedType(" << name << ", " << params.size() << ", ["; if (params.size() > 0) { copy(params.begin(), params.end() - 1, - ostream_iterator(Debug("parser"), ", ")); - Debug("parser") << params.back(); + ostream_iterator(Trace("parser"), ", ")); + Trace("parser") << params.back(); } - Debug("parser") << "], " << type << ")" << std::endl; + Trace("parser") << "], " << type << ")" << std::endl; } defineType(name, params, type); } api::Sort Parser::mkSort(const std::string& name) { - Debug("parser") << "newSort(" << name << ")" << std::endl; + Trace("parser") << "newSort(" << name << ")" << std::endl; api::Sort type = d_solver->mkUninterpretedSort(name); defineType(name, type); return type; @@ -315,7 +315,7 @@ api::Sort Parser::mkSort(const std::string& name) api::Sort Parser::mkSortConstructor(const std::string& name, size_t arity) { - Debug("parser") << "newSortConstructor(" << name << ", " << arity << ")" + Trace("parser") << "newSortConstructor(" << name << ", " << arity << ")" << std::endl; api::Sort type = d_solver->mkSortConstructorSort(name, arity); defineType(name, vector(arity), type); @@ -342,7 +342,7 @@ api::Sort Parser::mkUnresolvedTypeConstructor(const std::string& name, api::Sort Parser::mkUnresolvedTypeConstructor( const std::string& name, const std::vector& params) { - Debug("parser") << "newSortConstructor(P)(" << name << ", " << params.size() + Trace("parser") << "newSortConstructor(P)(" << name << ", " << params.size() << ")" << std::endl; api::Sort unresolved = d_solver->mkSortConstructorSort(name, params.size()); defineType(name, params, unresolved); @@ -380,7 +380,7 @@ std::vector Parser::bindMutualDatatypeTypes( api::Sort t = types[i]; const api::Datatype& dt = t.getDatatype(); const std::string& name = dt.getName(); - Debug("parser-idt") << "define " << name << " as " << t << std::endl; + Trace("parser-idt") << "define " << name << " as " << t << std::endl; if (isDeclared(name, SYM_SORT)) { throw ParserException(name + " already declared"); } @@ -399,7 +399,7 @@ std::vector Parser::bindMutualDatatypeTypes( { const api::DatatypeConstructor& ctor = dt[j]; api::Term constructor = ctor.getConstructorTerm(); - Debug("parser-idt") << "+ define " << constructor << std::endl; + Trace("parser-idt") << "+ define " << constructor << std::endl; string constructorName = ctor.getName(); if(consNames.find(constructorName)==consNames.end()) { if(!doOverload) { @@ -414,7 +414,7 @@ std::vector Parser::bindMutualDatatypeTypes( if (getTesterName(constructor, testerName)) { api::Term tester = ctor.getTesterTerm(); - Debug("parser-idt") << "+ define " << testerName << std::endl; + Trace("parser-idt") << "+ define " << testerName << std::endl; if (!doOverload) { checkDeclaration(testerName, CHECK_UNDECLARED); @@ -425,7 +425,7 @@ std::vector Parser::bindMutualDatatypeTypes( { const api::DatatypeSelector& sel = ctor[k]; api::Term selector = sel.getSelectorTerm(); - Debug("parser-idt") << "+++ define " << selector << std::endl; + Trace("parser-idt") << "+++ define " << selector << std::endl; string selectorName = sel.getName(); if(selNames.find(selectorName)==selNames.end()) { if(!doOverload) { @@ -491,14 +491,14 @@ api::Sort Parser::mkFlatFunctionType(std::vector& sorts, // no difference return range; } - if (Debug.isOn("parser")) + if (TraceIsOn("parser")) { - Debug("parser") << "mkFlatFunctionType: range " << range << " and domains "; + Trace("parser") << "mkFlatFunctionType: range " << range << " and domains "; for (api::Sort t : sorts) { - Debug("parser") << " " << t; + Trace("parser") << " " << t; } - Debug("parser") << "\n"; + Trace("parser") << "\n"; } while (range.isFunction()) { @@ -665,7 +665,7 @@ void Parser::addOperator(api::Kind kind) { d_logicOperators.insert(kind); } void Parser::preemptCommand(Command* cmd) { d_commandQueue.push_back(cmd); } Command* Parser::nextCommand() { - Debug("parser") << "nextCommand()" << std::endl; + Trace("parser") << "nextCommand()" << std::endl; Command* cmd = NULL; if (!d_commandQueue.empty()) { cmd = d_commandQueue.front(); @@ -686,13 +686,13 @@ Command* Parser::nextCommand() parseError(e.what()); } } - Debug("parser") << "nextCommand() => " << cmd << std::endl; + Trace("parser") << "nextCommand() => " << cmd << std::endl; return cmd; } api::Term Parser::nextExpression() { - Debug("parser") << "nextExpression()" << std::endl; + Trace("parser") << "nextExpression()" << std::endl; api::Term result; if (!done()) { try { @@ -706,7 +706,7 @@ api::Term Parser::nextExpression() parseError(e.what()); } } - Debug("parser") << "nextExpression() => " << result << std::endl; + Trace("parser") << "nextExpression() => " << result << std::endl; return result; } diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index ae935b7aa..40446874d 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -233,7 +233,7 @@ command [std::unique_ptr* cmd] symbol[name,CHECK_UNDECLARED,SYM_SORT] { PARSER_STATE->checkUserSymbol(name); } n=INTEGER_LITERAL - { Debug("parser") << "declare sort: '" << name + { Trace("parser") << "declare sort: '" << name << "' arity=" << n << std::endl; unsigned arity = AntlrInput::tokenToUnsigned(n); if(arity == 0) { @@ -270,7 +270,7 @@ command [std::unique_ptr* cmd] { PARSER_STATE->checkUserSymbol(name); } LPAREN_TOK sortList[sorts] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] - { Debug("parser") << "declare fun: '" << name << "'" << std::endl; + { Trace("parser") << "declare fun: '" << name << "'" << std::endl; if( !sorts.empty() ) { t = PARSER_STATE->mkFlatFunctionType(sorts, t); } @@ -298,7 +298,7 @@ command [std::unique_ptr* cmd] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] { /* add variables to parser state before parsing term */ - Debug("parser") << "define fun: '" << name << "'" << std::endl; + Trace("parser") << "define fun: '" << name << "'" << std::endl; if( sortedVarNames.size() > 0 ) { sorts.reserve(sortedVarNames.size()); for(std::vector >::const_iterator i = @@ -542,7 +542,7 @@ sygusCommand returns [std::unique_ptr cmd] sygusGrammar[grammar, sygusVars, name] )? { - Debug("parser-sygus") << "Define synth fun : " << name << std::endl; + Trace("parser-sygus") << "Define synth fun : " << name << std::endl; fun = isInv ? (grammar == nullptr ? SOLVER->synthInv(name, sygusVars) @@ -551,7 +551,7 @@ sygusCommand returns [std::unique_ptr cmd] ? SOLVER->synthFun(name, sygusVars, range) : SOLVER->synthFun(name, sygusVars, range, *grammar)); - Debug("parser-sygus") << "...read synth fun " << name << std::endl; + Trace("parser-sygus") << "...read synth fun " << name << std::endl; PARSER_STATE->popScope(); // we do not allow overloading for synth fun PARSER_STATE->defineVar(name, fun); @@ -564,7 +564,7 @@ sygusCommand returns [std::unique_ptr cmd] PARSER_STATE->checkThatLogicIsSet(); } term[expr, expr2] - { Debug("parser-sygus") << "...read constraint " << expr << std::endl; + { Trace("parser-sygus") << "...read constraint " << expr << std::endl; cmd.reset(new SygusConstraintCommand(expr, isAssume)); } | /* inv-constraint */ @@ -1042,7 +1042,7 @@ extendedCommand[std::unique_ptr* cmd] ( term[e, e2] { terms.push_back( e ); } )* RPAREN_TOK - { Debug("parser") << "declare pool: '" << name << "'" << std::endl; + { Trace("parser") << "declare pool: '" << name << "'" << std::endl; api::Term pool = SOLVER->declarePool(name, t, terms); PARSER_STATE->defineVar(name, pool); cmd->reset(new DeclarePoolCommand(name, pool, t, terms)); @@ -1088,7 +1088,7 @@ datatypesDefCommand[bool isCo, std::unique_ptr* cmd] LPAREN_TOK /* datatype definition prelude */ ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] n=INTEGER_LITERAL RPAREN_TOK { unsigned arity = AntlrInput::tokenToUnsigned(n); - Debug("parser-dt") << "Datatype : " << name << ", arity = " << arity << std::endl; + Trace("parser-dt") << "Datatype : " << name << ", arity = " << arity << std::endl; dnames.push_back(name); arities.push_back( static_cast(arity) ); } @@ -1138,7 +1138,7 @@ datatypesDef[bool isCo, } ( LPAREN_TOK { params.clear(); - Debug("parser-dt") << "Processing datatype #" << dts.size() << std::endl; + Trace("parser-dt") << "Processing datatype #" << dts.size() << std::endl; if( dts.size()>=dnames.size() ){ PARSER_STATE->parseError("Too many datatypes defined in this block."); } @@ -1158,7 +1158,7 @@ datatypesDef[bool isCo, // now declare it as an unresolved type PARSER_STATE->mkUnresolvedType(dnames[dts.size()], params.size()); } - Debug("parser-dt") << params.size() << " parameters for " << dnames[dts.size()] << std::endl; + Trace("parser-dt") << params.size() << " parameters for " << dnames[dts.size()] << std::endl; dts.push_back(SOLVER->mkDatatypeDecl(dnames[dts.size()], params, isCo)); } LPAREN_TOK @@ -1173,7 +1173,7 @@ datatypesDef[bool isCo, // now declare it as an unresolved type PARSER_STATE->mkUnresolvedType(dnames[dts.size()], 0); } - Debug("parser-dt") << params.size() << " parameters for " << dnames[dts.size()] << std::endl; + Trace("parser-dt") << params.size() << " parameters for " << dnames[dts.size()] << std::endl; dts.push_back(SOLVER->mkDatatypeDecl(dnames[dts.size()], params, isCo)); @@ -1271,7 +1271,7 @@ term[cvc5::api::Term& expr, cvc5::api::Term& expr2] */ termNonVariable[cvc5::api::Term& expr, cvc5::api::Term& expr2] @init { - Debug("parser") << "term: " << AntlrInput::tokenText(LT(1)) << std::endl; + Trace("parser") << "term: " << AntlrInput::tokenText(LT(1)) << std::endl; api::Kind kind = api::NULL_EXPR; std::string name; std::vector args; @@ -1371,7 +1371,7 @@ termNonVariable[cvc5::api::Term& expr, cvc5::api::Term& expr2] PARSER_STATE->pushScope(); // f should be a constructor type = f.getSort(); - Debug("parser-dt") << "Pattern head : " << f << " " << type << std::endl; + Trace("parser-dt") << "Pattern head : " << f << " " << type << std::endl; if (!type.isConstructor()) { PARSER_STATE->parseError("Pattern must be application of a constructor or a variable."); @@ -1888,7 +1888,7 @@ str[std::string& s, bool fsmtlib] quantOp[cvc5::api::Kind& kind] @init { - Debug("parser") << "quant: " << AntlrInput::tokenText(LT(1)) << std::endl; + Trace("parser") << "quant: " << AntlrInput::tokenText(LT(1)) << std::endl; } : EXISTS_TOK { $kind = api::EXISTS; } | FORALL_TOK { $kind = api::FORALL; } @@ -2055,12 +2055,12 @@ sortSymbol[cvc5::api::Sort& t, cvc5::parser::DeclarationCheck check] // make unresolved type if(args.empty()) { t = PARSER_STATE->mkUnresolvedType(name); - Debug("parser-param") << "param: make unres type " << name + Trace("parser-param") << "param: make unres type " << name << std::endl; } else { t = PARSER_STATE->mkUnresolvedTypeConstructor(name,args); t = t.instantiate( args ); - Debug("parser-param") + Trace("parser-param") << "param: make unres param type " << name << " " << args.size() << " " << PARSER_STATE->getArity( name ) << std::endl; } @@ -2172,7 +2172,7 @@ constructorDef[cvc5::api::DatatypeDecl& type] ( LPAREN_TOK selector[*ctor] RPAREN_TOK )* { // make the constructor type.addConstructor(*ctor); - Debug("parser-idt") << "constructor: " << id.c_str() << std::endl; + Trace("parser-idt") << "constructor: " << id.c_str() << std::endl; delete ctor; } ; @@ -2185,7 +2185,7 @@ selector[cvc5::api::DatatypeConstructorDecl& ctor] : symbol[id,CHECK_NONE,SYM_SORT] sortSymbol[t,CHECK_NONE] { ctor.addSelector(id, t); - Debug("parser-idt") << "selector: " << id.c_str() + Trace("parser-idt") << "selector: " << id.c_str() << " of type " << t << std::endl; } ; @@ -2351,7 +2351,7 @@ fragment NUMERAL char *start = (char*) GETCHARINDEX(); } : DIGIT+ - { Debug("parser-extra") << "NUMERAL: " + { Trace("parser-extra") << "NUMERAL: " << (uintptr_t)start << ".." << GETCHARINDEX() << " strict? " << (bool)(PARSER_STATE->strictModeEnabled()) << " ^0? " << (bool)(*start == '0') diff --git a/src/parser/smt2/smt2.cpp b/src/parser/smt2/smt2.cpp index 41389489f..24b055eef 100644 --- a/src/parser/smt2/smt2.cpp +++ b/src/parser/smt2/smt2.cpp @@ -292,7 +292,7 @@ void Smt2::addCoreSymbols() void Smt2::addOperator(api::Kind kind, const std::string& name) { - Debug("parser") << "Smt2::addOperator( " << kind << ", " << name << " )" + Trace("parser") << "Smt2::addOperator( " << kind << ", " << name << " )" << std::endl; Parser::addOperator(kind); d_operatorKindMap[name] = kind; @@ -444,8 +444,8 @@ std::unique_ptr Smt2::invConstraint( const std::vector& names) { checkThatLogicIsSet(); - Debug("parser-sygus") << "Sygus : define sygus funs..." << std::endl; - Debug("parser-sygus") << "Sygus : read inv-constraint..." << std::endl; + Trace("parser-sygus") << "Sygus : define sygus funs..." << std::endl; + Trace("parser-sygus") << "Sygus : read inv-constraint..." << std::endl; if (names.size() != 4) { @@ -770,7 +770,7 @@ void Smt2::checkLogicAllowsFunctions() // Inspired by http://www.antlr3.org/api/C/interop.html static bool newInputStream(const std::string& filename, pANTLR3_LEXER lexer) { - Debug("parser") << "Including " << filename << std::endl; + Trace("parser") << "Including " << filename << std::endl; // Create a new input stream and take advantage of built in stream stacking // in C target runtime. // @@ -781,7 +781,7 @@ static bool newInputStream(const std::string& filename, pANTLR3_LEXER lexer) { in = antlr3FileStreamNew((pANTLR3_UINT8) filename.c_str(), ANTLR3_ENC_8BIT); #endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */ if( in == NULL ) { - Debug("parser") << "Can't open " << filename << std::endl; + Trace("parser") << "Can't open " << filename << std::endl; return false; } // Same thing as the predefined PUSHSTREAM(in); @@ -833,7 +833,7 @@ bool Smt2::isAbstractValue(const std::string& name) void Smt2::parseOpApplyTypeAscription(ParseOp& p, api::Sort type) { - Debug("parser") << "parseOpApplyTypeAscription : " << p << " " << type + Trace("parser") << "parseOpApplyTypeAscription : " << p << " " << type << std::endl; // (as const (Array T1 T2)) if (p.d_kind == api::CONST_ARRAY) @@ -908,13 +908,13 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) // the builtin kind of the overall return expression api::Kind kind = api::NULL_EXPR; // First phase: process the operator - if (Debug.isOn("parser")) + if (TraceIsOn("parser")) { - Debug("parser") << "applyParseOp: " << p << " to:" << std::endl; + Trace("parser") << "applyParseOp: " << p << " to:" << std::endl; for (std::vector::iterator i = args.begin(); i != args.end(); ++i) { - Debug("parser") << "++ " << *i << std::endl; + Trace("parser") << "++ " << *i << std::endl; } } api::Op op; @@ -933,7 +933,7 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) // Testers are handled differently than other indexed operators, // since they require a kind. kind = fkind; - Debug("parser") << "Got function kind " << kind << " for expression " + Trace("parser") << "Got function kind " << kind << " for expression " << std::endl; } args.insert(args.begin(), p.d_expr); @@ -950,7 +950,7 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) { // a builtin operator, convert to kind kind = getOperatorKind(p.d_name); - Debug("parser") << "Got builtin kind " << kind << " for name" + Trace("parser") << "Got builtin kind " << kind << " for name" << std::endl; } else @@ -1012,7 +1012,7 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) parseError(ss.str()); } api::Term ret = d_solver->mkConstArray(p.d_type, constVal); - Debug("parser") << "applyParseOp: return store all " << ret << std::endl; + Trace("parser") << "applyParseOp: return store all " << ret << std::endl; return ret; } else if ((p.d_kind == api::APPLY_SELECTOR || p.d_kind == api::APPLY_UPDATER) @@ -1053,13 +1053,13 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) ret = d_solver->mkTerm( api::APPLY_UPDATER, dt[0][n].getUpdaterTerm(), args[0], args[1]); } - Debug("parser") << "applyParseOp: return selector " << ret << std::endl; + Trace("parser") << "applyParseOp: return selector " << ret << std::endl; return ret; } else if (p.d_kind == api::TUPLE_PROJECT) { api::Term ret = d_solver->mkTerm(p.d_op, args); - Debug("parser") << "applyParseOp: return projection " << ret << std::endl; + Trace("parser") << "applyParseOp: return projection " << ret << std::endl; return ret; } else if (p.d_kind != api::NULL_EXPR) @@ -1094,7 +1094,7 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) && args.size() == 1) { // Unary AND/OR can be replaced with the argument. - Debug("parser") << "applyParseOp: return unary " << args[0] << std::endl; + Trace("parser") << "applyParseOp: return unary " << args[0] << std::endl; return args[0]; } else if (kind == api::SUB && args.size() == 1) @@ -1105,12 +1105,12 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) std::stringstream suminus; suminus << "-" << args[0].getIntegerValue(); api::Term ret = d_solver->mkInteger(suminus.str()); - Debug("parser") << "applyParseOp: return negative constant " << ret + Trace("parser") << "applyParseOp: return negative constant " << ret << std::endl; return ret; } api::Term ret = d_solver->mkTerm(api::NEG, args[0]); - Debug("parser") << "applyParseOp: return uminus " << ret << std::endl; + Trace("parser") << "applyParseOp: return uminus " << ret << std::endl; return ret; } else if (kind == api::DIVISION && args.size() == 2 && isConstInt(args[0]) @@ -1120,14 +1120,14 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) std::stringstream sdiv; sdiv << args[0].getIntegerValue() << "/" << args[1].getIntegerValue(); api::Term ret = d_solver->mkReal(sdiv.str()); - Debug("parser") << "applyParseOp: return rational constant " << ret + Trace("parser") << "applyParseOp: return rational constant " << ret << std::endl; return ret; } if (kind == api::SET_SINGLETON && args.size() == 1) { api::Term ret = d_solver->mkTerm(api::SET_SINGLETON, args[0]); - Debug("parser") << "applyParseOp: return set.singleton " << ret + Trace("parser") << "applyParseOp: return set.singleton " << ret << std::endl; return ret; } @@ -1147,7 +1147,7 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) return ret; } api::Term ret = d_solver->mkTerm(kind, args); - Debug("parser") << "applyParseOp: return default builtin " << ret + Trace("parser") << "applyParseOp: return default builtin " << ret << std::endl; return ret; } @@ -1167,11 +1167,11 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) "Cannot partially apply functions unless logic is prefixed by " "HO_."); } - Debug("parser") << "Partial application of " << args[0]; - Debug("parser") << " : #argTypes = " << arity; - Debug("parser") << ", #args = " << args.size() - 1 << std::endl; + Trace("parser") << "Partial application of " << args[0]; + Trace("parser") << " : #argTypes = " << arity; + Trace("parser") << ", #args = " << args.size() - 1 << std::endl; api::Term ret = d_solver->mkTerm(api::HO_APPLY, args); - Debug("parser") << "applyParseOp: return curry higher order " << ret + Trace("parser") << "applyParseOp: return curry higher order " << ret << std::endl; // must curry the partial application return ret; @@ -1181,7 +1181,7 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) if (!op.isNull()) { api::Term ret = d_solver->mkTerm(op, args); - Debug("parser") << "applyParseOp: return op : " << ret << std::endl; + Trace("parser") << "applyParseOp: return op : " << ret << std::endl; return ret; } if (kind == api::NULL_EXPR) @@ -1189,10 +1189,10 @@ api::Term Smt2::applyParseOp(ParseOp& p, std::vector& args) // should never happen in the new API parseError("do not know how to process parse op"); } - Debug("parser") << "Try default term construction for kind " << kind + Trace("parser") << "Try default term construction for kind " << kind << " #args = " << args.size() << "..." << std::endl; api::Term ret = d_solver->mkTerm(kind, args); - Debug("parser") << "applyParseOp: return : " << ret << std::endl; + Trace("parser") << "applyParseOp: return : " << ret << std::endl; return ret; } diff --git a/src/parser/tptp/tptp.cpp b/src/parser/tptp/tptp.cpp index 37ef05f7f..d971c4f24 100644 --- a/src/parser/tptp/tptp.cpp +++ b/src/parser/tptp/tptp.cpp @@ -112,7 +112,7 @@ void Tptp::addTheory(Theory theory) { // Inspired by http://www.antlr3.org/api/C/interop.html bool newInputStream(std::string fileName, pANTLR3_LEXER lexer, std::vector< pANTLR3_INPUT_STREAM >& inc ) { - Debug("parser") << "Including " << fileName << std::endl; + Trace("parser") << "Including " << fileName << std::endl; // Create a new input stream and take advantage of built in stream stacking // in C target runtime. // @@ -123,7 +123,7 @@ bool newInputStream(std::string fileName, pANTLR3_LEXER lexer, std::vector< pANT in = antlr3FileStreamNew((pANTLR3_UINT8) fileName.c_str(), ANTLR3_ENC_8BIT); #endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */ if(in == NULL) { - Debug("parser") << "Can't open " << fileName << std::endl; + Trace("parser") << "Can't open " << fileName << std::endl; return false; } // Same thing as the predefined PUSHSTREAM(in); @@ -270,13 +270,13 @@ api::Term Tptp::isTptpDeclared(const std::string& name) api::Term Tptp::applyParseOp(ParseOp& p, std::vector& args) { - if (Debug.isOn("parser")) + if (TraceIsOn("parser")) { - Debug("parser") << "applyParseOp: " << p << " to:" << std::endl; + Trace("parser") << "applyParseOp: " << p << " to:" << std::endl; for (std::vector::iterator i = args.begin(); i != args.end(); ++i) { - Debug("parser") << "++ " << *i << std::endl; + Trace("parser") << "++ " << *i << std::endl; } } Assert(!args.empty()); @@ -380,9 +380,9 @@ api::Term Tptp::applyParseOp(ParseOp& p, std::vector& args) { parseError("Cannot partially apply functions unless THF."); } - Debug("parser") << "Partial application of " << args[0]; - Debug("parser") << " : #argTypes = " << arity; - Debug("parser") << ", #args = " << args.size() - 1 << std::endl; + Trace("parser") << "Partial application of " << args[0]; + Trace("parser") << " : #argTypes = " << arity; + Trace("parser") << ", #args = " << args.size() - 1 << std::endl; // must curry the partial application return d_solver->mkTerm(api::HO_APPLY, args); } @@ -520,7 +520,7 @@ api::Term Tptp::convertStrToUnsorted(std::string str) api::Term Tptp::mkLambdaWrapper(api::Kind k, api::Sort argType) { - Debug("parser") << "mkLambdaWrapper: kind " << k << " and type " << argType + Trace("parser") << "mkLambdaWrapper: kind " << k << " and type " << argType << "\n"; std::vector lvars; std::vector domainTypes = argType.getFunctionDomainSorts(); diff --git a/src/preprocessing/passes/bool_to_bv.cpp b/src/preprocessing/passes/bool_to_bv.cpp index 90b55a48a..8b26e564f 100644 --- a/src/preprocessing/passes/bool_to_bv.cpp +++ b/src/preprocessing/passes/bool_to_bv.cpp @@ -153,7 +153,7 @@ Node BoolToBV::lowerNode(const TNode& node, bool allowIteIntroduction) TNode n = to_visit.back(); to_visit.pop_back(); - Debug("bool-to-bv") << "BoolToBV::lowerNode: Post-order traversal with " + Trace("bool-to-bv") << "BoolToBV::lowerNode: Post-order traversal with " << n << " and visited = " << ContainsKey(visited, n) << std::endl; @@ -242,7 +242,7 @@ void BoolToBV::visit(const TNode& n, bool allowIteIntroduction) } } - Debug("bool-to-bv") << "safe_to_lower = " << safe_to_lower + Trace("bool-to-bv") << "safe_to_lower = " << safe_to_lower << ", safe_to_rebuild = " << safe_to_rebuild << std::endl; if (new_kind != k && safe_to_lower) @@ -266,7 +266,7 @@ void BoolToBV::visit(const TNode& n, bool allowIteIntroduction) fromCache(n), bv::utils::mkOne(1), bv::utils::mkZero(1))); - Debug("bool-to-bv") << "BoolToBV::visit forcing " << n + Trace("bool-to-bv") << "BoolToBV::visit forcing " << n << " =>\n" << fromCache(n) << std::endl; if (d_boolToBVMode == options::BoolToBVMode::ALL) @@ -290,7 +290,7 @@ void BoolToBV::visit(const TNode& n, bool allowIteIntroduction) // with ITE introductions updateCache( n, nm->mkNode(kind::ITE, n, bv::utils::mkOne(1), bv::utils::mkZero(1))); - Debug("bool-to-bv") << "BoolToBV::visit forcing " << n + Trace("bool-to-bv") << "BoolToBV::visit forcing " << n << " =>\n" << fromCache(n) << std::endl; if (d_boolToBVMode == options::BoolToBVMode::ALL) @@ -302,7 +302,7 @@ void BoolToBV::visit(const TNode& n, bool allowIteIntroduction) else { // do nothing - Debug("bool-to-bv") << "BoolToBV::visit skipping: " << n + Trace("bool-to-bv") << "BoolToBV::visit skipping: " << n << std::endl; } } @@ -318,7 +318,7 @@ Node BoolToBV::lowerIte(const TNode& node) TNode n = visit.back(); visit.pop_back(); - Debug("bool-to-bv") << "BoolToBV::lowerIte: Post-order traversal with " << n + Trace("bool-to-bv") << "BoolToBV::lowerIte: Post-order traversal with " << n << " and visited = " << ContainsKey(visited, n) << std::endl; @@ -327,7 +327,7 @@ Node BoolToBV::lowerIte(const TNode& node) { if ((n.getKind() == kind::ITE) && n[1].getType().isBitVector()) { - Debug("bool-to-bv") << "BoolToBV::lowerIte: adding " << n[0] + Trace("bool-to-bv") << "BoolToBV::lowerIte: adding " << n[0] << " to set of ite conditions" << std::endl; // don't force in this case -- forcing only introduces more ITEs Node loweredNode = lowerNode(n, false); @@ -355,7 +355,7 @@ Node BoolToBV::lowerIte(const TNode& node) } else { - Debug("bool-to-bv") + Trace("bool-to-bv") << "BoolToBV::lowerIte Skipping because don't need to rebuild: " << n << std::endl; } @@ -369,7 +369,7 @@ void BoolToBV::rebuildNode(const TNode& n, Kind new_kind) NodeManager* nm = NodeManager::currentNM(); NodeBuilder builder(new_kind); - Debug("bool-to-bv") << "BoolToBV::rebuildNode with " << n + Trace("bool-to-bv") << "BoolToBV::rebuildNode with " << n << " and new_kind = " << kindToString(new_kind) << std::endl; @@ -398,7 +398,7 @@ void BoolToBV::rebuildNode(const TNode& n, Kind new_kind) } } - Debug("bool-to-bv") << "BoolToBV::rebuildNode " << n << " =>\n" + Trace("bool-to-bv") << "BoolToBV::rebuildNode " << n << " =>\n" << builder << std::endl; updateCache(n, builder.constructNode()); diff --git a/src/preprocessing/passes/bv_to_bool.cpp b/src/preprocessing/passes/bv_to_bool.cpp index ca48c1a37..881732bfc 100644 --- a/src/preprocessing/passes/bv_to_bool.cpp +++ b/src/preprocessing/passes/bv_to_bool.cpp @@ -133,7 +133,7 @@ Node BVToBool::convertBvAtom(TNode node) Node a = convertBvTerm(node[0]); Node b = convertBvTerm(node[1]); Node result = NodeManager::currentNM()->mkNode(kind::EQUAL, a, b); - Debug("bv-to-bool") << "BVToBool::convertBvAtom " << node << " => " << result + Trace("bv-to-bool") << "BVToBool::convertBvAtom " << node << " => " << result << "\n"; ++(d_statistics.d_numAtomsLifted); @@ -154,7 +154,7 @@ Node BVToBool::convertBvTerm(TNode node) ++(d_statistics.d_numTermsForcedLifted); Node result = nm->mkNode(kind::EQUAL, node, d_one); addToBoolCache(node, result); - Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " + Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " << result << "\n"; return result; } @@ -164,7 +164,7 @@ Node BVToBool::convertBvTerm(TNode node) Assert(node.getKind() == kind::CONST_BITVECTOR); Node result = node == d_one ? bv::utils::mkTrue() : bv::utils::mkFalse(); // addToCache(node, result); - Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " + Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " << result << "\n"; return result; } @@ -179,7 +179,7 @@ Node BVToBool::convertBvTerm(TNode node) Node false_branch = convertBvTerm(node[2]); Node result = nm->mkNode(kind::ITE, cond, true_branch, false_branch); addToBoolCache(node, result); - Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " + Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " << result << "\n"; return result; } @@ -196,7 +196,7 @@ Node BVToBool::convertBvTerm(TNode node) Node converted = convertBvTerm(node[i]); result = nm->mkNode(kind::XOR, result, converted); } - Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " + Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " << result << "\n"; return result; } @@ -205,7 +205,7 @@ Node BVToBool::convertBvTerm(TNode node) { Node result = nm->mkNode(kind::EQUAL, node[0], node[1]); addToBoolCache(node, result); - Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " + Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " << result << "\n"; return result; } @@ -226,7 +226,7 @@ Node BVToBool::convertBvTerm(TNode node) Node result = builder; addToBoolCache(node, result); - Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " << result + Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " << result << "\n"; return result; } @@ -270,7 +270,7 @@ Node BVToBool::liftNode(TNode current) } Assert(result != Node()); Assert(result.getType() == current.getType()); - Debug("bv-to-bool") << "BVToBool::liftNode " << current << " => \n" + Trace("bv-to-bool") << "BVToBool::liftNode " << current << " => \n" << result << "\n"; return result; } diff --git a/src/preprocessing/passes/ite_simp.cpp b/src/preprocessing/passes/ite_simp.cpp index 14ed9df07..65ea84125 100644 --- a/src/preprocessing/passes/ite_simp.cpp +++ b/src/preprocessing/passes/ite_simp.cpp @@ -241,12 +241,12 @@ bool ITESimp::doneSimpITE(AssertionPipeline* assertionsToPreprocess) { anyItes = true; Node res = aiteu.reduceVariablesInItes(curr); - Debug("arith::ite::red") << "@ " << i << " ... " << curr << endl + Trace("arith::ite::red") << "@ " << i << " ... " << curr << endl << " ->" << res << endl; if (curr != res) { Node more = aiteu.reduceConstantIteByGCD(res); - Debug("arith::ite::red") << " gcd->" << more << endl; + Trace("arith::ite::red") << " gcd->" << more << endl; Node morer = rewrite(more); assertionsToPreprocess->replace(i, morer); } @@ -266,10 +266,10 @@ bool ITESimp::doneSimpITE(AssertionPipeline* assertionsToPreprocess) Node curr = (*assertionsToPreprocess)[i]; Node next = rewrite(aiteu.applySubstitutions(curr)); Node res = aiteu.reduceVariablesInItes(next); - Debug("arith::ite::red") << "@ " << i << " ... " << next << endl + Trace("arith::ite::red") << "@ " << i << " ... " << next << endl << " ->" << res << endl; Node more = aiteu.reduceConstantIteByGCD(res); - Debug("arith::ite::red") << " gcd->" << more << endl; + Trace("arith::ite::red") << " gcd->" << more << endl; if (more != next) { anySuccess = true; @@ -283,10 +283,10 @@ bool ITESimp::doneSimpITE(AssertionPipeline* assertionsToPreprocess) Node curr = (*assertionsToPreprocess)[i]; Node next = rewrite(aiteu.applySubstitutions(curr)); Node res = aiteu.reduceVariablesInItes(next); - Debug("arith::ite::red") << "@ " << i << " ... " << next << endl + Trace("arith::ite::red") << "@ " << i << " ... " << next << endl << " ->" << res << endl; Node more = aiteu.reduceConstantIteByGCD(res); - Debug("arith::ite::red") << " gcd->" << more << endl; + Trace("arith::ite::red") << " gcd->" << more << endl; Node morer = rewrite(more); assertionsToPreprocess->replace(i, morer); } diff --git a/src/preprocessing/passes/learned_rewrite.cpp b/src/preprocessing/passes/learned_rewrite.cpp index 5f659e7e6..a9c3b6e63 100644 --- a/src/preprocessing/passes/learned_rewrite.cpp +++ b/src/preprocessing/passes/learned_rewrite.cpp @@ -319,7 +319,7 @@ Node LearnedRewrite::rewriteLearned(Node n, bool lbSuccess = true; bool ubSuccess = true; Rational one(1); - if (Trace.isOn("learned-rewrite-arith-lit")) + if (TraceIsOn("learned-rewrite-arith-lit")) { Trace("learned-rewrite-arith-lit") << "Arithmetic lit: " << nr << std::endl; @@ -407,7 +407,7 @@ Node LearnedRewrite::rewriteLearned(Node n, Node LearnedRewrite::returnRewriteLearned(Node n, Node nr, LearnedRewriteId id) { - if (Trace.isOn("learned-rewrite")) + if (TraceIsOn("learned-rewrite")) { Trace("learned-rewrite") << "LearnedRewrite::Rewrite: (" << id << ") " << n << " == " << nr << std::endl; diff --git a/src/preprocessing/passes/miplib_trick.cpp b/src/preprocessing/passes/miplib_trick.cpp index f38567965..a20d9f3f6 100644 --- a/src/preprocessing/passes/miplib_trick.cpp +++ b/src/preprocessing/passes/miplib_trick.cpp @@ -221,7 +221,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( { if (propagator->isAssigned(v0)) { - Debug("miplib") << "ineligible: " << v0 << " because assigned " + Trace("miplib") << "ineligible: " << v0 << " because assigned " << propagator->getAssignment(v0) << endl; continue; } @@ -243,7 +243,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( assertions.push_back(v0); } } - Debug("miplib") << "for " << v0 << endl; + Trace("miplib") << "for " << v0 << endl; bool eligible = true; map, uint64_t> marks; map, vector > coef; @@ -253,25 +253,25 @@ PreprocessingPassResult MipLibTrick::applyInternal( j1 != assertions.end(); ++j1) { - Debug("miplib") << " found: " << *j1 << endl; + Trace("miplib") << " found: " << *j1 << endl; if ((*j1).getKind() != kind::IMPLIES) { eligible = false; - Debug("miplib") << " -- INELIGIBLE -- (not =>)" << endl; + Trace("miplib") << " -- INELIGIBLE -- (not =>)" << endl; break; } Node conj = BooleanSimplification::simplify((*j1)[0]); if (conj.getKind() == kind::AND && conj.getNumChildren() > 6) { eligible = false; - Debug("miplib") << " -- INELIGIBLE -- (N-ary /\\ too big)" << endl; + Trace("miplib") << " -- INELIGIBLE -- (N-ary /\\ too big)" << endl; break; } if (conj.getKind() != kind::AND && !conj.isVar() && !(conj.getKind() == kind::NOT && conj[0].isVar())) { eligible = false; - Debug("miplib") << " -- INELIGIBLE -- (not /\\ or literal)" << endl; + Trace("miplib") << " -- INELIGIBLE -- (not /\\ or literal)" << endl; break; } if ((*j1)[1].getKind() != kind::EQUAL @@ -279,7 +279,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( || ((*j1)[1][0].isConst() && (*j1)[1][1].isVar()))) { eligible = false; - Debug("miplib") << " -- INELIGIBLE -- (=> (and X X) X)" << endl; + Trace("miplib") << " -- INELIGIBLE -- (=> (and X X) X)" << endl; break; } if (conj.getKind() == kind::AND) @@ -304,14 +304,14 @@ PreprocessingPassResult MipLibTrick::applyInternal( else { eligible = false; - Debug("miplib") + Trace("miplib") << " -- INELIGIBLE -- (non-var: " << *ii << ")" << endl; break; } if (propagator->isAssigned(posv.back())) { eligible = false; - Debug("miplib") << " -- INELIGIBLE -- (" << posv.back() + Trace("miplib") << " -- INELIGIBLE -- (" << posv.back() << " asserted)" << endl; break; } @@ -323,7 +323,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( if (!found_x) { eligible = false; - Debug("miplib") << " --INELIGIBLE -- (couldn't find " << v0 + Trace("miplib") << " --INELIGIBLE -- (couldn't find " << v0 << " in conjunction)" << endl; break; } @@ -351,20 +351,20 @@ PreprocessingPassResult MipLibTrick::applyInternal( if ((marks[pos_var] & (1lu << mark)) != 0) { eligible = false; - Debug("miplib") << " -- INELIGIBLE -- (remarked)" << endl; + Trace("miplib") << " -- INELIGIBLE -- (remarked)" << endl; break; } - Debug("miplib") << "mark is " << mark << " -- " << (1lu << mark) + Trace("miplib") << "mark is " << mark << " -- " << (1lu << mark) << endl; marks[pos_var] |= (1lu << mark); - Debug("miplib") << "marks[" << pos << "," << var << "] now " + Trace("miplib") << "marks[" << pos << "," << var << "] now " << marks[pos_var] << endl; if (countneg == pos.getNumChildren()) { if (constant != 0) { eligible = false; - Debug("miplib") << " -- INELIGIBLE -- (nonzero constant)" << endl; + Trace("miplib") << " -- INELIGIBLE -- (nonzero constant)" << endl; break; } } @@ -393,13 +393,13 @@ PreprocessingPassResult MipLibTrick::applyInternal( if (x != v0 && x != (v0).notNode()) { eligible = false; - Debug("miplib") + Trace("miplib") << " -- INELIGIBLE -- (x not present where I expect it)" << endl; break; } const bool xneg = (x.getKind() == kind::NOT); x = xneg ? x[0] : x; - Debug("miplib") << " x:" << x << " " << xneg << endl; + Trace("miplib") << " x:" << x << " " << xneg << endl; const TNode var = ((*j1)[1][0].isConst()) ? (*j1)[1][1] : (*j1)[1][0]; const pair x_var(x, var); const Rational& constant = ((*j1)[1][0].isConst()) @@ -409,7 +409,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( if ((marks[x_var] & (1u << mark)) != 0) { eligible = false; - Debug("miplib") << " -- INELIGIBLE -- (remarked)" << endl; + Trace("miplib") << " -- INELIGIBLE -- (remarked)" << endl; break; } marks[x_var] |= (1u << mark); @@ -418,7 +418,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( if (constant != 0) { eligible = false; - Debug("miplib") << " -- INELIGIBLE -- (nonzero constant)" << endl; + Trace("miplib") << " -- INELIGIBLE -- (nonzero constant)" << endl; break; } } @@ -445,12 +445,12 @@ PreprocessingPassResult MipLibTrick::applyInternal( pos.getKind() == kind::AND ? pos.getNumChildren() : 1; uint64_t expected = (uint64_t(1) << (1 << numVars)) - 1; expected = (expected == 0) ? -1 : expected; // fix for overflow - Debug("miplib") << "[" << pos << "] => " << hex << mark << " expect " + Trace("miplib") << "[" << pos << "] => " << hex << mark << " expect " << expected << dec << endl; Assert(pos.getKind() == kind::AND || pos.isVar()); if (mark != expected) { - Debug("miplib") << " -- INELIGIBLE " << pos + Trace("miplib") << " -- INELIGIBLE " << pos << " -- (insufficiently marked, got " << mark << " for " << numVars << " vars, expected " << expected << endl; @@ -467,24 +467,24 @@ PreprocessingPassResult MipLibTrick::applyInternal( if ((k & (k - 1)) != 0) { Rational sum = 0; - Debug("miplib") << k << " => " << checks[pos_var][k] << endl; + Trace("miplib") << k << " => " << checks[pos_var][k] << endl; for (size_t v1 = 1, kk = k; kk != 0; ++v1, kk >>= 1) { if ((kk & 0x1) == 1) { Assert(pos.getKind() == kind::AND); - Debug("miplib") + Trace("miplib") << "var " << v1 << " : " << pos[v1 - 1] << " coef:" << coef[pos_var][v1 - 1] << endl; sum += coef[pos_var][v1 - 1]; } } - Debug("miplib") << "checkSum is " << sum << " input says " + Trace("miplib") << "checkSum is " << sum << " input says " << checks[pos_var][k] << endl; if (sum != checks[pos_var][k]) { eligible = false; - Debug("miplib") << " -- INELIGIBLE " << pos + Trace("miplib") << " -- INELIGIBLE " << pos << " -- (nonlinear combination)" << endl; break; } @@ -505,7 +505,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( continue; } - Debug("miplib") << " -- ELIGIBLE " << v0 << " , " << pos << " --" + Trace("miplib") << " -- ELIGIBLE " << v0 << " , " << pos << " --" << endl; vector newVars; expr::NodeSelfIterator ii, iiend; @@ -574,7 +574,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( sum = nm->mkNode( kind::MULT, nm->mkConstInt(coef[pos_var][0]), newVars[0]); } - Debug("miplib") << "vars[] " << var << endl + Trace("miplib") << "vars[] " << var << endl << " eq " << rewrite(sum) << endl; Node newAssertion = var.eqNode(rewrite(sum)); if (top_level_substs.hasSubstitution(newAssertion[0])) @@ -586,27 +586,27 @@ PreprocessingPassResult MipLibTrick::applyInternal( <= options().arith.arithMLTrickSubstitutions) { top_level_substs.addSubstitution(newAssertion[0], newAssertion[1]); - Debug("miplib") << "addSubs: " << newAssertion[0] << " to " + Trace("miplib") << "addSubs: " << newAssertion[0] << " to " << newAssertion[1] << endl; } else { - Debug("miplib") + Trace("miplib") << "skipSubs: " << newAssertion[0] << " to " << newAssertion[1] << " (threshold is " << options().arith.arithMLTrickSubstitutions << ")" << endl; } newAssertion = rewrite(newAssertion); - Debug("miplib") << " " << newAssertion << endl; + Trace("miplib") << " " << newAssertion << endl; assertionsToPreprocess->push_back(newAssertion); - Debug("miplib") << " assertions to remove: " << endl; + Trace("miplib") << " assertions to remove: " << endl; for (vector::const_iterator k = asserts[pos_var].begin(), k_end = asserts[pos_var].end(); k != k_end; ++k) { - Debug("miplib") << " " << *k << endl; + Trace("miplib") << " " << *k << endl; removeAssertions.insert((*k).getId()); } } @@ -615,7 +615,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( } if (!removeAssertions.empty()) { - Debug("miplib") << " scrubbing miplib encoding..." << endl; + Trace("miplib") << " scrubbing miplib encoding..." << endl; for (size_t i = 0, size = assertionsToPreprocess->getRealAssertionsEnd(); i < size; ++i) @@ -623,7 +623,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( Node assertion = (*assertionsToPreprocess)[i]; if (removeAssertions.find(assertion.getId()) != removeAssertions.end()) { - Debug("miplib") << " - removing " << assertion << endl; + Trace("miplib") << " - removing " << assertion << endl; assertionsToPreprocess->replace(i, trueNode); ++d_statistics.d_numMiplibAssertionsRemoved; } @@ -632,20 +632,20 @@ PreprocessingPassResult MipLibTrick::applyInternal( size_t removals = removeFromConjunction(assertion, removeAssertions); if (removals > 0) { - Debug("miplib") << " - reduced " << assertion << endl; - Debug("miplib") << " - by " << removals << " conjuncts" << endl; + Trace("miplib") << " - reduced " << assertion << endl; + Trace("miplib") << " - by " << removals << " conjuncts" << endl; d_statistics.d_numMiplibAssertionsRemoved += removals; } } - Debug("miplib") << "had: " << assertion << endl; + Trace("miplib") << "had: " << assertion << endl; assertionsToPreprocess->replace( i, rewrite(top_level_substs.apply(assertion))); - Debug("miplib") << "now: " << assertion << endl; + Trace("miplib") << "now: " << assertion << endl; } } else { - Debug("miplib") << " miplib pass found nothing." << endl; + Trace("miplib") << " miplib pass found nothing." << endl; } assertionsToPreprocess->updateRealAssertionsEnd(); return PreprocessingPassResult::NO_CONFLICT; diff --git a/src/preprocessing/passes/non_clausal_simp.cpp b/src/preprocessing/passes/non_clausal_simp.cpp index 4af8d7ffd..a71953a0f 100644 --- a/src/preprocessing/passes/non_clausal_simp.cpp +++ b/src/preprocessing/passes/non_clausal_simp.cpp @@ -68,7 +68,7 @@ PreprocessingPassResult NonClausalSimp::applyInternal( { d_preprocContext->spendResource(Resource::PreprocessStep); - if (Trace.isOn("non-clausal-simplify")) + if (TraceIsOn("non-clausal-simplify")) { for (size_t i = 0, size = assertionsToPreprocess->size(); i < size; ++i) { @@ -95,7 +95,7 @@ PreprocessingPassResult NonClausalSimp::applyInternal( } Trace("non-clausal-simplify") << "asserting " << (*assertionsToPreprocess)[i] << std::endl; - Debug("cores") << "propagator->assertTrue: " << (*assertionsToPreprocess)[i] + Trace("cores") << "propagator->assertTrue: " << (*assertionsToPreprocess)[i] << std::endl; propagator->assertTrue((*assertionsToPreprocess)[i]); } diff --git a/src/preprocessing/passes/pseudo_boolean_processor.cpp b/src/preprocessing/passes/pseudo_boolean_processor.cpp index f6095ee9c..34c6d55c3 100644 --- a/src/preprocessing/passes/pseudo_boolean_processor.cpp +++ b/src/preprocessing/passes/pseudo_boolean_processor.cpp @@ -61,26 +61,26 @@ bool PseudoBooleanProcessor::decomposeAssertion(Node assertion, bool negated) } Assert(assertion.getKind() == kind::GEQ); - Debug("pbs::rewrites") << "decomposeAssertion" << assertion << std::endl; + Trace("pbs::rewrites") << "decomposeAssertion" << assertion << std::endl; Node l = assertion[0]; Node r = assertion[1]; if (!r.isConst()) { - Debug("pbs::rewrites") << "not rhs constant" << assertion << std::endl; + Trace("pbs::rewrites") << "not rhs constant" << assertion << std::endl; return false; } // don't bother matching on anything other than + on the left hand side if (l.getKind() != kind::ADD) { - Debug("pbs::rewrites") << "not plus" << assertion << std::endl; + Trace("pbs::rewrites") << "not plus" << assertion << std::endl; return false; } if (!Polynomial::isMember(l)) { - Debug("pbs::rewrites") << "not polynomial" << assertion << std::endl; + Trace("pbs::rewrites") << "not polynomial" << assertion << std::endl; return false; } @@ -161,7 +161,7 @@ void PseudoBooleanProcessor::addGeqZero(Node v, Node exp) Assert(!exp.isNull()); CDNode2PairMap::const_iterator ci = d_pbBounds.find(v); - Debug("pbs::rewrites") << "addGeqZero " << v << std::endl; + Trace("pbs::rewrites") << "addGeqZero " << v << std::endl; if (ci == d_pbBounds.end()) { @@ -174,7 +174,7 @@ void PseudoBooleanProcessor::addGeqZero(Node v, Node exp) { Assert(!p.second.isNull()); d_pbBounds.insert(v, std::make_pair(exp, p.second)); - Debug("pbs::rewrites") << "add pbs " << v << std::endl; + Trace("pbs::rewrites") << "add pbs " << v << std::endl; Assert(isPseudoBoolean(v)); d_pbs = d_pbs + 1; } @@ -185,7 +185,7 @@ void PseudoBooleanProcessor::addLeqOne(Node v, Node exp) { Assert(isIntVar(v)); Assert(!exp.isNull()); - Debug("pbs::rewrites") << "addLeqOne " << v << std::endl; + Trace("pbs::rewrites") << "addLeqOne " << v << std::endl; CDNode2PairMap::const_iterator ci = d_pbBounds.find(v); if (ci == d_pbBounds.end()) { @@ -198,7 +198,7 @@ void PseudoBooleanProcessor::addLeqOne(Node v, Node exp) { Assert(!p.first.isNull()); d_pbBounds.insert(v, std::make_pair(p.first, exp)); - Debug("pbs::rewrites") << "add pbs " << v << std::endl; + Trace("pbs::rewrites") << "add pbs " << v << std::endl; Assert(isPseudoBoolean(v)); d_pbs = d_pbs + 1; } @@ -332,7 +332,7 @@ void PseudoBooleanProcessor::learnGeqSub(Node geq) bool success = decomposeAssertion(geq, negated); if (!success) { - Debug("pbs::rewrites") << "failed " << std::endl; + Trace("pbs::rewrites") << "failed " << std::endl; return; } Assert(d_off.value().isIntegral()); @@ -389,9 +389,9 @@ Node PseudoBooleanProcessor::applyReplacements(Node pre) Node assertion = rewrite(pre); Node result = d_subCache.apply(assertion); - if (Debug.isOn("pbs::rewrites") && result != assertion) + if (TraceIsOn("pbs::rewrites") && result != assertion) { - Debug("pbs::rewrites") << "applyReplacements" << assertion << "-> " + Trace("pbs::rewrites") << "applyReplacements" << assertion << "-> " << result << std::endl; } return result; diff --git a/src/preprocessing/util/ite_utilities.cpp b/src/preprocessing/util/ite_utilities.cpp index 45f09d48e..8436c7ec2 100644 --- a/src/preprocessing/util/ite_utilities.cpp +++ b/src/preprocessing/util/ite_utilities.cpp @@ -978,7 +978,7 @@ Node ITESimplifier::attemptLiftEquality(TNode atom) { d_statistics.d_maxNonConstantsFolded.maxAssign( search.nonConstants.size()); - Debug("ite::simpite") << "used " << search.nonConstants.size() + Trace("ite::simpite") << "used " << search.nonConstants.size() << " nonconstants" << endl; NodeManager* nm = NodeManager::currentNM(); Node simpVar = getSimpVar(notIte.getType()); @@ -1075,13 +1075,13 @@ Node ITESimplifier::constantIteEqualsConstant(TNode cite, TNode constant) { static int instance = 0; ++instance; - Debug("ite::constantIteEqualsConstant") + Trace("ite::constantIteEqualsConstant") << instance << "constantIteEqualsConstant(" << cite << ", " << constant << ")" << endl; if (cite.isConst()) { Node res = (cite == constant) ? d_true : d_false; - Debug("ite::constantIteEqualsConstant") << instance << "->" << res << endl; + Trace("ite::constantIteEqualsConstant") << instance << "->" << res << endl; return res; } std::pair pair = make_pair(cite, constant); @@ -1090,7 +1090,7 @@ Node ITESimplifier::constantIteEqualsConstant(TNode cite, TNode constant) d_constantIteEqualsConstantCache.find(pair); if (eq_pos != d_constantIteEqualsConstantCache.end()) { - Debug("ite::constantIteEqualsConstant") + Trace("ite::constantIteEqualsConstant") << instance << "->" << (*eq_pos).second << endl; return (*eq_pos).second; } @@ -1105,7 +1105,7 @@ Node ITESimplifier::constantIteEqualsConstant(TNode cite, TNode constant) { // probably unreachable d_constantIteEqualsConstantCache[pair] = d_true; - Debug("ite::constantIteEqualsConstant") + Trace("ite::constantIteEqualsConstant") << instance << "->" << d_true << endl; return d_true; } @@ -1128,7 +1128,7 @@ Node ITESimplifier::constantIteEqualsConstant(TNode cite, TNode constant) } ++itesMade; d_constantIteEqualsConstantCache[pair] = boolIte; - // Debug("ite::constantIteEqualsConstant") << instance << "->" << boolIte + // Trace("ite::constantIteEqualsConstant") << instance << "->" << boolIte // << endl; return boolIte; } @@ -1136,7 +1136,7 @@ Node ITESimplifier::constantIteEqualsConstant(TNode cite, TNode constant) else { d_constantIteEqualsConstantCache[pair] = d_false; - Debug("ite::constantIteEqualsConstant") + Trace("ite::constantIteEqualsConstant") << instance << "->" << d_false << endl; return d_false; } @@ -1157,7 +1157,7 @@ Node ITESimplifier::intersectConstantIte(TNode lcite, TNode rcite) unsigned preNumBranches = numBranches; unsigned preNumFalseBranches = numFalseBranches; Node bterm = constantIteEqualsConstant(cite, constant); - Debug("intersectConstantIte") << (numBranches - preNumBranches) << " " + Trace("intersectConstantIte") << (numBranches - preNumBranches) << " " << (numFalseBranches - preNumFalseBranches) << " " << (itesMade - preItesMade) << endl; return bterm; @@ -1452,13 +1452,13 @@ uint32_t countReachable(TNode x, Kind k) Node ITESimplifier::simpITEAtom(TNode atom) { CVC5_UNUSED static int instance = 0; - Debug("ite::atom") << "still simplifying " << (++instance) << endl; + Trace("ite::atom") << "still simplifying " << (++instance) << endl; Node attempt = transformAtom(atom); - Debug("ite::atom") << " finished " << instance << endl; + Trace("ite::atom") << " finished " << instance << endl; if (!attempt.isNull()) { Node rewritten = rewrite(attempt); - Debug("ite::print-success") + Trace("ite::print-success") << instance << " " << "rewriting " << countReachable(rewritten, kind::ITE) << " from " << countReachable(atom, kind::ITE) << endl @@ -1479,9 +1479,9 @@ Node ITESimplifier::simpITEAtom(TNode atom) { Assert(leavesAreConst(simpContext) && !containsTermITE(simpContext)); ++(d_statistics.d_unexpected); - Debug("ite::simpite") << instance << " " + Trace("ite::simpite") << instance << " " << "how about?" << atom << endl; - Debug("ite::simpite") << instance << " " + Trace("ite::simpite") << instance << " " << "\t" << simpContext << endl; return rewrite(simpContext); } @@ -1489,19 +1489,19 @@ Node ITESimplifier::simpITEAtom(TNode atom) if (!n.isNull()) { ++(d_statistics.d_unexpected); - Debug("ite::simpite") << instance << " " + Trace("ite::simpite") << instance << " " << "here?" << atom << endl; - Debug("ite::simpite") << instance << " " + Trace("ite::simpite") << instance << " " << "\t" << n << endl; return n; } } } - if (Debug.isOn("ite::simpite")) + if (TraceIsOn("ite::simpite")) { if (countReachable(atom, kind::ITE) > 0) { - Debug("ite::simpite") << instance << " " + Trace("ite::simpite") << instance << " " << "remaining " << atom << endl; } } diff --git a/src/proof/conv_proof_generator.cpp b/src/proof/conv_proof_generator.cpp index 1c4e2de5d..67f6d9678 100644 --- a/src/proof/conv_proof_generator.cpp +++ b/src/proof/conv_proof_generator.cpp @@ -197,7 +197,7 @@ std::shared_ptr TConvProofGenerator::getProofFor(Node f) Node conc = getProofForRewriting(f[0], lpf, d_tcontext); if (conc != f) { - bool debugTraceEnabled = Trace.isOn("tconv-pf-gen-debug"); + bool debugTraceEnabled = TraceIsOn("tconv-pf-gen-debug"); Assert(conc.getKind() == EQUAL && conc[0] == f[0]); std::stringstream serr; serr << "TConvProofGenerator::getProofFor: " << toStringDebug() diff --git a/src/proof/conv_seq_proof_generator.cpp b/src/proof/conv_seq_proof_generator.cpp index 7b6a06ddd..491e454e6 100644 --- a/src/proof/conv_seq_proof_generator.cpp +++ b/src/proof/conv_seq_proof_generator.cpp @@ -102,7 +102,7 @@ std::shared_ptr TConvSeqProofGenerator::getSubsequenceProofFor( serr << "expected after conversions: " << f[1] << std::endl; serr << " actual after conversions: " << curr << std::endl; - if (Trace.isOn("tconv-seq-pf-gen-debug")) + if (TraceIsOn("tconv-seq-pf-gen-debug")) { Trace("tconv-pf-gen-debug") << "Printing conversion steps..." << std::endl; diff --git a/src/proof/lazy_proof_chain.cpp b/src/proof/lazy_proof_chain.cpp index 3280626ad..a29e3cdd1 100644 --- a/src/proof/lazy_proof_chain.cpp +++ b/src/proof/lazy_proof_chain.cpp @@ -140,7 +140,7 @@ std::shared_ptr LazyCDProofChain::getProofFor(Node fact) visited[cur] = true; continue; } - if (Trace.isOn("lazy-cdproofchain")) + if (TraceIsOn("lazy-cdproofchain")) { unsigned alreadyToVisit = 0; Trace("lazy-cdproofchain") @@ -319,7 +319,7 @@ void LazyCDProofChain::addLazyStep(Node expected, { allowedLeaves.push_back(link.first); } - if (Trace.isOn("lazy-cdproofchain")) + if (TraceIsOn("lazy-cdproofchain")) { Trace("lazy-cdproofchain") << "Checking relative to leaves...\n"; for (const Node& n : allowedLeaves) diff --git a/src/proof/proof_checker.cpp b/src/proof/proof_checker.cpp index b688a28f3..189bc5e87 100644 --- a/src/proof/proof_checker.cpp +++ b/src/proof/proof_checker.cpp @@ -131,7 +131,7 @@ Node ProofChecker::check( return Node::null(); } cchildren.push_back(cres); - if (Trace.isOn("pfcheck")) + if (TraceIsOn("pfcheck")) { std::stringstream ssc; pc->printDebug(ssc); @@ -164,7 +164,7 @@ Node ProofChecker::checkDebug(PfRule id, const char* traceTag) { std::stringstream out; - bool traceEnabled = Trace.isOn(traceTag); + bool traceEnabled = TraceIsOn(traceTag); // Since we are debugging, we want to treat trusted (null) checkers as // a failure. We only enable output if the trace is enabled for efficiency. Node res = @@ -256,7 +256,7 @@ Node ProofChecker::checkInternal(PfRule id, if (enableOutput) { out << serr.str() << std::endl; - if (Trace.isOn("proof-pedantic")) + if (TraceIsOn("proof-pedantic")) { Trace("proof-pedantic") << "Failed pedantic check for " << id << std::endl; @@ -343,7 +343,7 @@ bool ProofChecker::isPedanticFailure(PfRule id, out << "pedantic level for " << id << " not met (rule level is " << itp->second << " which is at or below the pedantic level " << d_pclevel << ")"; - bool pedanticTraceEnabled = Trace.isOn("proof-pedantic"); + bool pedanticTraceEnabled = TraceIsOn("proof-pedantic"); if (!pedanticTraceEnabled) { out << ", use -t proof-pedantic for details"; diff --git a/src/proof/proof_ensure_closed.cpp b/src/proof/proof_ensure_closed.cpp index 3e91aa799..3df32a0a9 100644 --- a/src/proof/proof_ensure_closed.cpp +++ b/src/proof/proof_ensure_closed.cpp @@ -42,19 +42,19 @@ void ensureClosedWrtInternal(Node proven, // proofs not enabled, do not do check return; } - bool isTraceDebug = Trace.isOn(c); + bool isTraceDebug = TraceIsOn(c); if (options::proofCheck() != options::ProofCheckMode::EAGER && !isTraceDebug) { // trace is off and proof new eager checking is off, do not do check return; } std::stringstream sdiag; - bool isTraceOn = Trace.isOn(c); + bool isTraceOn = TraceIsOn(c); if (!isTraceOn) { sdiag << ", use -t " << c << " for details"; } - bool dumpProofTraceOn = Trace.isOn("dump-proof-error"); + bool dumpProofTraceOn = TraceIsOn("dump-proof-error"); if (!dumpProofTraceOn) { sdiag << ", use -t dump-proof-error for details on proof"; diff --git a/src/proof/proof_node_manager.cpp b/src/proof/proof_node_manager.cpp index c832ac3fa..7bea8f3f2 100644 --- a/src/proof/proof_node_manager.cpp +++ b/src/proof/proof_node_manager.cpp @@ -214,7 +214,7 @@ std::shared_ptr ProofNodeManager::mkScope( // should be arguments to SCOPE. std::stringstream ss; - bool dumpProofTraceOn = Trace.isOn("dump-proof-error"); + bool dumpProofTraceOn = TraceIsOn("dump-proof-error"); if (dumpProofTraceOn) { ss << "The proof : " << *pf << std::endl; diff --git a/src/proof/proof_node_updater.cpp b/src/proof/proof_node_updater.cpp index 47f30f9bb..3e8c394ff 100644 --- a/src/proof/proof_node_updater.cpp +++ b/src/proof/proof_node_updater.cpp @@ -51,7 +51,7 @@ void ProofNodeUpdater::process(std::shared_ptr pf) { if (d_debugFreeAssumps) { - if (Trace.isOn("pfnu-debug")) + if (TraceIsOn("pfnu-debug")) { Trace("pfnu-debug2") << "Initial proof: " << *pf.get() << std::endl; Trace("pfnu-debug") << "ProofNodeUpdater::process" << std::endl; diff --git a/src/proof/unsat_core.cpp b/src/proof/unsat_core.cpp index 419dda9e2..499af3049 100644 --- a/src/proof/unsat_core.cpp +++ b/src/proof/unsat_core.cpp @@ -26,13 +26,13 @@ namespace cvc5 { UnsatCore::UnsatCore(const std::vector& core) : d_useNames(false), d_core(core), d_names() { - Debug("core") << "UnsatCore size " << d_core.size() << std::endl; + Trace("core") << "UnsatCore size " << d_core.size() << std::endl; } UnsatCore::UnsatCore(std::vector& names) : d_useNames(true), d_core(), d_names(names) { - Debug("core") << "UnsatCore (names) size " << d_names.size() << std::endl; + Trace("core") << "UnsatCore (names) size " << d_names.size() << std::endl; } const std::vector& UnsatCore::getCore() const { return d_core; } diff --git a/src/prop/cryptominisat.cpp b/src/prop/cryptominisat.cpp index 446ddd2d4..45e9cc8a5 100644 --- a/src/prop/cryptominisat.cpp +++ b/src/prop/cryptominisat.cpp @@ -114,10 +114,10 @@ ClauseId CryptoMinisatSolver::addXorClause(SatClause& clause, bool rhs, bool removable) { - Debug("sat::cryptominisat") << "Add xor clause " << clause <<" = " << rhs << "\n"; + Trace("sat::cryptominisat") << "Add xor clause " << clause <<" = " << rhs << "\n"; if (!d_okay) { - Debug("sat::cryptominisat") << "Solver unsat: not adding clause.\n"; + Trace("sat::cryptominisat") << "Solver unsat: not adding clause.\n"; return ClauseIdError; } @@ -136,10 +136,10 @@ ClauseId CryptoMinisatSolver::addXorClause(SatClause& clause, } ClauseId CryptoMinisatSolver::addClause(SatClause& clause, bool removable){ - Debug("sat::cryptominisat") << "Add clause " << clause <<"\n"; + Trace("sat::cryptominisat") << "Add clause " << clause <<"\n"; if (!d_okay) { - Debug("sat::cryptominisat") << "Solver unsat: not adding clause.\n"; + Trace("sat::cryptominisat") << "Solver unsat: not adding clause.\n"; return ClauseIdError; } diff --git a/src/prop/minisat/core/Solver.cc b/src/prop/minisat/core/Solver.cc index 2d79e2900..75e1d831f 100644 --- a/src/prop/minisat/core/Solver.cc +++ b/src/prop/minisat/core/Solver.cc @@ -257,12 +257,12 @@ Var Solver::newVar(bool sign, bool dvar, bool isTheoryAtom, bool preRegister, bo setDecisionVar(v, dvar); - Debug("minisat") << "new var " << v << std::endl; + Trace("minisat") << "new var " << v << std::endl; // If the variable is introduced at non-zero level, we need to reintroduce it on backtracks if (preRegister) { - Debug("minisat") << " To register at level " << decisionLevel() + Trace("minisat") << " To register at level " << decisionLevel() << std::endl; variables_to_register.push(VarIntroInfo(v, decisionLevel())); } @@ -290,7 +290,7 @@ void Solver::resizeVars(int newSize) { theory.shrink(shrinkSize); } - if (Debug.isOn("minisat::pop")) { + if (TraceIsOn("minisat::pop")) { for (int i = 0; i < trail.size(); ++ i) { Assert(var(trail[i]) < nVars()); } @@ -303,7 +303,7 @@ CRef Solver::reason(Var x) { // If we already have a reason, just return it if (vardata[x].d_reason != CRef_Lazy) { - if (Trace.isOn("pf::sat")) + if (TraceIsOn("pf::sat")) { Trace("pf::sat") << " Solver::reason: " << vardata[x].d_reason << ", "; if (vardata[x].d_reason == CRef_Undef) @@ -529,7 +529,7 @@ bool Solver::addClause_(vec& ps, bool removable, ClauseId& id) if(assigns[var(ps[0])] == l_Undef) { Assert(assigns[var(ps[0])] != l_False); uncheckedEnqueue(ps[0], cr); - Debug("cores") << "i'm registering a unit clause, maybe input" + Trace("cores") << "i'm registering a unit clause, maybe input" << std::endl; if (ps.size() == 1) { @@ -570,14 +570,14 @@ bool Solver::addClause_(vec& ps, bool removable, ClauseId& id) void Solver::attachClause(CRef cr) { const Clause& c = ca[cr]; - if (Debug.isOn("minisat")) + if (TraceIsOn("minisat")) { - Debug("minisat") << "Solver::attachClause(" << c << "): "; + Trace("minisat") << "Solver::attachClause(" << c << "): "; for (unsigned i = 0, size = c.size(); i < size; ++i) { - Debug("minisat") << c[i] << " "; + Trace("minisat") << c[i] << " "; } - Debug("minisat") << ", level " << c.level() << "\n"; + Trace("minisat") << ", level " << c.level() << "\n"; } Assert(c.size() > 1); watches[~c[0]].push(Watcher(cr, c[1])); @@ -589,17 +589,17 @@ void Solver::attachClause(CRef cr) { void Solver::detachClause(CRef cr, bool strict) { const Clause& c = ca[cr]; - Debug("minisat") << "Solver::detachClause(" << c << ")" << std::endl; - if (Debug.isOn("minisat")) + Trace("minisat") << "Solver::detachClause(" << c << ")" << std::endl; + if (TraceIsOn("minisat")) { - Debug("minisat") << "Solver::detachClause(" << c << "), CRef " << cr + Trace("minisat") << "Solver::detachClause(" << c << "), CRef " << cr << ", clause "; for (unsigned i = 0, size = c.size(); i < size; ++i) { - Debug("minisat") << c[i] << " "; + Trace("minisat") << c[i] << " "; } - Debug("minisat") << "\n"; + Trace("minisat") << "\n"; } Assert(c.size() > 1); @@ -618,15 +618,15 @@ void Solver::detachClause(CRef cr, bool strict) { void Solver::removeClause(CRef cr) { Clause& c = ca[cr]; - if (Debug.isOn("minisat")) + if (TraceIsOn("minisat")) { - Debug("minisat") << "Solver::removeClause(" << c << "), CRef " << cr + Trace("minisat") << "Solver::removeClause(" << c << "), CRef " << cr << ", clause "; for (unsigned i = 0, size = c.size(); i < size; ++i) { - Debug("minisat") << c[i] << " "; + Trace("minisat") << c[i] << " "; } - Debug("minisat") << "\n"; + Trace("minisat") << "\n"; } detachClause(cr); // Don't leave pointers to free'd memory! @@ -667,7 +667,7 @@ bool Solver::satisfied(const Clause& c) const { // Revert to the state at given level (keeping all assignment at 'level' but not beyond). // void Solver::cancelUntil(int level) { - Debug("minisat") << "minisat::cancelUntil(" << level << ")" << std::endl; + Trace("minisat") << "minisat::cancelUntil(" << level << ")" << std::endl; if (decisionLevel() > level){ // Pop the SMT context @@ -718,13 +718,13 @@ Lit Solver::pickBranchLit() MinisatSatSolver::toMinisatLit(d_proxy->getNextTheoryDecisionRequest()); while (nextLit != lit_Undef) { if(value(var(nextLit)) == l_Undef) { - Debug("theoryDecision") + Trace("theoryDecision") << "getNextTheoryDecisionRequest(): now deciding on " << nextLit << std::endl; decisions++; // org-mode tracing -- theory decision - if (Trace.isOn("dtview")) + if (TraceIsOn("dtview")) { dtviewDecisionHelper( d_context->getLevel(), @@ -733,7 +733,7 @@ Lit Solver::pickBranchLit() options().base.incrementalSolving); } - if (Trace.isOn("dtview::prop")) + if (TraceIsOn("dtview::prop")) { dtviewPropagationHeaderHelper(d_context->getLevel(), options().base.incrementalSolving); @@ -741,14 +741,14 @@ Lit Solver::pickBranchLit() return nextLit; } else { - Debug("theoryDecision") + Trace("theoryDecision") << "getNextTheoryDecisionRequest(): would decide on " << nextLit << " but it already has an assignment" << std::endl; } nextLit = MinisatSatSolver::toMinisatLit( d_proxy->getNextTheoryDecisionRequest()); } - Debug("theoryDecision") + Trace("theoryDecision") << "getNextTheoryDecisionRequest(): decide on another literal" << std::endl; @@ -769,7 +769,7 @@ Lit Solver::pickBranchLit() } // org-mode tracing -- decision engine decision - if (Trace.isOn("dtview")) + if (TraceIsOn("dtview")) { dtviewDecisionHelper( d_context->getLevel(), @@ -778,7 +778,7 @@ Lit Solver::pickBranchLit() options().base.incrementalSolving); } - if (Trace.isOn("dtview::prop")) + if (TraceIsOn("dtview::prop")) { dtviewPropagationHeaderHelper(d_context->getLevel(), options().base.incrementalSolving); @@ -833,7 +833,7 @@ Lit Solver::pickBranchLit() } // org-mode tracing -- decision engine decision - if (Trace.isOn("dtview")) + if (TraceIsOn("dtview")) { dtviewDecisionHelper( d_context->getLevel(), @@ -842,7 +842,7 @@ Lit Solver::pickBranchLit() options().base.incrementalSolving); } - if (Trace.isOn("dtview::prop")) + if (TraceIsOn("dtview::prop")) { dtviewPropagationHeaderHelper(d_context->getLevel(), options().base.incrementalSolving); @@ -904,7 +904,7 @@ int Solver::analyze(CRef confl, vec& out_learnt, int& out_btlevel) if (c.removable()) claBumpActivity(c); } - if (Trace.isOn("pf::sat")) + if (TraceIsOn("pf::sat")) { Trace("pf::sat") << "Solver::analyze: conflict clause "; for (unsigned i = 0, size = ca[confl].size(); i < size; ++i) @@ -966,15 +966,15 @@ int Solver::analyze(CRef confl, vec& out_learnt, int& out_btlevel) } while (pathC > 0); out_learnt[0] = ~p; - if (Debug.isOn("newproof::sat")) + if (TraceIsOn("newproof::sat")) { - Debug("newproof::sat") << "finished with learnt clause "; + Trace("newproof::sat") << "finished with learnt clause "; for (unsigned i = 0, size = out_learnt.size(); i < size; ++i) { prop::SatLiteral satLit = toSatLiteral(out_learnt[i]); - Debug("newproof::sat") << satLit << " "; + Trace("newproof::sat") << satLit << " "; } - Debug("newproof::sat") << "\n"; + Trace("newproof::sat") << "\n"; } // Simplify conflict clause: @@ -996,7 +996,7 @@ int Solver::analyze(CRef confl, vec& out_learnt, int& out_btlevel) } else { if (needProof()) { - Debug("newproof::sat") + Trace("newproof::sat") << "Solver::analyze: redundant lit " << toSatLiteral(out_learnt[i]) << "\n"; d_pfManager->addResolutionStep(out_learnt[i], true); @@ -1136,28 +1136,28 @@ void Solver::analyzeFinal(Lit p, vec& out_conflict) void Solver::uncheckedEnqueue(Lit p, CRef from) { - if (Debug.isOn("minisat")) + if (TraceIsOn("minisat")) { - Debug("minisat") << "unchecked enqueue of " << p << " (" + Trace("minisat") << "unchecked enqueue of " << p << " (" << trail_index(var(p)) << ") trail size is " << trail.size() << " cap is " << trail.capacity() << ", reason is " << from << ", "; if (from == CRef_Lazy) { - Debug("minisat") << "CRef_Lazy"; + Trace("minisat") << "CRef_Lazy"; } else if (from == CRef_Undef) { - Debug("minisat") << "CRef_Undef"; + Trace("minisat") << "CRef_Undef"; } else { for (unsigned i = 0, size = ca[from].size(); i < size; ++i) { - Debug("minisat") << ca[from][i] << " "; + Trace("minisat") << ca[from][i] << " "; } } - Debug("minisat") << "\n"; + Trace("minisat") << "\n"; } Assert(value(p) == l_Undef); Assert(var(p) < nVars()); @@ -1228,7 +1228,7 @@ CRef Solver::propagate(TheoryCheckType type) } } else { // if dumping decision tree, print the conflict - if (Trace.isOn("dtview::conflict")) + if (TraceIsOn("dtview::conflict")) { if (confl != CRef_Undef) { @@ -1270,16 +1270,16 @@ void Solver::propagateTheory() { MinisatSatSolver::toMinisatClause(propagatedLiteralsClause, propagatedLiterals); int oldTrailSize = trail.size(); - Debug("minisat") << "old trail size is " << oldTrailSize << ", propagating " << propagatedLiterals.size() << " lits..." << std::endl; + Trace("minisat") << "old trail size is " << oldTrailSize << ", propagating " << propagatedLiterals.size() << " lits..." << std::endl; for (unsigned i = 0, i_end = propagatedLiterals.size(); i < i_end; ++ i) { - Debug("minisat") << "Theory propagated: " << propagatedLiterals[i] << std::endl; + Trace("minisat") << "Theory propagated: " << propagatedLiterals[i] << std::endl; // multiple theories can propagate the same literal Lit p = propagatedLiterals[i]; if (value(p) == l_Undef) { uncheckedEnqueue(p, CRef_Lazy); } else { if (value(p) == l_False) { - Debug("minisat") << "Conflict in theory propagation" << std::endl; + Trace("minisat") << "Conflict in theory propagation" << std::endl; SatClause explanation_cl; d_proxy->explainPropagation(MinisatSatSolver::toSatLiteral(p), explanation_cl); @@ -1331,7 +1331,7 @@ CRef Solver::propagateBool() num_props++; // if propagation tracing enabled, print boolean propagation - if (Trace.isOn("dtview::prop")) + if (TraceIsOn("dtview::prop")) { dtviewBoolPropagationHelper( decisionLevel(), p, d_proxy, options().base.incrementalSolving); @@ -1684,7 +1684,7 @@ lbool Solver::search(int nof_conflicts) if (next == lit_Undef) { // We need to do a full theory check to confirm - Debug("minisat::search") + Trace("minisat::search") << "Doing a full theory check..." << std::endl; check_type = CHECK_FINAL; continue; @@ -1744,7 +1744,7 @@ static double luby(double y, int x){ // NOTE: assumptions passed in member-variable 'assumptions'. lbool Solver::solve_() { - Debug("minisat") << "nvars = " << nVars() << std::endl; + Trace("minisat") << "nvars = " << nVars() << std::endl; ScopedBool scoped_bool(minisat_busy, true); @@ -1793,7 +1793,7 @@ lbool Solver::solve_() model.growTo(nVars()); for (int i = 0; i < nVars(); i++) { model[i] = value(i); - Debug("minisat") << i << " = " << model[i] << std::endl; + Trace("minisat") << i << " = " << model[i] << std::endl; } } else if (status == l_False && d_conflict.size() == 0) @@ -1948,13 +1948,13 @@ void Solver::push() Assert(decisionLevel() == 0); ++assertionLevel; - Debug("minisat") << "in user push, increasing assertion level to " << assertionLevel << std::endl; + Trace("minisat") << "in user push, increasing assertion level to " << assertionLevel << std::endl; trail_ok.push(ok); assigns_lim.push(assigns.size()); d_context->push(); // SAT context for cvc5 - Debug("minisat") << "MINISAT PUSH assertionLevel is " << assertionLevel << ", trail.size is " << trail.size() << std::endl; + Trace("minisat") << "MINISAT PUSH assertionLevel is " << assertionLevel << ", trail.size is " << trail.size() << std::endl; } void Solver::pop() @@ -1965,11 +1965,11 @@ void Solver::pop() // Pop the trail below the user level --assertionLevel; - Debug("minisat") << "in user pop, decreasing assertion level to " + Trace("minisat") << "in user pop, decreasing assertion level to " << assertionLevel << "\n" << cvc5::push; while (true) { - Debug("minisat") << "== unassigning " << trail.last() << std::endl; + Trace("minisat") << "== unassigning " << trail.last() << std::endl; Var x = var(trail.last()); if (user_level(x) > assertionLevel) { assigns[x] = l_Undef; @@ -1989,11 +1989,11 @@ void Solver::pop() // Remove the clauses removeClausesAboveLevel(clauses_persistent, assertionLevel); removeClausesAboveLevel(clauses_removable, assertionLevel); - Debug("minisat") << cvc5::pop; + Trace("minisat") << cvc5::pop; // Pop the SAT context to notify everyone d_context->pop(); // SAT context for cvc5 - Debug("minisat") << "MINISAT POP assertionLevel is " << assertionLevel + Trace("minisat") << "MINISAT POP assertionLevel is " << assertionLevel << ", trail.size is " << trail.size() << "\n"; // Pop the created variables resizeVars(assigns_lim.last()); @@ -2007,7 +2007,7 @@ void Solver::pop() CRef Solver::updateLemmas() { - Debug("minisat::lemmas") << "Solver::updateLemmas() begin" << std::endl; + Trace("minisat::lemmas") << "Solver::updateLemmas() begin" << std::endl; // Avoid adding lemmas indefinitely without resource-out d_proxy->spendResource(Resource::LemmaStep); @@ -2040,14 +2040,14 @@ CRef Solver::updateLemmas() { Assert(!options().smt.unsatCores && !needProof()); conflict = CRef_Lazy; backtrackLevel = 0; - Debug("minisat::lemmas") << "Solver::updateLemmas(): found empty clause" << std::endl; + Trace("minisat::lemmas") << "Solver::updateLemmas(): found empty clause" << std::endl; continue; } // Sort the lemma to be able to attach sort(lemma, lt); // See if the lemma propagates something if (lemma.size() == 1 || value(lemma[1]) == l_False) { - Debug("minisat::lemmas") << "found unit " << lemma.size() << std::endl; + Trace("minisat::lemmas") << "found unit " << lemma.size() << std::endl; // This lemma propagates, see which level we need to backtrack to int currentBacktrackLevel = lemma.size() == 1 ? 0 : level(var(lemma[1])); // Even if the first literal is true, we should propagate it at this level (unless it's set at a lower level) @@ -2060,7 +2060,7 @@ CRef Solver::updateLemmas() { } // Pop so that propagation would be current - Debug("minisat::lemmas") << "Solver::updateLemmas(): backtracking to " << backtrackLevel << " from " << decisionLevel() << std::endl; + Trace("minisat::lemmas") << "Solver::updateLemmas(): backtracking to " << backtrackLevel << " from " << decisionLevel() << std::endl; cancelUntil(backtrackLevel); } @@ -2105,10 +2105,10 @@ CRef Solver::updateLemmas() { if (value(lemma[0]) == l_False) { // We have a conflict if (lemma.size() > 1) { - Debug("minisat::lemmas") << "Solver::updateLemmas(): conflict" << std::endl; + Trace("minisat::lemmas") << "Solver::updateLemmas(): conflict" << std::endl; conflict = lemma_ref; } else { - Debug("minisat::lemmas") << "Solver::updateLemmas(): unit conflict or empty clause" << std::endl; + Trace("minisat::lemmas") << "Solver::updateLemmas(): unit conflict or empty clause" << std::endl; conflict = CRef_Lazy; if (needProof()) { @@ -2116,8 +2116,8 @@ CRef Solver::updateLemmas() { } } } else { - Debug("minisat::lemmas") << "lemma size is " << lemma.size() << std::endl; - Debug("minisat::lemmas") << "lemma ref is " << lemma_ref << std::endl; + Trace("minisat::lemmas") << "lemma size is " << lemma.size() << std::endl; + Trace("minisat::lemmas") << "lemma ref is " << lemma_ref << std::endl; uncheckedEnqueue(lemma[0], lemma_ref); } } @@ -2132,14 +2132,14 @@ CRef Solver::updateLemmas() { theoryConflict = true; } - Debug("minisat::lemmas") << "Solver::updateLemmas() end" << std::endl; + Trace("minisat::lemmas") << "Solver::updateLemmas() end" << std::endl; return conflict; } void ClauseAllocator::reloc(CRef& cr, ClauseAllocator& to) { - Debug("minisat") << "ClauseAllocator::reloc: cr " << cr << std::endl; + Trace("minisat") << "ClauseAllocator::reloc: cr " << cr << std::endl; // FIXME what is this CRef_lazy if (cr == CRef_Lazy) return; diff --git a/src/prop/minisat/core/Solver.h b/src/prop/minisat/core/Solver.h index 23dc7baae..2f19c6e16 100644 --- a/src/prop/minisat/core/Solver.h +++ b/src/prop/minisat/core/Solver.h @@ -586,7 +586,7 @@ inline bool Solver::isPropagatedBy(Var x, const Clause& c) const inline bool Solver::isDecision(Var x) const { - Debug("minisat") << "var " << x << " is a decision iff " + Trace("minisat") << "var " << x << " is a decision iff " << (vardata[x].d_reason == CRef_Undef) << " && " << level(x) << " > 0" << std::endl; return vardata[x].d_reason == CRef_Undef && level(x) > 0; diff --git a/src/prop/minisat/minisat.cpp b/src/prop/minisat/minisat.cpp index a8da07753..b41742cbe 100644 --- a/src/prop/minisat/minisat.cpp +++ b/src/prop/minisat/minisat.cpp @@ -257,7 +257,7 @@ bool MinisatSatSolver::properExplanation(SatLiteral lit, SatLiteral expl) const void MinisatSatSolver::requirePhase(SatLiteral lit) { Assert(!d_minisat->rnd_pol); - Debug("minisat") << "requirePhase(" << lit << ")" << " " << lit.getSatVariable() << " " << lit.isNegated() << std::endl; + Trace("minisat") << "requirePhase(" << lit << ")" << " " << lit.getSatVariable() << " " << lit.isNegated() << std::endl; SatVariable v = lit.getSatVariable(); d_minisat->freezePolarity(v, lit.isNegated()); } diff --git a/src/prop/minisat/simp/SimpSolver.cc b/src/prop/minisat/simp/SimpSolver.cc index 32b0b736f..78fda6ca7 100644 --- a/src/prop/minisat/simp/SimpSolver.cc +++ b/src/prop/minisat/simp/SimpSolver.cc @@ -218,7 +218,7 @@ bool SimpSolver::addClause_(vec& ps, bool removable, ClauseId& id) void SimpSolver::removeClause(CRef cr) { const Clause& c = ca[cr]; - Debug("minisat") << "SimpSolver::removeClause(" << c << ")" << std::endl; + Trace("minisat") << "SimpSolver::removeClause(" << c << ")" << std::endl; if (use_simplification) for (int i = 0; i < c.size(); i++){ diff --git a/src/prop/opt_clauses_manager.cpp b/src/prop/opt_clauses_manager.cpp index 20dee7296..495b564b3 100644 --- a/src/prop/opt_clauses_manager.cpp +++ b/src/prop/opt_clauses_manager.cpp @@ -67,7 +67,7 @@ void OptimizedClausesManager::contextNotifyPop() ++it; continue; } - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { Trace("sat-proof") << "Should remove from map pfs of [" << it->first << "]:\n"; diff --git a/src/prop/proof_cnf_stream.cpp b/src/prop/proof_cnf_stream.cpp index a3c8d4c71..34442b143 100644 --- a/src/prop/proof_cnf_stream.cpp +++ b/src/prop/proof_cnf_stream.cpp @@ -62,7 +62,7 @@ std::string ProofCnfStream::identify() const { return "ProofCnfStream"; } Node ProofCnfStream::normalizeAndRegister(TNode clauseNode) { Node normClauseNode = d_psb.factorReorderElimDoubleNeg(clauseNode); - if (Trace.isOn("cnf") && normClauseNode != clauseNode) + if (TraceIsOn("cnf") && normClauseNode != clauseNode) { Trace("cnf") << push << "ProofCnfStream::normalizeAndRegister: steps to normalized " diff --git a/src/prop/proof_post_processor.cpp b/src/prop/proof_post_processor.cpp index 596d2f7d9..b85265427 100644 --- a/src/prop/proof_post_processor.cpp +++ b/src/prop/proof_post_processor.cpp @@ -70,7 +70,7 @@ bool ProofPostprocessCallback::update(Node res, // get proof from proof cnf stream pfn = d_proofCnfStream->getProofFor(f); Assert(pfn != nullptr && pfn->getResult() == f); - if (Trace.isOn("prop-proof-pp")) + if (TraceIsOn("prop-proof-pp")) { Trace("prop-proof-pp") << "=== Connect CNF proof for: " << f << "\n"; Trace("prop-proof-pp") << *pfn.get() << "\n"; diff --git a/src/prop/prop_engine.cpp b/src/prop/prop_engine.cpp index 066c8395f..4c099ad0f 100644 --- a/src/prop/prop_engine.cpp +++ b/src/prop/prop_engine.cpp @@ -77,7 +77,7 @@ PropEngine::PropEngine(Env& env, TheoryEngine* te) d_interrupted(false), d_assumptions(d_env.getUserContext()) { - Debug("prop") << "Constructing the PropEngine" << std::endl; + Trace("prop") << "Constructing the PropEngine" << std::endl; context::UserContext* userContext = d_env.getUserContext(); ProofNodeManager* pnm = d_env.getProofNodeManager(); @@ -145,7 +145,7 @@ void PropEngine::finishInit() } PropEngine::~PropEngine() { - Debug("prop") << "Destructing the PropEngine" << std::endl; + Trace("prop") << "Destructing the PropEngine" << std::endl; d_decisionEngine.reset(nullptr); delete d_cnfStream; delete d_satSolver; @@ -172,7 +172,7 @@ void PropEngine::assertInputFormulas( d_theoryProxy->notifyInputFormulas(assertions, skolemMap); for (const Node& node : assertions) { - Debug("prop") << "assertFormula(" << node << ")" << std::endl; + Trace("prop") << "assertFormula(" << node << ")" << std::endl; assertInternal(node, false, false, true); } } @@ -199,7 +199,7 @@ void PropEngine::assertLemma(TrustNode tlemma, theory::LemmaProperty p) } } - if (Trace.isOn("te-lemma")) + if (TraceIsOn("te-lemma")) { Trace("te-lemma") << "Lemma, output: " << tplemma.getProven() << std::endl; for (const theory::SkolemLemma& lem : ppLemmas) @@ -216,7 +216,7 @@ void PropEngine::assertLemma(TrustNode tlemma, theory::LemmaProperty p) void PropEngine::assertTrustedLemmaInternal(TrustNode trn, bool removable) { Node node = trn.getNode(); - Debug("prop::lemmas") << "assertLemma(" << node << ")" << std::endl; + Trace("prop::lemmas") << "assertLemma(" << node << ")" << std::endl; bool negated = trn.getKind() == TrustNodeKind::CONFLICT; // should have a proof generator if the theory engine is proof producing Assert(!d_env.isTheoryProofProducing() || trn.getGenerator() != nullptr); @@ -295,7 +295,7 @@ void PropEngine::assertLemmasInternal( } void PropEngine::requirePhase(TNode n, bool phase) { - Debug("prop") << "requirePhase(" << n << ", " << phase << ")" << std::endl; + Trace("prop") << "requirePhase(" << n << ", " << phase << ")" << std::endl; Assert(n.getType().isBoolean()); SatLiteral lit = d_cnfStream->getLiteral(n); @@ -324,7 +324,7 @@ int32_t PropEngine::getIntroLevel(Node lit) const void PropEngine::printSatisfyingAssignment(){ const CnfStream::NodeToLiteralMap& transCache = d_cnfStream->getTranslationCache(); - Debug("prop-value") << "Literal | Value | Expr" << std::endl + Trace("prop-value") << "Literal | Value | Expr" << std::endl << "----------------------------------------" << "-----------------" << std::endl; for(CnfStream::NodeToLiteralMap::const_iterator i = transCache.begin(), @@ -336,14 +336,14 @@ void PropEngine::printSatisfyingAssignment(){ if(!l.isNegated()) { Node n = curr.first; SatValue value = d_satSolver->modelValue(l); - Debug("prop-value") << "'" << l << "' " << value << " " << n << std::endl; + Trace("prop-value") << "'" << l << "' " << value << " " << n << std::endl; } } } Result PropEngine::checkSat() { Assert(!d_inCheckSat) << "Sat solver in solve()!"; - Debug("prop") << "PropEngine::checkSat()" << std::endl; + Trace("prop") << "PropEngine::checkSat()" << std::endl; // Mark that we are in the checkSat ScopedBool scopedBool(d_inCheckSat); @@ -390,11 +390,11 @@ Result PropEngine::checkSat() { return Result(Result::SAT_UNKNOWN, why); } - if( result == SAT_VALUE_TRUE && Debug.isOn("prop") ) { + if( result == SAT_VALUE_TRUE && TraceIsOn("prop") ) { printSatisfyingAssignment(); } - Debug("prop") << "PropEngine::checkSat() => " << result << std::endl; + Trace("prop") << "PropEngine::checkSat() => " << result << std::endl; if (result == SAT_VALUE_TRUE && d_theoryProxy->isIncomplete()) { return Result(Result::SAT_UNKNOWN, Result::INCOMPLETE); @@ -525,20 +525,20 @@ void PropEngine::push() { Assert(!d_inCheckSat) << "Sat solver in solve()!"; d_satSolver->push(); - Debug("prop") << "push()" << std::endl; + Trace("prop") << "push()" << std::endl; } void PropEngine::pop() { Assert(!d_inCheckSat) << "Sat solver in solve()!"; d_satSolver->pop(); - Debug("prop") << "pop()" << std::endl; + Trace("prop") << "pop()" << std::endl; } void PropEngine::resetTrail() { d_satSolver->resetTrail(); - Debug("prop") << "resetTrail()" << std::endl; + Trace("prop") << "resetTrail()" << std::endl; } unsigned PropEngine::getAssertionLevel() const @@ -556,7 +556,7 @@ void PropEngine::interrupt() d_interrupted = true; d_satSolver->interrupt(); - Debug("prop") << "interrupt()" << std::endl; + Trace("prop") << "interrupt()" << std::endl; } void PropEngine::spendResource(Resource r) diff --git a/src/prop/prop_proof_manager.cpp b/src/prop/prop_proof_manager.cpp index 4fb027e54..c72d20047 100644 --- a/src/prop/prop_proof_manager.cpp +++ b/src/prop/prop_proof_manager.cpp @@ -71,7 +71,7 @@ std::shared_ptr PropPfManager::getProof() << "PropPfManager::getProof: Getting resolution proof of false\n"; std::shared_ptr conflictProof = d_satSolver->getProof(); Assert(conflictProof); - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { std::vector fassumps; expr::getFreeAssumptions(conflictProof.get(), fassumps); @@ -88,7 +88,7 @@ std::shared_ptr PropPfManager::getProof() } // connect it with CNF proof d_pfpp->process(conflictProof); - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { std::vector fassumps; expr::getFreeAssumptions(conflictProof.get(), fassumps); diff --git a/src/prop/sat_proof_manager.cpp b/src/prop/sat_proof_manager.cpp index fd57fb13c..582aa5253 100644 --- a/src/prop/sat_proof_manager.cpp +++ b/src/prop/sat_proof_manager.cpp @@ -64,7 +64,7 @@ Node SatProofManager::getClauseNode(const Minisat::Clause& clause) void SatProofManager::startResChain(const Minisat::Clause& start) { - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { Trace("sat-proof") << "SatProofManager::startResChain: "; printClause(start); @@ -112,7 +112,7 @@ void SatProofManager::addResolutionStep(const Minisat::Clause& clause, // negation in the first clause, which means that the third argument of the // tuple must be false d_resLinks.emplace_back(clauseNode, negated ? litNode[0] : litNode, negated); - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { Trace("sat-proof") << "SatProofManager::addResolutionStep: {" << satLit.isNegated() << "} [" << ~satLit << "] "; @@ -132,7 +132,7 @@ void SatProofManager::endResChain(Minisat::Lit lit) void SatProofManager::endResChain(const Minisat::Clause& clause) { - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { Trace("sat-proof") << "SatProofManager::endResChain: chain_res for "; printClause(clause); @@ -286,7 +286,7 @@ void SatProofManager::processRedundantLit( << "reasonRef " << reasonRef << " and d_satSolver->ca.size() " << d_solver->ca.size() << "\n"; const Minisat::Clause& reason = d_solver->ca[reasonRef]; - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { Trace("sat-proof") << "reason: "; printClause(reason); @@ -372,7 +372,7 @@ void SatProofManager::explainLit(SatLiteral lit, << d_solver->ca.size() << "\n"; const Minisat::Clause& reason = d_solver->ca[reasonRef]; unsigned size = reason.size(); - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { Trace("sat-proof") << "SatProofManager::explainLit: with clause: "; printClause(reason); @@ -428,7 +428,7 @@ void SatProofManager::explainLit(SatLiteral lit, premises.insert(childPremises.begin(), childPremises.end()); premises.insert(d_cnfStream->getNodeCache()[~currLit]); } - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { Trace("sat-proof") << pop << "SatProofManager::explainLit: chain_res for " << lit << ", " << litNode << " with clauses:\n"; @@ -475,7 +475,7 @@ void SatProofManager::finalizeProof(Node inConflictNode, { return; } - if (Trace.isOn("sat-proof-debug2")) + if (TraceIsOn("sat-proof-debug2")) { Trace("sat-proof-debug2") << push << "SatProofManager::finalizeProof: saved proofs in chain:\n"; @@ -587,7 +587,7 @@ void SatProofManager::finalizeProof(Node inConflictNode, premises.insert(negatedLitNode); Trace("sat-proof") << "===========\n"; } - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { Trace("sat-proof") << "SatProofManager::finalizeProof: chain_res for false " "with clauses:\n"; @@ -619,7 +619,7 @@ void SatProofManager::finalizeProof(Node inConflictNode, Trace("sat-proof-debug") << "sat proof of flase: " << *pfn.get() << "\n"; std::vector fassumps; expr::getFreeAssumptions(pfn.get(), fassumps); - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { for (const Node& fa : fassumps) { @@ -731,7 +731,7 @@ void SatProofManager::finalizeProof(Minisat::Lit inConflict, bool adding) void SatProofManager::finalizeProof(const Minisat::Clause& inConflict, bool adding) { - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { Trace("sat-proof") << "SatProofManager::finalizeProof: conflicting clause: "; diff --git a/src/prop/theory_proxy.cpp b/src/prop/theory_proxy.cpp index 78e011e74..e89d43e07 100644 --- a/src/prop/theory_proxy.cpp +++ b/src/prop/theory_proxy.cpp @@ -154,14 +154,14 @@ void TheoryProxy::theoryPropagate(std::vector& output) { std::vector outputNodes; d_theoryEngine->getPropagatedLiterals(outputNodes); for (unsigned i = 0, i_end = outputNodes.size(); i < i_end; ++ i) { - Debug("prop-explain") << "theoryPropagate() => " << outputNodes[i] << std::endl; + Trace("prop-explain") << "theoryPropagate() => " << outputNodes[i] << std::endl; output.push_back(d_cnfStream->getLiteral(outputNodes[i])); } } void TheoryProxy::explainPropagation(SatLiteral l, SatClause& explanation) { TNode lNode = d_cnfStream->getNode(l); - Debug("prop-explain") << "explainPropagation(" << lNode << ")" << std::endl; + Trace("prop-explain") << "explainPropagation(" << lNode << ")" << std::endl; TrustNode tte = d_theoryEngine->getExplanation(lNode); Node theoryExplanation = tte.getNode(); @@ -171,7 +171,7 @@ void TheoryProxy::explainPropagation(SatLiteral l, SatClause& explanation) { || tte.getGenerator()); d_propEngine->getProofCnfStream()->convertPropagation(tte); } - Debug("prop-explain") << "explainPropagation() => " << theoryExplanation + Trace("prop-explain") << "explainPropagation() => " << theoryExplanation << std::endl; explanation.push_back(l); if (theoryExplanation.getKind() == kind::AND) @@ -185,7 +185,7 @@ void TheoryProxy::explainPropagation(SatLiteral l, SatClause& explanation) { { explanation.push_back(~d_cnfStream->getLiteral(theoryExplanation)); } - if (Trace.isOn("sat-proof")) + if (TraceIsOn("sat-proof")) { std::stringstream ss; ss << "TheoryProxy::explainPropagation: clause for lit is "; @@ -200,7 +200,7 @@ void TheoryProxy::explainPropagation(SatLiteral l, SatClause& explanation) { void TheoryProxy::enqueueTheoryLiteral(const SatLiteral& l) { Node literalNode = d_cnfStream->getNode(l); - Debug("prop") << "enqueueing theory literal " << l << " " << literalNode << std::endl; + Trace("prop") << "enqueueing theory literal " << l << " " << literalNode << std::endl; Assert(!literalNode.isNull()); d_queue.push(literalNode); } diff --git a/src/smt/expand_definitions.cpp b/src/smt/expand_definitions.cpp index f8affe42b..7bf8ad787 100644 --- a/src/smt/expand_definitions.cpp +++ b/src/smt/expand_definitions.cpp @@ -125,14 +125,14 @@ TrustNode ExpandDefs::expandDefinitions(TNode n, // Working upwards // Reconstruct the node from it's (now rewritten) children on the stack - Debug("expand") << "cons : " << node << std::endl; + Trace("expand") << "cons : " << node << std::endl; if (node.getNumChildren() > 0) { // cout << "cons : " << node << std::endl; NodeBuilder nb(node.getKind()); if (node.getMetaKind() == metakind::PARAMETERIZED) { - Debug("expand") << "op : " << node.getOperator() << std::endl; + Trace("expand") << "op : " << node.getOperator() << std::endl; // cout << "op : " << node.getOperator() << std::endl; nb << node.getOperator(); } @@ -142,7 +142,7 @@ TrustNode ExpandDefs::expandDefinitions(TNode n, Node expanded = result.top(); result.pop(); // cout << "exchld : " << expanded << std::endl; - Debug("expand") << "exchld : " << expanded << std::endl; + Trace("expand") << "exchld : " << expanded << std::endl; nb << expanded; } node = nb; diff --git a/src/smt/model_core_builder.cpp b/src/smt/model_core_builder.cpp index 9a9c56972..96d675d18 100644 --- a/src/smt/model_core_builder.cpp +++ b/src/smt/model_core_builder.cpp @@ -32,7 +32,7 @@ bool ModelCoreBuilder::setModelCore(const std::vector& assertions, // already computed return true; } - if (Trace.isOn("model-core")) + if (TraceIsOn("model-core")) { Trace("model-core") << "Compute model core, assertions:" << std::endl; for (const Node& a : assertions) diff --git a/src/smt/process_assertions.cpp b/src/smt/process_assertions.cpp index e6185dffc..d0d2cf6e2 100644 --- a/src/smt/process_assertions.cpp +++ b/src/smt/process_assertions.cpp @@ -109,8 +109,8 @@ bool ProcessAssertions::apply(Assertions& as) Trace("smt-proc") << "ProcessAssertions::processAssertions() begin" << endl; Trace("smt") << "ProcessAssertions::processAssertions()" << endl; - Debug("smt") << "#Assertions : " << assertions.size() << endl; - Debug("smt") << "#Assumptions: " << assertions.getNumAssumptions() << endl; + Trace("smt") << "#Assertions : " << assertions.size() << endl; + Trace("smt") << "#Assumptions: " << assertions.getNumAssumptions() << endl; if (assertions.size() == 0) { @@ -144,7 +144,7 @@ bool ProcessAssertions::apply(Assertions& as) << "ProcessAssertions::processAssertions() : post-definition-expansion" << endl; - Debug("smt") << " assertions : " << assertions.size() << endl; + Trace("smt") << " assertions : " << assertions.size() << endl; if (options().quantifiers.globalNegate) { @@ -173,7 +173,7 @@ bool ProcessAssertions::apply(Assertions& as) applyPass("ackermann", as); } - Debug("smt") << " assertions : " << assertions.size() << endl; + Trace("smt") << " assertions : " << assertions.size() << endl; bool noConflict = true; @@ -280,7 +280,7 @@ bool ProcessAssertions::apply(Assertions& as) { applyPass("static-learning", as); } - Debug("smt") << " assertions : " << assertions.size() << endl; + Trace("smt") << " assertions : " << assertions.size() << endl; if (options().smt.learnedRewrite) { @@ -323,11 +323,11 @@ bool ProcessAssertions::apply(Assertions& as) // begin: INVARIANT to maintain: no reordering of assertions or // introducing new ones - Debug("smt") << " assertions : " << assertions.size() << endl; + Trace("smt") << " assertions : " << assertions.size() << endl; - Debug("smt") << "ProcessAssertions::processAssertions() POST SIMPLIFICATION" + Trace("smt") << "ProcessAssertions::processAssertions() POST SIMPLIFICATION" << endl; - Debug("smt") << " assertions : " << assertions.size() << endl; + Trace("smt") << " assertions : " << assertions.size() << endl; // ensure rewritten applyPass("rewrite", as); @@ -397,7 +397,7 @@ bool ProcessAssertions::simplifyAssertions(Assertions& as) } } - Debug("smt") << " assertions : " << assertions.size() << endl; + Trace("smt") << " assertions : " << assertions.size() << endl; // ITE simplification if (options().smt.doITESimp @@ -411,7 +411,7 @@ bool ProcessAssertions::simplifyAssertions(Assertions& as) } } - Debug("smt") << " assertions : " << assertions.size() << endl; + Trace("smt") << " assertions : " << assertions.size() << endl; // Unconstrained simplification if (options().smt.unconstrainedSimp) @@ -432,7 +432,7 @@ bool ProcessAssertions::simplifyAssertions(Assertions& as) dumpAssertions("post-repeatsimp", as); Trace("smt") << "POST repeatSimp" << endl; - Debug("smt") << " assertions : " << assertions.size() << endl; + Trace("smt") << " assertions : " << assertions.size() << endl; } catch (TypeCheckingExceptionPrivate& tcep) { @@ -450,7 +450,7 @@ bool ProcessAssertions::simplifyAssertions(Assertions& as) void ProcessAssertions::dumpAssertions(const std::string& key, Assertions& as) { - bool isTraceOn = Trace.isOn(key); + bool isTraceOn = TraceIsOn(key); if (!isTraceOn) { return; diff --git a/src/smt/proof_final_callback.cpp b/src/smt/proof_final_callback.cpp index 4cf3a68f7..12c6d9384 100644 --- a/src/smt/proof_final_callback.cpp +++ b/src/smt/proof_final_callback.cpp @@ -119,7 +119,7 @@ bool ProofFinalCallback::shouldUpdate(std::shared_ptr pn, } } // print for debugging - if (Trace.isOn("final-pf-hole")) + if (TraceIsOn("final-pf-hole")) { // currently only track theory rewrites if (r == PfRule::THEORY_REWRITE) diff --git a/src/smt/proof_manager.cpp b/src/smt/proof_manager.cpp index e8b07a819..7858769ea 100644 --- a/src/smt/proof_manager.cpp +++ b/src/smt/proof_manager.cpp @@ -113,7 +113,7 @@ void PfManager::setFinalProof(std::shared_ptr pfn, Assertions& as) // response. This method would need to cache its result otherwise. Trace("smt-proof") << "SolverEngine::setFinalProof(): get proof body...\n"; - if (Trace.isOn("smt-proof-debug")) + if (TraceIsOn("smt-proof-debug")) { Trace("smt-proof-debug") << "SolverEngine::setFinalProof(): Proof node for false:\n"; @@ -124,7 +124,7 @@ void PfManager::setFinalProof(std::shared_ptr pfn, Assertions& as) std::vector assertions; getAssertions(as, assertions); - if (Trace.isOn("smt-proof")) + if (TraceIsOn("smt-proof")) { Trace("smt-proof") << "SolverEngine::setFinalProof(): get free assumptions..." diff --git a/src/smt/proof_post_processor.cpp b/src/smt/proof_post_processor.cpp index 07f5e2c35..3c62d86c4 100644 --- a/src/smt/proof_post_processor.cpp +++ b/src/smt/proof_post_processor.cpp @@ -122,7 +122,7 @@ bool ProofPostprocessCallback::update(Node res, else { Assert(pfn->getResult() == f); - if (Trace.isOn("smt-proof-pp")) + if (TraceIsOn("smt-proof-pp")) { Trace("smt-proof-pp") << "=== Connect proof for preprocessing: " << f << std::endl; @@ -261,7 +261,7 @@ Node ProofPostprocessCallback::eliminateCrowdingLits( std::sort(lastInclusion.begin(), lastInclusion.end(), cmp); // order eliminators std::sort(eliminators.begin(), eliminators.end()); - if (Trace.isOn("smt-proof-pp-debug")) + if (TraceIsOn("smt-proof-pp-debug")) { Trace("smt-proof-pp-debug") << "crowding lits last inclusion:\n"; for (const auto& pair : lastInclusion) @@ -1067,14 +1067,14 @@ Node ProofPostprocessCallback::expandMacros(PfRule id, } else if (id == PfRule::MACRO_ARITH_SCALE_SUM_UB) { - Debug("macro::arith") << "Expand MACRO_ARITH_SCALE_SUM_UB" << std::endl; - if (Debug.isOn("macro::arith")) + Trace("macro::arith") << "Expand MACRO_ARITH_SCALE_SUM_UB" << std::endl; + if (TraceIsOn("macro::arith")) { for (const auto& child : children) { - Debug("macro::arith") << " child: " << child << std::endl; + Trace("macro::arith") << " child: " << child << std::endl; } - Debug("macro::arith") << " args: " << args << std::endl; + Trace("macro::arith") << " args: " << args << std::endl; } Assert(args.size() == children.size()); NodeManager* nm = NodeManager::currentNM(); @@ -1115,7 +1115,7 @@ Node ProofPostprocessCallback::expandMacros(PfRule id, Node sumBounds = steps.tryStep(PfRule::ARITH_SUM_UB, scaledRels, {}); cdp->addSteps(steps); - Debug("macro::arith") << "Expansion done. Proved: " << sumBounds + Trace("macro::arith") << "Expansion done. Proved: " << sumBounds << std::endl; return sumBounds; } diff --git a/src/smt/solver_engine_scope.cpp b/src/smt/solver_engine_scope.cpp index 6b12e4f74..1709e7ac7 100644 --- a/src/smt/solver_engine_scope.cpp +++ b/src/smt/solver_engine_scope.cpp @@ -48,13 +48,13 @@ SolverEngineScope::SolverEngineScope(const SolverEngine* smt) { Assert(smt != nullptr); s_slvEngine_current = const_cast(smt); - Debug("current") << "smt scope: " << s_slvEngine_current << std::endl; + Trace("current") << "smt scope: " << s_slvEngine_current << std::endl; } SolverEngineScope::~SolverEngineScope() { s_slvEngine_current = d_oldSlvEngine; - Debug("current") << "smt scope: returning to " << s_slvEngine_current + Trace("current") << "smt scope: returning to " << s_slvEngine_current << std::endl; } diff --git a/src/smt/term_formula_removal.cpp b/src/smt/term_formula_removal.cpp index 341893a70..e15afaafa 100644 --- a/src/smt/term_formula_removal.cpp +++ b/src/smt/term_formula_removal.cpp @@ -162,7 +162,7 @@ Node RemoveTermFormulas::runInternal(TNode assertion, TrustNode newLem; bool inQuant, inTerm; RtfTermContext::getFlags(nodeVal, inQuant, inTerm); - Debug("ite") << "removeITEs(" << node << ")" + Trace("ite") << "removeITEs(" << node << ")" << " " << inQuant << " " << inTerm << std::endl; Assert(!inQuant); Node currt = diff --git a/src/smt/unsat_core_manager.cpp b/src/smt/unsat_core_manager.cpp index 4d47b57ea..75cf725ee 100644 --- a/src/smt/unsat_core_manager.cpp +++ b/src/smt/unsat_core_manager.cpp @@ -42,7 +42,7 @@ void UnsatCoreManager::getUnsatCore(std::shared_ptr pfn, core.push_back(a); } } - if (Trace.isOn("unsat-core")) + if (TraceIsOn("unsat-core")) { Trace("unsat-core") << "UCManager::getUnsatCore():\n"; for (const Node& n : core) diff --git a/src/theory/arith/approx_simplex.cpp b/src/theory/arith/approx_simplex.cpp index 26f5ed1b4..c43a6494d 100644 --- a/src/theory/arith/approx_simplex.cpp +++ b/src/theory/arith/approx_simplex.cpp @@ -229,7 +229,7 @@ std::vector ApproximateSimplex::rationalToCfe(const Rational& q, int de mods.push_back(Integer()); Integer& back = mods.back(); back = carry.floor(); - Debug("rationalToCfe") << " cfe["< ApproximateSimplex::rationalToCfe(const Rational& q, int de Rational ApproximateSimplex::estimateWithCFE(const Rational& r, const Integer& K){ - Debug("estimateWithCFE") << "estimateWithCFE(" << r << ", " << K << ")" <" << numRows << endl; + Trace("approx") << "Row vars: " << v << "<->" << numRows << endl; }else{ ++numCols; d_colIndices.set(v, numCols); d_colToArithVar.set(numCols, v); - Debug("approx") << "Col vars: " << v << "<->" << numCols << endl; + Trace("approx") << "Col vars: " << v << "<->" << numCols << endl; } } Assert(numRows > 0); @@ -1102,7 +1102,7 @@ double ApproxGLPK::sumInfeasibilities(glp_prob* prob, bool mip) const{ if(newAssign > ub){ double ubinf = newAssign - ub; infeas += ubinf; - Debug("approx::soi") << "ub inf" << vi << " " << ubinf << " " << infeas << endl; + Trace("approx::soi") << "ub inf" << vi << " " << ubinf << " " << infeas << endl; } } if(lb != -DBL_MAX){ @@ -1110,7 +1110,7 @@ double ApproxGLPK::sumInfeasibilities(glp_prob* prob, bool mip) const{ double lbinf = lb - newAssign; infeas += lbinf; - Debug("approx::soi") << "lb inf" << vi << " " << lbinf << " " << infeas << endl; + Trace("approx::soi") << "lb inf" << vi << " " << lbinf << " " << infeas << endl; } } } @@ -1294,7 +1294,7 @@ static void loadCut(glp_tree *tree, CutInfo* cut){ static MirInfo* mirCut(glp_tree *tree, int exec_ord, int cut_ord){ - Debug("approx::mirCut") << "mirCut()" << exec_ord << endl; + Trace("approx::mirCut") << "mirCut()" << exec_ord << endl; MirInfo* mir; mir = new MirInfo(exec_ord, cut_ord); @@ -1313,16 +1313,16 @@ static MirInfo* mirCut(glp_tree *tree, int exec_ord, int cut_ord){ glp_ios_cut_get_mir_subst(tree, cut_ord, mir->subst); glp_ios_cut_get_mir_virtual_rows(tree, cut_ord, mir->vlbRows, mir->vubRows); - if(Debug.isOn("approx::mirCut")){ - Debug("approx::mirCut") << "mir_id: " << exec_ord << endl; - row_sum.print(Debug("approx::mirCut")); + if(TraceIsOn("approx::mirCut")){ + Trace("approx::mirCut") << "mir_id: " << exec_ord << endl; + row_sum.print(Trace("approx::mirCut")); } return mir; } static GmiInfo* gmiCut(glp_tree *tree, int exec_ord, int cut_ord){ - Debug("approx::gmiCut") << "gmiCut()" << exec_ord << endl; + Trace("approx::gmiCut") << "gmiCut()" << exec_ord << endl; int gmi_var; int write_pos; @@ -1352,17 +1352,17 @@ static GmiInfo* gmiCut(glp_tree *tree, int exec_ord, int cut_ord){ gmi->init_tab(N); gmi->basic = M+gmi_var; - Debug("approx::gmiCut") + Trace("approx::gmiCut") << gmi <<" " << gmi->basic << " " << cut_ord<<" " << M <<" " << gmi_var << endl; PrimitiveVec& tab_row = gmi->tab_row; - Debug("approx::gmiCut") << "Is N sufficient here?" << endl; + Trace("approx::gmiCut") << "Is N sufficient here?" << endl; tab_row.len = glp_eval_tab_row(lp, gmi->basic, tab_row.inds, tab_row.coeffs); - Debug("approx::gmiCut") << "gmi_var " << gmi_var << endl; + Trace("approx::gmiCut") << "gmi_var " << gmi_var << endl; - Debug("approx::gmiCut") << "tab_pos " << tab_row.len << endl; + Trace("approx::gmiCut") << "tab_pos " << tab_row.len << endl; write_pos = 1; for(read_pos = 1; read_pos <= tab_row.len; ++read_pos){ if (fabs(tab_row.coeffs[read_pos]) < 1e-10){ @@ -1373,16 +1373,16 @@ static GmiInfo* gmiCut(glp_tree *tree, int exec_ord, int cut_ord){ } } tab_row.len = write_pos-1; - Debug("approx::gmiCut") << "write_pos " << write_pos << endl; + Trace("approx::gmiCut") << "write_pos " << write_pos << endl; Assert(tab_row.len > 0); for(i = 1; i <= tab_row.len; ++i){ ind = tab_row.inds[i]; - Debug("approx::gmiCut") << "ind " << i << " " << ind << endl; + Trace("approx::gmiCut") << "ind " << i << " " << ind << endl; stat = (ind <= M) ? glp_get_row_stat(lp, ind) : glp_get_col_stat(lp, ind - M); - Debug("approx::gmiCut") << "ind " << i << " " << ind << " stat " << stat << endl; + Trace("approx::gmiCut") << "ind " << i << " " << ind << " stat " << stat << endl; switch (stat){ case GLP_NL: case GLP_NU: @@ -1395,8 +1395,8 @@ static GmiInfo* gmiCut(glp_tree *tree, int exec_ord, int cut_ord){ } } - if(Debug.isOn("approx::gmiCut")){ - gmi->print(Debug("approx::gmiCut")); + if(TraceIsOn("approx::gmiCut")){ + gmi->print(Trace("approx::gmiCut")); } return gmi; } @@ -1455,7 +1455,7 @@ static void glpkCallback(glp_tree *tree, void *info){ glpk_node_p = glp_ios_curr_node(tree); node_ord = glp_ios_node_ord(tree, glpk_node_p); Assert(cut_ord > 0); - Debug("approx") << "curr node " << glpk_node_p + Trace("approx") << "curr node " << glpk_node_p << " cut ordinal " << cut_ord << " node depth " << glp_ios_node_level(tree, glpk_node_p) << endl; @@ -1477,10 +1477,10 @@ static void glpkCallback(glp_tree *tree, void *info){ } break; case GLP_RF_COV: - Debug("approx") << "GLP_RF_COV" << endl; + Trace("approx") << "GLP_RF_COV" << endl; break; case GLP_RF_CLQ: - Debug("approx") << "GLP_RF_CLQ" << endl; + Trace("approx") << "GLP_RF_CLQ" << endl; break; default: break; @@ -1497,9 +1497,9 @@ static void glpkCallback(glp_tree *tree, void *info){ int N = glp_ios_selected_cuts(tree, ords, rows); NodeLog& nl = tl.getNode(node_ord); - Debug("approx") << glpk_node_p << " " << node_ord << " " << cuts << " " << N << std::endl; + Trace("approx") << glpk_node_p << " " << node_ord << " " << cuts << " " << N << std::endl; for(int i = 1; i <= N; ++i){ - Debug("approx") << "adding to " << node_ord <<" @ i= " << i + Trace("approx") << "adding to " << node_ord <<" @ i= " << i << " ords[i] = " << ords[i] << " rows[i] = " << rows[i] << endl; nl.addSelected(ords[i], rows[i]); @@ -1522,21 +1522,21 @@ static void glpkCallback(glp_tree *tree, void *info){ dn_ord = (dn >= 0) ? glp_ios_node_ord(tree, dn) : -1; up_ord = (up >= 0) ? glp_ios_node_ord(tree, up) : -1; - Debug("approx::") << "branch: "<< br_var << " " << br_val << " tree " << p << " " << dn << " " << up << endl; - Debug("approx::") << "\t " << p_ord << " " << dn_ord << " " << up_ord << endl; + Trace("approx::") << "branch: "<< br_var << " " << br_val << " tree " << p << " " << dn << " " << up << endl; + Trace("approx::") << "\t " << p_ord << " " << dn_ord << " " << up_ord << endl; if(dn < 0 && up < 0){ - Debug("approx::") << "branch close " << exec << endl; + Trace("approx::") << "branch close " << exec << endl; NodeLog& node = tl.getNode(p_ord); BranchCutInfo* cut_br = branchCut(tree, exec, br_var, br_val, dn < 0); node.addCut(cut_br); tl.close(p_ord); }else if(dn < 0 || up < 0){ - Debug("approx::") << "branch cut" << exec << endl; + Trace("approx::") << "branch cut" << exec << endl; NodeLog& node = tl.getNode(p_ord); BranchCutInfo* cut_br = branchCut(tree, exec, br_var, br_val, dn < 0); node.addCut(cut_br); }else{ - Debug("approx::") << "normal branch" << endl; + Trace("approx::") << "normal branch" << endl; tl.branch(p_ord, br_var, br_val, dn_ord, up_ord); } } @@ -1545,7 +1545,7 @@ static void glpkCallback(glp_tree *tree, void *info){ { glpk_node_p = glp_ios_curr_node(tree); node_ord = glp_ios_node_ord(tree, glpk_node_p); - Debug("approx::") << "close " << glpk_node_p << endl; + Trace("approx::") << "close " << glpk_node_p << endl; tl.close(node_ord); } break; @@ -1556,7 +1556,7 @@ static void glpkCallback(glp_tree *tree, void *info){ switch(glp_ios_reason(tree)){ case GLP_IBINGO: - Debug("approx::") << "bingo" << endl; + Trace("approx::") << "bingo" << endl; aux->term = MipBingo; glp_ios_terminate(tree); break; @@ -1663,19 +1663,19 @@ MipResult ApproxGLPK::solveMIP(bool activelyLog){ int res = glp_intopt(d_mipProb, &parm); - Debug("approx::solveMIP") << "res "<& xs, const DenseMap& xs, const DenseMapgetValue(); beta += bound * psi; - Debug("approx::sumConstraints") << " +("<& guess) const { DenseMap g = guess; removeAuxillaryVariables(d_vars, g); - if(Debug.isOn("guessIsConstructable")){ + if(TraceIsOn("guessIsConstructable")){ if(!g.empty()){ - Debug("approx::guessIsConstructable") << "guessIsConstructable failed " << g.size() << endl; - DenseVector::print(Debug("approx::guessIsConstructable"), g); - Debug("approx::guessIsConstructable") << endl; + Trace("approx::guessIsConstructable") << "guessIsConstructable failed " << g.size() << endl; + DenseVector::print(Trace("approx::guessIsConstructable"), g); + Trace("approx::guessIsConstructable") << endl; } } return g.empty(); @@ -1862,7 +1862,7 @@ bool ApproxGLPK::loadToBound(int nid, int M, int len, int* inds, int* statuses, return true; } if(c == NullConstraint){ - Debug("approx::") << "couldn't find " << v << " @ " << nid << endl; + Trace("approx::") << "couldn't find " << v << " @ " << nid << endl; return true; } Assert(c != NullConstraint); @@ -1873,18 +1873,18 @@ bool ApproxGLPK::loadToBound(int nid, int M, int len, int* inds, int* statuses, bool ApproxGLPK::checkCutOnPad(int nid, const CutInfo& cut) const{ - Debug("approx::checkCutOnPad") << "checkCutOnPad(" << nid <<", " << cut.getId() <<")"<& constructedLhs = d_pad.d_cut.lhs; const Rational& constructedRhs = d_pad.d_cut.rhs; std::unordered_set visited; if(constructedLhs.empty()){ - Debug("approx::checkCutOnPad") << "its empty?" <sgn() <= 0); if(d_pad.d_failure){ return true; } - Debug("approx::mir") << "applyCMIRRule() " << delta << " " << mir.delta << endl; + Trace("approx::mir") << "applyCMIRRule() " << delta << " " << mir.delta << endl; DenseMap::const_iterator iter, iend; iter = alpha.begin(), iend = alpha.end(); @@ -2132,29 +2132,29 @@ bool ApproxGLPK::attemptMir(int nid, const MirInfo& mir){ bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound& tmp){ if(ri <= 0) { return true; } - Debug("glpk::loadVB") << "loadVB()" << endl; + Trace("glpk::loadVB") << "loadVB()" << endl; ArithVar rowVar = _getArithVar(nid, M, ri); ArithVar contVar = _getArithVar(nid, M, j); if(rowVar == ARITHVAR_SENTINEL){ - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " rowVar is ARITHVAR_SENTINEL " << rowVar << endl; return true; } if(contVar == ARITHVAR_SENTINEL){ - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " contVar is ARITHVAR_SENTINEL " << contVar << endl; return true; } if(!d_vars.isAuxiliary(rowVar)){ - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " rowVar is not auxilliary " << rowVar << endl; return true; } // is integer is correct here if(d_vars.isInteger(contVar)){ - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " contVar is integer " << contVar << endl; return true; } @@ -2163,7 +2163,7 @@ bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound ConstraintP ub = d_vars.getUpperBoundConstraint(rowVar); if(lb != NullConstraint && ub != NullConstraint){ - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " lb and ub are both NULL " << lb << " " << ub << endl; return true; @@ -2171,20 +2171,20 @@ bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound ConstraintP rcon = lb == NullConstraint ? ub : lb; if(rcon == NullConstraint) { - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " rcon is NULL " << rcon << endl; return true; } if(!rcon->getValue().isZero()){ - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " rcon value is not 0 " << rcon->getValue() << endl; return true; } if(!d_vars.hasNode(rowVar)){ - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " does not have node " << rowVar << endl; return true; } @@ -2192,7 +2192,7 @@ bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound Polynomial p = Polynomial::parsePolynomial(d_vars.asNode(rowVar)); if (p.size() != 2) { - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " polynomial is not binary: " << p.getNode() << endl; return true; @@ -2205,13 +2205,13 @@ bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound Node nx2 = second.getVarList().getNode(); if(!d_vars.hasArithVar(nx1)) { - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " does not have a variable for nx1: " << nx1 << endl; return true; } if(!d_vars.hasArithVar(nx2)) { - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " does not have a variable for nx2 " << nx2 << endl; return true; @@ -2222,7 +2222,7 @@ bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound Assert(!c1.isZero()); Assert(!c2.isZero()); - Debug("glpk::loadVB") + Trace("glpk::loadVB") << " lb " << lb << " ub " << ub << " rcon " << rcon @@ -2235,14 +2235,14 @@ bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound Rational& cc = (x1 == contVar) ? c1 : c2; Rational& ic = (x1 == contVar) ? c2 : c1; - Debug("glpk::loadVB") + Trace("glpk::loadVB") << " cv " << contVar << " cc " << cc << " iv " << iv << " c2 " << ic << endl; if(!d_vars.isIntegerInput(iv)){ - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " iv is not an integer input variable " << iv << endl; return true; @@ -2253,7 +2253,7 @@ bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound if(rcon == ub){ // multiply by -1 cc = -cc; ic = - ic; } - Debug("glpk::loadVB") << " cv " << contVar + Trace("glpk::loadVB") << " cv " << contVar << " cc " << cc << " iv " << iv << " c2 " << ic << endl; @@ -2266,10 +2266,10 @@ bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound // cv >= -ic/cc * iv Assert(!cc.isZero()); Rational d = -ic/cc; - Debug("glpk::loadVB") << d << " " << cc.sgn() << endl; + Trace("glpk::loadVB") << d << " " << cc.sgn() << endl; bool nowUb = cc.sgn() < 0; if(wantUb != nowUb) { - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " wantUb is not nowUb " << wantUb << " " << nowUb << endl; @@ -2279,7 +2279,7 @@ bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound Kind rel = wantUb ? kind::LEQ : kind::GEQ; tmp = VirtualBound(contVar, rel, d, iv, rcon); - Debug("glpk::loadVB") << "loadVB()" + Trace("glpk::loadVB") << "loadVB()" << " was successful" << endl; return false; } @@ -2298,13 +2298,13 @@ bool ApproxGLPK::loadVirtualBoundsIntoPad(int nid, const MirInfo& mir){ if(d_pad.d_vlb.isKey(tmp.x)){ return true; } d_pad.d_vlb.set(tmp.x, tmp); }else if(mir.vlbRows[j] > 0){ - Debug("approx::mir") << "expected vlb to work" << endl; + Trace("approx::mir") << "expected vlb to work" << endl; } if(!loadVB(nid, M, j, mir.vubRows[j], true, tmp)){ if(d_pad.d_vub.isKey(tmp.x)){ return true; } d_pad.d_vub.set(tmp.x, tmp); }else if(mir.vubRows[j] > 0){ - Debug("approx::mir") << "expected vub to work" << endl; + Trace("approx::mir") << "expected vub to work" << endl; } } return false; @@ -2322,11 +2322,11 @@ bool ApproxGLPK::loadSlacksIntoPad(int nid, const MirInfo& mir){ SlackReplace rep; bool lb; ConstraintP b; - Debug("approx::mir") << "loadSlacksIntoPad(): N="<& mod = d_pad.d_mod.lhs; Rational& modRhs = d_pad.d_mod.rhs; - Debug("approx::mir") + Trace("approx::mir") << "buildModifiedRow()" << " |agg|=" << d_pad.d_agg.lhs.size() << " |mod|=" << d_pad.d_mod.lhs.size() @@ -2536,7 +2536,7 @@ bool ApproxGLPK::buildModifiedRow(int nid, const MirInfo& mir){ ArithVar x = *iter; const Rational& c = mod[x]; if(!d_pad.d_slacks.isKey(x)){ - Debug("approx::mir") << "missed x: " << x << endl; + Trace("approx::mir") << "missed x: " << x << endl; return true; } SlackReplace rep = d_pad.d_slacks[x]; @@ -2648,7 +2648,7 @@ bool ApproxGLPK::makeRangeForComplemented(int nid, const MirInfo& mir){ } } - Debug("approx::mir") << "makeRangeForComplemented()" << complemented << endl; + Trace("approx::mir") << "makeRangeForComplemented()" << complemented << endl; return false; } @@ -2681,7 +2681,7 @@ bool ApproxGLPK::constructMixedKnapsack(){ } } - Debug("approx::mir") + Trace("approx::mir") << "constructMixedKnapsack() " <<" dropped " << dropped <<" remain " << remain @@ -2713,10 +2713,10 @@ bool ApproxGLPK::gaussianElimConstructTableRow(int nid, int M, const PrimitiveVe if(d_vars.isAuxiliary(basic)) { return true; } - if(Debug.isOn("gaussianElimConstructTableRow")){ - Debug("gaussianElimConstructTableRow") << "1 gaussianElimConstructTableRow("< onrow; @@ -2724,14 +2724,14 @@ bool ApproxGLPK::gaussianElimConstructTableRow(int nid, int M, const PrimitiveVe int ind = vec.inds[i]; ArithVar var = _getArithVar(nid, M, ind); if(var == ARITHVAR_SENTINEL){ - Debug("gaussianElimConstructTableRow") << "couldn't find" << ind << " " << M << " " << nid << endl; + Trace("gaussianElimConstructTableRow") << "couldn't find" << ind << " " << M << " " << nid << endl; return true; } onrow.insert(var); } - Debug("gaussianElimConstructTableRow") << "2 gaussianElimConstructTableRow("< A; A.increaseSizeTo(d_vars.getNumberOfVariables()); @@ -2764,7 +2764,7 @@ bool ApproxGLPK::gaussianElimConstructTableRow(int nid, int M, const PrimitiveVe rows.push_back(make_pair(rid, ARITHVAR_SENTINEL)); } } - Debug("gaussianElimConstructTableRow") << "3 gaussianElimConstructTableRow("<::Entry& e = *k; tab.set(e.getColVar(), e.getCoefficient()); } - Debug("gaussianElimConstructTableRow") << "5 gaussianElimConstructTableRow("< cfe = estimateWithCFE(coeff, D); if (!cfe) @@ -2941,10 +2941,10 @@ bool ApproxGLPK::guessCoefficientsConstructTableRow(int nid, int M, const Primit return true; } tab.set(var, *cfe); - Debug("guessCoefficientsConstructTableRow") << var << " cfe " << cfe << endl; + Trace("guessCoefficientsConstructTableRow") << var << " cfe " << cfe << endl; } if(!guessIsConstructable(tab)){ - Debug("guessCoefficientsConstructTableRow") << "failed to construct with " << D << endl; + Trace("guessCoefficientsConstructTableRow") << "failed to construct with " << D << endl; return true; } tab.remove(basic); @@ -2966,7 +2966,7 @@ bool ApproxGLPK::constructGmiCut(){ bool anyInf; DeltaRational dbeta = sumConstraints(tabRow, toBound, &anyInf); const Rational& beta = dbeta.getNoninfinitesimalPart(); - Debug("approx::gmi") << dbeta << endl; + Trace("approx::gmi") << dbeta << endl; if(anyInf || beta.isIntegral()){ return true; } Rational one = Rational(1); @@ -2991,7 +2991,7 @@ bool ApproxGLPK::constructGmiCut(){ }else if(d_vars.isIntegerInput(x) && psi.isIntegral()){ // do not add a coefficient // nothing to explain - Debug("approx::gmi") << "skipping " << x << endl; + Trace("approx::gmi") << "skipping " << x << endl; }else{ explanation.insert(c); Rational phi; @@ -3020,24 +3020,24 @@ bool ApproxGLPK::constructGmiCut(){ } } } - if(Debug.isOn("approx::gmi")){ - Debug("approx::gmi") << "pre removeSlackVariables"; - d_pad.d_cut.print(Debug("approx::gmi")); - Debug("approx::gmi") << endl; + if(TraceIsOn("approx::gmi")){ + Trace("approx::gmi") << "pre removeSlackVariables"; + d_pad.d_cut.print(Trace("approx::gmi")); + Trace("approx::gmi") << endl; } removeAuxillaryVariables(d_vars, cut); - if(Debug.isOn("approx::gmi")){ - Debug("approx::gmi") << "post removeAuxillaryVariables"; - d_pad.d_cut.print(Debug("approx::gmi")); - Debug("approx::gmi") << endl; + if(TraceIsOn("approx::gmi")){ + Trace("approx::gmi") << "post removeAuxillaryVariables"; + d_pad.d_cut.print(Trace("approx::gmi")); + Trace("approx::gmi") << endl; } removeFixed(d_vars, d_pad.d_cut, explanation); - if(Debug.isOn("approx::gmi")){ - Debug("approx::gmi") << "post removeFixed"; - d_pad.d_cut.print(Debug("approx::gmi")); - Debug("approx::gmi") << endl; + if(TraceIsOn("approx::gmi")){ + Trace("approx::gmi") << "post removeFixed"; + d_pad.d_cut.print(Trace("approx::gmi")); + Trace("approx::gmi") << endl; } return false; } @@ -3072,7 +3072,7 @@ void ApproxGLPK::tryCut(int nid, CutInfo& cut) cut.swapExplanation(asvec); } }else{ - Debug("approx") << "failure " << cut.getKlass() << endl; + Trace("approx") << "failure " << cut.getKlass() << endl; } } diff --git a/src/theory/arith/arith_ite_utils.cpp b/src/theory/arith/arith_ite_utils.cpp index 029b74ed0..c43f16bd0 100644 --- a/src/theory/arith/arith_ite_utils.cpp +++ b/src/theory/arith/arith_ite_utils.cpp @@ -283,7 +283,7 @@ unsigned ArithIteUtils::getSubCount() const{ } void ArithIteUtils::addSubstitution(TNode f, TNode t){ - Debug("arith::ite") << "adding " << f << " -> " << t << endl; + Trace("arith::ite") << "adding " << f << " -> " << t << endl; d_subcount = d_subcount + 1; d_subs.addSubstitution(f, t); } @@ -418,7 +418,7 @@ bool ArithIteUtils::solveBinOr(TNode binor){ Assert(l.getKind() == kind::EQUAL); Assert(r.getKind() == kind::EQUAL); - Debug("arith::ite") << "bin or " << n << endl; + Trace("arith::ite") << "bin or " << n << endl; bool lArithEq = l.getKind() == kind::EQUAL && l[0].getType().isInteger(); bool rArithEq = r.getKind() == kind::EQUAL && r[0].getType().isInteger(); @@ -436,10 +436,10 @@ bool ArithIteUtils::solveBinOr(TNode binor){ }else if(l[1] == r[1]){ sel = l[1]; otherL = l[0]; otherR = r[0]; } - Debug("arith::ite") << "selected " << sel << endl; + Trace("arith::ite") << "selected " << sel << endl; if(sel.isVar() && sel.getKind() != kind::SKOLEM){ - Debug("arith::ite") << "others l:" << otherL << " r " << otherR << endl; + Trace("arith::ite") << "others l:" << otherL << " r " << otherR << endl; Node useForCmpL = selectForCmp(otherL); Node useForCmpR = selectForCmp(otherR); @@ -450,7 +450,7 @@ bool ArithIteUtils::solveBinOr(TNode binor){ Polynomial rside = Polynomial::parsePolynomial( useForCmpR ); Polynomial diff = lside-rside; - Debug("arith::ite") << "diff: " << diff.getNode() << endl; + Trace("arith::ite") << "diff: " << diff.getNode() << endl; if(diff.isConstant()){ // a: (sel = otherL) or (sel = otherR), otherL-otherR = c diff --git a/src/theory/arith/arith_static_learner.cpp b/src/theory/arith/arith_static_learner.cpp index 7a10d23bc..f33c065a0 100644 --- a/src/theory/arith/arith_static_learner.cpp +++ b/src/theory/arith/arith_static_learner.cpp @@ -101,14 +101,14 @@ void ArithStaticLearner::process(TNode n, NodeBuilder& learned, const TNodeSet& defTrue) { - Debug("arith::static") << "===================== looking at " << n << endl; + Trace("arith::static") << "===================== looking at " << n << endl; switch(n.getKind()){ case ITE: if (expr::hasBoundVar(n)) { // Unsafe with non-ground ITEs; do nothing - Debug("arith::static") + Trace("arith::static") << "(potentially) non-ground ITE, ignoring..." << endl; break; } @@ -168,7 +168,7 @@ void ArithStaticLearner::iteMinMax(TNode n, NodeBuilder& learned) case LEQ: { // (ite (<= x y) x y) Node nLeqX = NodeBuilder(LEQ) << n << t; Node nLeqY = NodeBuilder(LEQ) << n << e; - Debug("arith::static") << n << "is a min =>" << nLeqX << nLeqY << endl; + Trace("arith::static") << n << "is a min =>" << nLeqX << nLeqY << endl; learned << nLeqX << nLeqY; ++(d_statistics.d_iteMinMaxApplications); break; @@ -177,7 +177,7 @@ void ArithStaticLearner::iteMinMax(TNode n, NodeBuilder& learned) case GEQ: { // (ite (>= x y) x y) Node nGeqX = NodeBuilder(GEQ) << n << t; Node nGeqY = NodeBuilder(GEQ) << n << e; - Debug("arith::static") << n << "is a max =>" << nGeqX << nGeqY << endl; + Trace("arith::static") << n << "is a max =>" << nGeqX << nGeqY << endl; learned << nGeqX << nGeqY; ++(d_statistics.d_iteMinMaxApplications); break; @@ -191,7 +191,7 @@ void ArithStaticLearner::iteConstant(TNode n, NodeBuilder& learned) { Assert(n.getKind() == ITE); - Debug("arith::static") << "iteConstant(" << n << ")" << endl; + Trace("arith::static") << "iteConstant(" << n << ")" << endl; if (d_minMap.find(n[1]) != d_minMap.end() && d_minMap.find(n[2]) != d_minMap.end()) { const DeltaRational& first = d_minMap[n[1]]; @@ -206,7 +206,7 @@ void ArithStaticLearner::iteConstant(TNode n, NodeBuilder& learned) n, nm->mkConstRealOrInt(n.getType(), min.getNoninfinitesimalPart())); learned << nGeqMin; - Debug("arith::static") << n << " iteConstant" << nGeqMin << endl; + Trace("arith::static") << n << " iteConstant" << nGeqMin << endl; ++(d_statistics.d_iteConstantApplications); } } @@ -224,7 +224,7 @@ void ArithStaticLearner::iteConstant(TNode n, NodeBuilder& learned) n, nm->mkConstRealOrInt(n.getType(), max.getNoninfinitesimalPart())); learned << nLeqMax; - Debug("arith::static") << n << " iteConstant" << nLeqMax << endl; + Trace("arith::static") << n << " iteConstant" << nLeqMax << endl; ++(d_statistics.d_iteConstantApplications); } } @@ -254,7 +254,7 @@ void ArithStaticLearner::addBound(TNode n) { if (maxFind == d_maxMap.end() || (*maxFind).second > bound) { d_maxMap.insert(n[0], bound); - Debug("arith::static") << "adding bound " << n << endl; + Trace("arith::static") << "adding bound " << n << endl; } break; case kind::GT: bound = DeltaRational(constant, 1); CVC5_FALLTHROUGH; @@ -262,7 +262,7 @@ void ArithStaticLearner::addBound(TNode n) { if (minFind == d_minMap.end() || (*minFind).second < bound) { d_minMap.insert(n[0], bound); - Debug("arith::static") << "adding bound " << n << endl; + Trace("arith::static") << "adding bound " << n << endl; } break; default: Unhandled() << k; break; diff --git a/src/theory/arith/attempt_solution_simplex.cpp b/src/theory/arith/attempt_solution_simplex.cpp index be1c103fa..2ff166cbf 100644 --- a/src/theory/arith/attempt_solution_simplex.cpp +++ b/src/theory/arith/attempt_solution_simplex.cpp @@ -83,11 +83,11 @@ Result::Sat AttemptSolutionSDP::attempt(const ApproximateSimplex::Solution& sol) d_errorSet.setSelectionRule(options::ErrorSelectionRule::VAR_ORDER); if(processSignals()){ - Debug("arith::findModel") << "attemptSolution() early conflict" << endl; + Trace("arith::findModel") << "attemptSolution() early conflict" << endl; d_conflictVariables.purge(); return Result::UNSAT; }else if(d_errorSet.errorEmpty()){ - Debug("arith::findModel") << "attemptSolution() fixed itself" << endl; + Trace("arith::findModel") << "attemptSolution() fixed itself" << endl; return Result::SAT; } diff --git a/src/theory/arith/branch_and_bound.cpp b/src/theory/arith/branch_and_bound.cpp index 4aa9f009e..83c20330b 100644 --- a/src/theory/arith/branch_and_bound.cpp +++ b/src/theory/arith/branch_and_bound.cpp @@ -81,11 +81,11 @@ TrustNode BranchAndBound::branchIntegerVariable(TNode var, Rational value) Node less = nm->mkNode(LT, var, nm->mkConstInt(nearest)); Node greater = nm->mkNode(GT, var, nm->mkConstInt(nearest)); // TODO (project #37): justify. Thread proofs through *ensureLiteral*. - Debug("integers::pf") << "less: " << less << std::endl; - Debug("integers::pf") << "greater: " << greater << std::endl; - Debug("integers::pf") << "literal: " << literal << std::endl; - Debug("integers::pf") << "eq: " << eq << std::endl; - Debug("integers::pf") << "rawEq: " << rawEq << std::endl; + Trace("integers::pf") << "less: " << less << std::endl; + Trace("integers::pf") << "greater: " << greater << std::endl; + Trace("integers::pf") << "literal: " << literal << std::endl; + Trace("integers::pf") << "eq: " << eq << std::endl; + Trace("integers::pf") << "rawEq: " << rawEq << std::endl; Pf pfNotLit = d_pnm->mkAssume(literal.negate()); // rewrite notLiteral to notRawEq, using teq. Pf pfNotRawEq = diff --git a/src/theory/arith/congruence_manager.cpp b/src/theory/arith/congruence_manager.cpp index 6dc501c96..005596a4c 100644 --- a/src/theory/arith/congruence_manager.cpp +++ b/src/theory/arith/congruence_manager.cpp @@ -137,7 +137,7 @@ bool ArithCongruenceManager::ArithCongruenceNotify::eqNotifyTriggerPredicate( TNode predicate, bool value) { Assert(predicate.getKind() == kind::EQUAL); - Debug("arith::congruences") + Trace("arith::congruences") << "ArithCongruenceNotify::eqNotifyTriggerPredicate(" << predicate << ", " << (value ? "true" : "false") << ")" << std::endl; if (value) { @@ -147,7 +147,7 @@ bool ArithCongruenceManager::ArithCongruenceNotify::eqNotifyTriggerPredicate( } bool ArithCongruenceManager::ArithCongruenceNotify::eqNotifyTriggerTermEquality(TheoryId tag, TNode t1, TNode t2, bool value) { - Debug("arith::congruences") << "ArithCongruenceNotify::eqNotifyTriggerTermEquality(" << t1 << ", " << t2 << ", " << (value ? "true" : "false") << ")" << std::endl; + Trace("arith::congruences") << "ArithCongruenceNotify::eqNotifyTriggerTermEquality(" << t1 << ", " << t2 << ", " << (value ? "true" : "false") << ")" << std::endl; if (value) { return d_acm.propagate(t1.eqNode(t2)); } else { @@ -155,7 +155,7 @@ bool ArithCongruenceManager::ArithCongruenceNotify::eqNotifyTriggerTermEquality( } } void ArithCongruenceManager::ArithCongruenceNotify::eqNotifyConstantTermMerge(TNode t1, TNode t2) { - Debug("arith::congruences") << "ArithCongruenceNotify::eqNotifyConstantTermMerge(" << t1 << ", " << t2 << std::endl; + Trace("arith::congruences") << "ArithCongruenceNotify::eqNotifyConstantTermMerge(" << t1 << ", " << t2 << std::endl; d_acm.propagate(t1.eqNode(t2)); } void ArithCongruenceManager::ArithCongruenceNotify::eqNotifyNewClass(TNode t) { @@ -171,7 +171,7 @@ void ArithCongruenceManager::raiseConflict(Node conflict, std::shared_ptr pf) { Assert(!inConflict()); - Debug("arith::conflict") << "difference manager conflict " << conflict << std::endl; + Trace("arith::conflict") << "difference manager conflict " << conflict << std::endl; d_inConflict.raise(); d_raiseConflict.raiseEEConflict(conflict, pf); } @@ -256,7 +256,7 @@ void ArithCongruenceManager::watchedVariableIsZero(ConstraintCP lb, ConstraintCP } void ArithCongruenceManager::watchedVariableIsZero(ConstraintCP eq){ - Debug("arith::cong") << "Cong::watchedVariableIsZero: " << *eq << std::endl; + Trace("arith::cong") << "Cong::watchedVariableIsZero: " << *eq << std::endl; Assert(eq->isEquality()); Assert(eq->getValue().sgn() == 0); @@ -270,9 +270,9 @@ void ArithCongruenceManager::watchedVariableIsZero(ConstraintCP eq){ //These will be safe for propagation later as well NodeBuilder nb(Kind::AND); // An open proof of eq from literals now in reason. - if (Debug.isOn("arith::cong")) + if (TraceIsOn("arith::cong")) { - eq->printProofTree(Debug("arith::cong")); + eq->printProofTree(Trace("arith::cong")); } auto pf = eq->externalExplainByAssertions(nb); if (isProofEnabled()) @@ -287,7 +287,7 @@ void ArithCongruenceManager::watchedVariableIsZero(ConstraintCP eq){ } void ArithCongruenceManager::watchedVariableCannotBeZero(ConstraintCP c){ - Debug("arith::cong::notzero") + Trace("arith::cong::notzero") << "Cong::watchedVariableCannotBeZero " << *c << std::endl; ++(d_statistics.d_watchedVariableIsNotZero); @@ -299,11 +299,11 @@ void ArithCongruenceManager::watchedVariableCannotBeZero(ConstraintCP c){ NodeBuilder nb(Kind::AND); // An open proof of eq from literals now in reason. auto pf = c->externalExplainByAssertions(nb); - if (Debug.isOn("arith::cong::notzero")) + if (TraceIsOn("arith::cong::notzero")) { - Debug("arith::cong::notzero") << " original proof "; - pf->printDebug(Debug("arith::cong::notzero")); - Debug("arith::cong::notzero") << std::endl; + Trace("arith::cong::notzero") << " original proof "; + pf->printDebug(Trace("arith::cong::notzero")); + Trace("arith::cong::notzero") << std::endl; } Node reason = mkAndFromBuilder(nb); if (isProofEnabled()) @@ -316,7 +316,7 @@ void ArithCongruenceManager::watchedVariableCannotBeZero(ConstraintCP c){ } else { - Debug("arith::cong::notzero") + Trace("arith::cong::notzero") << " proof modification needed" << std::endl; // Four cases: @@ -341,9 +341,9 @@ void ArithCongruenceManager::watchedVariableCannotBeZero(ConstraintCP c){ PfRule::MACRO_SR_PRED_TRANSFORM, {sumPf}, {nm->mkConst(false)}); std::vector assumption = {isZero}; pf = d_pnm->mkScope(botPf, assumption, false); - Debug("arith::cong::notzero") << " new proof "; - pf->printDebug(Debug("arith::cong::notzero")); - Debug("arith::cong::notzero") << std::endl; + Trace("arith::cong::notzero") << " new proof "; + pf->printDebug(Trace("arith::cong::notzero")); + Trace("arith::cong::notzero") << std::endl; } Assert(pf->getResult() == disEq); } @@ -353,7 +353,7 @@ void ArithCongruenceManager::watchedVariableCannotBeZero(ConstraintCP c){ bool ArithCongruenceManager::propagate(TNode x){ - Debug("arith::congruenceManager")<< "ArithCongruenceManager::propagate("<getProofFor(trn.getProven()); @@ -397,7 +397,7 @@ bool ArithCongruenceManager::propagate(TNode x){ Assert(c != NullConstraint); } - Debug("arith::congruenceManager")<< "x is " + Trace("arith::congruenceManager")<< "x is " << c->hasProof() << " " << (x == rewritten) << " " << c->canBePropagated() << " " @@ -413,7 +413,7 @@ bool ArithCongruenceManager::propagate(TNode x){ ++(d_statistics.d_conflicts); raiseConflict(final); - Debug("arith::congruenceManager") << "congruenceManager found a conflict " << final << std::endl; + Trace("arith::congruenceManager") << "congruenceManager found a conflict " << final << std::endl; return false; } @@ -534,7 +534,7 @@ void ArithCongruenceManager::explain(TNode external, NodeBuilder& out) void ArithCongruenceManager::addWatchedPair(ArithVar s, TNode x, TNode y){ Assert(!isWatchedVariable(s)); - Debug("arith::congruenceManager") + Trace("arith::congruenceManager") << "addWatchedPair(" << s << ", " << x << ", " << y << ")" << std::endl; @@ -573,7 +573,7 @@ void ArithCongruenceManager::assertLitToEqualityEngine( { setProofFor(lit, pf); Trace("arith-pfee") << "Actually asserting" << std::endl; - if (Debug.isOn("arith-pfee")) + if (TraceIsOn("arith-pfee")) { Trace("arith-pfee") << "Proof: "; pf->printDebug(Trace("arith-pfee")); @@ -632,7 +632,7 @@ void ArithCongruenceManager::equalsConstant(ConstraintCP c){ Assert(c->isEquality()); ++(d_statistics.d_equalsConstantCalls); - Debug("equalsConstant") << "equals constant " << c << std::endl; + Trace("equalsConstant") << "equals constant " << c << std::endl; ArithVar x = c->getVariable(); Node xAsNode = d_avariables.asNode(x); @@ -660,7 +660,7 @@ void ArithCongruenceManager::equalsConstant(ConstraintCP lb, ConstraintCP ub){ Assert(lb->getVariable() == ub->getVariable()); ++(d_statistics.d_equalsConstantCalls); - Debug("equalsConstant") << "equals constant " << lb << std::endl + Trace("equalsConstant") << "equals constant " << lb << std::endl << ub << std::endl; ArithVar x = lb->getVariable(); diff --git a/src/theory/arith/constraint.cpp b/src/theory/arith/constraint.cpp index fcb6740f1..f412ba817 100644 --- a/src/theory/arith/constraint.cpp +++ b/src/theory/arith/constraint.cpp @@ -267,7 +267,7 @@ ConstraintP ValueCollection::getDisequality() const { void ValueCollection::push_into(std::vector& vec) const { - Debug("arith::constraint") << "push_into " << *this << endl; + Trace("arith::constraint") << "push_into " << *this << endl; if(hasEquality()){ vec.push_back(d_equality); } @@ -436,12 +436,12 @@ Constraint::~Constraint() { if(initialized()){ ValueCollection& vc = d_variablePosition->second; - Debug("arith::constraint") << "removing" << vc << endl; + Trace("arith::constraint") << "removing" << vc << endl; vc.remove(getType()); if(vc.empty()){ - Debug("arith::constraint") << "erasing" << vc << endl; + Trace("arith::constraint") << "erasing" << vc << endl; SortedConstraintMap& perVariable = d_database->getVariableSCM(getVariable()); perVariable.erase(d_variablePosition); } @@ -463,7 +463,7 @@ const ValueCollection& Constraint::getValueCollection() const{ ConstraintP Constraint::getCeiling() { - Debug("getCeiling") << "Constraint_::getCeiling on " << *this << endl; + Trace("getCeiling") << "Constraint_::getCeiling on " << *this << endl; Assert(getValue().getInfinitesimalPart().sgn() > 0); const DeltaRational ceiling(getValue().ceiling()); @@ -488,11 +488,11 @@ void Constraint::setAssertedToTheTheory(TNode witness, bool nowInConflict) { Assert(negationHasProof() == nowInConflict); d_database->pushAssertionOrderWatch(this, witness); - if(Debug.isOn("constraint::conflictCommit") && nowInConflict ){ - Debug("constraint::conflictCommit") << "inConflict@setAssertedToTheTheory"; - Debug("constraint::conflictCommit") << "\t" << this << std::endl; - Debug("constraint::conflictCommit") << "\t" << getNegation() << std::endl; - Debug("constraint::conflictCommit") << "\t" << getNegation()->externalExplainByAssertions() << std::endl; + if(TraceIsOn("constraint::conflictCommit") && nowInConflict ){ + Trace("constraint::conflictCommit") << "inConflict@setAssertedToTheTheory"; + Trace("constraint::conflictCommit") << "\t" << this << std::endl; + Trace("constraint::conflictCommit") << "\t" << getNegation() << std::endl; + Trace("constraint::conflictCommit") << "\t" << getNegation()->externalExplainByAssertions() << std::endl; } } @@ -552,10 +552,10 @@ bool Constraint::hasFarkasProof() const { bool Constraint::hasSimpleFarkasProof() const { - Debug("constraints::hsfp") << "hasSimpleFarkasProof " << this << std::endl; + Trace("constraints::hsfp") << "hasSimpleFarkasProof " << this << std::endl; if (!hasFarkasProof()) { - Debug("constraints::hsfp") << "There is no simple Farkas proof because " + Trace("constraints::hsfp") << "There is no simple Farkas proof because " "there is no farkas proof." << std::endl; return false; @@ -573,12 +573,12 @@ bool Constraint::hasSimpleFarkasProof() const } // ... otherwise, we do not have a simple Farkas proof. - if (Debug.isOn("constraints::hsfp")) + if (TraceIsOn("constraints::hsfp")) { - Debug("constraints::hsfp") << "There is no simple Farkas proof b/c there " + Trace("constraints::hsfp") << "There is no simple Farkas proof b/c there " "is an antecdent w/ rule "; - a->getConstraintRule().print(Debug("constraints::hsfp"), d_produceProofs); - Debug("constraints::hsfp") << std::endl; + a->getConstraintRule().print(Trace("constraints::hsfp"), d_produceProofs); + Trace("constraints::hsfp") << std::endl; } return false; @@ -666,15 +666,15 @@ bool Constraint::sanityChecking(Node n) const { const ArithVariables& avariables = d_database->getArithVariables(); - Debug("Constraint::sanityChecking") << cmp.getNode() << endl; - Debug("Constraint::sanityChecking") << k << endl; - Debug("Constraint::sanityChecking") << pleft.getNode() << endl; - Debug("Constraint::sanityChecking") << left << endl; - Debug("Constraint::sanityChecking") << right << endl; - Debug("Constraint::sanityChecking") << getValue() << endl; - Debug("Constraint::sanityChecking") << avariables.hasArithVar(left) << endl; - Debug("Constraint::sanityChecking") << avariables.asArithVar(left) << endl; - Debug("Constraint::sanityChecking") << getVariable() << endl; + Trace("Constraint::sanityChecking") << cmp.getNode() << endl; + Trace("Constraint::sanityChecking") << k << endl; + Trace("Constraint::sanityChecking") << pleft.getNode() << endl; + Trace("Constraint::sanityChecking") << left << endl; + Trace("Constraint::sanityChecking") << right << endl; + Trace("Constraint::sanityChecking") << getValue() << endl; + Trace("Constraint::sanityChecking") << avariables.hasArithVar(left) << endl; + Trace("Constraint::sanityChecking") << avariables.asArithVar(left) << endl; + Trace("Constraint::sanityChecking") << getVariable() << endl; if(avariables.hasArithVar(left) && @@ -794,7 +794,7 @@ bool Constraint::wellFormedFarkasProof() const { } else { lhs = Node::null(); } - Debug("constraints::wffp") << "running sum: " << lhs << " <= " << rhs << endl; + Trace("constraints::wffp") << "running sum: " << lhs << " <= " << rhs << endl; switch( antecedent->getType() ){ case LowerBound: @@ -853,7 +853,7 @@ bool Constraint::wellFormedFarkasProof() const { default: return false; } - Debug("constraints::wffp") << "final sum: " << lhs << " <= " << rhs << endl; + Trace("constraints::wffp") << "final sum: " << lhs << " <= " << rhs << endl; // 0 = lhs <= rhs < 0 return (lhs.isNull() || (Constant::isMember(lhs) && Constant(lhs).isZero())) && rhs.sgn() < 0; @@ -1069,7 +1069,7 @@ void ConstraintDatabase::addVariable(ArithVar v){ d_reclaimable.remove(v); }else{ - Debug("arith::constraint") << "about to fail" << v << " " << d_varDatabases.size() << endl; + Trace("arith::constraint") << "about to fail" << v << " " << d_varDatabases.size() << endl; Assert(v == d_varDatabases.size()); d_varDatabases.push_back(new PerVariableDatabase(v)); } @@ -1174,8 +1174,8 @@ ConstraintP ConstraintDatabase::addLiteral(TNode literal){ ConstraintP posC = new Constraint(v, posType, posDR, options().smt.produceProofs); - Debug("arith::constraint") << "addliteral( literal ->" << literal << ")" << endl; - Debug("arith::constraint") << "addliteral( posC ->" << posC << ")" << endl; + Trace("arith::constraint") << "addliteral( literal ->" << literal << ")" << endl; + Trace("arith::constraint") << "addliteral( posC ->" << posC << ")" << endl; SortedConstraintMap& scm = getVariableSCM(posC->getVariable()); pair insertAttempt; @@ -1189,8 +1189,8 @@ ConstraintP ConstraintDatabase::addLiteral(TNode literal){ //This is the situation where the ConstraintP exists, but //the literal has not been associated with it. ConstraintP hit = posI->second.getConstraintOfType(posC->getType()); - Debug("arith::constraint") << "hit " << hit << endl; - Debug("arith::constraint") << "posC " << posC << endl; + Trace("arith::constraint") << "hit " << hit << endl; + Trace("arith::constraint") << "posC " << posC << endl; delete posC; @@ -1216,9 +1216,9 @@ ConstraintP ConstraintDatabase::addLiteral(TNode literal){ pair negInsertAttempt; negInsertAttempt = scm.insert(make_pair(negC->getValue(), ValueCollection())); - Debug("nf::tmp") << "sdhjfgdhjkldfgljkhdfg" << endl; - Debug("nf::tmp") << negC << endl; - Debug("nf::tmp") << negC->getValue() << endl; + Trace("nf::tmp") << "sdhjfgdhjkldfgljkhdfg" << endl; + Trace("nf::tmp") << negC << endl; + Trace("nf::tmp") << negC->getValue() << endl; //This should always succeed as the DeltaRational for the negation is unique! Assert(negInsertAttempt.second); @@ -1250,7 +1250,7 @@ ConstraintP ConstraintDatabase::lookup(TNode literal) const{ } void Constraint::setAssumption(bool nowInConflict){ - Debug("constraints::pf") << "setAssumption(" << this << ")" << std::endl; + Trace("constraints::pf") << "setAssumption(" << this << ")" << std::endl; Assert(!hasProof()); Assert(negationHasProof() == nowInConflict); Assert(hasLiteral()); @@ -1259,8 +1259,8 @@ void Constraint::setAssumption(bool nowInConflict){ d_database->pushConstraintRule(ConstraintRule(this, AssumeAP)); Assert(inConflict() == nowInConflict); - if(Debug.isOn("constraint::conflictCommit") && inConflict()){ - Debug("constraint::conflictCommit") << "inConflict@setAssumption " << this << std::endl; + if(TraceIsOn("constraint::conflictCommit") && inConflict()){ + Trace("constraint::conflictCommit") << "inConflict@setAssumption " << this << std::endl; } } @@ -1293,7 +1293,7 @@ void Constraint::propagate(){ * 1*(x <= a) + (-1)*(x > b) => (0 <= a-b) */ void Constraint::impliedByUnate(ConstraintCP imp, bool nowInConflict){ - Debug("constraints::pf") << "impliedByUnate(" << this << ", " << *imp << ")" << std::endl; + Trace("constraints::pf") << "impliedByUnate(" << this << ", " << *imp << ")" << std::endl; Assert(!hasProof()); Assert(imp->hasProof()); Assert(negationHasProof() == nowInConflict); @@ -1323,19 +1323,19 @@ void Constraint::impliedByUnate(ConstraintCP imp, bool nowInConflict){ d_database->pushConstraintRule(ConstraintRule(this, FarkasAP, antecedentEnd, coeffs)); Assert(inConflict() == nowInConflict); - if(Debug.isOn("constraint::conflictCommit") && inConflict()){ - Debug("constraint::conflictCommit") << "inConflict@impliedByUnate " << this << std::endl; + if(TraceIsOn("constraint::conflictCommit") && inConflict()){ + Trace("constraint::conflictCommit") << "inConflict@impliedByUnate " << this << std::endl; } - if(Debug.isOn("constraints::wffp") && !wellFormedFarkasProof()){ - getConstraintRule().print(Debug("constraints::wffp"), d_produceProofs); + if(TraceIsOn("constraints::wffp") && !wellFormedFarkasProof()){ + getConstraintRule().print(Trace("constraints::wffp"), d_produceProofs); } Assert(wellFormedFarkasProof()); } void Constraint::impliedByTrichotomy(ConstraintCP a, ConstraintCP b, bool nowInConflict){ - Debug("constraints::pf") << "impliedByTrichotomy(" << this << ", " << *a << ", "; - Debug("constraints::pf") << *b << ")" << std::endl; + Trace("constraints::pf") << "impliedByTrichotomy(" << this << ", " << *a << ", "; + Trace("constraints::pf") << *b << ")" << std::endl; Assert(!hasProof()); Assert(negationHasProof() == nowInConflict); Assert(a->hasProof()); @@ -1349,8 +1349,8 @@ void Constraint::impliedByTrichotomy(ConstraintCP a, ConstraintCP b, bool nowInC d_database->pushConstraintRule(ConstraintRule(this, TrichotomyAP, antecedentEnd)); Assert(inConflict() == nowInConflict); - if(Debug.isOn("constraint::conflictCommit") && inConflict()){ - Debug("constraint::conflictCommit") << "inConflict@impliedByTrichotomy " << this << std::endl; + if(TraceIsOn("constraint::conflictCommit") && inConflict()){ + Trace("constraint::conflictCommit") << "inConflict@impliedByTrichotomy " << this << std::endl; } } @@ -1364,11 +1364,11 @@ bool Constraint::allHaveProof(const ConstraintCPVec& b){ } void Constraint::impliedByIntTighten(ConstraintCP a, bool nowInConflict){ - Debug("constraints::pf") << "impliedByIntTighten(" << this << ", " << *a << ")" << std::endl; + Trace("constraints::pf") << "impliedByIntTighten(" << this << ", " << *a << ")" << std::endl; Assert(!hasProof()); Assert(negationHasProof() == nowInConflict); Assert(a->hasProof()); - Debug("pf::arith") << "impliedByIntTighten(" << this << ", " << a << ")" + Trace("pf::arith") << "impliedByIntTighten(" << this << ", " << a << ")" << std::endl; d_database->d_antecedents.push_back(NullConstraint); @@ -1378,16 +1378,16 @@ void Constraint::impliedByIntTighten(ConstraintCP a, bool nowInConflict){ Assert(inConflict() == nowInConflict); if(inConflict()){ - Debug("constraint::conflictCommit") << "inConflict impliedByIntTighten" << this << std::endl; + Trace("constraint::conflictCommit") << "inConflict impliedByIntTighten" << this << std::endl; } } void Constraint::impliedByIntHole(ConstraintCP a, bool nowInConflict){ - Debug("constraints::pf") << "impliedByIntHole(" << this << ", " << *a << ")" << std::endl; + Trace("constraints::pf") << "impliedByIntHole(" << this << ", " << *a << ")" << std::endl; Assert(!hasProof()); Assert(negationHasProof() == nowInConflict); Assert(a->hasProof()); - Debug("pf::arith") << "impliedByIntHole(" << this << ", " << a << ")" + Trace("pf::arith") << "impliedByIntHole(" << this << ", " << a << ")" << std::endl; d_database->d_antecedents.push_back(NullConstraint); @@ -1396,20 +1396,20 @@ void Constraint::impliedByIntHole(ConstraintCP a, bool nowInConflict){ d_database->pushConstraintRule(ConstraintRule(this, IntHoleAP, antecedentEnd)); Assert(inConflict() == nowInConflict); - if(Debug.isOn("constraint::conflictCommit") && inConflict()){ - Debug("constraint::conflictCommit") << "inConflict impliedByIntHole" << this << std::endl; + if(TraceIsOn("constraint::conflictCommit") && inConflict()){ + Trace("constraint::conflictCommit") << "inConflict impliedByIntHole" << this << std::endl; } } void Constraint::impliedByIntHole(const ConstraintCPVec& b, bool nowInConflict){ - Debug("constraints::pf") << "impliedByIntHole(" << this; - if (Debug.isOn("constraints::pf")) { + Trace("constraints::pf") << "impliedByIntHole(" << this; + if (TraceIsOn("constraints::pf")) { for (const ConstraintCP& p : b) { - Debug("constraints::pf") << ", " << p; + Trace("constraints::pf") << ", " << p; } } - Debug("constraints::pf") << ")" << std::endl; + Trace("constraints::pf") << ")" << std::endl; Assert(!hasProof()); Assert(negationHasProof() == nowInConflict); @@ -1425,8 +1425,8 @@ void Constraint::impliedByIntHole(const ConstraintCPVec& b, bool nowInConflict){ d_database->pushConstraintRule(ConstraintRule(this, IntHoleAP, antecedentEnd)); Assert(inConflict() == nowInConflict); - if(Debug.isOn("constraint::conflictCommit") && inConflict()){ - Debug("constraint::conflictCommit") << "inConflict@impliedByIntHole[vec] " << this << std::endl; + if(TraceIsOn("constraint::conflictCommit") && inConflict()){ + Trace("constraint::conflictCommit") << "inConflict@impliedByIntHole[vec] " << this << std::endl; } } @@ -1439,15 +1439,15 @@ void Constraint::impliedByIntHole(const ConstraintCPVec& b, bool nowInConflict){ * coeff.back() corresponds to the current constraint. */ void Constraint::impliedByFarkas(const ConstraintCPVec& a, RationalVectorCP coeffs, bool nowInConflict){ - Debug("constraints::pf") << "impliedByFarkas(" << this; - if (Debug.isOn("constraints::pf")) { + Trace("constraints::pf") << "impliedByFarkas(" << this; + if (TraceIsOn("constraints::pf")) { for (const ConstraintCP& p : a) { - Debug("constraints::pf") << ", " << p; + Trace("constraints::pf") << ", " << p; } } - Debug("constraints::pf") << ", "; - Debug("constraints::pf") << ")" << std::endl; + Trace("constraints::pf") << ", "; + Trace("constraints::pf") << ")" << std::endl; Assert(!hasProof()); Assert(negationHasProof() == nowInConflict); Assert(allHaveProof(a)); @@ -1478,19 +1478,19 @@ void Constraint::impliedByFarkas(const ConstraintCPVec& a, RationalVectorCP coef d_database->pushConstraintRule(ConstraintRule(this, FarkasAP, antecedentEnd, coeffsCopy)); Assert(inConflict() == nowInConflict); - if(Debug.isOn("constraint::conflictCommit") && inConflict()){ - Debug("constraint::conflictCommit") << "inConflict@impliedByFarkas " << this << std::endl; + if(TraceIsOn("constraint::conflictCommit") && inConflict()){ + Trace("constraint::conflictCommit") << "inConflict@impliedByFarkas " << this << std::endl; } - if(Debug.isOn("constraints::wffp") && !wellFormedFarkasProof()){ - getConstraintRule().print(Debug("constraints::wffp"), d_produceProofs); + if(TraceIsOn("constraints::wffp") && !wellFormedFarkasProof()){ + getConstraintRule().print(Trace("constraints::wffp"), d_produceProofs); } Assert(wellFormedFarkasProof()); } void Constraint::setInternalAssumption(bool nowInConflict){ - Debug("constraints::pf") << "setInternalAssumption(" << this; - Debug("constraints::pf") << ")" << std::endl; + Trace("constraints::pf") << "setInternalAssumption(" << this; + Trace("constraints::pf") << ")" << std::endl; Assert(!hasProof()); Assert(negationHasProof() == nowInConflict); Assert(!assertedToTheTheory()); @@ -1498,15 +1498,15 @@ void Constraint::setInternalAssumption(bool nowInConflict){ d_database->pushConstraintRule(ConstraintRule(this, InternalAssumeAP)); Assert(inConflict() == nowInConflict); - if(Debug.isOn("constraint::conflictCommit") && inConflict()){ - Debug("constraint::conflictCommit") << "inConflict@setInternalAssumption " << this << std::endl; + if(TraceIsOn("constraint::conflictCommit") && inConflict()){ + Trace("constraint::conflictCommit") << "inConflict@setInternalAssumption " << this << std::endl; } } void Constraint::setEqualityEngineProof(){ - Debug("constraints::pf") << "setEqualityEngineProof(" << this; - Debug("constraints::pf") << ")" << std::endl; + Trace("constraints::pf") << "setEqualityEngineProof(" << this; + Trace("constraints::pf") << ")" << std::endl; Assert(truthIsUnknown()); Assert(hasLiteral()); d_database->pushConstraintRule(ConstraintRule(this, EqualityEngineAP)); @@ -1577,7 +1577,7 @@ TrustNode Constraint::externalExplainForPropagation(TNode lit) const TrustNode Constraint::externalExplainConflict() const { - Debug("pf::arith::explain") << this << std::endl; + Trace("pf::arith::explain") << this << std::endl; Assert(inConflict()); NodeBuilder nb(kind::AND); auto pf1 = externalExplainByAssertions(nb); @@ -1597,12 +1597,12 @@ TrustNode Constraint::externalExplainConflict() const { lits.push_back(n); } - if (Debug.isOn("arith::pf::externalExplainConflict")) + if (TraceIsOn("arith::pf::externalExplainConflict")) { - Debug("arith::pf::externalExplainConflict") << "Lits:" << std::endl; + Trace("arith::pf::externalExplainConflict") << "Lits:" << std::endl; for (const auto& l : lits) { - Debug("arith::pf::externalExplainConflict") << " : " << l << std::endl; + Trace("arith::pf::externalExplainConflict") << " : " << l << std::endl; } } std::vector contraLits = {getProofLiteral(), @@ -1611,13 +1611,13 @@ TrustNode Constraint::externalExplainConflict() const not2.getKind() == Kind::NOT ? d_database->d_pnm->mkNode(PfRule::CONTRA, {pf2, pfNot2}, {}) : d_database->d_pnm->mkNode(PfRule::CONTRA, {pfNot2, pf2}, {}); - if (Debug.isOn("arith::pf::tree")) + if (TraceIsOn("arith::pf::tree")) { - Debug("arith::pf::tree") << *this << std::endl; - Debug("arith::pf::tree") << *getNegation() << std::endl; - Debug("arith::pf::tree") << "\n\nTree:\n"; - printProofTree(Debug("arith::pf::tree")); - getNegation()->printProofTree(Debug("arith::pf::tree")); + Trace("arith::pf::tree") << *this << std::endl; + Trace("arith::pf::tree") << *getNegation() << std::endl; + Trace("arith::pf::tree") << "\n\nTree:\n"; + printProofTree(Trace("arith::pf::tree")); + getNegation()->printProofTree(Trace("arith::pf::tree")); } auto confPf = d_database->d_pnm->mkScope(bot, lits); return d_database->d_pfGen->mkTrustNode( @@ -1688,12 +1688,12 @@ Node Constraint::externalExplain(const ConstraintCPVec& v, AssertionOrder order) std::shared_ptr Constraint::externalExplain( NodeBuilder& nb, AssertionOrder order) const { - if (Debug.isOn("pf::arith::explain")) + if (TraceIsOn("pf::arith::explain")) { - this->printProofTree(Debug("arith::pf::tree")); - Debug("pf::arith::explain") << "Explaining: " << this << " with rule "; - getConstraintRule().print(Debug("pf::arith::explain"), d_produceProofs); - Debug("pf::arith::explain") << std::endl; + this->printProofTree(Trace("arith::pf::tree")); + Trace("pf::arith::explain") << "Explaining: " << this << " with rule "; + getConstraintRule().print(Trace("pf::arith::explain"), d_produceProofs); + Trace("pf::arith::explain") << std::endl; } Assert(hasProof()); Assert(!isAssumption() || assertedToTheTheory()); @@ -1704,7 +1704,7 @@ std::shared_ptr Constraint::externalExplain( if (assertedBefore(order)) { - Debug("pf::arith::explain") << " already asserted" << std::endl; + Trace("pf::arith::explain") << " already asserted" << std::endl; nb << getWitness(); if (d_database->isProofEnabled()) { @@ -1720,7 +1720,7 @@ std::shared_ptr Constraint::externalExplain( } else if (hasEqualityEngineProof()) { - Debug("pf::arith::explain") << " going to ee:" << std::endl; + Trace("pf::arith::explain") << " going to ee:" << std::endl; TrustNode exp = d_database->eeExplain(this); if (d_database->isProofEnabled()) { @@ -1743,7 +1743,7 @@ std::shared_ptr Constraint::externalExplain( pf = pnm->mkNode( PfRule::MACRO_SR_PRED_TRANSFORM, {hypotheses}, {getProofLiteral()}); } - Debug("pf::arith::explain") + Trace("pf::arith::explain") << " explanation: " << exp.getNode() << std::endl; if (exp.getNode().getKind() == Kind::AND) { @@ -1756,7 +1756,7 @@ std::shared_ptr Constraint::externalExplain( } else { - Debug("pf::arith::explain") << " recursion!" << std::endl; + Trace("pf::arith::explain") << " recursion!" << std::endl; Assert(!isAssumption()); AntecedentId p = getEndAntecedent(); ConstraintCP antecedent = d_database->d_antecedents[p]; @@ -1764,7 +1764,7 @@ std::shared_ptr Constraint::externalExplain( while (antecedent != NullConstraint) { - Debug("pf::arith::explain") << "Explain " << antecedent << std::endl; + Trace("pf::arith::explain") << "Explain " << antecedent << std::endl; auto pn = antecedent->externalExplain(nb, order); if (d_database->isProofEnabled()) { @@ -1973,18 +1973,18 @@ ConstraintP ConstraintDatabase::getBestImpliedBound(ArithVar v, ConstraintType t if(i == i_end){ --i; - Debug("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl; + Trace("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl; }else if( (i->first) > r){ if(i == i_begin){ return NullConstraint; }else{ --i; - Debug("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl; + Trace("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl; } } do{ - Debug("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl; + Trace("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl; Assert(r >= i->first); const ValueCollection& vc = i->second; @@ -2029,7 +2029,7 @@ ConstraintDatabase::Watches::Watches(context::Context* satContext, context::Cont void Constraint::setLiteral(Node n) { - Debug("arith::constraint") << "Mapping " << *this << " to " << n << std::endl; + Trace("arith::constraint") << "Mapping " << *this << " to " << n << std::endl; Assert(Comparison::isNormalAtom(n)); Assert(!hasLiteral()); Assert(sanityChecking(n)); @@ -2261,13 +2261,13 @@ void ConstraintDatabase::outputUnateInequalityLemmas( bool ConstraintDatabase::handleUnateProp(ConstraintP ant, ConstraintP cons){ if(cons->negationHasProof()){ - Debug("arith::unate") << "handleUnate: " << ant << " implies " << cons << endl; + Trace("arith::unate") << "handleUnate: " << ant << " implies " << cons << endl; cons->impliedByUnate(ant, true); d_raiseConflict.raiseConflict(cons, InferenceId::ARITH_CONF_UNATE_PROP); return true; }else if(!cons->isTrue()){ ++d_statistics.d_unatePropagateImplications; - Debug("arith::unate") << "handleUnate: " << ant << " implies " << cons << endl; + Trace("arith::unate") << "handleUnate: " << ant << " implies " << cons << endl; cons->impliedByUnate(ant, false); cons->tryToPropagate(); return false; @@ -2277,7 +2277,7 @@ bool ConstraintDatabase::handleUnateProp(ConstraintP ant, ConstraintP cons){ } void ConstraintDatabase::unatePropLowerBound(ConstraintP curr, ConstraintP prev){ - Debug("arith::unate") << "unatePropLowerBound " << curr << " " << prev << endl; + Trace("arith::unate") << "unatePropLowerBound " << curr << " " << prev << endl; Assert(curr != prev); Assert(curr != NullConstraint); bool hasPrev = ! (prev == NullConstraint); @@ -2319,7 +2319,7 @@ void ConstraintDatabase::unatePropLowerBound(ConstraintP curr, ConstraintP prev) } void ConstraintDatabase::unatePropUpperBound(ConstraintP curr, ConstraintP prev){ - Debug("arith::unate") << "unatePropUpperBound " << curr << " " << prev << endl; + Trace("arith::unate") << "unatePropUpperBound " << curr << " " << prev << endl; Assert(curr != prev); Assert(curr != NullConstraint); bool hasPrev = ! (prev == NullConstraint); @@ -2354,7 +2354,7 @@ void ConstraintDatabase::unatePropUpperBound(ConstraintP curr, ConstraintP prev) } void ConstraintDatabase::unatePropEquality(ConstraintP curr, ConstraintP prevLB, ConstraintP prevUB){ - Debug("arith::unate") << "unatePropEquality " << curr << " " << prevLB << " " << prevUB << endl; + Trace("arith::unate") << "unatePropEquality " << curr << " " << prevLB << " " << prevUB << endl; Assert(curr != prevLB); Assert(curr != prevUB); Assert(curr != NullConstraint); @@ -2448,7 +2448,7 @@ std::pair Constraint::unateFarkasSigns(ConstraintCP ca, ConstraintCP c Assert(a_sgn != 0); Assert(b_sgn != 0); - Debug("arith::unateFarkasSigns") << "Constraint::unateFarkasSigns("< " + Trace("arith::unateFarkasSigns") << "Constraint::unateFarkasSigns("< " << "("<getId() << " " << poolOrd << "->" << d_rowIdsSelected[poolOrd] << endl; + Trace("approx::nodelog") << "applySelected " << curr->getId() << " " << poolOrd << "->" << d_rowIdsSelected[poolOrd] << endl; curr->setRowId( d_rowIdsSelected[poolOrd] ); ++iter; } @@ -392,13 +392,13 @@ void NodeLog::applyRowsDeleted(const RowsDeleted& rd) { sortedRemoved.push_back(INT_MAX); std::sort(sortedRemoved.begin(), sortedRemoved.end()); - if(Debug.isOn("approx::nodelog")){ - Debug("approx::nodelog") << "Removing #" << sortedRemoved.size()<< "..."; + if(TraceIsOn("approx::nodelog")){ + Trace("approx::nodelog") << "Removing #" << sortedRemoved.size()<< "..."; for(unsigned k = 0; k " << v << endl; + Trace("approx::nodelog") << "deleting from above because of " << rd << endl; + Trace("approx::nodelog") << "had " << origOrd << " <-> " << v << endl; d_rowId2ArithVar.erase(origOrd); }else{ - Debug("approx::nodelog") << "deleting " << ci << " because of " << rd << endl; - Debug("approx::nodelog") << "had " << origOrd << " <-> " << v << endl; + Trace("approx::nodelog") << "deleting " << ci << " because of " << rd << endl; + Trace("approx::nodelog") << "had " << origOrd << " <-> " << v << endl; d_rowId2ArithVar.erase(origOrd); ci->setRowId(-1); } @@ -463,15 +463,15 @@ void NodeLog::applyRowsDeleted(const RowsDeleted& rd) { int newOrd = origOrd - posInSorted; Assert(newOrd > 0); if(ci == NULL){ - Debug("approx::nodelog") << "shifting above down due to " << rd << endl; - Debug("approx::nodelog") << "had " << origOrd << " <-> " << v << endl; - Debug("approx::nodelog") << "now have " << newOrd << " <-> " << v << endl; + Trace("approx::nodelog") << "shifting above down due to " << rd << endl; + Trace("approx::nodelog") << "had " << origOrd << " <-> " << v << endl; + Trace("approx::nodelog") << "now have " << newOrd << " <-> " << v << endl; d_rowId2ArithVar.erase(origOrd); mapRowId(newOrd, v); }else{ - Debug("approx::nodelog") << "shifting " << ci << " down due to " << rd << endl; - Debug("approx::nodelog") << "had " << origOrd << " <-> " << v << endl; - Debug("approx::nodelog") << "now have " << newOrd << " <-> " << v << endl; + Trace("approx::nodelog") << "shifting " << ci << " down due to " << rd << endl; + Trace("approx::nodelog") << "had " << origOrd << " <-> " << v << endl; + Trace("approx::nodelog") << "now have " << newOrd << " <-> " << v << endl; ci->setRowId(newOrd); d_rowId2ArithVar.erase(origOrd); mapRowId(newOrd, v); @@ -527,7 +527,7 @@ ArithVar NodeLog::lookupRowId(int rowId) const{ void NodeLog::mapRowId(int rowId, ArithVar v){ Assert(lookupRowId(rowId) == ARITHVAR_SENTINEL); - Debug("approx::nodelog") + Trace("approx::nodelog") << "On " << getNodeId() << " adding row id " << rowId << " <-> " << v << endl; d_rowId2ArithVar[rowId] = v; diff --git a/src/theory/arith/dio_solver.cpp b/src/theory/arith/dio_solver.cpp index de8ee8477..bf0483823 100644 --- a/src/theory/arith/dio_solver.cpp +++ b/src/theory/arith/dio_solver.cpp @@ -74,11 +74,11 @@ DioSolver::Statistics::Statistics() } bool DioSolver::queueConditions(TrailIndex t){ - Debug("queueConditions") << !inConflict() << std::endl; - Debug("queueConditions") << gcdIsOne(t) << std::endl; - Debug("queueConditions") << !debugAnySubstitionApplies(t) << std::endl; - Debug("queueConditions") << !triviallySat(t) << std::endl; - Debug("queueConditions") << !triviallyUnsat(t) << std::endl; + Trace("queueConditions") << !inConflict() << std::endl; + Trace("queueConditions") << gcdIsOne(t) << std::endl; + Trace("queueConditions") << !debugAnySubstitionApplies(t) << std::endl; + Trace("queueConditions") << !triviallySat(t) << std::endl; + Trace("queueConditions") << !triviallyUnsat(t) << std::endl; return !inConflict() && @@ -153,7 +153,7 @@ void DioSolver::pushInputConstraint(const Comparison& eq, Node reason){ //Variable proofVariable(makeIntegerVariable()); TrailIndex posInTrail = d_trail.size(); - Debug("dio::pushInputConstraint") << "pushInputConstraint @ " << posInTrail + Trace("dio::pushInputConstraint") << "pushInputConstraint @ " << posInTrail << " " << eq.getNode() << " " << reason << endl; d_trail.push_back(Constraint(sp,Polynomial::mkPolynomial(proofVariable))); @@ -181,8 +181,8 @@ DioSolver::TrailIndex DioSolver::scaleEqAtIndex(DioSolver::TrailIndex i, const I d_trail.push_back(Constraint(newSP, newProof)); - Debug("arith::dio") << "scaleEqAtIndex(" << i <<","<= 2 && length > d_maxInputCoefficientLength + MAX_GROWTH_RATE; - if(Debug.isOn("arith::dio::max") && result){ + if(TraceIsOn("arith::dio::max") && result){ const SumPair& eq = d_trail[j].d_eq; const Polynomial& proof = d_trail[j].d_proof; - Debug("arith::dio::max") << "about to drop:" << std::endl; - Debug("arith::dio::max") << "d_trail[" << j << "].d_eq = " << eq.getNode() << std::endl; - Debug("arith::dio::max") << "d_trail[" << j << "].d_proof = " << proof.getNode() << std::endl; + Trace("arith::dio::max") << "about to drop:" << std::endl; + Trace("arith::dio::max") << "d_trail[" << j << "].d_eq = " << eq.getNode() << std::endl; + Trace("arith::dio::max") << "d_trail[" << j << "].d_proof = " << proof.getNode() << std::endl; } return result; } @@ -371,7 +371,7 @@ DioSolver::TrailIndex DioSolver::impliedGcdOfOne(){ //For the rest of the equations keep reducing until the coefficient is one for(; iter != end; ++iter){ - Debug("arith::dio") << "next round : " << currentCoeff << " " << currentGcd << endl; + Trace("arith::dio") << "next round : " << currentCoeff << " " << currentGcd << endl; TrailIndex inQueue = *iter; Constant iqc = d_trail[inQueue].d_eq.getPolynomial().getCoefficient(vl); if(!iqc.isZero()){ @@ -382,20 +382,20 @@ DioSolver::TrailIndex DioSolver::impliedGcdOfOne(){ // g = a*s + b*t Integer::extendedGcd(g, s, t, currentCoeff, inQueueCoeff); - Debug("arith::dio") << "extendedReduction : " << endl; - Debug("arith::dio") << g << " = " << s <<"*"<< currentCoeff << " + " << t <<"*"<< inQueueCoeff << endl; + Trace("arith::dio") << "extendedReduction : " << endl; + Trace("arith::dio") << g << " = " << s <<"*"<< currentCoeff << " + " << t <<"*"<< inQueueCoeff << endl; Assert(g <= currentGcd); if(g < currentGcd){ if(s.sgn() == 0){ - Debug("arith::dio") << "extendedReduction drop" << endl; + Trace("arith::dio") << "extendedReduction drop" << endl; Assert(inQueueCoeff.divides(currentGcd)); current = *iter; currentCoeff = inQueueCoeff; currentGcd = inQueueCoeff.abs(); }else{ - Debug("arith::dio") << "extendedReduction combine" << endl; + Trace("arith::dio") << "extendedReduction combine" << endl; TrailIndex next = combineEqAtIndexes(current, s, inQueue, t); Assert(d_trail[next] @@ -433,7 +433,7 @@ bool DioSolver::processEquations(bool allowDecomposition){ Assert(inRange(minimum)); Assert(!inConflict()); - Debug("arith::dio") << "processEquations " << minimum << " : " << d_trail[minimum].d_eq.getNode() << endl; + Trace("arith::dio") << "processEquations " << minimum << " : " << d_trail[minimum].d_eq.getNode() << endl; Assert(queueConditions(minimum)); @@ -541,8 +541,8 @@ DioSolver::TrailIndex DioSolver::combineEqAtIndexes(DioSolver::TrailIndex i, con const SumPair& si = d_trail[i].d_eq; const SumPair& sj = d_trail[j].d_eq; - Debug("arith::dio") << "combineEqAtIndexes(" << i <<","< DioSolver::solveIndex(DioS SubIndex subBy = d_subs.size(); d_subs.push_back(Substitution(Node::null(), var, ci)); - Debug("arith::dio") << "after solveIndex " << d_trail[ci].d_eq.getNode() << " for " << av.getNode() << endl; + Trace("arith::dio") << "after solveIndex " << d_trail[ci].d_eq.getNode() << " for " << av.getNode() << endl; Assert(d_trail[ci].d_eq.getPolynomial().getCoefficient(vl) == Constant::mkConstant(-1)); @@ -648,7 +648,7 @@ std::pair DioSolver::decomposeIndex( d_usedDecomposeIndex = true; - Debug("arith::dio") << "before decomposeIndex("< DioSolver::decomposeIndex( // no longer reference av safely! addTrailElementAsLemma(ci); - Debug("arith::dio") << "Decompose ci(" << ci <<":" << d_trail[ci].d_eq.getNode() + Trace("arith::dio") << "Decompose ci(" << ci <<":" << d_trail[ci].d_eq.getNode() << ") for " << d_trail[i].d_minimalMonomial.getNode() << endl; Assert(d_trail[ci].d_eq.getPolynomial().getCoefficient(vl) == Constant::mkConstant(-1)); @@ -706,7 +706,7 @@ std::pair DioSolver::decomposeIndex( SubIndex subBy = d_subs.size(); d_subs.push_back(Substitution(freshNode, var, ci)); - Debug("arith::dio") << "Decompose nextIndex " << d_trail[nextIndex].d_eq.getNode() << endl; + Trace("arith::dio") << "Decompose nextIndex " << d_trail[nextIndex].d_eq.getNode() << endl; return make_pair(subBy, nextIndex); } @@ -739,11 +739,11 @@ DioSolver::TrailIndex DioSolver::reduceByGCD(DioSolver::TrailIndex ti){ Polynomial vsum = sp.getPolynomial(); Constant c = sp.getConstant(); - Debug("arith::dio") << "reduceByGCD " << vsum.getNode() << endl; + Trace("arith::dio") << "reduceByGCD " << vsum.getNode() << endl; Assert(!vsum.isConstant()); Integer g = vsum.gcd(); Assert(g >= 1); - Debug("arith::dio") << "gcd("<< vsum.getNode() <<")=" << g << " " << c.getValue() << endl; + Trace("arith::dio") << "gcd("<< vsum.getNode() <<")=" << g << " " << c.getValue() << endl; if(g.divides(c.getValue().getNumerator())){ if(g > 1){ return scaleEqAtIndex(ti, g); diff --git a/src/theory/arith/dio_solver.h b/src/theory/arith/dio_solver.h index 2e99f04e4..0ee79380e 100644 --- a/src/theory/arith/dio_solver.h +++ b/src/theory/arith/dio_solver.h @@ -298,7 +298,7 @@ private: /** Solves the index at ti for the value in minimumMonomial. */ std::pair solveIndex(TrailIndex ti); - /** Prints the queue for debugging purposes to Debug("arith::dio"). */ + /** Prints the queue for debugging purposes to Trace("arith::dio"). */ void printQueue(); /** diff --git a/src/theory/arith/dual_simplex.cpp b/src/theory/arith/dual_simplex.cpp index 84cd0fe5a..1f98044eb 100644 --- a/src/theory/arith/dual_simplex.cpp +++ b/src/theory/arith/dual_simplex.cpp @@ -64,7 +64,7 @@ Result::Sat DualSimplexDecisionProcedure::dualFindModel(bool exactResult){ d_pivots = 0; if(d_errorSet.errorEmpty() && !d_errorSet.moreSignals()){ - Debug("arith::findModel") << "dualFindModel() trivial" << endl; + Trace("arith::findModel") << "dualFindModel() trivial" << endl; return Result::SAT; } @@ -75,15 +75,15 @@ Result::Sat DualSimplexDecisionProcedure::dualFindModel(bool exactResult){ if(processSignals()){ d_conflictVariables.purge(); - Debug("arith::findModel") << "dualFindModel() early conflict" << endl; + Trace("arith::findModel") << "dualFindModel() early conflict" << endl; return Result::UNSAT; }else if(d_errorSet.errorEmpty()){ - Debug("arith::findModel") << "dualFindModel() fixed itself" << endl; + Trace("arith::findModel") << "dualFindModel() fixed itself" << endl; Assert(!d_errorSet.moreSignals()); return Result::SAT; } - Debug("arith::findModel") << "dualFindModel() start non-trivial" << endl; + Trace("arith::findModel") << "dualFindModel() start non-trivial" << endl; Result::Sat result = Result::SAT_UNKNOWN; @@ -134,7 +134,7 @@ Result::Sat DualSimplexDecisionProcedure::dualFindModel(bool exactResult){ // ensure that the conflict variable is still in the queue. d_conflictVariables.purge(); - Debug("arith::findModel") << "end findModel() " << result << endl; + Trace("arith::findModel") << "end findModel() " << result << endl; return result; } @@ -144,17 +144,17 @@ Result::Sat DualSimplexDecisionProcedure::dualFindModel(bool exactResult){ bool DualSimplexDecisionProcedure::searchForFeasibleSolution(uint32_t remainingIterations){ TimerStat::CodeTimer codeTimer(d_statistics.d_searchTime); - Debug("arith") << "searchForFeasibleSolution" << endl; + Trace("arith") << "searchForFeasibleSolution" << endl; Assert(remainingIterations > 0); while(remainingIterations > 0 && !d_errorSet.focusEmpty()){ - if(Debug.isOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); } + if(TraceIsOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); } Assert(d_conflictVariables.empty()); ArithVar x_i = d_errorSet.topFocusVariable(); - Debug("arith::update::select") << "selectSmallestInconsistentVar()=" << x_i << endl; + Trace("arith::update::select") << "selectSmallestInconsistentVar()=" << x_i << endl; if(x_i == ARITHVAR_SENTINEL){ - Debug("arith::update") << "No inconsistent variables" << endl; + Trace("arith::update") << "No inconsistent variables" << endl; return false; //sat } @@ -166,7 +166,7 @@ bool DualSimplexDecisionProcedure::searchForFeasibleSolution(uint32_t remainingI d_pivotsInRound.add(x_i); } - Debug("arith::update") << "pivots in rounds: " << d_pivotsInRound.count(x_i) + Trace("arith::update") << "pivots in rounds: " << d_pivotsInRound.count(x_i) << " use " << useVarOrderPivot << " threshold " << options().arith.arithPivotThreshold << std::endl; @@ -215,8 +215,8 @@ bool DualSimplexDecisionProcedure::searchForFeasibleSolution(uint32_t remainingI int32_t currErrorSize CVC5_UNUSED = d_errorSet.errorSize(); d_pivots++; - if(Debug.isOn("arith::dual")){ - Debug("arith::dual") + if(TraceIsOn("arith::dual")){ + Trace("arith::dual") << "#" << d_pivots << " c" << conflict << " d" << (prevErrorSize - currErrorSize) diff --git a/src/theory/arith/error_set.cpp b/src/theory/arith/error_set.cpp index c7666fff3..c2b7d7cba 100644 --- a/src/theory/arith/error_set.cpp +++ b/src/theory/arith/error_set.cpp @@ -37,7 +37,7 @@ ErrorInformation::ErrorInformation() d_amount(nullptr), d_metric(0) { - Debug("arith::error::mem") + Trace("arith::error::mem") << "def constructor " << d_variable << " " << d_amount.get() << endl; } @@ -52,7 +52,7 @@ ErrorInformation::ErrorInformation(ArithVar var, ConstraintP vio, int sgn) d_metric(0) { Assert(debugInitialized()); - Debug("arith::error::mem") + Trace("arith::error::mem") << "constructor " << d_variable << " " << d_amount.get() << endl; } @@ -61,8 +61,8 @@ ErrorInformation::~ErrorInformation() { Assert(d_relaxed != true); if (d_amount != nullptr) { - Debug("arith::error::mem") << d_amount.get() << endl; - Debug("arith::error::mem") + Trace("arith::error::mem") << d_amount.get() << endl; + Trace("arith::error::mem") << "destroy " << d_variable << " " << d_amount.get() << endl; d_amount = nullptr; } @@ -85,7 +85,7 @@ ErrorInformation::ErrorInformation(const ErrorInformation& ei) { d_amount = std::make_unique(*ei.d_amount); } - Debug("arith::error::mem") + Trace("arith::error::mem") << "copy const " << d_variable << " " << d_amount.get() << endl; } @@ -99,19 +99,19 @@ ErrorInformation& ErrorInformation::operator=(const ErrorInformation& ei){ d_metric = ei.d_metric; if (d_amount != nullptr && ei.d_amount != nullptr) { - Debug("arith::error::mem") + Trace("arith::error::mem") << "assignment assign " << d_variable << " " << d_amount.get() << endl; *d_amount = *ei.d_amount; } else if (ei.d_amount != nullptr) { d_amount = std::make_unique(*ei.d_amount); - Debug("arith::error::mem") + Trace("arith::error::mem") << "assignment alloc " << d_variable << " " << d_amount.get() << endl; } else if (d_amount != nullptr) { - Debug("arith::error::mem") + Trace("arith::error::mem") << "assignment release " << d_variable << " " << d_amount.get() << endl; d_amount = nullptr; } @@ -130,7 +130,7 @@ void ErrorInformation::reset(ConstraintP c, int sgn){ if (d_amount != nullptr) { - Debug("arith::error::mem") + Trace("arith::error::mem") << "reset " << d_variable << " " << d_amount.get() << endl; d_amount = nullptr; } @@ -140,7 +140,7 @@ void ErrorInformation::setAmount(const DeltaRational& am){ if (d_amount == nullptr) { d_amount = std::make_unique(); - Debug("arith::error::mem") + Trace("arith::error::mem") << "setAmount " << d_variable << " " << d_amount.get() << endl; } (*d_amount) = am; diff --git a/src/theory/arith/fc_simplex.cpp b/src/theory/arith/fc_simplex.cpp index d3f7e071f..6042d4484 100644 --- a/src/theory/arith/fc_simplex.cpp +++ b/src/theory/arith/fc_simplex.cpp @@ -74,7 +74,7 @@ Result::Sat FCSimplexDecisionProcedure::findModel(bool exactResult){ d_pivots = 0; if(d_errorSet.errorEmpty() && !d_errorSet.moreSignals()){ - Debug("arith::findModel") << "fcFindModel() trivial" << endl; + Trace("arith::findModel") << "fcFindModel() trivial" << endl; Assert(d_conflictVariables.empty()); return Result::SAT; } @@ -87,16 +87,16 @@ Result::Sat FCSimplexDecisionProcedure::findModel(bool exactResult){ if(initialProcessSignals()){ d_conflictVariables.purge(); - Debug("arith::findModel") << "fcFindModel() early conflict" << endl; + Trace("arith::findModel") << "fcFindModel() early conflict" << endl; Assert(d_conflictVariables.empty()); return Result::UNSAT; }else if(d_errorSet.errorEmpty()){ - Debug("arith::findModel") << "fcFindModel() fixed itself" << endl; + Trace("arith::findModel") << "fcFindModel() fixed itself" << endl; Assert(d_conflictVariables.empty()); return Result::SAT; } - Debug("arith::findModel") << "fcFindModel() start non-trivial" << endl; + Trace("arith::findModel") << "fcFindModel() start non-trivial" << endl; exactResult |= d_varOrderPivotLimit < 0; @@ -131,7 +131,7 @@ Result::Sat FCSimplexDecisionProcedure::findModel(bool exactResult){ // ensure that the conflict variable is still in the queue. d_conflictVariables.purge(); - Debug("arith::findModel") << "end findModel() " << result << endl; + Trace("arith::findModel") << "end findModel() " << result << endl; Assert(d_conflictVariables.empty()); return result; @@ -161,7 +161,7 @@ void FCSimplexDecisionProcedure::logPivot(WitnessImprovement w){ d_leavingCountSinceImprovement.purge(); } - Debug("logPivot") << "logPivot " << d_prevWitnessImprovement << " " << d_witnessImprovementInARow << endl; + Trace("logPivot") << "logPivot " << d_prevWitnessImprovement << " " << d_witnessImprovementInARow << endl; } @@ -249,7 +249,7 @@ WitnessImprovement FCSimplexDecisionProcedure::focusDownToJust(ArithVar v){ UpdateInfo FCSimplexDecisionProcedure::selectPrimalUpdate(ArithVar basic, LinearEqualityModule::UpdatePreferenceFunction upf, LinearEqualityModule::VarPreferenceFunction bpf) { UpdateInfo selected; - Debug("arith::selectPrimalUpdate") + Trace("arith::selectPrimalUpdate") << "selectPrimalUpdate" << endl << basic << " " << d_tableau.basicRowLength(basic) << " " << d_linEq.debugBasicAtBoundCount(basic) << endl; @@ -281,7 +281,7 @@ UpdateInfo FCSimplexDecisionProcedure::selectPrimalUpdate(ArithVar basic, Linear (curr_movement > 0 && d_variables.cmpAssignmentUpperBound(curr) < 0) || (curr_movement < 0 && d_variables.cmpAssignmentLowerBound(curr) > 0); - Debug("arith::selectPrimalUpdate") + Trace("arith::selectPrimalUpdate") << "storing " << basic << " " << curr << " " << candidate @@ -295,7 +295,7 @@ UpdateInfo FCSimplexDecisionProcedure::selectPrimalUpdate(ArithVar basic, Linear const Rational& focusC = focusCoefficient(curr); Assert(dualLike || !focusC.isZero()); if(dualLike && curr_movement != focusC.sgn()){ - Debug("arith::selectPrimalUpdate") << "sgn disagreement " << curr << endl; + Trace("arith::selectPrimalUpdate") << "sgn disagreement " << curr << endl; d_sgnDisagreements.push_back(curr); continue; }else{ @@ -324,7 +324,7 @@ UpdateInfo FCSimplexDecisionProcedure::selectPrimalUpdate(ArithVar basic, Linear LinearEqualityModule::UpdatePreferenceFunction leavingPrefFunc = selectLeavingFunction(curr); UpdateInfo currProposal = d_linEq.speculativeUpdate(curr, coeff, leavingPrefFunc); - Debug("arith::selectPrimalUpdate") + Trace("arith::selectPrimalUpdate") << "selected " << selected << endl << "currProp " << currProposal << endl << "coeff " << coeff << endl; @@ -339,7 +339,7 @@ UpdateInfo FCSimplexDecisionProcedure::selectPrimalUpdate(ArithVar basic, Linear selected = currProposal; WitnessImprovement w = selected.getWitness(false); - Debug("arith::selectPrimalUpdate") << "selected " << w << endl; + Trace("arith::selectPrimalUpdate") << "selected " << w << endl; setPenalty(curr, w); if(improvement(w)){ bool exitEarly; @@ -348,7 +348,7 @@ UpdateInfo FCSimplexDecisionProcedure::selectPrimalUpdate(ArithVar basic, Linear case ErrorDropped: if(checkEverything){ exitEarly = d_errorSize + selected.errorsChange() == 0; - Debug("arith::selectPrimalUpdate") + Trace("arith::selectPrimalUpdate") << "ee " << d_errorSize << " " << selected.errorsChange() << " " << d_errorSize + selected.errorsChange() << endl; @@ -366,7 +366,7 @@ UpdateInfo FCSimplexDecisionProcedure::selectPrimalUpdate(ArithVar basic, Linear if(exitEarly){ break; } } }else{ - Debug("arith::selectPrimalUpdate") << "dropped "<< endl; + Trace("arith::selectPrimalUpdate") << "dropped "<< endl; } } @@ -410,14 +410,14 @@ WitnessImprovement FCSimplexDecisionProcedure::focusUsingSignDisagreements(Arith Assert(!d_sgnDisagreements.empty()); Assert(d_errorSet.focusSize() >= 2); - if(Debug.isOn("arith::focus")){ - d_errorSet.debugPrint(Debug("arith::focus")); + if(TraceIsOn("arith::focus")){ + d_errorSet.debugPrint(Trace("arith::focus")); } ArithVar nb = d_linEq.minBy(d_sgnDisagreements, &LinearEqualityModule::minColLength); const Tableau::Entry& e_evar_nb = d_tableau.basicFindEntry(basic, nb); int oppositeSgn = - (e_evar_nb.getCoefficient().sgn()); - Debug("arith::focus") << "focusUsingSignDisagreements " << basic << " " << oppositeSgn << endl; + Trace("arith::focus") << "focusUsingSignDisagreements " << basic << " " << oppositeSgn << endl; ArithVarVec dropped; @@ -427,7 +427,7 @@ WitnessImprovement FCSimplexDecisionProcedure::focusUsingSignDisagreements(Arith Assert(entry.getColVar() == nb); int sgn = entry.getCoefficient().sgn(); - Debug("arith::focus") + Trace("arith::focus") << "on row " << d_tableau.rowIndexToBasic(entry.getRowIndex()) << " " @@ -438,7 +438,7 @@ WitnessImprovement FCSimplexDecisionProcedure::focusUsingSignDisagreements(Arith if(errSgn * sgn == oppositeSgn){ dropped.push_back(currRow); - Debug("arith::focus") << "dropping from focus " << currRow << endl; + Trace("arith::focus") << "dropping from focus " << currRow << endl; } } } @@ -453,13 +453,13 @@ bool debugSelectedErrorDropped(const UpdateInfo& selected, int32_t prevErrorSize } void FCSimplexDecisionProcedure::debugPrintSignal(ArithVar updated) const{ - Debug("updateAndSignal") << "updated basic " << updated; - Debug("updateAndSignal") << " length " << d_tableau.basicRowLength(updated); - Debug("updateAndSignal") << " consistent " << d_variables.assignmentIsConsistent(updated); + Trace("updateAndSignal") << "updated basic " << updated; + Trace("updateAndSignal") << " length " << d_tableau.basicRowLength(updated); + Trace("updateAndSignal") << " consistent " << d_variables.assignmentIsConsistent(updated); int dir = !d_variables.assignmentIsConsistent(updated) ? d_errorSet.getSgn(updated) : 0; - Debug("updateAndSignal") << " dir " << dir; - Debug("updateAndSignal") << " debugBasicAtBoundCount " << d_linEq.debugBasicAtBoundCount(updated) << endl; + Trace("updateAndSignal") << " dir " << dir; + Trace("updateAndSignal") << " debugBasicAtBoundCount " << d_linEq.debugBasicAtBoundCount(updated) << endl; } bool debugUpdatedBasic(const UpdateInfo& selected, ArithVar updated){ @@ -473,7 +473,7 @@ bool debugUpdatedBasic(const UpdateInfo& selected, ArithVar updated){ void FCSimplexDecisionProcedure::updateAndSignal(const UpdateInfo& selected, WitnessImprovement w){ ArithVar nonbasic = selected.nonbasic(); - Debug("updateAndSignal") << "updateAndSignal " << selected << endl; + Trace("updateAndSignal") << "updateAndSignal " << selected << endl; stringstream ss; @@ -502,7 +502,7 @@ void FCSimplexDecisionProcedure::updateAndSignal(const UpdateInfo& selected, Wit if(d_tableau.isBasic(updated)){ Assert(!d_variables.assignmentIsConsistent(updated) == d_errorSet.inError(updated)); - if(Debug.isOn("updateAndSignal")){debugPrintSignal(updated);} + if(TraceIsOn("updateAndSignal")){debugPrintSignal(updated);} if(!d_variables.assignmentIsConsistent(updated)){ if(checkBasicForConflict(updated)){ reportConflict(updated); @@ -510,7 +510,7 @@ void FCSimplexDecisionProcedure::updateAndSignal(const UpdateInfo& selected, Wit } } }else{ - Debug("updateAndSignal") << "updated nonbasic " << updated << endl; + Trace("updateAndSignal") << "updated nonbasic " << updated << endl; } int currFocusSgn = d_errorSet.focusSgn(updated); if(currFocusSgn != prevFocusSgn){ @@ -519,7 +519,7 @@ void FCSimplexDecisionProcedure::updateAndSignal(const UpdateInfo& selected, Wit } } - if(Debug.isOn("error")){ d_errorSet.debugPrint(Debug("error")); } + if(TraceIsOn("error")){ d_errorSet.debugPrint(Trace("error")); } Assert( debugSelectedErrorDropped(selected, d_errorSize, d_errorSet.errorSize())); @@ -552,7 +552,7 @@ WitnessImprovement FCSimplexDecisionProcedure::dualLikeImproveError(ArithVar err d_prevWitnessImprovement == HeuristicDegenerate && d_witnessImprovementInARow >= s_focusThreshold){ - Debug("focusDownToJust") << "focusDownToJust " << errorVar << endl; + Trace("focusDownToJust") << "focusDownToJust " << errorVar << endl; return focusDownToJust(errorVar); }else{ @@ -567,7 +567,7 @@ WitnessImprovement FCSimplexDecisionProcedure::dualLikeImproveError(ArithVar err WitnessImprovement FCSimplexDecisionProcedure::focusDownToLastHalf(){ Assert(d_focusSize >= 2); - Debug("focusDownToLastHalf") << "focusDownToLastHalf " + Trace("focusDownToLastHalf") << "focusDownToLastHalf " << d_errorSet.errorSize() << " " << d_errorSet.focusSize() << " "; @@ -582,7 +582,7 @@ WitnessImprovement FCSimplexDecisionProcedure::focusDownToLastHalf(){ } } WitnessImprovement w = adjustFocusShrank(buf); - Debug("focusDownToLastHalf") << "-> " << d_errorSet.focusSize() << endl; + Trace("focusDownToLastHalf") << "-> " << d_errorSet.focusSize() << endl; return w; } @@ -599,7 +599,7 @@ WitnessImprovement FCSimplexDecisionProcedure::selectFocusImproving() { UpdateInfo selected = selectPrimalUpdate(d_focusErrorVar, upf, bpf); if(selected.uninitialized()){ - Debug("selectFocusImproving") << "focus is optimum, but we don't have sat/conflict yet" << endl; + Trace("selectFocusImproving") << "focus is optimum, but we don't have sat/conflict yet" << endl; return focusDownToLastHalf(); } @@ -608,16 +608,16 @@ WitnessImprovement FCSimplexDecisionProcedure::selectFocusImproving() { Assert(debugCheckWitness(selected, w, false)); if(degenerate(w)){ - Debug("selectFocusImproving") << "only degenerate" << endl; + Trace("selectFocusImproving") << "only degenerate" << endl; if(d_prevWitnessImprovement == HeuristicDegenerate && d_witnessImprovementInARow >= s_focusThreshold){ - Debug("selectFocusImproving") << "focus down been degenerate too long" << endl; + Trace("selectFocusImproving") << "focus down been degenerate too long" << endl; return focusDownToLastHalf(); }else{ - Debug("selectFocusImproving") << "taking degenerate" << endl; + Trace("selectFocusImproving") << "taking degenerate" << endl; } } - Debug("selectFocusImproving") << "selectFocusImproving did this " << selected << endl; + Trace("selectFocusImproving") << "selectFocusImproving did this " << selected << endl; updateAndSignal(selected, w); logPivot(w); @@ -676,7 +676,7 @@ Result::Sat FCSimplexDecisionProcedure::dualLike(){ while(d_pivotBudget != 0 && d_errorSize > 0 && d_conflictVariables.empty()){ - Debug("dualLike") << "dualLike " << endl; + Trace("dualLike") << "dualLike " << endl; Assert(d_errorSet.noSignals()); @@ -697,7 +697,7 @@ Result::Sat FCSimplexDecisionProcedure::dualLike(){ d_focusErrorVar = constructInfeasiblityFunction(d_statistics.d_fcFocusConstructionTimer); - Debug("dualLike") << "blur " << d_focusSize << endl; + Trace("dualLike") << "blur " << d_focusSize << endl; }else if(d_focusSize == 1){ // Possible outcomes: // - errorSet size shrunk @@ -707,7 +707,7 @@ Result::Sat FCSimplexDecisionProcedure::dualLike(){ // - budget was exhausted ArithVar e = d_errorSet.topFocusVariable(); - Debug("dualLike") << "primalImproveError " << e << endl; + Trace("dualLike") << "primalImproveError " << e << endl; w = primalImproveError(e); }else{ @@ -722,20 +722,20 @@ Result::Sat FCSimplexDecisionProcedure::dualLike(){ ArithVar e = d_errorSet.topFocusVariable(); static constexpr unsigned s_sumMetricThreshold = 1; if(d_errorSet.sumMetric(e) <= s_sumMetricThreshold){ - Debug("dualLike") << "dualLikeImproveError " << e << endl; + Trace("dualLike") << "dualLikeImproveError " << e << endl; w = dualLikeImproveError(e); }else{ - Debug("dualLike") << "selectFocusImproving " << endl; + Trace("dualLike") << "selectFocusImproving " << endl; w = selectFocusImproving(); } } - Debug("dualLike") << "witnessImprovement: " << w << endl; + Trace("dualLike") << "witnessImprovement: " << w << endl; Assert(d_focusSize == d_errorSet.focusSize()); Assert(d_errorSize == d_errorSet.errorSize()); - Assert(debugDualLike(w, Debug("dualLike"), prevFocusSize, prevErrorSize)); - Debug("dualLike") << "Focus size " << d_focusSize << " (was " << prevFocusSize << ")" << endl; - Debug("dualLike") << "Error size " << d_errorSize << " (was " << prevErrorSize << ")" << endl; + Assert(debugDualLike(w, Trace("dualLike"), prevFocusSize, prevErrorSize)); + Trace("dualLike") << "Focus size " << d_focusSize << " (was " << prevFocusSize << ")" << endl; + Trace("dualLike") << "Error size " << d_errorSize << " (was " << prevErrorSize << ")" << endl; } diff --git a/src/theory/arith/linear_equality.cpp b/src/theory/arith/linear_equality.cpp index bc4f11e9d..b0636880a 100644 --- a/src/theory/arith/linear_equality.cpp +++ b/src/theory/arith/linear_equality.cpp @@ -101,9 +101,9 @@ void LinearEqualityModule::includeBoundUpdate(ArithVar v, const BoundsInfo& prev RowIndex ridx = entry.getRowIndex(); BoundsInfo& counts = d_btracking.get(ridx); - Debug("includeBoundUpdate") << d_tableau.rowIndexToBasic(ridx) << " " << counts << " to " ; + Trace("includeBoundUpdate") << d_tableau.rowIndexToBasic(ridx) << " " << counts << " to " ; counts.addInChange(a_ijSgn, prev, curr); - Debug("includeBoundUpdate") << counts << " " << a_ijSgn << std::endl; + Trace("includeBoundUpdate") << counts << " " << a_ijSgn << std::endl; } } @@ -182,7 +182,7 @@ void LinearEqualityModule::updateUntracked(ArithVar x_i, const DeltaRational& v) ++(d_statistics.d_statUpdates); - Debug("arith") <<"update " << x_i << ": " + Trace("arith") <<"update " << x_i << ": " << assignment_x_i << "|-> " << v << endl; DeltaRational diff = v - assignment_x_i; @@ -203,7 +203,7 @@ void LinearEqualityModule::updateUntracked(ArithVar x_i, const DeltaRational& v) d_variables.setAssignment(x_i, v); - if(Debug.isOn("paranoid:check_tableau")){ debugCheckTableau(); } + if(TraceIsOn("paranoid:check_tableau")){ debugCheckTableau(); } } void LinearEqualityModule::updateTracked(ArithVar x_i, const DeltaRational& v){ @@ -215,7 +215,7 @@ void LinearEqualityModule::updateTracked(ArithVar x_i, const DeltaRational& v){ ++(d_statistics.d_statUpdates); DeltaRational diff = v - d_variables.getAssignment(x_i); - Debug("arith") <<"update " << x_i << ": " + Trace("arith") <<"update " << x_i << ": " << d_variables.getAssignment(x_i) << "|-> " << v << endl; @@ -236,7 +236,7 @@ void LinearEqualityModule::updateTracked(ArithVar x_i, const DeltaRational& v){ const DeltaRational& assignment = d_variables.getAssignment(x_j); DeltaRational nAssignment = assignment+(diff * a_ji); - Debug("update") << x_j << " " << a_ji << assignment << " -> " << nAssignment << endl; + Trace("update") << x_j << " " << a_ji << assignment << " -> " << nAssignment << endl; BoundCounts xjBefore = d_variables.atBoundCounts(x_j); d_variables.setAssignment(x_j, nAssignment); BoundCounts xjAfter = d_variables.atBoundCounts(x_j); @@ -253,7 +253,7 @@ void LinearEqualityModule::updateTracked(ArithVar x_i, const DeltaRational& v){ d_basicVariableUpdates(x_j); } - if(Debug.isOn("paranoid:check_tableau")){ debugCheckTableau(); } + if(TraceIsOn("paranoid:check_tableau")){ debugCheckTableau(); } } void LinearEqualityModule::pivotAndUpdate(ArithVar x_i, ArithVar x_j, const DeltaRational& x_i_value){ @@ -261,12 +261,12 @@ void LinearEqualityModule::pivotAndUpdate(ArithVar x_i, ArithVar x_j, const Delt TimerStat::CodeTimer codeTimer(d_statistics.d_pivotTime); - if(Debug.isOn("arith::tracking::pre")){ - Debug("arith::tracking") << "pre update" << endl; + if(TraceIsOn("arith::tracking::pre")){ + Trace("arith::tracking") << "pre update" << endl; debugCheckTracking(); } - if(Debug.isOn("arith::simplex:row")){ debugPivot(x_i, x_j); } + if(TraceIsOn("arith::simplex:row")){ debugPivot(x_i, x_j); } RowIndex ridx = d_tableau.basicToRowIndex(x_i); const Tableau::Entry& entry_ij = d_tableau.findEntry(ridx, x_j); @@ -279,8 +279,8 @@ void LinearEqualityModule::pivotAndUpdate(ArithVar x_i, ArithVar x_j, const Delt updateTracked(x_j, x_j_value); - if(Debug.isOn("arith::tracking::mid")){ - Debug("arith::tracking") << "postupdate prepivot" << endl; + if(TraceIsOn("arith::tracking::mid")){ + Trace("arith::tracking") << "postupdate prepivot" << endl; debugCheckTracking(); } @@ -289,14 +289,14 @@ void LinearEqualityModule::pivotAndUpdate(ArithVar x_i, ArithVar x_j, const Delt d_tableau.pivot(x_i, x_j, d_trackCallback); - if(Debug.isOn("arith::tracking::post")){ - Debug("arith::tracking") << "postpivot" << endl; + if(TraceIsOn("arith::tracking::post")){ + Trace("arith::tracking") << "postpivot" << endl; debugCheckTracking(); } d_basicVariableUpdates(x_j); - if(Debug.isOn("matrix")){ + if(TraceIsOn("matrix")){ d_tableau.printMatrix(); } } @@ -316,30 +316,30 @@ void LinearEqualityModule::debugCheckTracking(){ endIter = d_tableau.endBasic(); for(; basicIter != endIter; ++basicIter){ ArithVar basic = *basicIter; - Debug("arith::tracking") << "arith::tracking row basic: " << basic << endl; + Trace("arith::tracking") << "arith::tracking row basic: " << basic << endl; - for(Tableau::RowIterator iter = d_tableau.basicRowIterator(basic); !iter.atEnd() && Debug.isOn("arith::tracking"); ++iter){ + for(Tableau::RowIterator iter = d_tableau.basicRowIterator(basic); !iter.atEnd() && TraceIsOn("arith::tracking"); ++iter){ const Tableau::Entry& entry = *iter; ArithVar var = entry.getColVar(); const Rational& coeff = entry.getCoefficient(); DeltaRational beta = d_variables.getAssignment(var); - Debug("arith::tracking") << var << " " << d_variables.boundsInfo(var) + Trace("arith::tracking") << var << " " << d_variables.boundsInfo(var) << " " << beta << coeff; if(d_variables.hasLowerBound(var)){ - Debug("arith::tracking") << "(lb " << d_variables.getLowerBound(var) << ")"; + Trace("arith::tracking") << "(lb " << d_variables.getLowerBound(var) << ")"; } if(d_variables.hasUpperBound(var)){ - Debug("arith::tracking") << "(up " << d_variables.getUpperBound(var) << ")"; + Trace("arith::tracking") << "(up " << d_variables.getUpperBound(var) << ")"; } - Debug("arith::tracking") << endl; + Trace("arith::tracking") << endl; } - Debug("arith::tracking") << "end row"<< endl; + Trace("arith::tracking") << "end row"<< endl; if(basicIsTracked(basic)){ RowIndex ridx = d_tableau.basicToRowIndex(basic); BoundsInfo computed = computeRowBoundInfo(ridx, false); - Debug("arith::tracking") + Trace("arith::tracking") << "computed " << computed << " tracking " << d_btracking[ridx] << endl; Assert(computed == d_btracking[ridx]); @@ -348,7 +348,7 @@ void LinearEqualityModule::debugCheckTracking(){ } void LinearEqualityModule::debugPivot(ArithVar x_i, ArithVar x_j){ - Debug("arith::pivot") << "debugPivot("<< x_i <<"|->"<< x_j << ")" << endl; + Trace("arith::pivot") << "debugPivot("<< x_i <<"|->"<< x_j << ")" << endl; for(Tableau::RowIterator iter = d_tableau.basicRowIterator(x_i); !iter.atEnd(); ++iter){ const Tableau::Entry& entry = *iter; @@ -356,22 +356,22 @@ void LinearEqualityModule::debugPivot(ArithVar x_i, ArithVar x_j){ ArithVar var = entry.getColVar(); const Rational& coeff = entry.getCoefficient(); DeltaRational beta = d_variables.getAssignment(var); - Debug("arith::pivot") << var << beta << coeff; + Trace("arith::pivot") << var << beta << coeff; if(d_variables.hasLowerBound(var)){ - Debug("arith::pivot") << "(lb " << d_variables.getLowerBound(var) << ")"; + Trace("arith::pivot") << "(lb " << d_variables.getLowerBound(var) << ")"; } if(d_variables.hasUpperBound(var)){ - Debug("arith::pivot") << "(up " << d_variables.getUpperBound(var) << ")"; + Trace("arith::pivot") << "(up " << d_variables.getUpperBound(var) << ")"; } - Debug("arith::pivot") << endl; + Trace("arith::pivot") << endl; } - Debug("arith::pivot") << "end row"<< endl; + Trace("arith::pivot") << "end row"<< endl; } /** * This check is quite expensive. - * It should be wrapped in a Debug.isOn() guard. - * if(Debug.isOn("paranoid:check_tableau")){ + * It should be wrapped in a TraceIsOn() guard. + * if(TraceIsOn("paranoid:check_tableau")){ * checkTableau(); * } */ @@ -381,7 +381,7 @@ void LinearEqualityModule::debugCheckTableau(){ for(; basicIter != endIter; ++basicIter){ ArithVar basic = *basicIter; DeltaRational sum; - Debug("paranoid:check_tableau") << "starting row" << basic << endl; + Trace("paranoid:check_tableau") << "starting row" << basic << endl; Tableau::RowIterator nonbasicIter = d_tableau.basicRowIterator(basic); for(; !nonbasicIter.atEnd(); ++nonbasicIter){ const Tableau::Entry& entry = *nonbasicIter; @@ -390,11 +390,11 @@ void LinearEqualityModule::debugCheckTableau(){ const Rational& coeff = entry.getCoefficient(); DeltaRational beta = d_variables.getAssignment(nonbasic); - Debug("paranoid:check_tableau") << nonbasic << beta << coeff<getVariable(); - Debug("arith::propagateRow") << "LinearEqualityModule::propagateRow(" + Trace("arith::propagateRow") << "LinearEqualityModule::propagateRow(" << ridx << ", " << rowUp << ", " << v << ") start" << endl; const Rational& multiple = rowUp ? d_one : d_negOne; - Debug("arith::propagateRow") << "multiple: " << multiple << endl; + Trace("arith::propagateRow") << "multiple: " << multiple << endl; Tableau::RowIterator iter = d_tableau.ridRowIterator(ridx); for(; !iter.atEnd(); ++iter){ @@ -541,28 +541,28 @@ void LinearEqualityModule::propagateRow(ConstraintCPVec& into, RowIndex ridx, bo || (!rowUp && a_ij.sgn() > 0 && c->isUpperBound()) || (!rowUp && a_ij.sgn() < 0 && c->isLowerBound())); - if(Debug.isOn("arith::propagateRow")){ + if(TraceIsOn("arith::propagateRow")){ if(nonbasic == v){ - Debug("arith::propagateRow") << "(target) " + Trace("arith::propagateRow") << "(target) " << rowUp << " " << a_ij.sgn() << " " << c->isLowerBound() << " " << c->isUpperBound() << endl; - Debug("arith::propagateRow") << "(target) "; + Trace("arith::propagateRow") << "(target) "; } - Debug("arith::propagateRow") << "propagateRow " << a_ij << " * " << nonbasic ; + Trace("arith::propagateRow") << "propagateRow " << a_ij << " * " << nonbasic ; } if(nonbasic == v){ if(farkas != RationalVectorPSentinel){ Assert(farkas->front().isZero()); Rational multAij = multiple * a_ij; - Debug("arith::propagateRow") << "(" << multAij << ") "; + Trace("arith::propagateRow") << "(" << multAij << ") "; farkas->front() = multAij; } - Debug("arith::propagateRow") << c << endl; + Trace("arith::propagateRow") << c << endl; }else{ ConstraintCP bound = selectUb @@ -571,15 +571,15 @@ void LinearEqualityModule::propagateRow(ConstraintCPVec& into, RowIndex ridx, bo if(farkas != RationalVectorPSentinel){ Rational multAij = multiple * a_ij; - Debug("arith::propagateRow") << "(" << multAij << ") "; + Trace("arith::propagateRow") << "(" << multAij << ") "; farkas->push_back(multAij); } Assert(bound != NullConstraint); - Debug("arith::propagateRow") << bound << endl; + Trace("arith::propagateRow") << bound << endl; into.push_back(bound); } } - Debug("arith::propagateRow") << "LinearEqualityModule::propagateRow(" + Trace("arith::propagateRow") << "LinearEqualityModule::propagateRow(" << ridx << ", " << rowUp << ", " << v << ") done" << endl; } @@ -617,11 +617,11 @@ ConstraintP LinearEqualityModule::weakestExplanation(bool aboveUpper, DeltaRatio anyWeakening = true; surplus = surplus - diff; - Debug("arith::weak") << "found:" << endl; + Trace("arith::weak") << "found:" << endl; if(v == basic){ - Debug("arith::weak") << " basic: "; + Trace("arith::weak") << " basic: "; } - Debug("arith::weak") << " " << surplus << " "<< diff << endl + Trace("arith::weak") << " " << surplus << " "<< diff << endl << " " << bound << c << endl << " " << weakerBound << weaker << endl; @@ -672,7 +672,7 @@ ConstraintCP LinearEqualityModule::minimallyWeakConflict(bool aboveUpper, ArithV Assert(!fcs.underConstruction()); TimerStat::CodeTimer codeTimer(d_statistics.d_weakenTime); - Debug("arith::weak") << "LinearEqualityModule::minimallyWeakConflict(" + Trace("arith::weak") << "LinearEqualityModule::minimallyWeakConflict(" << aboveUpper <<", "<< basicVar << ", ...) start" << endl; const Rational& adjustSgn = aboveUpper ? d_negOne : d_one; @@ -695,7 +695,7 @@ ConstraintCP LinearEqualityModule::minimallyWeakConflict(bool aboveUpper, ArithV const Rational& coeff = entry.getCoefficient(); bool weakening = false; ConstraintP c = weakestExplanation(aboveUpper, surplus, v, coeff, weakening, basicVar); - Debug("arith::weak") << "weak : " << weakening << " " + Trace("arith::weak") << "weak : " << weakening << " " << c->assertedToTheTheory() << " " << d_variables.getAssignment(v) << " " << c << endl; @@ -715,7 +715,7 @@ ConstraintCP LinearEqualityModule::minimallyWeakConflict(bool aboveUpper, ArithV if(anyWeakenings){ ++d_statistics.d_weakeningSuccesses; } - Debug("arith::weak") << "LinearEqualityModule::minimallyWeakConflict(" + Trace("arith::weak") << "LinearEqualityModule::minimallyWeakConflict(" << aboveUpper <<", "<< basicVar << ", ...) done" << endl; return conflicted; } @@ -822,7 +822,7 @@ const Tableau::Entry* LinearEqualityModule::selectSlackEntry(ArithVar x_i, bool void LinearEqualityModule::startTrackingBoundCounts(){ Assert(!d_areTracking); d_areTracking = true; - if(Debug.isOn("arith::tracking")){ + if(TraceIsOn("arith::tracking")){ debugCheckTracking(); } Assert(d_areTracking); @@ -831,7 +831,7 @@ void LinearEqualityModule::startTrackingBoundCounts(){ void LinearEqualityModule::stopTrackingBoundCounts(){ Assert(d_areTracking); d_areTracking = false; - if(Debug.isOn("arith::tracking")){ + if(TraceIsOn("arith::tracking")){ debugCheckTracking(); } Assert(!d_areTracking); @@ -893,7 +893,7 @@ bool LinearEqualityModule::basicsAtBounds(const UpdateInfo& u) const { nonb = nonb.multiplyBySgn(-coeffSgn); uint32_t length = d_tableau.basicRowLength(basic); - Debug("basicsAtBounds") + Trace("basicsAtBounds") << "bcs " << bcs << "nonb " << nonb << "length " << length << endl; @@ -1019,10 +1019,10 @@ bool LinearEqualityModule::accumulateBorder(const Tableau::Entry& entry, bool ub // else, inc if(increasing){ - Debug("handleBorders") << "push back increasing " << border << endl; + Trace("handleBorders") << "push back increasing " << border << endl; d_increasing.push_back(border); }else{ - Debug("handleBorders") << "push back decreasing " << border << endl; + Trace("handleBorders") << "push back decreasing " << border << endl; d_decreasing.push_back(border); } return false; @@ -1115,22 +1115,22 @@ UpdateInfo LinearEqualityModule::speculativeUpdate(ArithVar nb, const Rational& int focusCoeffSgn = focusCoeff.sgn(); - Debug("speculativeUpdate") << "speculativeUpdate" << endl; - Debug("speculativeUpdate") << "nb " << nb << endl; - Debug("speculativeUpdate") << "focusCoeff " << focusCoeff << endl; + Trace("speculativeUpdate") << "speculativeUpdate" << endl; + Trace("speculativeUpdate") << "nb " << nb << endl; + Trace("speculativeUpdate") << "focusCoeff " << focusCoeff << endl; if(d_variables.hasUpperBound(nb)){ ConstraintP ub = d_variables.getUpperBoundConstraint(nb); d_upperBoundDifference = ub->getValue() - d_variables.getAssignment(nb); Border border(ub, *d_upperBoundDifference, false, NULL, true); - Debug("handleBorders") << "push back increasing " << border << endl; + Trace("handleBorders") << "push back increasing " << border << endl; d_increasing.push_back(border); } if(d_variables.hasLowerBound(nb)){ ConstraintP lb = d_variables.getLowerBoundConstraint(nb); d_lowerBoundDifference = lb->getValue() - d_variables.getAssignment(nb); Border border(lb, *d_lowerBoundDifference, false, NULL, false); - Debug("handleBorders") << "push back decreasing " << border << endl; + Trace("handleBorders") << "push back decreasing " << border << endl; d_decreasing.push_back(border); } @@ -1179,7 +1179,7 @@ void LinearEqualityModule::handleBorders(UpdateInfo& selected, ArithVar nb, cons int fixesRemaining = heap.possibleFixes(); - Debug("handleBorders") + Trace("handleBorders") << "handleBorders " << "nb " << nb << "fc " << focusCoeff @@ -1256,7 +1256,7 @@ void LinearEqualityModule::handleBorders(UpdateInfo& selected, ArithVar nb, cons DeltaRational blockChangeToFocus = diff * effectiveCoefficient; totalFocusChange += blockChangeToFocus; - Debug("handleBorders") + Trace("handleBorders") << "blockValue " << (blockValue) << "diff " << diff << "blockChangeToFocus " << totalFocusChange @@ -1270,7 +1270,7 @@ void LinearEqualityModule::handleBorders(UpdateInfo& selected, ArithVar nb, cons for(BorderVec::const_iterator i = startBlock; i != endBlock; ++i){ const Border& b = *i; - Debug("handleBorders") << b << endl; + Trace("handleBorders") << b << endl; bool makesImprovement = negErrorChange > 0 || (negErrorChange == 0 && currFocusChangeSgn > 0); diff --git a/src/theory/arith/matrix.h b/src/theory/arith/matrix.h index 7713dd2c3..0328c0e58 100644 --- a/src/theory/arith/matrix.h +++ b/src/theory/arith/matrix.h @@ -466,7 +466,7 @@ public: protected: void addEntry(RowIndex row, ArithVar col, const T& coeff){ - Debug("tableau") << "addEntry(" << row << "," << col <<"," << coeff << ")" << std::endl; + Trace("tableau") << "addEntry(" << row << "," << col <<"," << coeff << ")" << std::endl; Assert(coeff != 0); Assert(row < d_rows.size()); @@ -640,7 +640,7 @@ public: Assert(d_rowInMergeBuffer != ROW_INDEX_SENTINEL); Assert(to != ROW_INDEX_SENTINEL); - Debug("tableau") << "rowPlusRowTimesConstant(" + Trace("tableau") << "rowPlusRowTimesConstant(" << to << "," << mult << "," << d_rowInMergeBuffer << ")" << std::endl; @@ -691,7 +691,7 @@ public: Assert(mergeBufferIsClear()); - if(Debug.isOn("matrix")) { printMatrix(); } + if(TraceIsOn("matrix")) { printMatrix(); } } /** to += mult * buffer. */ @@ -699,7 +699,7 @@ public: Assert(d_rowInMergeBuffer != ROW_INDEX_SENTINEL); Assert(to != ROW_INDEX_SENTINEL); - Debug("tableau") << "rowPlusRowTimesConstant(" + Trace("tableau") << "rowPlusRowTimesConstant(" << to << "," << mult << "," << d_rowInMergeBuffer << ")" << std::endl; @@ -758,7 +758,7 @@ public: Assert(mergeBufferIsClear()); - if(Debug.isOn("matrix")) { printMatrix(); } + if(TraceIsOn("matrix")) { printMatrix(); } } bool mergeBufferIsClear() const{ @@ -822,7 +822,7 @@ public: } /** - * Prints the contents of the Matrix to Debug("matrix") + * Prints the contents of the Matrix to Trace("matrix") */ void printMatrix(std::ostream& out) const { out << "Matrix::printMatrix" << std::endl; @@ -832,7 +832,7 @@ public: } } void printMatrix() const { - printMatrix(Debug("matrix")); + printMatrix(Trace("matrix")); } void printRow(RowIndex rid, std::ostream& out) const { @@ -847,14 +847,14 @@ public: out << "}" << std::endl; } void printRow(RowIndex rid) const { - printRow(rid, Debug("matrix")); + printRow(rid, Trace("matrix")); } void printEntry(const MatrixEntry& entry, std::ostream& out) const { out << entry.getColVar() << "*" << entry.getCoefficient(); } void printEntry(const MatrixEntry& entry) const { - printEntry(entry, Debug("matrix")); + printEntry(entry, Trace("matrix")); } public: uint32_t size() const { @@ -966,7 +966,7 @@ protected: const Entry& entry = *i; ArithVar colVar = entry.getColVar(); uint32_t count = debugCountColLength(colVar); - Debug("tableau") << "debugMatchingCountsForRow " + Trace("tableau") << "debugMatchingCountsForRow " << ridx << ":" << colVar << " " << count <<" "<< getColLength(colVar) << std::endl; if( count != getColLength(colVar) ){ @@ -977,14 +977,14 @@ protected: } uint32_t debugCountColLength(ArithVar var){ - Debug("tableau") << var << " "; + Trace("tableau") << var << " "; uint32_t count = 0; for(ColIterator i=getColumn(var).begin(); !i.atEnd(); ++i){ const Entry& entry = *i; - Debug("tableau") << "(" << entry.getRowIndex() << ", " << i.getID() << ") "; + Trace("tableau") << "(" << entry.getRowIndex() << ", " << i.getID() << ") "; ++count; } - Debug("tableau") << std::endl; + Trace("tableau") << std::endl; return count; } uint32_t debugCountRowLength(RowIndex ridx){ diff --git a/src/theory/arith/nl/coverings/cdcac.cpp b/src/theory/arith/nl/coverings/cdcac.cpp index 8091964d7..dbadb78a1 100644 --- a/src/theory/arith/nl/coverings/cdcac.cpp +++ b/src/theory/arith/nl/coverings/cdcac.cpp @@ -125,7 +125,7 @@ std::vector CDCAC::getUnsatIntervals(std::size_t cur_variable) == options::nlCovLiftingMode::LAZARD) { intervals = le.infeasibleRegions(p, sc); - if (Trace.isOn("cdcac")) + if (TraceIsOn("cdcac")) { auto reference = poly::infeasible_regions(p, d_assignment, sc); Trace("cdcac") << "Lazard: " << intervals << std::endl; @@ -292,7 +292,7 @@ PolyVector requiredCoefficientsLazardModified( PolyVector CDCAC::requiredCoefficients(const poly::Polynomial& p) { - if (Trace.isOn("cdcac::projection")) + if (TraceIsOn("cdcac::projection")) { Trace("cdcac::projection") << "Poly: " << p << " over " << d_assignment << std::endl; @@ -519,7 +519,7 @@ std::vector CDCAC::getUnsatCoverImpl(std::size_t curVariable, << d_variableOrdering[curVariable] << std::endl; std::vector intervals = getUnsatIntervals(curVariable); - if (Trace.isOn("cdcac")) + if (TraceIsOn("cdcac")) { Trace("cdcac") << "Unsat intervals for " << d_variableOrdering[curVariable] << ":" << std::endl; @@ -610,7 +610,7 @@ std::vector CDCAC::getUnsatCoverImpl(std::size_t curVariable, pruneRedundantIntervals(intervals); } - if (Trace.isOn("cdcac")) + if (TraceIsOn("cdcac")) { Trace("cdcac") << "Returning intervals for " << d_variableOrdering[curVariable] << ":" << std::endl; @@ -704,7 +704,7 @@ void CDCAC::pruneRedundantIntervals(std::vector& intervals) cleanIntervals(intervals); if (options().arith.nlCovPrune) { - if (Trace.isOn("cdcac")) + if (TraceIsOn("cdcac")) { auto copy = intervals; removeRedundantIntervals(intervals); diff --git a/src/theory/arith/nl/coverings/cdcac_utils.cpp b/src/theory/arith/nl/coverings/cdcac_utils.cpp index ae1abe9d0..a65673b16 100644 --- a/src/theory/arith/nl/coverings/cdcac_utils.cpp +++ b/src/theory/arith/nl/coverings/cdcac_utils.cpp @@ -175,7 +175,7 @@ void cleanIntervals(std::vector& intervals) // Simplifies removal of redundancies later on. if (intervals.size() < 2) return; - if (Trace.isOn("cdcac")) + if (TraceIsOn("cdcac")) { Trace("cdcac") << "Before pruning:" << std::endl; for (const auto& i : intervals) @@ -224,7 +224,7 @@ void cleanIntervals(std::vector& intervals) intervals.pop_back(); } } - if (Trace.isOn("cdcac")) + if (TraceIsOn("cdcac")) { Trace("cdcac") << "After pruning:" << std::endl; for (const auto& i : intervals) diff --git a/src/theory/arith/nl/coverings/lazard_evaluation.cpp b/src/theory/arith/nl/coverings/lazard_evaluation.cpp index 53d0898dd..81b305d1b 100644 --- a/src/theory/arith/nl/coverings/lazard_evaluation.cpp +++ b/src/theory/arith/nl/coverings/lazard_evaluation.cpp @@ -283,7 +283,7 @@ struct LazardEvaluationState void addR(const poly::Variable& var) { d_variables.emplace_back(var); - if (Trace.isOn("nl-cov::lazard")) + if (TraceIsOn("nl-cov::lazard")) { std::string vname = lp_variable_db_get_name( poly::Context::get_context().get_variable_db(), var.get_internal()); diff --git a/src/theory/arith/nl/coverings_solver.cpp b/src/theory/arith/nl/coverings_solver.cpp index 062a9213b..b16f1a3c2 100644 --- a/src/theory/arith/nl/coverings_solver.cpp +++ b/src/theory/arith/nl/coverings_solver.cpp @@ -59,7 +59,7 @@ CoveringsSolver::~CoveringsSolver() {} void CoveringsSolver::initLastCall(const std::vector& assertions) { #ifdef CVC5_POLY_IMP - if (Trace.isOn("nl-cov")) + if (TraceIsOn("nl-cov")) { Trace("nl-cov") << "CoveringsSolver::initLastCall" << std::endl; Trace("nl-cov") << "* Assertions: " << std::endl; @@ -79,7 +79,7 @@ void CoveringsSolver::initLastCall(const std::vector& assertions) Trace("nl-cov") << "Found conflict: " << lem << std::endl; return; } - if (Trace.isOn("nl-cov")) + if (TraceIsOn("nl-cov")) { Trace("nl-cov") << "After simplifications" << std::endl; Trace("nl-cov") << "* Assertions: " << std::endl; diff --git a/src/theory/arith/nl/equality_substitution.cpp b/src/theory/arith/nl/equality_substitution.cpp index c1276474b..0335e8758 100644 --- a/src/theory/arith/nl/equality_substitution.cpp +++ b/src/theory/arith/nl/equality_substitution.cpp @@ -54,7 +54,7 @@ void EqualitySubstitution::reset() std::vector EqualitySubstitution::eliminateEqualities( const std::vector& assertions) { - if (Trace.isOn("nl-eqs")) + if (TraceIsOn("nl-eqs")) { Trace("nl-eqs") << "Input:" << std::endl; for (const auto& a : assertions) @@ -147,7 +147,7 @@ std::vector EqualitySubstitution::eliminateEqualities( asserts = std::move(next); } d_conflict.clear(); - if (Trace.isOn("nl-eqs")) + if (TraceIsOn("nl-eqs")) { Trace("nl-eqs") << "Output:" << std::endl; for (const auto& a : asserts) diff --git a/src/theory/arith/nl/ext/constraint.cpp b/src/theory/arith/nl/ext/constraint.cpp index 2f479f8f0..c86a9d3a3 100644 --- a/src/theory/arith/nl/ext/constraint.cpp +++ b/src/theory/arith/nl/ext/constraint.cpp @@ -41,7 +41,7 @@ void ConstraintDb::registerConstraint(Node atom) if (ArithMSum::getMonomialSumLit(atom, msum)) { Trace("nl-ext-debug") << "got monomial sum: " << std::endl; - if (Trace.isOn("nl-ext-debug")) + if (TraceIsOn("nl-ext-debug")) { ArithMSum::debugPrintMonomialSum(msum, "nl-ext-debug"); } diff --git a/src/theory/arith/nl/ext/factoring_check.cpp b/src/theory/arith/nl/ext/factoring_check.cpp index 51b589351..3a1f00db7 100644 --- a/src/theory/arith/nl/ext/factoring_check.cpp +++ b/src/theory/arith/nl/ext/factoring_check.cpp @@ -60,7 +60,7 @@ void FactoringCheck::check(const std::vector& asserts, { Trace("nl-ext-factor") << "Factoring for literal " << lit << ", monomial sum is : " << std::endl; - if (Trace.isOn("nl-ext-factor")) + if (TraceIsOn("nl-ext-factor")) { ArithMSum::debugPrintMonomialSum(msum, "nl-ext-factor"); } diff --git a/src/theory/arith/nl/ext/monomial_bounds_check.cpp b/src/theory/arith/nl/ext/monomial_bounds_check.cpp index e97f8b772..e101eb752 100644 --- a/src/theory/arith/nl/ext/monomial_bounds_check.cpp +++ b/src/theory/arith/nl/ext/monomial_bounds_check.cpp @@ -152,7 +152,7 @@ void MonomialBoundsCheck::checkBounds(const std::vector& asserts, } // add to status if maximal degree d_ci_max[x][coeff][rhs] = d_cdb.isMaximal(atom, x); - if (Trace.isOn("nl-ext-bound-debug2")) + if (TraceIsOn("nl-ext-bound-debug2")) { Node t = ArithMSum::mkCoeffTerm(coeff, x); Trace("nl-ext-bound-debug2") << "Add Bound: " << t << " " << type << " " @@ -193,7 +193,7 @@ void MonomialBoundsCheck::checkBounds(const std::vector& asserts, updated = false; } } - if (Trace.isOn("nl-ext-bound")) + if (TraceIsOn("nl-ext-bound")) { if (updated) { @@ -511,7 +511,7 @@ void MonomialBoundsCheck::checkResBounds() } Kind type_b = itcbr->second; exp.push_back(d_ci_exp[b][coeff_b][rhs_b]); - if (Trace.isOn("nl-ext-rbound")) + if (TraceIsOn("nl-ext-rbound")) { Trace("nl-ext-rbound") << "* try bounds : "; debugPrintBound("nl-ext-rbound", coeff_a, a, type_a, rhs_a); diff --git a/src/theory/arith/nl/ext/monomial_check.cpp b/src/theory/arith/nl/ext/monomial_check.cpp index 887ef3f1b..418b657a9 100644 --- a/src/theory/arith/nl/ext/monomial_check.cpp +++ b/src/theory/arith/nl/ext/monomial_check.cpp @@ -77,7 +77,7 @@ void MonomialCheck::checkSign() if (d_ms_proc.find(a) == d_ms_proc.end()) { std::vector exp; - if (Trace.isOn("nl-ext-debug")) + if (TraceIsOn("nl-ext-debug")) { Node cmva = d_data->d_model.computeConcreteModelValue(a); Trace("nl-ext-debug") diff --git a/src/theory/arith/nl/iand_solver.cpp b/src/theory/arith/nl/iand_solver.cpp index 27bb70fe0..8a8d095ec 100644 --- a/src/theory/arith/nl/iand_solver.cpp +++ b/src/theory/arith/nl/iand_solver.cpp @@ -131,7 +131,7 @@ void IAndSolver::checkFullRefine() { Node valAndXY = d_model.computeAbstractModelValue(i); Node valAndXYC = d_model.computeConcreteModelValue(i); - if (Trace.isOn("iand-check")) + if (TraceIsOn("iand-check")) { Node x = i[0]; Node y = i[1]; diff --git a/src/theory/arith/nl/nl_model.cpp b/src/theory/arith/nl/nl_model.cpp index 3c9458ae3..4a60b0a62 100644 --- a/src/theory/arith/nl/nl_model.cpp +++ b/src/theory/arith/nl/nl_model.cpp @@ -218,7 +218,7 @@ bool NlModel::checkModel(const std::vector& assertions, { // set its exact model value in the substitution Node curv = computeConcreteModelValue(cur); - if (Trace.isOn("nl-ext-cm")) + if (TraceIsOn("nl-ext-cm")) { Trace("nl-ext-cm") << "check-model-bound : exact : " << cur << " = "; @@ -344,7 +344,7 @@ bool NlModel::addBound(TNode v, TNode l, TNode u) Assert(u.isConst()); Assert(l.getConst() <= u.getConst()); d_check_model_bounds[v] = std::pair(l, u); - if (Trace.isOn("nl-ext-cm")) + if (TraceIsOn("nl-ext-cm")) { Trace("nl-ext-cm") << "check-model-bound : approximate : "; printRationalApprox("nl-ext-cm", l); @@ -488,7 +488,7 @@ bool NlModel::solveEqualitySimple(Node eq, if (uvf.isVar() && !hasAssignment(uvf)) { Node uvfv = computeConcreteModelValue(uvf); - if (Trace.isOn("nl-ext-cm")) + if (TraceIsOn("nl-ext-cm")) { Trace("nl-ext-cm") << "check-model-bound : exact : " << uvf << " = "; printRationalApprox("nl-ext-cm", uvfv); @@ -519,7 +519,7 @@ bool NlModel::solveEqualitySimple(Node eq, } Node val = nm->mkConst(CONST_RATIONAL, -c.getConst() / b.getConst()); - if (Trace.isOn("nl-ext-cm")) + if (TraceIsOn("nl-ext-cm")) { Trace("nl-ext-cm") << "check-model-bound : exact : " << var << " = "; printRationalApprox("nl-ext-cm", val); @@ -805,7 +805,7 @@ bool NlModel::simpleCheckModelMsum(const std::map& msum, bool pol) { Node vc = vars[i]; unsigned vcfact = factors[i]; - if (Trace.isOn("nl-ext-cms-debug")) + if (TraceIsOn("nl-ext-cms-debug")) { Trace("nl-ext-cms-debug") << "-- " << vc; if (vcfact > 1) @@ -984,7 +984,7 @@ bool NlModel::simpleCheckModelMsum(const std::map& msum, bool pol) void NlModel::printModelValue(const char* c, Node n, unsigned prec) const { - if (Trace.isOn(c)) + if (TraceIsOn(c)) { Trace(c) << " " << n << " -> "; const Node& aval = d_abstractModelCache.at(n); diff --git a/src/theory/arith/nl/nonlinear_extension.cpp b/src/theory/arith/nl/nonlinear_extension.cpp index 6f8bd56a5..bcece4e4d 100644 --- a/src/theory/arith/nl/nonlinear_extension.cpp +++ b/src/theory/arith/nl/nonlinear_extension.cpp @@ -330,7 +330,7 @@ Result::Sat NonlinearExtension::modelBasedRefinement(const std::set& termS } } - if (Trace.isOn("nl-ext-debug")) + if (TraceIsOn("nl-ext-debug")) { Trace("nl-ext-debug") << " processing NonlinearExtension::check : " << std::endl; @@ -436,7 +436,7 @@ void NonlinearExtension::runStrategy(Theory::Effort effort, { ++(d_stats.d_checkRuns); - if (Trace.isOn("nl-strategy")) + if (TraceIsOn("nl-strategy")) { for (const auto& a : assertions) { diff --git a/src/theory/arith/nl/pow2_solver.cpp b/src/theory/arith/nl/pow2_solver.cpp index 59bf89151..cf7243a70 100644 --- a/src/theory/arith/nl/pow2_solver.cpp +++ b/src/theory/arith/nl/pow2_solver.cpp @@ -120,7 +120,7 @@ void Pow2Solver::checkFullRefine() Node valPow2xAbstract = d_model.computeAbstractModelValue(n); Node valPow2xConcrete = d_model.computeConcreteModelValue(n); Node valXConcrete = d_model.computeConcreteModelValue(n[0]); - if (Trace.isOn("pow2-check")) + if (TraceIsOn("pow2-check")) { Trace("pow2-check") << "* " << i << ", value = " << valPow2xAbstract << std::endl; diff --git a/src/theory/arith/nl/transcendental/transcendental_solver.cpp b/src/theory/arith/nl/transcendental/transcendental_solver.cpp index 94aaaf0a0..28b11d404 100644 --- a/src/theory/arith/nl/transcendental/transcendental_solver.cpp +++ b/src/theory/arith/nl/transcendental/transcendental_solver.cpp @@ -204,7 +204,7 @@ void TranscendentalSolver::checkTranscendentalMonotonic() void TranscendentalSolver::checkTranscendentalTangentPlanes() { - if (Trace.isOn("nl-ext")) + if (TraceIsOn("nl-ext")) { if (!d_tstate.d_funcMap.empty()) { @@ -360,7 +360,7 @@ bool TranscendentalSolver::checkTfTangentPlanesFun(Node tf, unsigned d) is_tangent = concavity == -1; is_secant = concavity == 1; } - if (Trace.isOn("nl-ext-tftp")) + if (TraceIsOn("nl-ext-tftp")) { Trace("nl-ext-tftp") << "*** Outside boundary point ("; Trace("nl-ext-tftp") << (r == 0 ? "low" : "high") << ") "; diff --git a/src/theory/arith/nl/transcendental/transcendental_state.cpp b/src/theory/arith/nl/transcendental/transcendental_state.cpp index 4d7d95a86..51a1e6a51 100644 --- a/src/theory/arith/nl/transcendental/transcendental_state.cpp +++ b/src/theory/arith/nl/transcendental/transcendental_state.cpp @@ -151,7 +151,7 @@ void TranscendentalState::init(const std::vector& xts, getCurrentPiBounds(); } - if (Trace.isOn("nl-ext-mv")) + if (TraceIsOn("nl-ext-mv")) { Trace("nl-ext-mv") << "Arguments of trancendental functions : " << std::endl; diff --git a/src/theory/arith/normal_form.cpp b/src/theory/arith/normal_form.cpp index 3d2e0dc09..8f3c98a25 100644 --- a/src/theory/arith/normal_form.cpp +++ b/src/theory/arith/normal_form.cpp @@ -358,7 +358,7 @@ void Monomial::combineAdjacentMonomials(std::vector& monos) { } void Monomial::print() const { - Debug("normal-form") << getNode() << std::endl; + Trace("normal-form") << getNode() << std::endl; } void Monomial::printList(const std::vector& list) { @@ -625,8 +625,8 @@ bool Polynomial::variableMonomialAreStrictlyGreater(const Monomial& m) const{ return true; }else{ Monomial minimum = minimumVariableMonomial(); - Debug("nf::tmp") << "minimum " << minimum.getNode() << endl; - Debug("nf::tmp") << "m " << m.getNode() << endl; + Trace("nf::tmp") << "minimum " << minimum.getNode() << endl; + Trace("nf::tmp") << "m " << m.getNode() << endl; return m < minimum; } } @@ -724,8 +724,8 @@ SumPair Comparison::toSumPair() const { { Polynomial left = getLeft(); Polynomial right = getRight(); - Debug("nf::tmp") << "left: " << left.getNode() << endl; - Debug("nf::tmp") << "right: " << right.getNode() << endl; + Trace("nf::tmp") << "left: " << left.getNode() << endl; + Trace("nf::tmp") << "right: " << right.getNode() << endl; if(right.isConstant()){ return SumPair(left, -right.getHead().getConstant()); }else if(right.containsConstant()){ @@ -887,7 +887,7 @@ std::tuple Comparison::decompose( } Comparison Comparison::parseNormalForm(TNode n) { - Debug("polynomial") << "Comparison::parseNormalForm(" << n << ")"; + Trace("polynomial") << "Comparison::parseNormalForm(" << n << ")"; Comparison result(n); Assert(result.isNormalForm()); return result; @@ -996,7 +996,7 @@ Polynomial Comparison::getRight() const { bool Comparison::isNormalForm() const { Node n = getNode(); Kind cmpKind = comparisonKind(n); - Debug("nf::tmp") << "isNormalForm " << n << " " << cmpKind << endl; + Trace("nf::tmp") << "isNormalForm " << n << " " << cmpKind << endl; switch(cmpKind){ case kind::CONST_BOOLEAN: return true; @@ -1038,7 +1038,7 @@ bool Comparison::isNormalGT() const { /** This must be (not (> qpolynomial constant)) */ bool Comparison::isNormalLEQ() const { Node n = getNode(); - Debug("nf::tmp") << "isNormalLEQ " << n << endl; + Trace("nf::tmp") << "isNormalLEQ " << n << endl; Assert(n.getKind() == kind::NOT); Assert(n[0].getKind() == kind::GT); if(!rightIsConstant()){ @@ -1061,7 +1061,7 @@ bool Comparison::isNormalGEQ() const { Node n = getNode(); Assert(n.getKind() == kind::GEQ); - Debug("nf::tmp") << "isNormalGEQ " << n << " " << rightIsConstant() << endl; + Trace("nf::tmp") << "isNormalGEQ " << n << " " << rightIsConstant() << endl; if(!rightIsConstant()){ return false; @@ -1122,14 +1122,14 @@ bool Comparison::isNormalEqualityOrDisequality() const { }else{ Integer lcm = lcoeff.getDenominator().lcm(varRight.denominatorLCM()); Integer g = lcoeff.getNumerator().gcd(varRight.numeratorGCD()); - Debug("nf::tmp") << lcm << " " << g << endl; + Trace("nf::tmp") << lcm << " " << g << endl; if(!lcm.isOne()){ return false; }else if(!g.isOne()){ return false; }else{ Monomial absMinRight = varRight.selectAbsMinimum(); - Debug("nf::tmp") << mleft.getNode() << " " << absMinRight.getNode() << endl; + Trace("nf::tmp") << mleft.getNode() << " " << absMinRight.getNode() << endl; if( mleft.absCmp(absMinRight) < 0){ return true; }else{ @@ -1139,7 +1139,7 @@ bool Comparison::isNormalEqualityOrDisequality() const { } }else{ if(mleft.coefficientIsOne()){ - Debug("nf::tmp") + Trace("nf::tmp") << "dfklj " << mleft.getNode() << endl << pright.getNode() << endl << pright.variableMonomialAreStrictlyGreater(mleft) diff --git a/src/theory/arith/normal_form.h b/src/theory/arith/normal_form.h index 6ef32ea6e..545c72a5b 100644 --- a/src/theory/arith/normal_form.h +++ b/src/theory/arith/normal_form.h @@ -955,13 +955,13 @@ public: bool variableMonomialAreStrictlyGreater(const Monomial& m) const; void printList() const { - if(Debug.isOn("normal-form")){ - Debug("normal-form") << "start list" << std::endl; + if(TraceIsOn("normal-form")){ + Trace("normal-form") << "start list" << std::endl; for(iterator i = begin(), oend = end(); i != oend; ++i) { const Monomial& m =*i; m.print(); } - Debug("normal-form") << "end list" << std::endl; + Trace("normal-form") << "end list" << std::endl; } } diff --git a/src/theory/arith/partial_model.cpp b/src/theory/arith/partial_model.cpp index 1e7739ad9..72315b6a6 100644 --- a/src/theory/arith/partial_model.cpp +++ b/src/theory/arith/partial_model.cpp @@ -332,7 +332,7 @@ std::pair ArithVariables::explainEqualBounds(ArithVar } void ArithVariables::setAssignment(ArithVar x, const DeltaRational& r){ - Debug("partial_model") << "pm: updating the assignment to" << x + Trace("partial_model") << "pm: updating the assignment to" << x << " now " << r <isEquality() || c->isLowerBound(), "Constraint type must be set to an equality or UpperBound."); ArithVar x = c->getVariable(); - Debug("partial_model") << "setLowerBoundConstraint(" << x << ":" << c << ")" << endl; + Trace("partial_model") << "setLowerBoundConstraint(" << x << ":" << c << ")" << endl; Assert(inMaps(x)); Assert(greaterThanLowerBound(x, c->getValue())); @@ -456,7 +456,7 @@ void ArithVariables::setUpperBoundConstraint(ConstraintP c){ "Constraint type must be set to an equality or UpperBound."); ArithVar x = c->getVariable(); - Debug("partial_model") << "setUpperBoundConstraint(" << x << ":" << c << ")" << endl; + Trace("partial_model") << "setUpperBoundConstraint(" << x << ":" << c << ")" << endl; Assert(inMaps(x)); Assert(lessThanUpperBound(x, c->getValue())); @@ -589,7 +589,7 @@ void ArithVariables::printModel(ArithVar x, std::ostream& out) const{ } void ArithVariables::printModel(ArithVar x) const{ - printModel(x, Debug("model")); + printModel(x, Trace("model")); } void ArithVariables::pushUpperBound(VarInfo& vi){ diff --git a/src/theory/arith/pp_rewrite_eq.cpp b/src/theory/arith/pp_rewrite_eq.cpp index 6391836e5..a78dd0e79 100644 --- a/src/theory/arith/pp_rewrite_eq.cpp +++ b/src/theory/arith/pp_rewrite_eq.cpp @@ -41,7 +41,7 @@ TrustNode PreprocessRewriteEq::ppRewriteEq(TNode atom) Node leq = NodeBuilder(kind::LEQ) << atom[0] << atom[1]; Node geq = NodeBuilder(kind::GEQ) << atom[0] << atom[1]; Node rewritten = rewrite(leq.andNode(geq)); - Debug("arith::preprocess") + Trace("arith::preprocess") << "arith::preprocess() : returning " << rewritten << std::endl; // don't need to rewrite terms since rewritten is not a non-standard op if (d_env.isTheoryProofProducing()) diff --git a/src/theory/arith/proof_checker.cpp b/src/theory/arith/proof_checker.cpp index 6e0494432..e9d62ed6f 100644 --- a/src/theory/arith/proof_checker.cpp +++ b/src/theory/arith/proof_checker.cpp @@ -49,18 +49,18 @@ Node ArithProofRuleChecker::checkInternal(PfRule id, const std::vector& args) { NodeManager* nm = NodeManager::currentNM(); - if (Debug.isOn("arith::pf::check")) + if (TraceIsOn("arith::pf::check")) { - Debug("arith::pf::check") << "Arith PfRule:" << id << std::endl; - Debug("arith::pf::check") << " children: " << std::endl; + Trace("arith::pf::check") << "Arith PfRule:" << id << std::endl; + Trace("arith::pf::check") << " children: " << std::endl; for (const auto& c : children) { - Debug("arith::pf::check") << " * " << c << std::endl; + Trace("arith::pf::check") << " * " << c << std::endl; } - Debug("arith::pf::check") << " args:" << std::endl; + Trace("arith::pf::check") << " args:" << std::endl; for (const auto& c : args) { - Debug("arith::pf::check") << " * " << c << std::endl; + Trace("arith::pf::check") << " * " << c << std::endl; } } switch (id) @@ -130,7 +130,7 @@ Node ArithProofRuleChecker::checkInternal(PfRule id, } default: { - Debug("arith::pf::check") + Trace("arith::pf::check") << "Bad kind: " << children[i].getKind() << std::endl; return Node::null(); } @@ -182,7 +182,7 @@ Node ArithProofRuleChecker::checkInternal(PfRule id, Rational scalar = args[i].getConst(); if (scalar == 0) { - Debug("arith::pf::check") << "Error: zero scalar" << std::endl; + Trace("arith::pf::check") << "Error: zero scalar" << std::endl; return Node::null(); } @@ -203,7 +203,7 @@ Node ArithProofRuleChecker::checkInternal(PfRule id, } default: { - Debug("arith::pf::check") + Trace("arith::pf::check") << "Bad kind: " << children[i].getKind() << std::endl; } } @@ -215,7 +215,7 @@ Node ArithProofRuleChecker::checkInternal(PfRule id, { if (scalar > 0) { - Debug("arith::pf::check") + Trace("arith::pf::check") << "Positive scalar for lower bound: " << scalar << " for " << children[i] << std::endl; return Node::null(); @@ -227,7 +227,7 @@ Node ArithProofRuleChecker::checkInternal(PfRule id, { if (scalar < 0) { - Debug("arith::pf::check") + Trace("arith::pf::check") << "Negative scalar for upper bound: " << scalar << " for " << children[i] << std::endl; return Node::null(); @@ -240,7 +240,7 @@ Node ArithProofRuleChecker::checkInternal(PfRule id, } default: { - Debug("arith::pf::check") + Trace("arith::pf::check") << "Bad kind: " << children[i].getKind() << std::endl; } } @@ -264,7 +264,7 @@ Node ArithProofRuleChecker::checkInternal(PfRule id, && children[0].getKind() != Kind::GEQ) || !children[0][0].getType().isInteger() || !children[0][1].isConst()) { - Debug("arith::pf::check") << "Illformed input: " << children; + Trace("arith::pf::check") << "Illformed input: " << children; return Node::null(); } else @@ -288,7 +288,7 @@ Node ArithProofRuleChecker::checkInternal(PfRule id, && children[0].getKind() != Kind::LEQ) || !children[0][0].getType().isInteger() || !children[0][1].isConst()) { - Debug("arith::pf::check") << "Illformed input: " << children; + Trace("arith::pf::check") << "Illformed input: " << children; return Node::null(); } else @@ -312,28 +312,28 @@ Node ArithProofRuleChecker::checkInternal(PfRule id, cmps.insert(c.getKind()); if (cmps.count(Kind::EQUAL) == 0) { - Debug("arith::pf::check") << "Error: No = " << std::endl; + Trace("arith::pf::check") << "Error: No = " << std::endl; return Node::null(); } if (cmps.count(Kind::GT) == 0) { - Debug("arith::pf::check") << "Error: No > " << std::endl; + Trace("arith::pf::check") << "Error: No > " << std::endl; return Node::null(); } if (cmps.count(Kind::LT) == 0) { - Debug("arith::pf::check") << "Error: No < " << std::endl; + Trace("arith::pf::check") << "Error: No < " << std::endl; return Node::null(); } return args[0]; } else { - Debug("arith::pf::check") + Trace("arith::pf::check") << "Error: Different polynomials / values" << std::endl; - Debug("arith::pf::check") << " a: " << a << std::endl; - Debug("arith::pf::check") << " b: " << b << std::endl; - Debug("arith::pf::check") << " c: " << c << std::endl; + Trace("arith::pf::check") << " a: " << a << std::endl; + Trace("arith::pf::check") << " b: " << b << std::endl; + Trace("arith::pf::check") << " c: " << c << std::endl; return Node::null(); } // Check that all have the same constant: diff --git a/src/theory/arith/rewriter/addition.cpp b/src/theory/arith/rewriter/addition.cpp index dca343e82..9e4cee966 100644 --- a/src/theory/arith/rewriter/addition.cpp +++ b/src/theory/arith/rewriter/addition.cpp @@ -207,7 +207,7 @@ Node collectSum(const Sum& sum) Node distributeMultiplication(const std::vector& factors) { - if (Trace.isOn("arith-rewriter-distribute")) + if (TraceIsOn("arith-rewriter-distribute")) { Trace("arith-rewriter-distribute") << "Distributing" << std::endl; for (const auto& f : factors) @@ -268,7 +268,7 @@ Node distributeMultiplication(const std::vector& factors) addToSum(newsum, mkNonlinearMult(newProduct), multiplicity); } } - if (Trace.isOn("arith-rewriter-distribute")) + if (TraceIsOn("arith-rewriter-distribute")) { Trace("arith-rewriter-distribute") << "multiplied with " << factor << std::endl; diff --git a/src/theory/arith/simplex.cpp b/src/theory/arith/simplex.cpp index d5a9b9c0a..e82a3de39 100644 --- a/src/theory/arith/simplex.cpp +++ b/src/theory/arith/simplex.cpp @@ -75,7 +75,7 @@ bool SimplexDecisionProcedure::standardProcessSignals(TimerStat &timer, IntStat& if(!d_conflictVariables.isMember(curr) && checkBasicForConflict(curr)){ - Debug("recentlyViolated") + Trace("recentlyViolated") << "It worked? " << conflicts.get() << " " << curr @@ -200,7 +200,7 @@ void SimplexDecisionProcedure::removeFromInfeasFunc(TimerStat& timer, ArithVar i } ArithVar SimplexDecisionProcedure::constructInfeasiblityFunction(TimerStat& timer, const ArithVarVec& set){ - Debug("constructInfeasiblityFunction") << "constructInfeasiblityFunction start" << endl; + Trace("constructInfeasiblityFunction") << "constructInfeasiblityFunction start" << endl; TimerStat::CodeTimer codeTimer(timer); Assert(!d_errorSet.focusEmpty()); @@ -224,7 +224,7 @@ ArithVar SimplexDecisionProcedure::constructInfeasiblityFunction(TimerStat& time coeffs.push_back(violatedCoeff); variables.push_back(e); - Debug("constructInfeasiblityFunction") << violatedCoeff << " " << e << endl; + Trace("constructInfeasiblityFunction") << violatedCoeff << " " << e << endl; } d_tableau.addRow(inf, coeffs, variables); @@ -234,8 +234,8 @@ ArithVar SimplexDecisionProcedure::constructInfeasiblityFunction(TimerStat& time //d_linEq.trackVariable(inf); d_linEq.trackRowIndex(d_tableau.basicToRowIndex(inf)); - Debug("constructInfeasiblityFunction") << inf << " " << newAssignment << endl; - Debug("constructInfeasiblityFunction") << "constructInfeasiblityFunction done" << endl; + Trace("constructInfeasiblityFunction") << inf << " " << newAssignment << endl; + Trace("constructInfeasiblityFunction") << "constructInfeasiblityFunction done" << endl; return inf; } diff --git a/src/theory/arith/soi_simplex.cpp b/src/theory/arith/soi_simplex.cpp index e8afb6413..2f3c2ac83 100644 --- a/src/theory/arith/soi_simplex.cpp +++ b/src/theory/arith/soi_simplex.cpp @@ -80,7 +80,7 @@ Result::Sat SumOfInfeasibilitiesSPD::findModel(bool exactResult){ d_pivots = 0; if(d_errorSet.errorEmpty() && !d_errorSet.moreSignals()){ - Debug("soi::findModel") << "soiFindModel() trivial" << endl; + Trace("soi::findModel") << "soiFindModel() trivial" << endl; Assert(d_conflictVariables.empty()); return Result::SAT; } @@ -93,17 +93,17 @@ Result::Sat SumOfInfeasibilitiesSPD::findModel(bool exactResult){ if(initialProcessSignals()){ d_conflictVariables.purge(); - Debug("soi::findModel") << "fcFindModel() early conflict" << endl; + Trace("soi::findModel") << "fcFindModel() early conflict" << endl; Assert(d_conflictVariables.empty()); return Result::UNSAT; }else if(d_errorSet.errorEmpty()){ - Debug("soi::findModel") << "fcFindModel() fixed itself" << endl; + Trace("soi::findModel") << "fcFindModel() fixed itself" << endl; Assert(!d_errorSet.moreSignals()); Assert(d_conflictVariables.empty()); return Result::SAT; } - Debug("soi::findModel") << "fcFindModel() start non-trivial" << endl; + Trace("soi::findModel") << "fcFindModel() start non-trivial" << endl; exactResult |= d_varOrderPivotLimit < 0; @@ -138,7 +138,7 @@ Result::Sat SumOfInfeasibilitiesSPD::findModel(bool exactResult){ // ensure that the conflict variable is still in the queue. d_conflictVariables.purge(); - Debug("soi::findModel") << "end findModel() " << result << endl; + Trace("soi::findModel") << "end findModel() " << result << endl; Assert(d_conflictVariables.empty()); return result; @@ -166,7 +166,7 @@ void SumOfInfeasibilitiesSPD::logPivot(WitnessImprovement w){ d_leavingCountSinceImprovement.purge(); } - Debug("logPivot") << "logPivot " << d_prevWitnessImprovement << " " << d_witnessImprovementInARow << endl; + Trace("logPivot") << "logPivot " << d_prevWitnessImprovement << " " << d_witnessImprovementInARow << endl; } uint32_t SumOfInfeasibilitiesSPD::degeneratePivotsInARow() const { @@ -198,7 +198,7 @@ void SumOfInfeasibilitiesSPD::adjustFocusAndError(const UpdateInfo& up, const AV UpdateInfo SumOfInfeasibilitiesSPD::selectUpdate(LinearEqualityModule::UpdatePreferenceFunction upf, LinearEqualityModule::VarPreferenceFunction bpf) { UpdateInfo selected; - Debug("soi::selectPrimalUpdate") + Trace("soi::selectPrimalUpdate") << "selectPrimalUpdate " << endl << d_soiVar << " " << d_tableau.basicRowLength(d_soiVar) << " " << d_linEq.debugBasicAtBoundCount(d_soiVar) << endl; @@ -216,7 +216,7 @@ UpdateInfo SumOfInfeasibilitiesSPD::selectUpdate(LinearEqualityModule::UpdatePre (sgn > 0 && d_variables.cmpAssignmentUpperBound(curr) < 0) || (sgn < 0 && d_variables.cmpAssignmentLowerBound(curr) > 0); - Debug("soi::selectPrimalUpdate") + Trace("soi::selectPrimalUpdate") << "storing " << d_soiVar << " " << curr << " " << candidate @@ -251,7 +251,7 @@ UpdateInfo SumOfInfeasibilitiesSPD::selectUpdate(LinearEqualityModule::UpdatePre LinearEqualityModule::UpdatePreferenceFunction leavingPrefFunc = selectLeavingFunction(curr); UpdateInfo currProposal = d_linEq.speculativeUpdate(curr, coeff, leavingPrefFunc); - Debug("soi::selectPrimalUpdate") + Trace("soi::selectPrimalUpdate") << "selected " << selected << endl << "currProp " << currProposal << endl << "coeff " << coeff << endl; @@ -265,7 +265,7 @@ UpdateInfo SumOfInfeasibilitiesSPD::selectUpdate(LinearEqualityModule::UpdatePre if(selected.uninitialized() || (d_linEq.*upf)(selected, currProposal)){ selected = currProposal; WitnessImprovement w = selected.getWitness(false); - Debug("soi::selectPrimalUpdate") << "selected " << w << endl; + Trace("soi::selectPrimalUpdate") << "selected " << w << endl; //setPenalty(curr, w); if(improvement(w)){ bool exitEarly; @@ -281,7 +281,7 @@ UpdateInfo SumOfInfeasibilitiesSPD::selectUpdate(LinearEqualityModule::UpdatePre if(exitEarly){ break; } } }else{ - Debug("soi::selectPrimalUpdate") << "dropped "<< endl; + Trace("soi::selectPrimalUpdate") << "dropped "<< endl; } } @@ -306,20 +306,20 @@ bool debugCheckWitness(const UpdateInfo& inf, WitnessImprovement w, bool useBlan void SumOfInfeasibilitiesSPD::debugPrintSignal(ArithVar updated) const{ - Debug("updateAndSignal") << "updated basic " << updated; - Debug("updateAndSignal") << " length " << d_tableau.basicRowLength(updated); - Debug("updateAndSignal") << " consistent " << d_variables.assignmentIsConsistent(updated); + Trace("updateAndSignal") << "updated basic " << updated; + Trace("updateAndSignal") << " length " << d_tableau.basicRowLength(updated); + Trace("updateAndSignal") << " consistent " << d_variables.assignmentIsConsistent(updated); int dir = !d_variables.assignmentIsConsistent(updated) ? d_errorSet.getSgn(updated) : 0; - Debug("updateAndSignal") << " dir " << dir; - Debug("updateAndSignal") << " debugBasicAtBoundCount " << d_linEq.debugBasicAtBoundCount(updated) << endl; + Trace("updateAndSignal") << " dir " << dir; + Trace("updateAndSignal") << " debugBasicAtBoundCount " << d_linEq.debugBasicAtBoundCount(updated) << endl; } void SumOfInfeasibilitiesSPD::updateAndSignal(const UpdateInfo& selected, WitnessImprovement w){ ArithVar nonbasic = selected.nonbasic(); - Debug("updateAndSignal") << "updateAndSignal " << selected << endl; + Trace("updateAndSignal") << "updateAndSignal " << selected << endl; if(selected.describesPivot()){ ConstraintP limiting = selected.limiting(); @@ -346,7 +346,7 @@ void SumOfInfeasibilitiesSPD::updateAndSignal(const UpdateInfo& selected, Witnes if(d_tableau.isBasic(updated)){ Assert(!d_variables.assignmentIsConsistent(updated) == d_errorSet.inError(updated)); - if(Debug.isOn("updateAndSignal")){debugPrintSignal(updated);} + if(TraceIsOn("updateAndSignal")){debugPrintSignal(updated);} if(!d_variables.assignmentIsConsistent(updated)){ if(checkBasicForConflict(updated)){ reportConflict(updated); @@ -354,7 +354,7 @@ void SumOfInfeasibilitiesSPD::updateAndSignal(const UpdateInfo& selected, Witnes } } }else{ - Debug("updateAndSignal") << "updated nonbasic " << updated << endl; + Trace("updateAndSignal") << "updated nonbasic " << updated << endl; } int currFocusSgn = d_errorSet.focusSgn(updated); if(currFocusSgn != prevFocusSgn){ @@ -363,7 +363,7 @@ void SumOfInfeasibilitiesSPD::updateAndSignal(const UpdateInfo& selected, Witnes } } - if(Debug.isOn("error")){ d_errorSet.debugPrint(Debug("error")); } + if(TraceIsOn("error")){ d_errorSet.debugPrint(Trace("error")); } //Assert(debugSelectedErrorDropped(selected, d_errorSize, d_errorSet.errorSize())); @@ -570,7 +570,7 @@ unsigned SumOfInfeasibilitiesSPD::trySet(const ArithVarVec& set){ } std::vector< ArithVarVec > SumOfInfeasibilitiesSPD::greedyConflictSubsets(){ - Debug("arith::greedyConflictSubsets") << "greedyConflictSubsets start" << endl; + Trace("arith::greedyConflictSubsets") << "greedyConflictSubsets start" << endl; std::vector< ArithVarVec > subsets; Assert(d_soiVar == ARITHVAR_SENTINEL); @@ -593,10 +593,10 @@ std::vector< ArithVarVec > SumOfInfeasibilitiesSPD::greedyConflictSubsets(){ ArithVar e = *iter; addRowSgns(sgns, e, d_errorSet.getSgn(e)); - Debug("arith::greedyConflictSubsets") << "basic error var: " << e << endl; - if(Debug.isOn("arith::greedyConflictSubsets")){ + Trace("arith::greedyConflictSubsets") << "basic error var: " << e << endl; + if(TraceIsOn("arith::greedyConflictSubsets")){ d_tableau.debugPrintIsBasic(e); - d_tableau.printBasicRow(e, Debug("arith::greedyConflictSubsets")); + d_tableau.printBasicRow(e, Trace("arith::greedyConflictSubsets")); } } @@ -625,7 +625,7 @@ std::vector< ArithVarVec > SumOfInfeasibilitiesSPD::greedyConflictSubsets(){ tmp[0] = e; tmp[1] = b; if(trySet(tmp) == 2){ - Debug("arith::greedyConflictSubsets") << "found a pair " << b << " " << e << endl; + Trace("arith::greedyConflictSubsets") << "found a pair " << b << " " << e << endl; hasParticipated.softAdd(b); hasParticipated.softAdd(e); Assert(debugIsASet(tmp)); @@ -655,7 +655,7 @@ std::vector< ArithVarVec > SumOfInfeasibilitiesSPD::greedyConflictSubsets(){ underConstruction.push_back(v); d_soiVar = constructInfeasiblityFunction(d_statistics.d_soiConflictMinimization, v); - Debug("arith::greedyConflictSubsets") << "trying " << v << endl; + Trace("arith::greedyConflictSubsets") << "trying " << v << endl; const Tableau::Entry* spoiler = NULL; while( (spoiler = d_linEq.selectSlackEntry(d_soiVar, false)) != NULL){ @@ -663,16 +663,16 @@ std::vector< ArithVarVec > SumOfInfeasibilitiesSPD::greedyConflictSubsets(){ int oppositeSgn = -(spoiler->getCoefficient().sgn()); Assert(oppositeSgn != 0); - Debug("arith::greedyConflictSubsets") << "looking for " << nb << " " << oppositeSgn << endl; + Trace("arith::greedyConflictSubsets") << "looking for " << nb << " " << oppositeSgn << endl; ArithVar basicWithOp = find_basic_in_sgns(sgns, nb, oppositeSgn, hasParticipated, false); if(basicWithOp == ARITHVAR_SENTINEL){ - Debug("arith::greedyConflictSubsets") << "search did not work for " << nb << endl; + Trace("arith::greedyConflictSubsets") << "search did not work for " << nb << endl; // greedy construction has failed break; }else{ - Debug("arith::greedyConflictSubsets") << "found " << basicWithOp << endl; + Trace("arith::greedyConflictSubsets") << "found " << basicWithOp << endl; addToInfeasFunc(d_statistics.d_soiConflictMinimization, d_soiVar, basicWithOp); hasParticipated.softAdd(basicWithOp); @@ -680,7 +680,7 @@ std::vector< ArithVarVec > SumOfInfeasibilitiesSPD::greedyConflictSubsets(){ } } if(spoiler == NULL){ - Debug("arith::greedyConflictSubsets") << "success" << endl; + Trace("arith::greedyConflictSubsets") << "success" << endl; //then underConstruction contains a conflicting subset Assert(debugIsASet(underConstruction)); subsets.push_back(underConstruction); @@ -691,7 +691,7 @@ std::vector< ArithVarVec > SumOfInfeasibilitiesSPD::greedyConflictSubsets(){ ++d_statistics.d_maybeNotMinimal; } }else{ - Debug("arith::greedyConflictSubsets") << "failure" << endl; + Trace("arith::greedyConflictSubsets") << "failure" << endl; } tearDownInfeasiblityFunction(d_statistics.d_soiConflictMinimization, d_soiVar); d_soiVar = ARITHVAR_SENTINEL; @@ -707,7 +707,7 @@ std::vector< ArithVarVec > SumOfInfeasibilitiesSPD::greedyConflictSubsets(){ } Assert(d_soiVar == ARITHVAR_SENTINEL); - Debug("arith::greedyConflictSubsets") << "greedyConflictSubsets done" << endl; + Trace("arith::greedyConflictSubsets") << "greedyConflictSubsets done" << endl; return subsets; } @@ -717,7 +717,7 @@ bool SumOfInfeasibilitiesSPD::generateSOIConflict(const ArithVarVec& subset){ Assert(!subset.empty()); Assert(!d_conflictBuilder->underConstruction()); - Debug("arith::generateSOIConflict") << "SumOfInfeasibilitiesSPD::generateSOIConflict(...) start" << endl; + Trace("arith::generateSOIConflict") << "SumOfInfeasibilitiesSPD::generateSOIConflict(...) start" << endl; bool success = false; @@ -728,7 +728,7 @@ bool SumOfInfeasibilitiesSPD::generateSOIConflict(const ArithVarVec& subset){ int sgn = d_errorSet.getSgn(e); const Rational& violatedCoeff = sgn > 0 ? d_negOne : d_posOne; - Debug("arith::generateSOIConflict") << "basic error var: " + Trace("arith::generateSOIConflict") << "basic error var: " << "(" << violatedCoeff << ")" << " " << violated << endl; @@ -760,7 +760,7 @@ bool SumOfInfeasibilitiesSPD::generateSOIConflict(const ArithVarVec& subset){ d_variables.getUpperBoundConstraint(v) : d_variables.getLowerBoundConstraint(v); - Debug("arith::generateSOIConflict") << "non-basic var: " + Trace("arith::generateSOIConflict") << "non-basic var: " << "(" << coeff << ")" << " " << c << endl; @@ -773,7 +773,7 @@ bool SumOfInfeasibilitiesSPD::generateSOIConflict(const ArithVarVec& subset){ tearDownInfeasiblityFunction(d_statistics.d_soiConflictMinimization, d_soiVar); d_soiVar = ARITHVAR_SENTINEL; - Debug("arith::generateSOIConflict") << "SumOfInfeasibilitiesSPD::generateSOIConflict(...) done" << endl; + Trace("arith::generateSOIConflict") << "SumOfInfeasibilitiesSPD::generateSOIConflict(...) done" << endl; Assert(d_soiVar == ARITHVAR_SENTINEL); Assert(!d_conflictBuilder->underConstruction()); return success; @@ -781,12 +781,12 @@ bool SumOfInfeasibilitiesSPD::generateSOIConflict(const ArithVarVec& subset){ WitnessImprovement SumOfInfeasibilitiesSPD::SOIConflict(){ - Debug("arith::SOIConflict") << "SumOfInfeasibilitiesSPD::SOIConflict() start " + Trace("arith::SOIConflict") << "SumOfInfeasibilitiesSPD::SOIConflict() start " << ": |E| = " << d_errorSize << endl; - if(Debug.isOn("arith::SOIConflict")){ + if(TraceIsOn("arith::SOIConflict")){ d_errorSet.debugPrint(cout); } - Debug("arith::SOIConflict") << endl; + Trace("arith::SOIConflict") << endl; tearDownInfeasiblityFunction(d_statistics.d_soiConflictMinimization, d_soiVar); d_soiVar = ARITHVAR_SENTINEL; @@ -820,7 +820,7 @@ WitnessImprovement SumOfInfeasibilitiesSPD::SOIConflict(){ //reportConflict(conf); do not do this. We need a custom explanations! d_conflictVariables.add(d_soiVar); - Debug("arith::SOIConflict") + Trace("arith::SOIConflict") << "SumOfInfeasibilitiesSPD::SOIConflict() end" << endl; return ConflictFound; } @@ -844,7 +844,7 @@ WitnessImprovement SumOfInfeasibilitiesSPD::soiRound() { UpdateInfo selected = selectUpdate(upf, bpf); if(selected.uninitialized()){ - Debug("selectFocusImproving") << "SOI is optimum, but we don't have sat/conflict yet" << endl; + Trace("selectFocusImproving") << "SOI is optimum, but we don't have sat/conflict yet" << endl; return SOIConflict(); }else{ Assert(!selected.uninitialized()); @@ -872,7 +872,7 @@ Result::Sat SumOfInfeasibilitiesSPD::sumOfInfeasibilities(){ while(d_pivotBudget != 0 && d_errorSize > 0 && d_conflictVariables.empty()){ - Debug("dualLike") << "dualLike" << endl; + Trace("dualLike") << "dualLike" << endl; Assert(d_errorSet.noSignals()); // Possible outcomes: @@ -880,7 +880,7 @@ Result::Sat SumOfInfeasibilitiesSPD::sumOfInfeasibilities(){ // - budget was exhausted // - focus went down WitnessImprovement w = soiRound(); - Debug("dualLike") << "selectFocusImproving -> " << w << endl; + Trace("dualLike") << "selectFocusImproving -> " << w << endl; Assert(d_errorSize == d_errorSet.errorSize()); } diff --git a/src/theory/arith/tableau.cpp b/src/theory/arith/tableau.cpp index 6f3ddd5eb..250c966d4 100644 --- a/src/theory/arith/tableau.cpp +++ b/src/theory/arith/tableau.cpp @@ -30,7 +30,7 @@ void Tableau::pivot(ArithVar oldBasic, ArithVar newBasic, CoefficientChangeCallb Assert(!isBasic(newBasic)); Assert(d_mergeBuffer.empty()); - Debug("tableau") << "Tableau::pivot(" << oldBasic <<", " << newBasic <<")" << endl; + Trace("tableau") << "Tableau::pivot(" << oldBasic <<", " << newBasic <<")" << endl; RowIndex ridx = basicToRowIndex(oldBasic); @@ -116,7 +116,7 @@ void Tableau::addRow(ArithVar basic, d_rowIndex2basic.set(newRow, basic); - if(Debug.isOn("matrix")){ printMatrix(); } + if(TraceIsOn("matrix")){ printMatrix(); } NoEffectCCCB noeffect; NoEffectCCCB* nep = &noeffect; @@ -139,7 +139,7 @@ void Tableau::addRow(ArithVar basic, } } - if(Debug.isOn("matrix")) { printMatrix(); } + if(TraceIsOn("matrix")) { printMatrix(); } Assert(debugNoZeroCoefficients(newRow)); Assert(debugMatchingCountsForRow(newRow)); diff --git a/src/theory/arith/tableau.h b/src/theory/arith/tableau.h index f9c690545..52920850a 100644 --- a/src/theory/arith/tableau.h +++ b/src/theory/arith/tableau.h @@ -65,9 +65,9 @@ public: void debugPrintIsBasic(ArithVar v) const { if(isBasic(v)){ - Debug("model") << v << " is basic." << std::endl; + Trace("model") << v << " is basic." << std::endl; }else{ - Debug("model") << v << " is non-basic." << std::endl; + Trace("model") << v << " is non-basic." << std::endl; } } diff --git a/src/theory/arith/theory_arith.cpp b/src/theory/arith/theory_arith.cpp index 624a7d7cd..5337a725b 100644 --- a/src/theory/arith/theory_arith.cpp +++ b/src/theory/arith/theory_arith.cpp @@ -127,7 +127,7 @@ void TheoryArith::notifySharedTerm(TNode n) { d_internal->notifySharedTerm(n); } TrustNode TheoryArith::ppRewrite(TNode atom, std::vector& lems) { CodeTimer timer(d_ppRewriteTimer, /* allow_reentrant = */ true); - Debug("arith::preprocess") << "arith::preprocess() : " << atom << endl; + Trace("arith::preprocess") << "arith::preprocess() : " << atom << endl; if (atom.getKind() == kind::EQUAL) { @@ -280,7 +280,7 @@ bool TheoryArith::collectModelInfo(TheoryModel* m, bool TheoryArith::collectModelValues(TheoryModel* m, const std::set& termSet) { - if (Trace.isOn("arith::model")) + if (TraceIsOn("arith::model")) { Trace("arith::model") << "arithmetic model after pruning" << std::endl; for (const auto& p : d_arithModelCache) @@ -334,7 +334,7 @@ void TheoryArith::presolve(){ } EqualityStatus TheoryArith::getEqualityStatus(TNode a, TNode b) { - Debug("arith") << "TheoryArith::getEqualityStatus(" << a << ", " << b << ")" << std::endl; + Trace("arith") << "TheoryArith::getEqualityStatus(" << a << ", " << b << ")" << std::endl; if (a == b) { return EQUALITY_TRUE_IN_MODEL; diff --git a/src/theory/arith/theory_arith_private.cpp b/src/theory/arith/theory_arith_private.cpp index ff2c7a145..13d169040 100644 --- a/src/theory/arith/theory_arith_private.cpp +++ b/src/theory/arith/theory_arith_private.cpp @@ -386,12 +386,12 @@ void TheoryArithPrivate::raiseConflict(ConstraintCP a, InferenceId id){ void TheoryArithPrivate::raiseBlackBoxConflict(Node bb, std::shared_ptr pf) { - Debug("arith::bb") << "raiseBlackBoxConflict: " << bb << std::endl; + Trace("arith::bb") << "raiseBlackBoxConflict: " << bb << std::endl; if (d_blackBoxConflict.get().isNull()) { if (isProofEnabled()) { - Debug("arith::bb") << " with proof " << pf << std::endl; + Trace("arith::bb") << " with proof " << pf << std::endl; d_blackBoxConflictPf.set(pf); } d_blackBoxConflict = bb; @@ -467,7 +467,7 @@ bool TheoryArithPrivate::AssertLower(ConstraintP constraint){ ArithVar x_i = constraint->getVariable(); const DeltaRational& c_i = constraint->getValue(); - Debug("arith") << "AssertLower(" << x_i << " " << c_i << ")"<< std::endl; + Trace("arith") << "AssertLower(" << x_i << " " << c_i << ")"<< std::endl; Assert(!isInteger(x_i) || c_i.isIntegral()); @@ -489,7 +489,7 @@ bool TheoryArithPrivate::AssertLower(ConstraintP constraint){ }else if(cmpToUB == 0){ if(isInteger(x_i)){ d_constantIntegerVariables.push_back(x_i); - Debug("dio::push") << "dio::push " << x_i << endl; + Trace("dio::push") << "dio::push " << x_i << endl; } ConstraintP ub = d_partialModel.getUpperBoundConstraint(x_i); @@ -509,7 +509,7 @@ bool TheoryArithPrivate::AssertLower(ConstraintP constraint){ ConstraintP diseq = vc.getDisequality(); // x <= b, x >= b |= x = b // (x > b or x < b or x = b) - Debug("arith::eq") << "lb == ub, propagate eq" << eq << endl; + Trace("arith::eq") << "lb == ub, propagate eq" << eq << endl; bool triConflict = diseq->isTrue(); if(!eq->isTrue()){ @@ -569,8 +569,8 @@ bool TheoryArithPrivate::AssertLower(ConstraintP constraint){ d_updatedBounds.softAdd(x_i); - if(Debug.isOn("model")) { - Debug("model") << "before" << endl; + if(TraceIsOn("model")) { + Trace("model") << "before" << endl; d_partialModel.printModel(x_i); d_tableau.debugPrintIsBasic(x_i); } @@ -583,8 +583,8 @@ bool TheoryArithPrivate::AssertLower(ConstraintP constraint){ d_errorSet.signalVariable(x_i); } - if(Debug.isOn("model")) { - Debug("model") << "after" << endl; + if(TraceIsOn("model")) { + Trace("model") << "after" << endl; d_partialModel.printModel(x_i); d_tableau.debugPrintIsBasic(x_i); } @@ -602,14 +602,14 @@ bool TheoryArithPrivate::AssertUpper(ConstraintP constraint){ ArithVar x_i = constraint->getVariable(); const DeltaRational& c_i = constraint->getValue(); - Debug("arith") << "AssertUpper(" << x_i << " " << c_i << ")"<< std::endl; + Trace("arith") << "AssertUpper(" << x_i << " " << c_i << ")"<< std::endl; //Too strong because of rounding with integers //Assert(!constraint->hasLiteral() || original == constraint->getLiteral()); Assert(!isInteger(x_i) || c_i.isIntegral()); - Debug("arith") << "AssertUpper(" << x_i << " " << c_i << ")"<< std::endl; + Trace("arith") << "AssertUpper(" << x_i << " " << c_i << ")"<< std::endl; if(d_partialModel.greaterThanUpperBound(x_i, c_i) ){ // \upperbound(x_i) <= c_i return false; //sat @@ -629,7 +629,7 @@ bool TheoryArithPrivate::AssertUpper(ConstraintP constraint){ }else if(cmpToLB == 0){ // \lowerBound(x_i) == \upperbound(x_i) if(isInteger(x_i)){ d_constantIntegerVariables.push_back(x_i); - Debug("dio::push") << "dio::push " << x_i << endl; + Trace("dio::push") << "dio::push " << x_i << endl; } const ValueCollection& vc = constraint->getValueCollection(); @@ -649,7 +649,7 @@ bool TheoryArithPrivate::AssertUpper(ConstraintP constraint){ ConstraintP diseq = vc.getDisequality(); // x <= b, x >= b |= x = b // (x > b or x < b or x = b) - Debug("arith::eq") << "lb == ub, propagate eq" << eq << endl; + Trace("arith::eq") << "lb == ub, propagate eq" << eq << endl; bool triConflict = diseq->isTrue(); if(!eq->isTrue()){ eq->impliedByTrichotomy(constraint, lb, triConflict); @@ -709,8 +709,8 @@ bool TheoryArithPrivate::AssertUpper(ConstraintP constraint){ d_updatedBounds.softAdd(x_i); - if(Debug.isOn("model")) { - Debug("model") << "before" << endl; + if(TraceIsOn("model")) { + Trace("model") << "before" << endl; d_partialModel.printModel(x_i); d_tableau.debugPrintIsBasic(x_i); } @@ -723,8 +723,8 @@ bool TheoryArithPrivate::AssertUpper(ConstraintP constraint){ d_errorSet.signalVariable(x_i); } - if(Debug.isOn("model")) { - Debug("model") << "after" << endl; + if(TraceIsOn("model")) { + Trace("model") << "after" << endl; d_partialModel.printModel(x_i); d_tableau.debugPrintIsBasic(x_i); } @@ -743,7 +743,7 @@ bool TheoryArithPrivate::AssertEquality(ConstraintP constraint){ ArithVar x_i = constraint->getVariable(); const DeltaRational& c_i = constraint->getValue(); - Debug("arith") << "AssertEquality(" << x_i << " " << c_i << ")"<< std::endl; + Trace("arith") << "AssertEquality(" << x_i << " " << c_i << ")"<< std::endl; //Should be fine in integers Assert(!isInteger(x_i) || c_i.isIntegral()); @@ -773,7 +773,7 @@ bool TheoryArithPrivate::AssertEquality(ConstraintP constraint){ if(isInteger(x_i)){ d_constantIntegerVariables.push_back(x_i); - Debug("dio::push") << "dio::push " << x_i << endl; + Trace("dio::push") << "dio::push " << x_i << endl; } // Don't bother to check whether x_i != c_i is in d_diseq @@ -801,8 +801,8 @@ bool TheoryArithPrivate::AssertEquality(ConstraintP constraint){ d_updatedBounds.softAdd(x_i); - if(Debug.isOn("model")) { - Debug("model") << "before" << endl; + if(TraceIsOn("model")) { + Trace("model") << "before" << endl; d_partialModel.printModel(x_i); d_tableau.debugPrintIsBasic(x_i); } @@ -815,8 +815,8 @@ bool TheoryArithPrivate::AssertEquality(ConstraintP constraint){ d_errorSet.signalVariable(x_i); } - if(Debug.isOn("model")) { - Debug("model") << "after" << endl; + if(TraceIsOn("model")) { + Trace("model") << "after" << endl; d_partialModel.printModel(x_i); d_tableau.debugPrintIsBasic(x_i); } @@ -834,7 +834,7 @@ bool TheoryArithPrivate::AssertDisequality(ConstraintP constraint){ ArithVar x_i = constraint->getVariable(); const DeltaRational& c_i = constraint->getValue(); - Debug("arith") << "AssertDisequality(" << x_i << " " << c_i << ")"<< std::endl; + Trace("arith") << "AssertDisequality(" << x_i << " " << c_i << ")"<< std::endl; //Should be fine in integers Assert(!isInteger(x_i) || c_i.isIntegral()); @@ -866,7 +866,7 @@ bool TheoryArithPrivate::AssertDisequality(ConstraintP constraint){ if(lb->isTrue()){ const ConstraintP ub = d_constraintDatabase.ensureConstraint(const_cast(vc), UpperBound); Assert(!ub->isTrue()); - Debug("arith::eq") << "propagate UpperBound " << constraint << lb << ub << endl; + Trace("arith::eq") << "propagate UpperBound " << constraint << lb << ub << endl; const ConstraintP negUb = ub->getNegation(); if(!negUb->isTrue()){ negUb->impliedByTrichotomy(constraint, lb, false); @@ -881,7 +881,7 @@ bool TheoryArithPrivate::AssertDisequality(ConstraintP constraint){ const ConstraintP lb = d_constraintDatabase.ensureConstraint(const_cast(vc), LowerBound); Assert(!lb->isTrue()); - Debug("arith::eq") << "propagate LowerBound " << constraint << lb << ub << endl; + Trace("arith::eq") << "propagate LowerBound " << constraint << lb << ub << endl; const ConstraintP negLb = lb->getNegation(); if(!negLb->isTrue()){ negLb->impliedByTrichotomy(constraint, ub, false); @@ -894,26 +894,26 @@ bool TheoryArithPrivate::AssertDisequality(ConstraintP constraint){ bool split = constraint->isSplit(); if(!split && c_i == d_partialModel.getAssignment(x_i)){ - Debug("arith::eq") << "lemma now! " << constraint << endl; + Trace("arith::eq") << "lemma now! " << constraint << endl; outputTrustedLemma(constraint->split(), InferenceId::ARITH_SPLIT_DEQ); return false; }else if(d_partialModel.strictlyLessThanLowerBound(x_i, c_i)){ - Debug("arith::eq") << "can drop as less than lb" << constraint << endl; + Trace("arith::eq") << "can drop as less than lb" << constraint << endl; }else if(d_partialModel.strictlyGreaterThanUpperBound(x_i, c_i)){ - Debug("arith::eq") << "can drop as less than ub" << constraint << endl; + Trace("arith::eq") << "can drop as less than ub" << constraint << endl; }else if(!split){ - Debug("arith::eq") << "push back" << constraint << endl; + Trace("arith::eq") << "push back" << constraint << endl; d_diseqQueue.push(constraint); d_partialModel.invalidateDelta(); }else{ - Debug("arith::eq") << "skipping already split " << constraint << endl; + Trace("arith::eq") << "skipping already split " << constraint << endl; } return false; } void TheoryArithPrivate::notifySharedTerm(TNode n) { - Debug("arith::notifySharedTerm") << "notifySharedTerm: " << n << endl; + Trace("arith::notifySharedTerm") << "notifySharedTerm: " << n << endl; if(n.isConst()){ d_partialModel.invalidateDelta(); } @@ -948,7 +948,7 @@ Theory::PPAssertStatus TheoryArithPrivate::ppAssert( { TimerStat::CodeTimer codeTimer(d_statistics.d_simplifyTimer); TNode in = tin.getNode(); - Debug("simplify") << "TheoryArithPrivate::solve(" << in << ")" << endl; + Trace("simplify") << "TheoryArithPrivate::solve(" << in << ")" << endl; // Solve equalities @@ -985,17 +985,17 @@ Theory::PPAssertStatus TheoryArithPrivate::ppAssert( if (right.size() > options().arith.ppAssertMaxSubSize) { - Debug("simplify") + Trace("simplify") << "TheoryArithPrivate::solve(): did not substitute due to the " "right hand side containing too many terms: " << minVar << ":" << elim << endl; - Debug("simplify") << right.size() << endl; + Trace("simplify") << right.size() << endl; } else if (d_containing.isLegalElimination(minVar, elim)) { // cannot eliminate integers here unless we know the resulting // substitution is integral - Debug("simplify") << "TheoryArithPrivate::solve(): substitution " + Trace("simplify") << "TheoryArithPrivate::solve(): substitution " << minVar << " |-> " << elim << endl; outSubstitutions.addSubstitutionSolved(minVar, elim, tin); @@ -1003,7 +1003,7 @@ Theory::PPAssertStatus TheoryArithPrivate::ppAssert( } else { - Debug("simplify") << "TheoryArithPrivate::solve(): can't substitute " + Trace("simplify") << "TheoryArithPrivate::solve(): can't substitute " << minVar << ":" << minVar.getType() << " |-> " << elim << ":" << elim.getType() << endl; } @@ -1207,7 +1207,7 @@ void TheoryArithPrivate::setupAtom(TNode atom) { } void TheoryArithPrivate::preRegisterTerm(TNode n) { - Debug("arith::preregister") <<"begin arith::preRegisterTerm("<< n <<")"<< endl; + Trace("arith::preregister") <<"begin arith::preRegisterTerm("<< n <<")"<< endl; d_preregisteredNodes.insert(n); @@ -1219,7 +1219,7 @@ void TheoryArithPrivate::preRegisterTerm(TNode n) { ConstraintP c = d_constraintDatabase.lookup(n); Assert(c != NullConstraint); - Debug("arith::preregister") << "setup constraint" << c << endl; + Trace("arith::preregister") << "setup constraint" << c << endl; Assert(!c->canBePropagated()); c->setPreregistered(); } @@ -1229,7 +1229,7 @@ void TheoryArithPrivate::preRegisterTerm(TNode n) { throw LogicException(ss.str()); } - Debug("arith::preregister") << "end arith::preRegisterTerm("<< n <<")" << endl; + Trace("arith::preregister") << "end arith::preRegisterTerm("<< n <<")" << endl; } void TheoryArithPrivate::releaseArithVar(ArithVar v){ @@ -1268,7 +1268,7 @@ ArithVar TheoryArithPrivate::requestArithVar(TNode x, bool aux, bool internal){ } d_constraintDatabase.addVariable(varX); - Debug("arith::arithvar") << "@" << context()->getLevel() << " " << x + Trace("arith::arithvar") << "@" << context()->getLevel() << " " << x << " |-> " << varX << "(relaiming " << reclaim << ")" << endl; @@ -1286,7 +1286,7 @@ void TheoryArithPrivate::asVectors(const Polynomial& p, std::vector& c Node n = variable.getNode(); - Debug("arith::asVectors") << "should be var: " << n << endl; + Trace("arith::asVectors") << "should be var: " << n << endl; // TODO: This VarList::isMember(n) can be stronger Assert(isLeaf(n) || VarList::isMember(n)); @@ -1314,19 +1314,19 @@ void TheoryArithPrivate::setupBasicValue(ArithVar x){ DeltaRational assignment = d_linEq.computeRowValue(x, false); d_partialModel.setAssignment(x,safeAssignment,assignment); - Debug("arith") << "setupVariable("<mkNode(OR, leq.getNode(), geq.getNode()); Node rewrittenLemma = rewrite(lemma); - Debug("arith::dio::ex") << "dioCutting found the plane: " << plane.getNode() << endl; - Debug("arith::dio::ex") << "resulting in the cut: " << lemma << endl; - Debug("arith::dio::ex") << "rewritten " << rewrittenLemma << endl; - Debug("arith::dio") << "dioCutting found the plane: " << plane.getNode() << endl; - Debug("arith::dio") << "resulting in the cut: " << lemma << endl; - Debug("arith::dio") << "rewritten " << rewrittenLemma << endl; + Trace("arith::dio::ex") << "dioCutting found the plane: " << plane.getNode() << endl; + Trace("arith::dio::ex") << "resulting in the cut: " << lemma << endl; + Trace("arith::dio::ex") << "rewritten " << rewrittenLemma << endl; + Trace("arith::dio") << "dioCutting found the plane: " << plane.getNode() << endl; + Trace("arith::dio") << "resulting in the cut: " << lemma << endl; + Trace("arith::dio") << "rewritten " << rewrittenLemma << endl; if (proofsEnabled()) { NodeManager* nm = NodeManager::currentNM(); @@ -1432,7 +1432,7 @@ Node TheoryArithPrivate::callDioSolver(){ ArithVar v = d_constantIntegerVariables.front(); d_constantIntegerVariables.pop(); - Debug("arith::dio") << "callDioSolver " << v << endl; + Trace("arith::dio") << "callDioSolver " << v << endl; Assert(isInteger(v)); Assert(d_partialModel.boundsAreEqual(v)); @@ -1461,7 +1461,7 @@ Node TheoryArithPrivate::callDioSolver(){ Assert(orig.getKind() != EQUAL); return orig; }else{ - Debug("dio::push") << "dio::push " << v << " " << eq.getNode() << " with reason " << orig << endl; + Trace("dio::push") << "dio::push " << v << " " << eq.getNode() << " with reason " << orig << endl; d_diosolver.pushInputConstraint(eq, orig); } } @@ -1479,9 +1479,9 @@ ConstraintP TheoryArithPrivate::constraintFromFactQueue(TNode assertion) Node eq = (simpleKind == DISTINCT) ? assertion[0] : assertion; Assert(!isSetup(eq)); Node reEq = rewrite(eq); - Debug("arith::distinct::const") << "Assertion: " << assertion << std::endl; - Debug("arith::distinct::const") << "Eq : " << eq << std::endl; - Debug("arith::distinct::const") << "reEq : " << reEq << std::endl; + Trace("arith::distinct::const") << "Assertion: " << assertion << std::endl; + Trace("arith::distinct::const") << "Eq : " << eq << std::endl; + Trace("arith::distinct::const") << "reEq : " << reEq << std::endl; if(reEq.getKind() == CONST_BOOLEAN){ if(reEq.getConst() == isDistinct){ // if is (not true), or false @@ -1512,7 +1512,7 @@ ConstraintP TheoryArithPrivate::constraintFromFactQueue(TNode assertion) constraint = d_constraintDatabase.lookup(reAssertion); if(assertion != reAssertion){ - Debug("arith::nf") << "getting non-nf assertion " << assertion << " |-> " << reAssertion << endl; + Trace("arith::nf") << "getting non-nf assertion " << assertion << " |-> " << reAssertion << endl; Assert(constraint != NullConstraint); d_assertionsThatDoNotMatchTheirLiterals.insert(assertion, constraint); } @@ -1529,32 +1529,32 @@ ConstraintP TheoryArithPrivate::constraintFromFactQueue(TNode assertion) constraint->setAssertedToTheTheory(assertion, inConflict); if(!constraint->hasProof()){ - Debug("arith::constraint") << "marking as constraint as self explaining " << endl; + Trace("arith::constraint") << "marking as constraint as self explaining " << endl; constraint->setAssumption(inConflict); } else { - Debug("arith::constraint") + Trace("arith::constraint") << "already has proof: " << Constraint::externalExplainByAssertions({constraint}); } - if(Debug.isOn("arith::negatedassumption") && inConflict){ + if(TraceIsOn("arith::negatedassumption") && inConflict){ ConstraintP negation = constraint->getNegation(); - if(Debug.isOn("arith::negatedassumption") && negation->isAssumption()){ + if(TraceIsOn("arith::negatedassumption") && negation->isAssumption()){ debugPrintFacts(); } - Debug("arith::eq") << "negation has proof" << endl; - Debug("arith::eq") << constraint << endl; - Debug("arith::eq") << negation << endl; + Trace("arith::eq") << "negation has proof" << endl; + Trace("arith::eq") << constraint << endl; + Trace("arith::eq") << negation << endl; } if(inConflict){ ConstraintP negation = constraint->getNegation(); - if(Debug.isOn("arith::negatedassumption") && negation->isAssumption()){ + if(TraceIsOn("arith::negatedassumption") && negation->isAssumption()){ debugPrintFacts(); } - Debug("arith::eq") << "negation has proof" << endl; - Debug("arith::eq") << constraint << endl; - Debug("arith::eq") << negation << endl; + Trace("arith::eq") << "negation has proof" << endl; + Trace("arith::eq") << constraint << endl; + Trace("arith::eq") << negation << endl; raiseConflict(negation, InferenceId::ARITH_CONF_FACT_QUEUE); return NullConstraint; }else{ @@ -1574,9 +1574,9 @@ bool TheoryArithPrivate::assertionCases(ConstraintP constraint){ ConstraintP floorConstraint = constraint->getFloor(); if(!floorConstraint->isTrue()){ bool inConflict = floorConstraint->negationHasProof(); - if (Debug.isOn("arith::intbound")) { - Debug("arith::intbound") << "literal, before: " << constraint->getLiteral() << std::endl; - Debug("arith::intbound") << "constraint, after: " << floorConstraint << std::endl; + if (TraceIsOn("arith::intbound")) { + Trace("arith::intbound") << "literal, before: " << constraint->getLiteral() << std::endl; + Trace("arith::intbound") << "constraint, after: " << floorConstraint << std::endl; } floorConstraint->impliedByIntTighten(constraint, inConflict); floorConstraint->tryToPropagate(); @@ -1594,9 +1594,9 @@ bool TheoryArithPrivate::assertionCases(ConstraintP constraint){ ConstraintP ceilingConstraint = constraint->getCeiling(); if(!ceilingConstraint->isTrue()){ bool inConflict = ceilingConstraint->negationHasProof(); - if (Debug.isOn("arith::intbound")) { - Debug("arith::intbound") << "literal, before: " << constraint->getLiteral() << std::endl; - Debug("arith::intbound") << "constraint, after: " << ceilingConstraint << std::endl; + if (TraceIsOn("arith::intbound")) { + Trace("arith::intbound") << "literal, before: " << constraint->getLiteral() << std::endl; + Trace("arith::intbound") << "constraint, after: " << ceilingConstraint << std::endl; } ceilingConstraint->impliedByIntTighten(constraint, inConflict); ceilingConstraint->tryToPropagate(); @@ -1662,10 +1662,10 @@ bool TheoryArithPrivate::hasIntegerModel() if (next != ARITHVAR_SENTINEL) { d_nextIntegerCheckVar = next; - if (Debug.isOn("arith::hasIntegerModel")) + if (TraceIsOn("arith::hasIntegerModel")) { - Debug("arith::hasIntegerModel") << "has int model? " << next << endl; - d_partialModel.printModel(next, Debug("arith::hasIntegerModel")); + Trace("arith::hasIntegerModel") << "has int model? " << next << endl; + d_partialModel.printModel(next, Trace("arith::hasIntegerModel")); } return false; } @@ -1710,7 +1710,7 @@ Node flattenAndSort(Node n){ /** Outputs conflicts to the output channel. */ void TheoryArithPrivate::outputConflicts(){ - Debug("arith::conflict") << "outputting conflicts" << std::endl; + Trace("arith::conflict") << "outputting conflicts" << std::endl; Assert(anyConflict()); if(!conflictQueueEmpty()){ @@ -1721,27 +1721,27 @@ void TheoryArithPrivate::outputConflicts(){ bool hasProof = confConstraint->hasProof(); Assert(confConstraint->inConflict()); const ConstraintRule& pf = confConstraint->getConstraintRule(); - if (Debug.isOn("arith::conflict")) + if (TraceIsOn("arith::conflict")) { pf.print(std::cout, options().smt.produceProofs); std::cout << std::endl; } - if (Debug.isOn("arith::pf::tree")) + if (TraceIsOn("arith::pf::tree")) { - Debug("arith::pf::tree") << "\n\nTree:\n"; - confConstraint->printProofTree(Debug("arith::pf::tree")); - confConstraint->getNegation()->printProofTree(Debug("arith::pf::tree")); + Trace("arith::pf::tree") << "\n\nTree:\n"; + confConstraint->printProofTree(Trace("arith::pf::tree")); + confConstraint->getNegation()->printProofTree(Trace("arith::pf::tree")); } TrustNode trustedConflict = confConstraint->externalExplainConflict(); Node conflict = trustedConflict.getNode(); - Debug("arith::conflict") + Trace("arith::conflict") << "d_conflicts[" << i << "] " << conflict << " has proof: " << hasProof << ", id = " << conf.second << endl; - if(Debug.isOn("arith::normalize::external")){ + if(TraceIsOn("arith::normalize::external")){ conflict = flattenAndSort(conflict); - Debug("arith::conflict") << "(normalized to) " << conflict << endl; + Trace("arith::conflict") << "(normalized to) " << conflict << endl; } if (isProofEnabled()) @@ -1756,11 +1756,11 @@ void TheoryArithPrivate::outputConflicts(){ } if(!d_blackBoxConflict.get().isNull()){ Node bb = d_blackBoxConflict.get(); - Debug("arith::conflict") << "black box conflict" << bb + Trace("arith::conflict") << "black box conflict" << bb << endl; - if(Debug.isOn("arith::normalize::external")){ + if(TraceIsOn("arith::normalize::external")){ bb = flattenAndSort(bb); - Debug("arith::conflict") << "(normalized to) " << bb << endl; + Trace("arith::conflict") << "(normalized to) " << bb << endl; } if (isProofEnabled() && d_blackBoxConflictPf.get()) { @@ -1776,40 +1776,40 @@ void TheoryArithPrivate::outputConflicts(){ bool TheoryArithPrivate::outputTrustedLemma(TrustNode lemma, InferenceId id) { - Debug("arith::channel") << "Arith trusted lemma: " << lemma << std::endl; + Trace("arith::channel") << "Arith trusted lemma: " << lemma << std::endl; return d_containing.d_im.trustedLemma(lemma, id); } bool TheoryArithPrivate::outputLemma(TNode lem, InferenceId id) { - Debug("arith::channel") << "Arith lemma: " << lem << std::endl; + Trace("arith::channel") << "Arith lemma: " << lem << std::endl; return d_containing.d_im.lemma(lem, id); } void TheoryArithPrivate::outputTrustedConflict(TrustNode conf, InferenceId id) { - Debug("arith::channel") << "Arith trusted conflict: " << conf << std::endl; + Trace("arith::channel") << "Arith trusted conflict: " << conf << std::endl; d_containing.d_im.trustedConflict(conf, id); } void TheoryArithPrivate::outputConflict(TNode lit, InferenceId id) { - Debug("arith::channel") << "Arith conflict: " << lit << std::endl; + Trace("arith::channel") << "Arith conflict: " << lit << std::endl; d_containing.d_im.conflict(lit, id); } void TheoryArithPrivate::outputPropagate(TNode lit) { - Debug("arith::channel") << "Arith propagation: " << lit << std::endl; + Trace("arith::channel") << "Arith propagation: " << lit << std::endl; // call the propagate lit method of the d_containing.d_im.propagateLit(lit); } void TheoryArithPrivate::outputRestart() { - Debug("arith::channel") << "Arith restart!" << std::endl; + Trace("arith::channel") << "Arith restart!" << std::endl; (d_containing.d_out)->demandRestart(); } bool TheoryArithPrivate::attemptSolveInteger(Theory::Effort effortLevel, bool emmmittedLemmaOrSplit){ int level = context()->getLevel(); - Debug("approx") + Trace("approx") << "attemptSolveInteger " << d_qflraStatus << " " << emmmittedLemmaOrSplit << " " << effortLevel @@ -1896,7 +1896,7 @@ bool TheoryArithPrivate::replayLog(ApproximateSimplex* approx){ vec.pop_back(); ConstraintP neg_at_j = at_j->getNegation(); - Debug("approx::replayLog") << "Setting the proof for the replayLog conflict on:" << endl + Trace("approx::replayLog") << "Setting the proof for the replayLog conflict on:" << endl << " (" << neg_at_j->isTrue() <<") " << neg_at_j << endl << " (" << at_j->isTrue() <<") " << at_j << endl; neg_at_j->impliedByIntHole(vec, true); @@ -1929,7 +1929,7 @@ std::pair TheoryArithPrivate::replayGetConstraint(const D Node sum = toSumNode(d_partialModel, lhs); if(sum.isNull()){ return make_pair(NullConstraint, added); } - Debug("approx::constraint") << "replayGetConstraint " << sum + Trace("approx::constraint") << "replayGetConstraint " << sum << " " << k << " " << rhs << endl; @@ -1955,7 +1955,7 @@ std::pair TheoryArithPrivate::replayGetConstraint(const D ConstraintType t = Constraint::constraintTypeOfComparison(cmp); DeltaRational dr = cmp.normalizedDeltaRational(); - Debug("approx::constraint") << "rewriting " << rewritten << endl + Trace("approx::constraint") << "rewriting " << rewritten << endl << " |-> " << norm << " " << t << " " << dr << endl; Assert(!branch || d_partialModel.hasArithVar(norm)); @@ -1963,7 +1963,7 @@ std::pair TheoryArithPrivate::replayGetConstraint(const D if(d_partialModel.hasArithVar(norm)){ v = d_partialModel.asArithVar(norm); - Debug("approx::constraint") + Trace("approx::constraint") << "replayGetConstraint found " << norm << " |-> " << v << " @ " << context()->getLevel() << endl; Assert(!branch || d_partialModel.isIntegerInput(v)); @@ -1973,7 +1973,7 @@ std::pair TheoryArithPrivate::replayGetConstraint(const D added = v; - Debug("approx::constraint") + Trace("approx::constraint") << "replayGetConstraint adding " << norm << " |-> " << v << " @ " << context()->getLevel() << endl; @@ -2039,7 +2039,7 @@ std::pair TheoryArithPrivate::replayGetConstraint(const C } Node toSumNode(const ArithVariables& vars, const DenseMap& sum){ - Debug("arith::toSumNode") << "toSumNode() begin" << endl; + Trace("arith::toSumNode") << "toSumNode() begin" << endl; NodeManager* nm = NodeManager::currentNM(); DenseMap::const_iterator iter, end; iter = sum.begin(), end = sum.end(); @@ -2050,10 +2050,10 @@ Node toSumNode(const ArithVariables& vars, const DenseMap& sum){ Node xNode = vars.asNode(x); const Rational& q = sum[x]; Node mult = nm->mkNode(kind::MULT, mkRationalNode(q), xNode); - Debug("arith::toSumNode") << "toSumNode() " << x << " " << mult << endl; + Trace("arith::toSumNode") << "toSumNode() " << x << " " << mult << endl; children.push_back(mult); } - Debug("arith::toSumNode") << "toSumNode() end" << endl; + Trace("arith::toSumNode") << "toSumNode() end" << endl; if (children.empty()) { // NOTE: real type assumed here @@ -2098,7 +2098,7 @@ void TheoryArithPrivate::tryBranchCut(ApproximateSimplex* approx, int nid, Branc std::vector< ConstraintCPVec > conflicts; approx->tryCut(nid, bci); - Debug("approx::branch") << "tryBranchCut" << bci << endl; + Trace("approx::branch") << "tryBranchCut" << bci << endl; Assert(bci.reconstructed()); Assert(!bci.proven()); pair p = replayGetConstraint(bci); @@ -2149,26 +2149,26 @@ void TheoryArithPrivate::tryBranchCut(ApproximateSimplex* approx, int nid, Branc // Constraint::assertionFringe(back); } - if(Debug.isOn("approx::branch")){ + if(TraceIsOn("approx::branch")){ if(d_conflicts.empty()){ entireStateIsConsistent("branchfailure"); } } } - Debug("approx::branch") << "branch constraint " << bc << endl; + Trace("approx::branch") << "branch constraint " << bc << endl; for(size_t i = 0, N = conflicts.size(); i < N; ++i){ ConstraintCPVec& conf = conflicts[i]; // make sure to be working on the assertion fringe! if(!contains(conf, bcneg)){ - Debug("approx::branch") << "reraise " << conf << endl; + Trace("approx::branch") << "reraise " << conf << endl; ConstraintCP conflicting = vectorToIntHoleConflict(conf); raiseConflict(conflicting, InferenceId::ARITH_CONF_BRANCH_CUT); }else if(!bci.proven()){ drop(conf, bcneg); bci.setExplanation(conf); - Debug("approx::branch") << "dropped " << bci << endl; + Trace("approx::branch") << "dropped " << bci << endl; } } } @@ -2178,34 +2178,34 @@ void TheoryArithPrivate::replayAssert(ConstraintP c) { bool inConflict = c->negationHasProof(); if(!c->hasProof()){ c->setInternalAssumption(inConflict); - Debug("approx::replayAssert") << "replayAssert " << c << " set internal" << endl; + Trace("approx::replayAssert") << "replayAssert " << c << " set internal" << endl; }else{ - Debug("approx::replayAssert") << "replayAssert " << c << " has explanation" << endl; + Trace("approx::replayAssert") << "replayAssert " << c << " has explanation" << endl; } - Debug("approx::replayAssert") << "replayAssertion " << c << endl; + Trace("approx::replayAssert") << "replayAssertion " << c << endl; if(inConflict){ raiseConflict(c, InferenceId::ARITH_CONF_REPLAY_ASSERT); }else{ assertionCases(c); } }else{ - Debug("approx::replayAssert") + Trace("approx::replayAssert") << "replayAssert " << c << " already asserted" << endl; } } void TheoryArithPrivate::resolveOutPropagated(std::vector& confs, const std::set& propagated) const { - Debug("arith::resolveOutPropagated") + Trace("arith::resolveOutPropagated") << "starting resolveOutPropagated() " << confs.size() << endl; for(size_t i =0, N = confs.size(); i < N; ++i){ ConstraintCPVec& conf = confs[i]; size_t orig = conf.size(); Constraint::assertionFringe(conf); - Debug("arith::resolveOutPropagated") + Trace("arith::resolveOutPropagated") << " conf["< TheoryArithPrivate::replayLogRec(ApproximateSimplex* approx, int nid, ConstraintP bc, int depth){ ++(d_statistics.d_replayLogRecCount); - Debug("approx::replayLogRec") << "replayLogRec()" << std::endl; + Trace("approx::replayLogRec") << "replayLogRec()" << std::endl; size_t rpvars_size = d_replayVariables.size(); size_t rpcons_size = d_replayConstraints.size(); @@ -2315,8 +2315,8 @@ std::vector TheoryArithPrivate::replayLogRec(ApproximateSimplex tl.mapRowId(nl.getNodeId(), ci->getRowId(), p.second); } ConstraintP con = p.first; - if(Debug.isOn("approx::replayLogRec")){ - Debug("approx::replayLogRec") << "cut was remade " << con << " " << *ci << endl; + if(TraceIsOn("approx::replayLogRec")){ + Trace("approx::replayLogRec") << "cut was remade " << con << " " << *ci << endl; } if(ci->proven()){ @@ -2325,19 +2325,19 @@ std::vector TheoryArithPrivate::replayLogRec(ApproximateSimplex const ConstraintCPVec& exp = ci->getExplanation(); // success if(con->isTrue()){ - Debug("approx::replayLogRec") << "not asserted?" << endl; + Trace("approx::replayLogRec") << "not asserted?" << endl; }else if(!con->negationHasProof()){ con->impliedByIntHole(exp, false); replayAssert(con); - Debug("approx::replayLogRec") << "cut prop" << endl; + Trace("approx::replayLogRec") << "cut prop" << endl; }else { con->impliedByIntHole(exp, true); - Debug("approx::replayLogRec") << "cut into conflict " << con << endl; + Trace("approx::replayLogRec") << "cut into conflict " << con << endl; raiseConflict(con, InferenceId::ARITH_CONF_REPLAY_LOG_REC); } }else{ ++d_statistics.d_cutsProofFailed; - Debug("approx::replayLogRec") << "failed to get proof " << *ci << endl; + Trace("approx::replayLogRec") << "failed to get proof " << *ci << endl; } }else if(ci->getKlass() != RowsDeletedKlass){ ++d_statistics.d_cutsReconstructionFailed; @@ -2406,7 +2406,7 @@ std::vector TheoryArithPrivate::replayLogRec(ApproximateSimplex } } }else{ - Debug("approx::replayLogRec") << "replayLogRec() skipping" << dnlog << std::endl; + Trace("approx::replayLogRec") << "replayLogRec() skipping" << dnlog << std::endl; ++d_statistics.d_replayBranchSkips; } @@ -2422,7 +2422,7 @@ std::vector TheoryArithPrivate::replayLogRec(ApproximateSimplex } } }else{ - Debug("approx::replayLogRec") << "replayLogRec() skipping" << uplog << std::endl; + Trace("approx::replayLogRec") << "replayLogRec() skipping" << uplog << std::endl; ++d_statistics.d_replayBranchSkips; } @@ -2445,23 +2445,23 @@ std::vector TheoryArithPrivate::replayLogRec(ApproximateSimplex } } }else{ - Debug("approx::replayLogRec") << "replayLogRec() skipping resolving" << nl << std::endl; + Trace("approx::replayLogRec") << "replayLogRec() skipping resolving" << nl << std::endl; } - Debug("approx::replayLogRec") << "found #"< TheoryArithPrivate::replayLogRec(ApproximateSimplex d_tableau.removeBasicRow(v); releaseArithVar(v); - Debug("approx::vars") << "releasing " << v << endl; + Trace("approx::vars") << "releasing " << v << endl; } d_linEq.stopTrackingBoundCounts(); d_partialModel.startQueueingBoundCounts(); @@ -2622,7 +2622,7 @@ bool TheoryArithPrivate::replayLemmas(ApproximateSimplex* approx){ // DO NOT CALL OUTPUT LEMMA! // TODO (project #37): justify d_approxCuts.push_back(TrustNode::mkTrustLemma(implication, nullptr)); - Debug("approx::lemmas") << "cut["<solveMIP(false); } - Debug("arith::solveInteger") << "mipRes " << mipRes << endl; + Trace("arith::solveInteger") << "mipRes " << mipRes << endl; switch(mipRes) { case MipBingo: // attempt the solution @@ -2855,16 +2855,16 @@ SimplexDecisionProcedure& TheoryArithPrivate::selectSimplex(bool pass1){ } void TheoryArithPrivate::importSolution(const ApproximateSimplex::Solution& solution){ - if(Debug.isOn("arith::importSolution")){ - Debug("arith::importSolution") << "importSolution before " << d_qflraStatus << endl; - d_partialModel.printEntireModel(Debug("arith::importSolution")); + if(TraceIsOn("arith::importSolution")){ + Trace("arith::importSolution") << "importSolution before " << d_qflraStatus << endl; + d_partialModel.printEntireModel(Trace("arith::importSolution")); } d_qflraStatus = d_attemptSolSimplex.attempt(solution); - if(Debug.isOn("arith::importSolution")){ - Debug("arith::importSolution") << "importSolution intermediate " << d_qflraStatus << endl; - d_partialModel.printEntireModel(Debug("arith::importSolution")); + if(TraceIsOn("arith::importSolution")){ + Trace("arith::importSolution") << "importSolution intermediate " << d_qflraStatus << endl; + d_partialModel.printEntireModel(Trace("arith::importSolution")); } if(d_qflraStatus != Result::UNSAT){ @@ -2874,9 +2874,9 @@ void TheoryArithPrivate::importSolution(const ApproximateSimplex::Solution& solu d_qflraStatus = simplex.findModel(false); } - if(Debug.isOn("arith::importSolution")){ - Debug("arith::importSolution") << "importSolution after " << d_qflraStatus << endl; - d_partialModel.printEntireModel(Debug("arith::importSolution")); + if(TraceIsOn("arith::importSolution")){ + Trace("arith::importSolution") << "importSolution after " << d_qflraStatus << endl; + d_partialModel.printEntireModel(Trace("arith::importSolution")); } } @@ -2926,7 +2926,7 @@ bool TheoryArithPrivate::solveRealRelaxation(Theory::Effort effortLevel){ bool useApprox = options().arith.useApprox && ApproximateSimplex::enabled() && getSolveIntegerResource(); - Debug("TheoryArithPrivate::solveRealRelaxation") + Trace("TheoryArithPrivate::solveRealRelaxation") << "solveRealRelaxation() approx" << " " << options().arith.useApprox << " " << ApproximateSimplex::enabled() << " " << useApprox << " " @@ -2935,7 +2935,7 @@ bool TheoryArithPrivate::solveRealRelaxation(Theory::Effort effortLevel){ bool noPivotLimitPass1 = noPivotLimit && !useApprox; d_qflraStatus = simplex.findModel(noPivotLimitPass1); - Debug("TheoryArithPrivate::solveRealRelaxation") + Trace("TheoryArithPrivate::solveRealRelaxation") << "solveRealRelaxation()" << " pass1 " << d_qflraStatus << endl; if(d_qflraStatus == Result::SAT_UNKNOWN && useApprox && safeToCallApprox()){ @@ -2966,10 +2966,10 @@ bool TheoryArithPrivate::solveRealRelaxation(Theory::Effort effortLevel){ TimerStat::CodeTimer codeTimer1(d_statistics.d_lpTimer); relaxRes = approxSolver->solveRelaxation(); } - Debug("solveRealRelaxation") << "solve relaxation? " << endl; + Trace("solveRealRelaxation") << "solve relaxation? " << endl; switch(relaxRes){ case LinFeasible: - Debug("solveRealRelaxation") << "lin feasible? " << endl; + Trace("solveRealRelaxation") << "lin feasible? " << endl; ++d_statistics.d_relaxLinFeas; relaxSolution = approxSolver->extractRelaxation(); importSolution(relaxSolution); @@ -2980,7 +2980,7 @@ bool TheoryArithPrivate::solveRealRelaxation(Theory::Effort effortLevel){ case LinInfeasible: // todo attempt to recreate approximate conflict ++d_statistics.d_relaxLinInfeas; - Debug("solveRealRelaxation") << "lin infeasible " << endl; + Trace("solveRealRelaxation") << "lin infeasible " << endl; relaxSolution = approxSolver->extractRelaxation(); importSolution(relaxSolution); if(d_qflraStatus != Result::UNSAT){ @@ -2989,7 +2989,7 @@ bool TheoryArithPrivate::solveRealRelaxation(Theory::Effort effortLevel){ break; case LinExhausted: ++d_statistics.d_relaxLinExhausted; - Debug("solveRealRelaxation") << "exhuasted " << endl; + Trace("solveRealRelaxation") << "exhuasted " << endl; break; case LinUnknown: default: @@ -3050,7 +3050,7 @@ bool TheoryArithPrivate::hasFreshArithLiteral(Node n) const{ bool TheoryArithPrivate::preCheck(Theory::Effort level) { Assert(d_currentPropagationList.empty()); - if(Debug.isOn("arith::consistency")){ + if(TraceIsOn("arith::consistency")){ Assert(unenqueuedVariablesAreConsistent()); } @@ -3083,7 +3083,7 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) // we may attempt some constraints twice. this is okay! ConstraintP curr = d_learnedBounds.front(); d_learnedBounds.pop(); - Debug("arith::learned") << curr << endl; + Trace("arith::learned") << curr << endl; bool res CVC5_UNUSED = assertionCases(curr); Assert(!res || anyConflict()); @@ -3097,14 +3097,14 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) if (options().arith.revertArithModels && d_previousStatus == Result::SAT) { ++d_statistics.d_revertsOnConflicts; - Debug("arith::bt") << "clearing here " + Trace("arith::bt") << "clearing here " << " " << d_newFacts << " " << d_previousStatus << " " << d_qflraStatus << endl; revertOutOfConflict(); d_errorSet.clear(); }else{ ++d_statistics.d_commitsOnConflicts; - Debug("arith::bt") << "committing here " + Trace("arith::bt") << "committing here " << " " << d_newFacts << " " << d_previousStatus << " " << d_qflraStatus << endl; d_partialModel.commitAssignmentChanges(); @@ -3116,32 +3116,32 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) } - if(Debug.isOn("arith::print_assertions")) { - debugPrintAssertions(Debug("arith::print_assertions")); + if(TraceIsOn("arith::print_assertions")) { + debugPrintAssertions(Trace("arith::print_assertions")); } bool emmittedConflictOrSplit = false; Assert(d_conflicts.empty()); bool useSimplex = d_qflraStatus != Result::SAT; - Debug("arith::ems") << "ems: " << emmittedConflictOrSplit + Trace("arith::ems") << "ems: " << emmittedConflictOrSplit << "pre realRelax" << endl; if(useSimplex){ emmittedConflictOrSplit = solveRealRelaxation(effortLevel); } - Debug("arith::ems") << "ems: " << emmittedConflictOrSplit + Trace("arith::ems") << "ems: " << emmittedConflictOrSplit << "post realRelax" << endl; - Debug("arith::ems") << "ems: " << emmittedConflictOrSplit + Trace("arith::ems") << "ems: " << emmittedConflictOrSplit << "pre solveInteger" << endl; if(attemptSolveInteger(effortLevel, emmittedConflictOrSplit)){ solveInteger(effortLevel); if(anyConflict()){ ++d_statistics.d_commitsOnConflicts; - Debug("arith::bt") << "committing here " + Trace("arith::bt") << "committing here " << " " << d_newFacts << " " << d_previousStatus << " " << d_qflraStatus << endl; revertOutOfConflict(); @@ -3151,7 +3151,7 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) } } - Debug("arith::ems") << "ems: " << emmittedConflictOrSplit + Trace("arith::ems") << "ems: " << emmittedConflictOrSplit << "post solveInteger" << endl; switch(d_qflraStatus){ @@ -3161,12 +3161,12 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) ++d_statistics.d_nontrivialSatChecks; } - Debug("arith::bt") << "committing sap inConflit" + Trace("arith::bt") << "committing sap inConflit" << " " << d_newFacts << " " << d_previousStatus << " " << d_qflraStatus << endl; d_partialModel.commitAssignmentChanges(); d_unknownsInARow = 0; - if(Debug.isOn("arith::consistency")){ + if(TraceIsOn("arith::consistency")){ Assert(entireStateIsConsistent("sat comit")); } if (useSimplex && options().arith.collectPivots) @@ -3185,7 +3185,7 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) ++d_unknownsInARow; ++(d_statistics.d_unknownChecks); Assert(!Theory::fullEffort(effortLevel)); - Debug("arith::bt") << "committing unknown" + Trace("arith::bt") << "committing unknown" << " " << d_newFacts << " " << d_previousStatus << " " << d_qflraStatus << endl; d_partialModel.commitAssignmentChanges(); @@ -3208,18 +3208,18 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) ++d_statistics.d_commitsOnConflicts; - Debug("arith::bt") << "committing on conflict" + Trace("arith::bt") << "committing on conflict" << " " << d_newFacts << " " << d_previousStatus << " " << d_qflraStatus << endl; d_partialModel.commitAssignmentChanges(); revertOutOfConflict(); - if(Debug.isOn("arith::consistency::comitonconflict")){ + if(TraceIsOn("arith::consistency::comitonconflict")){ entireStateIsConsistent("commit on conflict"); } outputConflicts(); emmittedConflictOrSplit = true; - Debug("arith::conflict") << "simplex conflict" << endl; + Trace("arith::conflict") << "simplex conflict" << endl; if (useSimplex && options().arith.collectPivots) { @@ -3246,16 +3246,16 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) Resource::ArithPivotStep); } - Debug("arith::ems") << "ems: " << emmittedConflictOrSplit + Trace("arith::ems") << "ems: " << emmittedConflictOrSplit << "pre approx cuts" << endl; if(!d_approxCuts.empty()){ bool anyFresh = false; while(!d_approxCuts.empty()){ TrustNode lem = d_approxCuts.front(); d_approxCuts.pop(); - Debug("arith::approx::cuts") << "approximate cut:" << lem << endl; + Trace("arith::approx::cuts") << "approximate cut:" << lem << endl; anyFresh = anyFresh || hasFreshArithLiteral(lem.getNode()); - Debug("arith::lemma") << "approximate cut:" << lem << endl; + Trace("arith::lemma") << "approximate cut:" << lem << endl; outputTrustedLemma(lem, InferenceId::ARITH_APPROX_CUT); } if(anyFresh){ @@ -3263,7 +3263,7 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) } } - Debug("arith::ems") << "ems: " << emmittedConflictOrSplit + Trace("arith::ems") << "ems: " << emmittedConflictOrSplit << "post approx cuts" << endl; // This should be fine if sat or unknown @@ -3313,17 +3313,17 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) } if(anyConflict()){ - Debug("arith::unate") << "unate conflict" << endl; + Trace("arith::unate") << "unate conflict" << endl; revertOutOfConflict(); d_qflraStatus = Result::UNSAT; outputConflicts(); emmittedConflictOrSplit = true; //cout << "unate conflict " << endl; - Debug("arith::bt") << "committing on unate conflict" + Trace("arith::bt") << "committing on unate conflict" << " " << d_newFacts << " " << d_previousStatus << " " << d_qflraStatus << endl; - Debug("arith::conflict") << "unate arith conflict" << endl; + Trace("arith::conflict") << "unate arith conflict" << endl; } } else @@ -3333,7 +3333,7 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) } Assert(d_currentPropagationList.empty()); - Debug("arith::ems") << "ems: " << emmittedConflictOrSplit + Trace("arith::ems") << "ems: " << emmittedConflictOrSplit << "post unate" << endl; if(!emmittedConflictOrSplit && Theory::fullEffort(effortLevel)){ @@ -3342,11 +3342,11 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) if(!emmittedConflictOrSplit && Theory::fullEffort(effortLevel)){ emmittedConflictOrSplit = splitDisequalities(); } - Debug("arith::ems") << "ems: " << emmittedConflictOrSplit + Trace("arith::ems") << "ems: " << emmittedConflictOrSplit << "pos splitting" << endl; - Debug("arith") << "integer? " + Trace("arith") << "integer? " << " conf/split " << emmittedConflictOrSplit << " fulleffort " << Theory::fullEffort(effortLevel) << endl; @@ -3357,7 +3357,7 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) possibleConflict = callDioSolver(); if(possibleConflict != Node::null()){ revertOutOfConflict(); - Debug("arith::conflict") << "dio conflict " << possibleConflict << endl; + Trace("arith::conflict") << "dio conflict " << possibleConflict << endl; // TODO (project #37): justify (proofs in the DIO solver) raiseBlackBoxConflict(possibleConflict); outputConflicts(); @@ -3373,7 +3373,7 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) if(!possibleLemma.isNull()){ d_hasDoneWorkSinceCut = false; d_cutCount = d_cutCount + 1; - Debug("arith::lemma") << "dio cut " << possibleLemma << endl; + Trace("arith::lemma") << "dio cut " << possibleLemma << endl; if (outputTrustedLemma(possibleLemma, InferenceId::ARITH_DIO_CUT)) { emmittedConflictOrSplit = true; @@ -3388,7 +3388,7 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) { ++(d_statistics.d_externalBranchAndBounds); d_cutCount = d_cutCount + 1; - Debug("arith::lemma") << "rrbranch lemma" + Trace("arith::lemma") << "rrbranch lemma" << possibleLemma << endl; if (outputTrustedLemma(possibleLemma, InferenceId::ARITH_BB_LEMMA)) { @@ -3402,28 +3402,28 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel) if(d_diosolver.hasMoreDecompositionLemmas()){ while(d_diosolver.hasMoreDecompositionLemmas()){ Node decompositionLemma = d_diosolver.nextDecompositionLemma(); - Debug("arith::lemma") << "dio decomposition lemma " + Trace("arith::lemma") << "dio decomposition lemma " << decompositionLemma << endl; outputLemma(decompositionLemma, InferenceId::ARITH_DIO_DECOMPOSITION); } }else{ - Debug("arith::restart") << "arith restart!" << endl; + Trace("arith::restart") << "arith restart!" << endl; outputRestart(); } } }//if !emmittedConflictOrSplit && fullEffort(effortLevel) && !hasIntegerModel() if(Theory::fullEffort(effortLevel)){ - if(Debug.isOn("arith::consistency::final")){ + if(TraceIsOn("arith::consistency::final")){ entireStateIsConsistent("arith::consistency::final"); } } - if(Debug.isOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); } - if(Debug.isOn("arith::print_model")) { - debugPrintModel(Debug("arith::print_model")); + if(TraceIsOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); } + if(TraceIsOn("arith::print_model")) { + debugPrintModel(Trace("arith::print_model")); } - Debug("arith") << "TheoryArithPrivate::check end" << std::endl; + Trace("arith") << "TheoryArithPrivate::check end" << std::endl; return emmittedConflictOrSplit; } @@ -3439,27 +3439,27 @@ TrustNode TheoryArithPrivate::branchIntegerVariable(ArithVar x) const Assert(!(r.getDenominator() == 1 && i.getNumerator() == 0)); TNode var = d_partialModel.asNode(x); TrustNode lem = d_bab.branchIntegerVariable(var, r); - if (Debug.isOn("integers")) + if (TraceIsOn("integers")) { Node l = lem.getNode(); if (isSatLiteral(l[0])) { - Debug("integers") << " " << l[0] << " == " << getSatValue(l[0]) + Trace("integers") << " " << l[0] << " == " << getSatValue(l[0]) << endl; } else { - Debug("integers") << " " << l[0] << " is not assigned a SAT literal" + Trace("integers") << " " << l[0] << " is not assigned a SAT literal" << endl; } if (isSatLiteral(l[1])) { - Debug("integers") << " " << l[1] << " == " << getSatValue(l[1]) + Trace("integers") << " " << l[1] << " == " << getSatValue(l[1]) << endl; } else { - Debug("integers") << " " << l[1] << " is not assigned a SAT literal" + Trace("integers") << " " << l[1] << " is not assigned a SAT literal" << endl; } } @@ -3511,31 +3511,31 @@ bool TheoryArithPrivate::splitDisequalities(){ d_diseqQueue.pop(); if(front->isSplit()){ - Debug("arith::eq") << "split already" << endl; + Trace("arith::eq") << "split already" << endl; }else{ - Debug("arith::eq") << "not split already" << endl; + Trace("arith::eq") << "not split already" << endl; ArithVar lhsVar = front->getVariable(); const DeltaRational& lhsValue = d_partialModel.getAssignment(lhsVar); const DeltaRational& rhsValue = front->getValue(); if(lhsValue == rhsValue){ - Debug("arith::lemma") << "Splitting on " << front << endl; - Debug("arith::lemma") << "LHS value = " << lhsValue << endl; - Debug("arith::lemma") << "RHS value = " << rhsValue << endl; + Trace("arith::lemma") << "Splitting on " << front << endl; + Trace("arith::lemma") << "LHS value = " << lhsValue << endl; + Trace("arith::lemma") << "RHS value = " << rhsValue << endl; TrustNode lemma = front->split(); ++(d_statistics.d_statDisequalitySplits); - Debug("arith::lemma") << "Now " << rewrite(lemma.getNode()) << endl; + Trace("arith::lemma") << "Now " << rewrite(lemma.getNode()) << endl; outputTrustedLemma(lemma, InferenceId::ARITH_SPLIT_DEQ); // cout << "Now " << rewrite(lemma) << endl; splitSomething = true; }else if(d_partialModel.strictlyLessThanLowerBound(lhsVar, rhsValue)){ - Debug("arith::eq") << "can drop as less than lb" << front << endl; + Trace("arith::eq") << "can drop as less than lb" << front << endl; }else if(d_partialModel.strictlyGreaterThanUpperBound(lhsVar, rhsValue)){ - Debug("arith::eq") << "can drop as greater than ub" << front << endl; + Trace("arith::eq") << "can drop as greater than ub" << front << endl; }else{ - Debug("arith::eq") << "save" << front << ": " <getLevel() << ": " << n + Trace("arith::explain") << "explain @" << context()->getLevel() << ": " << n << endl; ConstraintP c = d_constraintDatabase.lookup(n); @@ -3597,20 +3597,20 @@ TrustNode TheoryArithPrivate::explain(TNode n) if(c != NullConstraint){ Assert(!c->isAssumption()); exp = c->externalExplainForPropagation(n); - Debug("arith::explain") << "constraint explanation" << n << ":" << exp << endl; + Trace("arith::explain") << "constraint explanation" << n << ":" << exp << endl; }else if(d_assertionsThatDoNotMatchTheirLiterals.find(n) != d_assertionsThatDoNotMatchTheirLiterals.end()){ c = d_assertionsThatDoNotMatchTheirLiterals[n]; if(!c->isAssumption()){ exp = c->externalExplainForPropagation(n); - Debug("arith::explain") << "assertions explanation" << n << ":" << exp << endl; + Trace("arith::explain") << "assertions explanation" << n << ":" << exp << endl; }else{ - Debug("arith::explain") << "this is a strange mismatch" << n << endl; + Trace("arith::explain") << "this is a strange mismatch" << n << endl; Assert(d_congruenceManager.canExplain(n)); exp = d_congruenceManager.explain(n); } }else{ Assert(d_congruenceManager.canExplain(n)); - Debug("arith::explain") << "dm explanation" << n << endl; + Trace("arith::explain") << "dm explanation" << n << endl; exp = d_congruenceManager.explain(n); } return exp; @@ -3641,12 +3641,12 @@ void TheoryArithPrivate::propagate(Theory::Effort e) { while(d_constraintDatabase.hasMorePropagations()){ ConstraintCP c = d_constraintDatabase.nextPropagation(); - Debug("arith::prop") << "next prop" << context()->getLevel() << ": " << c + Trace("arith::prop") << "next prop" << context()->getLevel() << ": " << c << endl; if(c->negationHasProof()){ - Debug("arith::prop") << "negation has proof " << c->getNegation() << endl; - Debug("arith::prop") << c->getNegation()->externalExplainByAssertions() + Trace("arith::prop") << "negation has proof " << c->getNegation() << endl; + Trace("arith::prop") << c->getNegation()->externalExplainByAssertions() << endl; } Assert(!c->negationHasProof()) @@ -3655,12 +3655,12 @@ void TheoryArithPrivate::propagate(Theory::Effort e) { if(!c->assertedToTheTheory()){ Node literal = c->getLiteral(); - Debug("arith::prop") << "propagating @" << context()->getLevel() << " " + Trace("arith::prop") << "propagating @" << context()->getLevel() << " " << literal << endl; outputPropagate(literal); }else{ - Debug("arith::prop") << "already asserted to the theory " << c->getLiteral() << endl; + Trace("arith::prop") << "already asserted to the theory " << c->getLiteral() << endl; } } @@ -3674,7 +3674,7 @@ void TheoryArithPrivate::propagate(Theory::Effort e) { ConstraintP constraint = d_constraintDatabase.lookup(normalized); if(constraint == NullConstraint){ - Debug("arith::prop") << "propagating on non-constraint? " << toProp << endl; + Trace("arith::prop") << "propagating on non-constraint? " << toProp << endl; outputPropagate(toProp); }else if(constraint->negationHasProof()){ @@ -3685,7 +3685,7 @@ void TheoryArithPrivate::propagate(Theory::Effort e) { std::vector ants(exp.getNode().begin(), exp.getNode().end()); ants.push_back(notNormalized); Node lp = nm->mkAnd(ants); - Debug("arith::prop") << "propagate conflict" << lp << endl; + Trace("arith::prop") << "propagate conflict" << lp << endl; if (proofsEnabled()) { // Assume all of antecedents and ~toProp (rewritten) @@ -3729,7 +3729,7 @@ void TheoryArithPrivate::propagate(Theory::Effort e) { outputConflicts(); return; }else{ - Debug("arith::prop") << "propagating still?" << toProp << endl; + Trace("arith::prop") << "propagating still?" << toProp << endl; outputPropagate(toProp); } } @@ -3738,7 +3738,7 @@ void TheoryArithPrivate::propagate(Theory::Effort e) { DeltaRational TheoryArithPrivate::getDeltaValue(TNode term) const { AlwaysAssert(d_qflraStatus != Result::SAT_UNKNOWN); - Debug("arith::value") << term << std::endl; + Trace("arith::value") << term << std::endl; if (d_partialModel.hasArithVar(term)) { ArithVar var = d_partialModel.asArithVar(term); @@ -3869,11 +3869,11 @@ void TheoryArithPrivate::collectModelValues(const std::set& termSet, { AlwaysAssert(d_qflraStatus == Result::SAT); - if(Debug.isOn("arith::collectModelInfo")){ + if(TraceIsOn("arith::collectModelInfo")){ debugPrintFacts(); } - Debug("arith::collectModelInfo") << "collectModelInfo() begin " << endl; + Trace("arith::collectModelInfo") << "collectModelInfo() begin " << endl; // Delta lasts at least the duration of the function call const Rational& delta = d_partialModel.getDelta(); @@ -3896,11 +3896,11 @@ void TheoryArithPrivate::collectModelValues(const std::set& termSet, Rational qmodel = mod.substituteDelta(delta); Node qNode = nm->mkConstRealOrInt(term.getType(), qmodel); - Debug("arith::collectModelInfo") << "m->assertEquality(" << term << ", " << qmodel << ", true)" << endl; + Trace("arith::collectModelInfo") << "m->assertEquality(" << term << ", " << qmodel << ", true)" << endl; // Add to the map arithModel[term] = qNode; }else{ - Debug("arith::collectModelInfo") << "Skipping m->assertEquality(" << term << ", true)" << endl; + Trace("arith::collectModelInfo") << "Skipping m->assertEquality(" << term << ", true)" << endl; } } @@ -3910,7 +3910,7 @@ void TheoryArithPrivate::collectModelValues(const std::set& termSet, // const eq::EqualityEngine& ee = d_congruenceManager.getEqualityEngine(); // m->assertEqualityEngine(&ee); - Debug("arith::collectModelInfo") << "collectModelInfo() end " << endl; + Trace("arith::collectModelInfo") << "collectModelInfo() end " << endl; } bool TheoryArithPrivate::safeToReset() const { @@ -3932,7 +3932,7 @@ bool TheoryArithPrivate::safeToReset() const { void TheoryArithPrivate::notifyRestart(){ TimerStat::CodeTimer codeTimer(d_statistics.d_restartTimer); - if(Debug.isOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); } + if(TraceIsOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); } ++d_restartsCounter; d_solveIntMaybeHelp = 0; @@ -3979,7 +3979,7 @@ bool TheoryArithPrivate::unenqueuedVariablesAreConsistent(){ } warning() << std::endl; result = false; - } else if(Debug.isOn("arith::consistency::initial")){ + } else if(TraceIsOn("arith::consistency::initial")){ d_partialModel.printModel(var); warning() << "Initial var is not consistent for " << var << d_partialModel.asNode(var); if(d_tableau.isBasic(var)){ @@ -3997,10 +3997,10 @@ void TheoryArithPrivate::presolve(){ d_statistics.d_initialTableauSize = d_tableau.size(); - if(Debug.isOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); } + if(TraceIsOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); } - if(Debug.isOn("arith::presolve")) { - Debug("arith::presolve") << "TheoryArithPrivate::presolve" << endl; + if(TraceIsOn("arith::presolve")) { + Trace("arith::presolve") << "TheoryArithPrivate::presolve" << endl; } vector lemmas; @@ -4026,7 +4026,7 @@ void TheoryArithPrivate::presolve(){ vector::const_iterator i = lemmas.begin(), i_end = lemmas.end(); for(; i != i_end; ++i){ TrustNode lem = *i; - Debug("arith::oldprop") << " lemma lemma duck " <canBePropagated(); bool hasProof = bestImplied->hasProof(); - Debug("arith::prop") << "arith::prop" << basic + Trace("arith::prop") << "arith::prop" << basic << " " << assertedToTheTheory << " " << canBePropagated << " " << hasProof @@ -4109,24 +4109,24 @@ bool TheoryArithPrivate::propagateCandidateBound(ArithVar basic, bool upperBound d_linEq.propagateBasicFromRow(bestImplied, options().smt.produceProofs); // I think this can be skipped if canBePropagated is true //d_learnedBounds.push(bestImplied); - if(Debug.isOn("arith::prop")){ - Debug("arith::prop") << "success " << bestImplied << endl; - d_partialModel.printModel(basic, Debug("arith::prop")); + if(TraceIsOn("arith::prop")){ + Trace("arith::prop") << "success " << bestImplied << endl; + d_partialModel.printModel(basic, Trace("arith::prop")); } return true; } - if(Debug.isOn("arith::prop")){ - Debug("arith::prop") << "failed " << basic + if(TraceIsOn("arith::prop")){ + Trace("arith::prop") << "failed " << basic << " " << bound << " " << assertedToTheTheory << " " << canBePropagated << " " << hasProof << endl; - d_partialModel.printModel(basic, Debug("arith::prop")); + d_partialModel.printModel(basic, Trace("arith::prop")); } } - }else if(Debug.isOn("arith::prop")){ - Debug("arith::prop") << "false " << bound << " "; - d_partialModel.printModel(basic, Debug("arith::prop")); + }else if(TraceIsOn("arith::prop")){ + Trace("arith::prop") << "false " << bound << " "; + d_partialModel.printModel(basic, Trace("arith::prop")); } return false; } @@ -4157,7 +4157,7 @@ void TheoryArithPrivate::propagateCandidate(ArithVar basic){ void TheoryArithPrivate::propagateCandidates(){ TimerStat::CodeTimer codeTimer(d_statistics.d_boundComputationTime); - Debug("arith::prop") << "propagateCandidates begin" << endl; + Trace("arith::prop") << "propagateCandidates begin" << endl; Assert(d_candidateBasics.empty()); @@ -4198,7 +4198,7 @@ void TheoryArithPrivate::propagateCandidates(){ Assert(d_tableau.isBasic(candidate)); propagateCandidate(candidate); } - Debug("arith::prop") << "propagateCandidates end" << endl << endl << endl; + Trace("arith::prop") << "propagateCandidates end" << endl << endl << endl; } void TheoryArithPrivate::propagateCandidatesNew(){ @@ -4217,7 +4217,7 @@ void TheoryArithPrivate::propagateCandidatesNew(){ */ TimerStat::CodeTimer codeTimer(d_statistics.d_boundComputationTime); - Debug("arith::prop") << "propagateCandidatesNew begin" << endl; + Trace("arith::prop") << "propagateCandidatesNew begin" << endl; Assert(d_qflraStatus == Result::SAT); if(d_updatedBounds.empty()){ return; } @@ -4234,7 +4234,7 @@ void TheoryArithPrivate::propagateCandidatesNew(){ d_candidateRows.pop_back(); propagateCandidateRow(candidate); } - Debug("arith::prop") << "propagateCandidatesNew end" << endl << endl << endl; + Trace("arith::prop") << "propagateCandidatesNew end" << endl << endl << endl; } bool TheoryArithPrivate::propagateMightSucceed(ArithVar v, bool ub) const{ @@ -4265,7 +4265,7 @@ bool TheoryArithPrivate::propagateMightSucceed(ArithVar v, bool ub) const{ } bool TheoryArithPrivate::attemptSingleton(RowIndex ridx, bool rowUp){ - Debug("arith::prop") << " attemptSingleton" << ridx; + Trace("arith::prop") << " attemptSingleton" << ridx; const Tableau::Entry* ep; ep = d_linEq.rowLacksBound(ridx, rowUp, ARITHVAR_SENTINEL); @@ -4285,8 +4285,8 @@ bool TheoryArithPrivate::attemptSingleton(RowIndex ridx, bool rowUp){ // if c < 0, v \geq -D/c so !vUp bool vUp = (rowUp == ( coeff.sgn() < 0)); - Debug("arith::prop") << " " << rowUp << " " << v << " " << coeff << " " << vUp << endl; - Debug("arith::prop") << " " << propagateMightSucceed(v, vUp) << endl; + Trace("arith::prop") << " " << rowUp << " " << v << " " << coeff << " " << vUp << endl; + Trace("arith::prop") << " " << propagateMightSucceed(v, vUp) << endl; if(propagateMightSucceed(v, vUp)){ DeltaRational dr = d_linEq.computeRowBound(ridx, rowUp, v); @@ -4297,7 +4297,7 @@ bool TheoryArithPrivate::attemptSingleton(RowIndex ridx, bool rowUp){ } bool TheoryArithPrivate::attemptFull(RowIndex ridx, bool rowUp){ - Debug("arith::prop") << " attemptFull" << ridx << endl; + Trace("arith::prop") << " attemptFull" << ridx << endl; vector candidates; @@ -4402,7 +4402,7 @@ bool TheoryArithPrivate::rowImplicationCanBeApplied(RowIndex ridx, bool rowUp, C bool canBePropagated = implied->canBePropagated(); bool hasProof = implied->hasProof(); - Debug("arith::prop") << "arith::prop" << v + Trace("arith::prop") << "arith::prop" << v << " " << assertedToTheTheory << " " << canBePropagated << " " << hasProof @@ -4424,10 +4424,10 @@ bool TheoryArithPrivate::rowImplicationCanBeApplied(RowIndex ridx, bool rowUp, C d_linEq.propagateRow(explain, ridx, rowUp, implied, coeffs); if (d_tableau.getRowLength(ridx) <= options().arith.arithPropAsLemmaLength) { - if (Debug.isOn("arith::prop::pf")) { + if (TraceIsOn("arith::prop::pf")) { for (const auto & constraint : explain) { Assert(constraint->hasProof()); - constraint->printProofTree(Debug("arith::prop::pf")); + constraint->printProofTree(Trace("arith::prop::pf")); } } Node implication = implied->externalImplication(explain); @@ -4499,11 +4499,11 @@ bool TheoryArithPrivate::rowImplicationCanBeApplied(RowIndex ridx, bool rowUp, C return true; } - if(Debug.isOn("arith::prop")){ - Debug("arith::prop") + if(TraceIsOn("arith::prop")){ + Trace("arith::prop") << "failed " << v << " " << assertedToTheTheory << " " << canBePropagated << " " << hasProof << " " << implied << endl; - d_partialModel.printModel(v, Debug("arith::prop")); + d_partialModel.printModel(v, Trace("arith::prop")); } return false; } @@ -4514,7 +4514,7 @@ bool TheoryArithPrivate::propagateCandidateRow(RowIndex ridx){ bool success = false; - Debug("arith::prop") << "propagateCandidateRow attempt " << rowLength << " " + Trace("arith::prop") << "propagateCandidateRow attempt " << rowLength << " " << hasCount << endl; if (rowLength >= options().arith.arithPropagateMaxLength @@ -4569,7 +4569,7 @@ std::pair TheoryArithPrivate::entailmentCheck(TNode lit, const Arith // l k r // diff : (l - r) k 0 - Debug("arith::entailCheck") << "TheoryArithPrivate::entailmentCheck(" << lit << ")"<< endl; + Trace("arith::entailCheck") << "TheoryArithPrivate::entailmentCheck(" << lit << ")"<< endl; Kind k; int primDir; Rational lm, rm, dm; @@ -4608,7 +4608,7 @@ std::pair TheoryArithPrivate::entailmentCheck(TNode lit, const Arith for( alg = params.begin(), alg_end = params.end(); alg != alg_end; ++alg ){ const inferbounds::InferBoundAlgorithm& ibalg = *alg; - Debug("arith::entailCheck") << "entailmentCheck trying " << (inferbounds::Algorithms) ibalg.getAlgorithm() << endl; + Trace("arith::entailCheck") << "entailmentCheck trying " << (inferbounds::Algorithms) ibalg.getAlgorithm() << endl; switch(ibalg.getAlgorithm()){ case inferbounds::None: break; @@ -4676,7 +4676,7 @@ std::pair TheoryArithPrivate::entailmentCheck(TNode lit, const Arith if(!bestPrimDiff.first.isNull()){ DeltaRational d = (bestPrimDiff.second * dm); if((primDir > 0 && d <= sep) || (primDir < 0 && d >= sep) ){ - Debug("arith::entailCheck") << "entailmentCheck found " + Trace("arith::entailCheck") << "entailmentCheck found " << primDir << "*" << dm << "*(" << dp<<")" << " <= " << primDir << "*" << dm << "*" << bestPrimDiff.second << " <= " << primDir << "*" << sep << endl @@ -4882,7 +4882,7 @@ bool TheoryArithPrivate::decomposeLiteral(Node lit, Kind& k, int& dir, Rational& dir = 1; } - Debug("arith::decomp") << "arith::decomp " + Trace("arith::decomp") << "arith::decomp " << lit << "(" << normKind << "*" << dir << ")"<< endl << " left:" << lc << " + " << lm << "*(" << lp << ") : " <push_back(i); } } - if(Trace.isOn("arrays-ind")) { + if(TraceIsOn("arrays-ind")) { printList((*(info_map.find(a))).second->indices); } @@ -425,12 +425,12 @@ void ArrayInfo::mergeInfo(const TNode a, const TNode b){ if(ita != info_map.end()) { Trace("arrays-mergei")<<"Arrays::mergeInfo info "<print(); if(itb != info_map.end()) { Trace("arrays-mergei")<<"Arrays::mergeInfo info "<print(); CTNodeList* lista_i = (*ita).second->indices; diff --git a/src/theory/arrays/theory_arrays.cpp b/src/theory/arrays/theory_arrays.cpp index d7f36cde1..fc5535408 100644 --- a/src/theory/arrays/theory_arrays.cpp +++ b/src/theory/arrays/theory_arrays.cpp @@ -398,14 +398,14 @@ Theory::PPAssertStatus TheoryArrays::ppAssert( bool TheoryArrays::propagateLit(TNode literal) { - Debug("arrays") << spaces(context()->getLevel()) + Trace("arrays") << spaces(context()->getLevel()) << "TheoryArrays::propagateLit(" << literal << ")" << std::endl; // If already in conflict, no more propagation if (d_state.isInConflict()) { - Debug("arrays") << spaces(context()->getLevel()) + Trace("arrays") << spaces(context()->getLevel()) << "TheoryArrays::propagateLit(" << literal << "): already in conflict" << std::endl; return false; @@ -647,7 +647,7 @@ void TheoryArrays::preRegisterTermInternal(TNode node) { return; } - Debug("arrays") << spaces(context()->getLevel()) + Trace("arrays") << spaces(context()->getLevel()) << "TheoryArrays::preRegisterTerm(" << node << ")" << std::endl; Kind nk = node.getKind(); @@ -830,7 +830,7 @@ TrustNode TheoryArrays::explain(TNode literal) void TheoryArrays::notifySharedTerm(TNode t) { - Debug("arrays::sharing") << spaces(context()->getLevel()) + Trace("arrays::sharing") << spaces(context()->getLevel()) << "TheoryArrays::notifySharedTerm(" << t << ")" << std::endl; if (t.getType().isArray()) { @@ -846,7 +846,7 @@ void TheoryArrays::notifySharedTerm(TNode t) void TheoryArrays::checkPair(TNode r1, TNode r2) { - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): checking reads " << r1 << " and " << r2 << std::endl; + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): checking reads " << r1 << " and " << r2 << std::endl; TNode x = r1[1]; TNode y = r2[1]; @@ -856,14 +856,14 @@ void TheoryArrays::checkPair(TNode r1, TNode r2) && (d_equalityEngine->areEqual(x, y) || d_equalityEngine->areDisequal(x, y, false))) { - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): equality known, skipping" << std::endl; + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): equality known, skipping" << std::endl; return; } // If the terms are already known to be equal, we are also in good shape if (d_equalityEngine->areEqual(r1, r2)) { - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): equal, skipping" << std::endl; + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): equal, skipping" << std::endl; return; } @@ -874,7 +874,7 @@ void TheoryArrays::checkPair(TNode r1, TNode r2) if (r1[0].getType() != r2[0].getType() || d_equalityEngine->areDisequal(r1[0], r2[0], false)) { - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): arrays can't be equal, skipping" << std::endl; + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): arrays can't be equal, skipping" << std::endl; return; } else if (!d_mayEqualEqualityEngine.areEqual(r1[0], r2[0])) { @@ -884,7 +884,7 @@ void TheoryArrays::checkPair(TNode r1, TNode r2) if (!d_equalityEngine->isTriggerTerm(y, THEORY_ARRAYS)) { - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): not connected to shared terms, skipping" << std::endl; + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): not connected to shared terms, skipping" << std::endl; return; } @@ -901,10 +901,10 @@ void TheoryArrays::checkPair(TNode r1, TNode r2) break; case EQUALITY_TRUE: // Missed propagation - need to add the pair so that theory engine can force propagation - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): missed propagation" << std::endl; + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): missed propagation" << std::endl; break; case EQUALITY_FALSE_AND_PROPAGATED: - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): checkPair " + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): checkPair " "called when false in model" << std::endl; // Should have been propagated to us @@ -913,7 +913,7 @@ void TheoryArrays::checkPair(TNode r1, TNode r2) case EQUALITY_FALSE: CVC5_FALLTHROUGH; case EQUALITY_FALSE_IN_MODEL: // This is unlikely, but I think it could happen - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): checkPair called when false in model" << std::endl; + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): checkPair called when false in model" << std::endl; return; default: // Covers EQUALITY_TRUE_IN_MODEL (common case) and EQUALITY_UNKNOWN @@ -921,7 +921,7 @@ void TheoryArrays::checkPair(TNode r1, TNode r2) } // Add this pair - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): adding to care-graph" << std::endl; + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): adding to care-graph" << std::endl; addCarePair(x_shared, y_shared); } @@ -965,13 +965,13 @@ void TheoryArrays::computeCareGraph() for (unsigned i = 0; i < size; ++ i) { TNode r1 = d_reads[i]; - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): checking read " << r1 << std::endl; + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): checking read " << r1 << std::endl; Assert(d_equalityEngine->hasTerm(r1)); TNode x = r1[1]; if (!d_equalityEngine->isTriggerTerm(x, THEORY_ARRAYS)) { - Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): not connected to shared terms, skipping" << std::endl; + Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): not connected to shared terms, skipping" << std::endl; continue; } Node x_shared = @@ -1198,11 +1198,11 @@ Node TheoryArrays::getSkolem(TNode ref) skolem = (*it).second; } - Debug("pf::array") << "Pregistering a Skolem" << std::endl; + Trace("pf::array") << "Pregistering a Skolem" << std::endl; preRegisterTermInternal(skolem); - Debug("pf::array") << "Pregistering a Skolem DONE" << std::endl; + Trace("pf::array") << "Pregistering a Skolem DONE" << std::endl; - Debug("pf::array") << "getSkolem DONE" << std::endl; + Trace("pf::array") << "getSkolem DONE" << std::endl; return skolem; } @@ -1244,7 +1244,7 @@ void TheoryArrays::postCheck(Effort level) for (; i != readsEnd; ++i) { const TNode& r = *i; - Debug("arrays::weak") << "TheoryArrays::check(): checking read " << r << std::endl; + Trace("arrays::weak") << "TheoryArrays::check(): checking read " << r << std::endl; // Find the bucket for this read. mayRep = d_mayEqualEqualityEngine.getRepresentative(r[0]); @@ -1355,7 +1355,7 @@ void TheoryArrays::notifyFact(TNode atom, bool pol, TNode fact, bool isInternal) TNode k; // k is the skolem for this disequality. - Debug("pf::array") << "Check: kind::NOT: array theory making a skolem" + Trace("pf::array") << "Check: kind::NOT: array theory making a skolem" << std::endl; // If not in replay mode, generate a fresh skolem variable @@ -1370,7 +1370,7 @@ void TheoryArrays::notifyFact(TNode atom, bool pol, TNode fact, bool isInternal) && d_equalityEngine->hasTerm(bk)) { // Propagate witness disequality - might produce a conflict - Debug("pf::array") << "Asserting to the equality engine:" << std::endl + Trace("pf::array") << "Asserting to the equality engine:" << std::endl << "\teq = " << eq << std::endl << "\treason = " << fact << std::endl; d_im.assertInference(eq, false, InferenceId::ARRAYS_EXT, fact, PfRule::ARRAYS_EXT); @@ -1385,7 +1385,7 @@ void TheoryArrays::notifyFact(TNode atom, bool pol, TNode fact, bool isInternal) } else { - Debug("pf::array") << "Check: kind::NOT: array theory NOT making a skolem" + Trace("pf::array") << "Check: kind::NOT: array theory NOT making a skolem" << std::endl; d_modelConstraints.push_back(fact); } @@ -1623,7 +1623,7 @@ void TheoryArrays::checkStore(TNode a) Trace("arrays-cri")<<"Arrays::checkStore "<print(); } Assert(a.getType().isArray()); @@ -1657,7 +1657,7 @@ void TheoryArrays::checkRowForIndex(TNode i, TNode a) Trace("arrays-cri")<<"Arrays::checkRowForIndex "<print(); } Assert(a.getType().isArray()); @@ -1722,10 +1722,10 @@ void TheoryArrays::checkRowLemmas(TNode a, TNode b) if (options().arrays.arraysWeakEquivalence) return; Trace("arrays-crl")<<"Arrays::checkLemmas begin \n"<print(); Trace("arrays-crl")<<" ------------ and "<print(); const CTNodeList* i_a = d_infoMap.getIndices(a); @@ -1787,7 +1787,7 @@ void TheoryArrays::checkRowLemmas(TNode a, TNode b) void TheoryArrays::propagateRowLemma(RowLemmaType lem) { - Debug("pf::array") << "TheoryArrays: RowLemma Propagate called. " + Trace("pf::array") << "TheoryArrays: RowLemma Propagate called. " "arraysPropagate = " << options().arrays.arraysPropagate << std::endl; @@ -1850,7 +1850,7 @@ void TheoryArrays::propagateRowLemma(RowLemmaType lem) void TheoryArrays::queueRowLemma(RowLemmaType lem) { - Debug("pf::array") << "Array solver: queue row lemma called" << std::endl; + Trace("pf::array") << "Array solver: queue row lemma called" << std::endl; if (d_state.isInConflict() || d_RowAlreadyAdded.contains(lem)) { @@ -2115,7 +2115,7 @@ bool TheoryArrays::dischargeLemmas() } void TheoryArrays::conflict(TNode a, TNode b) { - Debug("pf::array") << "TheoryArrays::Conflict called" << std::endl; + Trace("pf::array") << "TheoryArrays::Conflict called" << std::endl; d_im.conflictEqConstantMerge(a, b); } diff --git a/src/theory/arrays/theory_arrays.h b/src/theory/arrays/theory_arrays.h index 636d7e8f5..11c838c2b 100644 --- a/src/theory/arrays/theory_arrays.h +++ b/src/theory/arrays/theory_arrays.h @@ -297,7 +297,7 @@ class TheoryArrays : public Theory { bool eqNotifyTriggerPredicate(TNode predicate, bool value) override { - Debug("arrays::propagate") + Trace("arrays::propagate") << spaces(d_arrays.context()->getLevel()) << "NotifyClass::eqNotifyTriggerPredicate(" << predicate << ", " << (value ? "true" : "false") << ")" << std::endl; @@ -313,7 +313,7 @@ class TheoryArrays : public Theory { TNode t2, bool value) override { - Debug("arrays::propagate") + Trace("arrays::propagate") << spaces(d_arrays.context()->getLevel()) << "NotifyClass::eqNotifyTriggerTermEquality(" << t1 << ", " << t2 << ", " << (value ? "true" : "false") << ")" << std::endl; @@ -326,7 +326,7 @@ class TheoryArrays : public Theory { void eqNotifyConstantTermMerge(TNode t1, TNode t2) override { - Debug("arrays::propagate") << spaces(d_arrays.context()->getLevel()) + Trace("arrays::propagate") << spaces(d_arrays.context()->getLevel()) << "NotifyClass::eqNotifyConstantTermMerge(" << t1 << ", " << t2 << ")" << std::endl; d_arrays.conflict(t1, t2); diff --git a/src/theory/arrays/theory_arrays_type_rules.cpp b/src/theory/arrays/theory_arrays_type_rules.cpp index 7ba98000a..331178d89 100644 --- a/src/theory/arrays/theory_arrays_type_rules.cpp +++ b/src/theory/arrays/theory_arrays_type_rules.cpp @@ -72,10 +72,10 @@ TypeNode ArrayStoreTypeRule::computeType(NodeManager* nodeManager, } if (!valueType.isSubtypeOf(arrayType.getArrayConstituentType())) { - Debug("array-types") + Trace("array-types") << "array type: " << arrayType.getArrayConstituentType() << std::endl; - Debug("array-types") << "value types: " << valueType << std::endl; + Trace("array-types") << "value types: " << valueType << std::endl; throw TypeCheckingExceptionPrivate( n, "array store not assigned with correct type for array"); } diff --git a/src/theory/atom_requests.cpp b/src/theory/atom_requests.cpp index 70af341ea..e0c7c9862 100644 --- a/src/theory/atom_requests.cpp +++ b/src/theory/atom_requests.cpp @@ -45,16 +45,16 @@ AtomRequests::atom_iterator AtomRequests::getAtomIterator(TNode trigger) const { void AtomRequests::add(TNode triggerAtom, TNode atomToSend, theory::TheoryId toTheory) { - Debug("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << ")" << std::endl; + Trace("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << ")" << std::endl; Request request(atomToSend, toTheory); if (d_allRequests.find(request) != d_allRequests.end()) { // Have it already - Debug("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << "): already there" << std::endl; + Trace("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << "): already there" << std::endl; return; } - Debug("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << "): adding" << std::endl; + Trace("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << "): adding" << std::endl; /// Mark the new request d_allRequests.insert(request); diff --git a/src/theory/bags/theory_bags.cpp b/src/theory/bags/theory_bags.cpp index 3db8637d9..b1e9b32b7 100644 --- a/src/theory/bags/theory_bags.cpp +++ b/src/theory/bags/theory_bags.cpp @@ -224,7 +224,7 @@ void TheoryBags::postCheck(Effort effort) // (2) unsuccessfully processed pending lemmas. // In either case, we repeat the strategy if we are not in conflict. sentLemma = d_im.hasSentLemma(); - if (Trace.isOn("bags-check")) + if (TraceIsOn("bags-check")) { Trace("bags-check") << " ...finish run strategy: "; Trace("bags-check") << (hadPending ? "hadPending " : ""); @@ -458,9 +458,9 @@ void TheoryBags::preRegisterTerm(TNode n) void TheoryBags::presolve() { - Debug("bags-presolve") << "Started presolve" << std::endl; + Trace("bags-presolve") << "Started presolve" << std::endl; d_strat.initializeStrategy(); - Debug("bags-presolve") << "Finished presolve" << std::endl; + Trace("bags-presolve") << "Finished presolve" << std::endl; } /**************************** eq::NotifyClass *****************************/ @@ -473,21 +473,21 @@ void TheoryBags::eqNotifyDisequal(TNode n1, TNode n2, TNode reason) {} void TheoryBags::NotifyClass::eqNotifyNewClass(TNode n) { - Debug("bags-eq") << "[bags-eq] eqNotifyNewClass:" + Trace("bags-eq") << "[bags-eq] eqNotifyNewClass:" << " n = " << n << std::endl; d_theory.eqNotifyNewClass(n); } void TheoryBags::NotifyClass::eqNotifyMerge(TNode n1, TNode n2) { - Debug("bags-eq") << "[bags-eq] eqNotifyMerge:" + Trace("bags-eq") << "[bags-eq] eqNotifyMerge:" << " n1 = " << n1 << " n2 = " << n2 << std::endl; d_theory.eqNotifyMerge(n1, n2); } void TheoryBags::NotifyClass::eqNotifyDisequal(TNode n1, TNode n2, TNode reason) { - Debug("bags-eq") << "[bags-eq] eqNotifyDisequal:" + Trace("bags-eq") << "[bags-eq] eqNotifyDisequal:" << " n1 = " << n1 << " n2 = " << n2 << " reason = " << reason << std::endl; d_theory.eqNotifyDisequal(n1, n2, reason); diff --git a/src/theory/booleans/circuit_propagator.cpp b/src/theory/booleans/circuit_propagator.cpp index e12f5b521..36614182e 100644 --- a/src/theory/booleans/circuit_propagator.cpp +++ b/src/theory/booleans/circuit_propagator.cpp @@ -186,7 +186,7 @@ void CircuitPropagator::makeConflict(Node n) void CircuitPropagator::computeBackEdges(TNode node) { - Debug("circuit-prop") << "CircuitPropagator::computeBackEdges(" << node << ")" + Trace("circuit-prop") << "CircuitPropagator::computeBackEdges(" << node << ")" << endl; // Vector of nodes to visit @@ -207,7 +207,7 @@ void CircuitPropagator::computeBackEdges(TNode node) { // Node we need to visit TNode current = toVisit[i]; - Debug("circuit-prop") + Trace("circuit-prop") << "CircuitPropagator::computeBackEdges(): processing " << current << endl; Assert(d_seen.find(current) != d_seen.end()); @@ -235,7 +235,7 @@ void CircuitPropagator::computeBackEdges(TNode node) void CircuitPropagator::propagateBackward(TNode parent, bool parentAssignment) { - Debug("circuit-prop") << "CircuitPropagator::propagateBackward(" << parent + Trace("circuit-prop") << "CircuitPropagator::propagateBackward(" << parent << ", " << parentAssignment << ")" << endl; ProofCircuitPropagatorBackward prover{d_pnm, parent, parentAssignment}; @@ -433,7 +433,7 @@ void CircuitPropagator::propagateBackward(TNode parent, bool parentAssignment) void CircuitPropagator::propagateForward(TNode child, bool childAssignment) { // The assignment we have - Debug("circuit-prop") << "CircuitPropagator::propagateForward(" << child + Trace("circuit-prop") << "CircuitPropagator::propagateForward(" << child << ", " << childAssignment << ")" << endl; // Get the back any nodes where this is child @@ -446,7 +446,7 @@ void CircuitPropagator::propagateForward(TNode child, bool childAssignment) { // The current parent of the child TNode parent = *parent_it; - Debug("circuit-prop") << "Parent: " << parent << endl; + Trace("circuit-prop") << "Parent: " << parent << endl; Assert(expr::hasSubterm(parent, child)); ProofCircuitPropagatorForward prover{d_pnm, child, childAssignment, parent}; @@ -695,7 +695,7 @@ void CircuitPropagator::propagateForward(TNode child, bool childAssignment) TrustNode CircuitPropagator::propagate() { - Debug("circuit-prop") << "CircuitPropagator::propagate()" << std::endl; + Trace("circuit-prop") << "CircuitPropagator::propagate()" << std::endl; for (unsigned i = 0; i < d_propagationQueue.size() && d_conflict.get().isNull(); @@ -703,10 +703,10 @@ TrustNode CircuitPropagator::propagate() { // The current node we are propagating TNode current = d_propagationQueue[i]; - Debug("circuit-prop") << "CircuitPropagator::propagate(): processing " + Trace("circuit-prop") << "CircuitPropagator::propagate(): processing " << current << std::endl; bool assignment = getAssignment(current); - Debug("circuit-prop") << "CircuitPropagator::propagate(): assigned to " + Trace("circuit-prop") << "CircuitPropagator::propagate(): assigned to " << (assignment ? "true" : "false") << std::endl; // Is this an atom @@ -719,7 +719,7 @@ TrustNode CircuitPropagator::propagate() || (current.getKind() == kind::EQUAL && (current[0].isVar() || current[1].isVar()))) { - Debug("circuit-prop") + Trace("circuit-prop") << "CircuitPropagator::propagate(): adding to learned: " << (assignment ? (Node)current : current.notNode()) << std::endl; Node lit = assignment ? Node(current) : current.notNode(); @@ -804,7 +804,7 @@ void CircuitPropagator::addProof(TNode f, std::shared_ptr pf) << "\t" << *pf << std::endl; d_epg->setProofFor(f, std::move(pf)); } - else if (Trace.isOn("circuit-prop")) + else if (TraceIsOn("circuit-prop")) { auto prf = d_epg->getProofFor(f); Trace("circuit-prop") << "Ignoring proof\n\t" << *pf diff --git a/src/theory/booleans/proof_circuit_propagator.cpp b/src/theory/booleans/proof_circuit_propagator.cpp index 60ded97b6..487f7928b 100644 --- a/src/theory/booleans/proof_circuit_propagator.cpp +++ b/src/theory/booleans/proof_circuit_propagator.cpp @@ -243,7 +243,7 @@ std::shared_ptr ProofCircuitPropagator::mkProof( const std::vector>& children, const std::vector& args) { - if (Trace.isOn("circuit-prop")) + if (TraceIsOn("circuit-prop")) { std::stringstream ss; ss << "Constructing (" << rule; diff --git a/src/theory/booleans/theory_bool_rewriter.cpp b/src/theory/booleans/theory_bool_rewriter.cpp index 0172c0845..61d473817 100644 --- a/src/theory/booleans/theory_bool_rewriter.cpp +++ b/src/theory/booleans/theory_bool_rewriter.cpp @@ -185,7 +185,7 @@ RewriteResponse TheoryBoolRewriter::preRewrite(TNode n) { } if (!done) { RewriteResponse ret = flattenNode(n, /* trivialNode = */ ff, /* skipNode = */ tt); - Debug("bool-flatten") << n << ": " << ret.d_node << std::endl; + Trace("bool-flatten") << n << ": " << ret.d_node << std::endl; return ret; } // x ^ ... ^ x --> x @@ -328,25 +328,25 @@ RewriteResponse TheoryBoolRewriter::preRewrite(TNode n) { if (n[0].isConst()) { if (n[0] == tt) { // ITE true x y - Debug("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[0] ==tt " + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[0] ==tt " << n << ": " << n[1] << std::endl; return RewriteResponse(REWRITE_AGAIN, n[1]); } else { Assert(n[0] == ff); // ITE false x y - Debug("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[0] ==ff " + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[0] ==ff " << n << ": " << n[1] << std::endl; return RewriteResponse(REWRITE_AGAIN, n[2]); } } else if (n[1].isConst()) { if (n[1] == tt && n[2] == ff) { - Debug("bool-ite") + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[1] ==tt && n[2] == ff " << n << ": " << n[0] << std::endl; return RewriteResponse(REWRITE_AGAIN, n[0]); } else if (n[1] == ff && n[2] == tt) { - Debug("bool-ite") + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[1] ==ff && n[2] == tt " << n << ": " << n[0].notNode() << std::endl; return RewriteResponse(REWRITE_AGAIN, makeNegation(n[0])); @@ -363,7 +363,7 @@ RewriteResponse TheoryBoolRewriter::preRewrite(TNode n) { int parityTmp; if ((parityTmp = equalityParity(n[1], n[2])) != 0) { Node resp = (parityTmp == 1) ? (Node)n[1] : n[0].eqNode(n[1]); - Debug("bool-ite") + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: equalityParity n[1], n[2] " << parityTmp << " " << n << ": " << resp << std::endl; return RewriteResponse(REWRITE_AGAIN, resp); @@ -376,7 +376,7 @@ RewriteResponse TheoryBoolRewriter::preRewrite(TNode n) { // if n[1] is constant this can loop, this is possible in prewrite Node resp = n[0].iteNode( (parityTmp == 1) ? tt : ff, n[2]); - Debug("bool-ite") + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: equalityParity n[0], n[1] " << parityTmp << " " << n << ": " << resp << std::endl; return RewriteResponse(REWRITE_AGAIN, resp); @@ -384,7 +384,7 @@ RewriteResponse TheoryBoolRewriter::preRewrite(TNode n) { // (parityTmp == 1) if n[0] == n[2] // otherwise, n[0] == not(n[2]) or not(n[0]) == n[2] Node resp = n[0].iteNode(n[1], (parityTmp == 1) ? ff : tt); - Debug("bool-ite") + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: equalityParity n[0], n[2] " << parityTmp << " " << n << ": " << resp << std::endl; return RewriteResponse(REWRITE_AGAIN, resp); @@ -394,7 +394,7 @@ RewriteResponse TheoryBoolRewriter::preRewrite(TNode n) { // (parityTmp > 1) then n : (ite c (ite (not c) x y) z) or // n: (ite (not c) (ite c x y) z) Node resp = n[0].iteNode((parityTmp == 1) ? n[1][1] : n[1][2], n[2]); - Debug("bool-ite") + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite: equalityParity n[0], n[1][0] " << parityTmp << " " << n << ": " << resp << std::endl; return RewriteResponse(REWRITE_AGAIN, resp); @@ -404,7 +404,7 @@ RewriteResponse TheoryBoolRewriter::preRewrite(TNode n) { // (parityTmp > 1) then n : (ite c x (ite (not c) y z)) or // n: (ite (not c) x (ite c y z)) Node resp = n[0].iteNode(n[1], (parityTmp == 1) ? n[2][2] : n[2][1]); - Debug("bool-ite") + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite: equalityParity n[0], n[2][0] " << parityTmp << " " << n << ": " << resp << std::endl; return RewriteResponse(REWRITE_AGAIN, resp); @@ -420,7 +420,7 @@ RewriteResponse TheoryBoolRewriter::preRewrite(TNode n) { // ITE C false y --> ~C ^ y Node resp = n[1] == tt ? n[0].orNode(n[2]) : (n[0].negate()).andNode(n[2]); - Debug("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[1] const " + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[1] const " << n << ": " << resp << std::endl; return RewriteResponse(REWRITE_AGAIN, resp); } @@ -430,7 +430,7 @@ RewriteResponse TheoryBoolRewriter::preRewrite(TNode n) { // ITE C x false --> C ^ x Node resp = n[2] == tt ? (n[0].negate()).orNode(n[1]) : n[0].andNode(n[1]); - Debug("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[2] const " + Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[2] const " << n << ": " << resp << std::endl; return RewriteResponse(REWRITE_AGAIN, resp); } diff --git a/src/theory/booleans/theory_bool_type_rules.cpp b/src/theory/booleans/theory_bool_type_rules.cpp index 11210a869..0fe914f2f 100644 --- a/src/theory/booleans/theory_bool_type_rules.cpp +++ b/src/theory/booleans/theory_bool_type_rules.cpp @@ -32,10 +32,10 @@ TypeNode BooleanTypeRule::computeType(NodeManager* nodeManager, { if (!child.getType(check).isBoolean()) { - Debug("pb") << "failed type checking: " << child << std::endl; - Debug("pb") << " integer: " << child.getType(check).isInteger() + Trace("pb") << "failed type checking: " << child << std::endl; + Trace("pb") << " integer: " << child.getType(check).isInteger() << std::endl; - Debug("pb") << " real: " << child.getType(check).isReal() << std::endl; + Trace("pb") << " real: " << child.getType(check).isReal() << std::endl; throw TypeCheckingExceptionPrivate(n, "expecting a Boolean subexpression"); } diff --git a/src/theory/bv/bitblast/bitblast_strategies_template.h b/src/theory/bv/bitblast/bitblast_strategies_template.h index ca2d55dc9..bd9381af1 100644 --- a/src/theory/bv/bitblast/bitblast_strategies_template.h +++ b/src/theory/bv/bitblast/bitblast_strategies_template.h @@ -40,7 +40,7 @@ namespace bv { template T UndefinedAtomBBStrategy(TNode node, TBitblaster* bb) { - Debug("bitvector") << "TheoryBV::Bitblaster Undefined bitblasting strategy for kind: " + Trace("bitvector") << "TheoryBV::Bitblaster Undefined bitblasting strategy for kind: " << node.getKind() << "\n"; Unreachable(); } @@ -48,7 +48,7 @@ T UndefinedAtomBBStrategy(TNode node, TBitblaster* bb) { template T DefaultEqBB(TNode node, TBitblaster* bb) { - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; Assert(node.getKind() == kind::EQUAL); std::vector lhs, rhs; @@ -68,7 +68,7 @@ T DefaultEqBB(TNode node, TBitblaster* bb) { template T AdderUltBB(TNode node, TBitblaster* bb) { - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_ULT); std::vector a, b; bb->bbTerm(node[0], a); @@ -91,7 +91,7 @@ T AdderUltBB(TNode node, TBitblaster* bb) { template T DefaultUltBB(TNode node, TBitblaster* bb) { - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_ULT); std::vector a, b; bb->bbTerm(node[0], a); @@ -105,7 +105,7 @@ T DefaultUltBB(TNode node, TBitblaster* bb) { template T DefaultUleBB(TNode node, TBitblaster* bb){ - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_ULE); std::vector a, b; @@ -119,20 +119,20 @@ T DefaultUleBB(TNode node, TBitblaster* bb){ template T DefaultUgtBB(TNode node, TBitblaster* bb){ - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; // should be rewritten Unimplemented(); } template T DefaultUgeBB(TNode node, TBitblaster* bb){ - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; // should be rewritten Unimplemented(); } template T DefaultSltBB(TNode node, TBitblaster* bb){ - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; std::vector a, b; bb->bbTerm(node[0], a); @@ -145,7 +145,7 @@ T DefaultSltBB(TNode node, TBitblaster* bb){ template T DefaultSleBB(TNode node, TBitblaster* bb){ - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; std::vector a, b; bb->bbTerm(node[0], a); @@ -158,14 +158,14 @@ T DefaultSleBB(TNode node, TBitblaster* bb){ template T DefaultSgtBB(TNode node, TBitblaster* bb){ - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; // should be rewritten Unimplemented(); } template T DefaultSgeBB(TNode node, TBitblaster* bb){ - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; // should be rewritten Unimplemented(); } @@ -182,7 +182,7 @@ T DefaultSgeBB(TNode node, TBitblaster* bb){ */ template void UndefinedTermBBStrategy(TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: Undefined bitblasting strategy for kind: " + Trace("bitvector") << "theory::bv:: Undefined bitblasting strategy for kind: " << node.getKind() << "\n"; Unreachable(); } @@ -192,15 +192,15 @@ void DefaultVarBB (TNode node, std::vector& bits, TBitblaster* bb) { Assert(bits.size() == 0); bb->makeVariable(node, bits); - if(Debug.isOn("bitvector-bb")) { - Debug("bitvector-bb") << "theory::bv::DefaultVarBB bitblasting " << node << "\n"; - Debug("bitvector-bb") << " with bits " << toString(bits); + if(TraceIsOn("bitvector-bb")) { + Trace("bitvector-bb") << "theory::bv::DefaultVarBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << " with bits " << toString(bits); } } template void DefaultConstBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultConstBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultConstBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::CONST_BITVECTOR); Assert(bits.size() == 0); @@ -213,15 +213,15 @@ void DefaultConstBB (TNode node, std::vector& bits, TBitblaster* bb) { bits.push_back(mkTrue()); } } - if(Debug.isOn("bitvector-bb")) { - Debug("bitvector-bb") << "with bits: " << toString(bits) << "\n"; + if(TraceIsOn("bitvector-bb")) { + Trace("bitvector-bb") << "with bits: " << toString(bits) << "\n"; } } template void DefaultNotBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultNotBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultNotBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_NOT); Assert(bits.size() == 0); std::vector bv; @@ -231,7 +231,7 @@ void DefaultNotBB (TNode node, std::vector& bits, TBitblaster* bb) { template void DefaultConcatBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultConcatBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultConcatBB bitblasting " << node << "\n"; Assert(bits.size() == 0); Assert(node.getKind() == kind::BITVECTOR_CONCAT); @@ -245,14 +245,14 @@ void DefaultConcatBB (TNode node, std::vector& bits, TBitblaster* bb) { } } Assert(bits.size() == utils::getSize(node)); - if(Debug.isOn("bitvector-bb")) { - Debug("bitvector-bb") << "with bits: " << toString(bits) << "\n"; + if(TraceIsOn("bitvector-bb")) { + Trace("bitvector-bb") << "with bits: " << toString(bits) << "\n"; } } template void DefaultAndBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultAndBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultAndBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_AND && bits.size() == 0); @@ -270,7 +270,7 @@ void DefaultAndBB (TNode node, std::vector& bits, TBitblaster* bb) { template void DefaultOrBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultOrBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultOrBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_OR && bits.size() == 0); @@ -288,7 +288,7 @@ void DefaultOrBB (TNode node, std::vector& bits, TBitblaster* bb) { template void DefaultXorBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultXorBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultXorBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_XOR && bits.size() == 0); @@ -306,7 +306,7 @@ void DefaultXorBB (TNode node, std::vector& bits, TBitblaster* bb) { template void DefaultXnorBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultXnorBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultXnorBB bitblasting " << node << "\n"; Assert(node.getNumChildren() == 2 && node.getKind() == kind::BITVECTOR_XNOR && bits.size() == 0); @@ -323,19 +323,19 @@ void DefaultXnorBB (TNode node, std::vector& bits, TBitblaster* bb) { template void DefaultNandBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: Unimplemented kind " + Trace("bitvector") << "theory::bv:: Unimplemented kind " << node.getKind() << "\n"; Unimplemented(); } template void DefaultNorBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: Unimplemented kind " + Trace("bitvector") << "theory::bv:: Unimplemented kind " << node.getKind() << "\n"; Unimplemented(); } template void DefaultCompBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: DefaultCompBB bitblasting "<< node << "\n"; + Trace("bitvector") << "theory::bv:: DefaultCompBB bitblasting "<< node << "\n"; Assert(utils::getSize(node) == 1 && bits.size() == 0 && node.getKind() == kind::BITVECTOR_COMP); @@ -354,7 +354,7 @@ void DefaultCompBB (TNode node, std::vector& bits, TBitblaster* bb) { template void DefaultMultBB (TNode node, std::vector& res, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: DefaultMultBB bitblasting "<< node << "\n"; + Trace("bitvector") << "theory::bv:: DefaultMultBB bitblasting "<< node << "\n"; Assert(res.size() == 0 && node.getKind() == kind::BITVECTOR_MULT); // if (node.getNumChildren() == 2) { @@ -388,15 +388,15 @@ void DefaultMultBB (TNode node, std::vector& res, TBitblaster* bb) { shiftAddMultiplier(res, current, newres); res = newres; } - if(Debug.isOn("bitvector-bb")) { - Debug("bitvector-bb") << "with bits: " << toString(res) << "\n"; + if(TraceIsOn("bitvector-bb")) { + Trace("bitvector-bb") << "with bits: " << toString(res) << "\n"; } } template void DefaultAddBB(TNode node, std::vector& res, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultAddBB bitblasting " << node + Trace("bitvector-bb") << "theory::bv::DefaultAddBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_ADD && res.size() == 0); @@ -417,7 +417,7 @@ void DefaultAddBB(TNode node, std::vector& res, TBitblaster* bb) template void DefaultSubBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultSubBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultSubBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_SUB && node.getNumChildren() == 2 && bits.size() == 0); @@ -434,7 +434,7 @@ void DefaultSubBB (TNode node, std::vector& bits, TBitblaster* bb) { template void DefaultNegBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultNegBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultNegBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_NEG); std::vector a; @@ -518,7 +518,7 @@ void UdivUremBB(TNode node, std::vector& rem, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultUdivBB bitblasting " << node + Trace("bitvector-bb") << "theory::bv::DefaultUdivBB bitblasting " << node << "\n"; Assert(quot.empty()); Assert(rem.empty()); @@ -548,7 +548,7 @@ void UdivUremBB(TNode node, template void DefaultUdivBB(TNode node, std::vector& quot, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultUdivBB bitblasting " << node + Trace("bitvector-bb") << "theory::bv::DefaultUdivBB bitblasting " << node << "\n"; Assert(quot.empty()); Assert(node.getKind() == kind::BITVECTOR_UDIV); @@ -560,7 +560,7 @@ void DefaultUdivBB(TNode node, std::vector& quot, TBitblaster* bb) template void DefaultUremBB(TNode node, std::vector& rem, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultUremBB bitblasting " << node + Trace("bitvector-bb") << "theory::bv::DefaultUremBB bitblasting " << node << "\n"; Assert(rem.empty()); Assert(node.getKind() == kind::BITVECTOR_UREM); @@ -571,19 +571,19 @@ void DefaultUremBB(TNode node, std::vector& rem, TBitblaster* bb) template void DefaultSdivBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: Unimplemented kind " + Trace("bitvector") << "theory::bv:: Unimplemented kind " << node.getKind() << "\n"; Unimplemented(); } template void DefaultSremBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: Unimplemented kind " + Trace("bitvector") << "theory::bv:: Unimplemented kind " << node.getKind() << "\n"; Unimplemented(); } template void DefaultSmodBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: Unimplemented kind " + Trace("bitvector") << "theory::bv:: Unimplemented kind " << node.getKind() << "\n"; Unimplemented(); } @@ -591,7 +591,7 @@ void DefaultSmodBB (TNode node, std::vector& bits, TBitblaster* bb) { template void DefaultShlBB(TNode node, std::vector& res, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultShlBB bitblasting " << node + Trace("bitvector-bb") << "theory::bv::DefaultShlBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_SHL && res.size() == 0); std::vector a, b; @@ -640,16 +640,16 @@ void DefaultShlBB(TNode node, std::vector& res, TBitblaster* bb) res[i] = mkIte(b_ult_a_size, prev_res[i], mkFalse()); } - if (Debug.isOn("bitvector-bb")) + if (TraceIsOn("bitvector-bb")) { - Debug("bitvector-bb") << "with bits: " << toString(res) << "\n"; + Trace("bitvector-bb") << "with bits: " << toString(res) << "\n"; } } template void DefaultLshrBB(TNode node, std::vector& res, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultLshrBB bitblasting " << node + Trace("bitvector-bb") << "theory::bv::DefaultLshrBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_LSHR && res.size() == 0); std::vector a, b; @@ -698,16 +698,16 @@ void DefaultLshrBB(TNode node, std::vector& res, TBitblaster* bb) res[i] = mkIte(b_ult_a_size, prev_res[i], mkFalse()); } - if (Debug.isOn("bitvector-bb")) + if (TraceIsOn("bitvector-bb")) { - Debug("bitvector-bb") << "with bits: " << toString(res) << "\n"; + Trace("bitvector-bb") << "with bits: " << toString(res) << "\n"; } } template void DefaultAshrBB(TNode node, std::vector& res, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultAshrBB bitblasting " << node + Trace("bitvector-bb") << "theory::bv::DefaultAshrBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_ASHR && res.size() == 0); std::vector a, b; @@ -758,15 +758,15 @@ void DefaultAshrBB(TNode node, std::vector& res, TBitblaster* bb) res[i] = mkIte(b_ult_a_size, prev_res[i], sign_bit); } - if (Debug.isOn("bitvector-bb")) + if (TraceIsOn("bitvector-bb")) { - Debug("bitvector-bb") << "with bits: " << toString(res) << "\n"; + Trace("bitvector-bb") << "with bits: " << toString(res) << "\n"; } } template void DefaultUltbvBB (TNode node, std::vector& res, TBitblaster* bb) { - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_ULTBV); std::vector a, b; bb->bbTerm(node[0], a); @@ -779,7 +779,7 @@ void DefaultUltbvBB (TNode node, std::vector& res, TBitblaster* bb) { template void DefaultSltbvBB (TNode node, std::vector& res, TBitblaster* bb) { - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_SLTBV); std::vector a, b; bb->bbTerm(node[0], a); @@ -792,7 +792,7 @@ void DefaultSltbvBB (TNode node, std::vector& res, TBitblaster* bb) { template void DefaultIteBB (TNode node, std::vector& res, TBitblaster* bb) { - Debug("bitvector-bb") << "Bitblasting node " << node << "\n"; + Trace("bitvector-bb") << "Bitblasting node " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_ITE); std::vector cond, thenpart, elsepart; bb->bbTerm(node[0], cond); @@ -823,16 +823,16 @@ void DefaultExtractBB (TNode node, std::vector& bits, TBitblaster* bb) { } Assert(bits.size() == high - low + 1); - if(Debug.isOn("bitvector-bb")) { - Debug("bitvector-bb") << "theory::bv::DefaultExtractBB bitblasting " << node << "\n"; - Debug("bitvector-bb") << " with bits " << toString(bits); + if(TraceIsOn("bitvector-bb")) { + Trace("bitvector-bb") << "theory::bv::DefaultExtractBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << " with bits " << toString(bits); } } template void DefaultRepeatBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: Unimplemented kind " + Trace("bitvector") << "theory::bv:: Unimplemented kind " << node.getKind() << "\n"; // this should be rewritten Unimplemented(); @@ -841,7 +841,7 @@ void DefaultRepeatBB (TNode node, std::vector& bits, TBitblaster* bb) { template void DefaultZeroExtendBB (TNode node, std::vector& res_bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultZeroExtendBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultZeroExtendBB bitblasting " << node << "\n"; // this should be rewritten Unimplemented(); @@ -850,7 +850,7 @@ void DefaultZeroExtendBB (TNode node, std::vector& res_bits, TBitblaster* template void DefaultSignExtendBB (TNode node, std::vector& res_bits, TBitblaster* bb) { - Debug("bitvector-bb") << "theory::bv::DefaultSignExtendBB bitblasting " << node << "\n"; + Trace("bitvector-bb") << "theory::bv::DefaultSignExtendBB bitblasting " << node << "\n"; Assert(node.getKind() == kind::BITVECTOR_SIGN_EXTEND && res_bits.size() == 0); @@ -874,7 +874,7 @@ void DefaultSignExtendBB (TNode node, std::vector& res_bits, TBitblaster* template void DefaultRotateRightBB (TNode node, std::vector& res, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: Unimplemented kind " + Trace("bitvector") << "theory::bv:: Unimplemented kind " << node.getKind() << "\n"; Unimplemented(); @@ -882,7 +882,7 @@ void DefaultRotateRightBB (TNode node, std::vector& res, TBitblaster* bb) template void DefaultRotateLeftBB (TNode node, std::vector& bits, TBitblaster* bb) { - Debug("bitvector") << "theory::bv:: Unimplemented kind " + Trace("bitvector") << "theory::bv:: Unimplemented kind " << node.getKind() << "\n"; Unimplemented(); } diff --git a/src/theory/bv/bv_solver_bitblast.cpp b/src/theory/bv/bv_solver_bitblast.cpp index b3667fa86..0686deaa8 100644 --- a/src/theory/bv/bv_solver_bitblast.cpp +++ b/src/theory/bv/bv_solver_bitblast.cpp @@ -224,7 +224,7 @@ void BVSolverBitblast::postCheck(Theory::Effort level) for (const prop::SatLiteral& lit : unsat_assumptions) { conf.push_back(d_literalFactCache[lit]); - Debug("bv-bitblast") + Trace("bv-bitblast") << "unsat assumption (" << lit << "): " << conf.back() << std::endl; } conflict = nm->mkAnd(conf); @@ -265,7 +265,7 @@ bool BVSolverBitblast::preNotifyFact( TrustNode BVSolverBitblast::explain(TNode n) { - Debug("bv-bitblast") << "explain called on " << n << std::endl; + Trace("bv-bitblast") << "explain called on " << n << std::endl; return d_im.explainLit(n); } diff --git a/src/theory/bv/bv_solver_bitblast_internal.cpp b/src/theory/bv/bv_solver_bitblast_internal.cpp index 1d864e72a..55d1f16a2 100644 --- a/src/theory/bv/bv_solver_bitblast_internal.cpp +++ b/src/theory/bv/bv_solver_bitblast_internal.cpp @@ -155,7 +155,7 @@ bool BVSolverBitblastInternal::preNotifyFact( TrustNode BVSolverBitblastInternal::explain(TNode n) { - Debug("bv-bitblast-internal") << "explain called on " << n << std::endl; + Trace("bv-bitblast-internal") << "explain called on " << n << std::endl; return d_im.explainLit(n); } diff --git a/src/theory/bv/theory_bv.cpp b/src/theory/bv/theory_bv.cpp index 96b1815e6..0a87ceb39 100644 --- a/src/theory/bv/theory_bv.cpp +++ b/src/theory/bv/theory_bv.cpp @@ -277,7 +277,7 @@ TrustNode TheoryBV::ppRewrite(TNode t, std::vector& lems) return texp; } - Debug("theory-bv-pp-rewrite") << "ppRewrite " << t << "\n"; + Trace("theory-bv-pp-rewrite") << "ppRewrite " << t << "\n"; Node res = t; if (options().bv.bitwiseEq && RewriteRule::applies(t)) { @@ -301,7 +301,7 @@ TrustNode TheoryBV::ppRewrite(TNode t, std::vector& lems) } } - Debug("theory-bv-pp-rewrite") << "to " << res << "\n"; + Trace("theory-bv-pp-rewrite") << "to " << res << "\n"; if (res != t) { return TrustNode::mkTrustRewrite(t, res, nullptr); @@ -328,10 +328,10 @@ EqualityStatus TheoryBV::getEqualityStatus(TNode a, TNode b) if (value_a == value_b) { - Debug("theory-bv") << EQUALITY_TRUE_IN_MODEL << std::endl; + Trace("theory-bv") << EQUALITY_TRUE_IN_MODEL << std::endl; return EQUALITY_TRUE_IN_MODEL; } - Debug("theory-bv") << EQUALITY_FALSE_IN_MODEL << std::endl; + Trace("theory-bv") << EQUALITY_FALSE_IN_MODEL << std::endl; return EQUALITY_FALSE_IN_MODEL; } return status; diff --git a/src/theory/bv/theory_bv_rewrite_rules.h b/src/theory/bv/theory_bv_rewrite_rules.h index 208f0ebd3..ecf1bcc00 100644 --- a/src/theory/bv/theory_bv_rewrite_rules.h +++ b/src/theory/bv/theory_bv_rewrite_rules.h @@ -447,11 +447,11 @@ public: { if (!checkApplies || applies(node)) { - Debug("theory::bv::rewrite") + Trace("theory::bv::rewrite") << "RewriteRule<" << rule << ">(" << node << ")" << std::endl; Assert(checkApplies || applies(node)); Node result = apply(node); - Debug("theory::bv::rewrite") << "RewriteRule<" << rule << ">(" << node + Trace("theory::bv::rewrite") << "RewriteRule<" << rule << ">(" << node << ") => " << result << std::endl; return result; } @@ -620,7 +620,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule for " << node.getKind() <<"\n"; + Trace("bv-rewrite") << "RewriteRule for " << node.getKind() <<"\n"; Unreachable(); return node; } diff --git a/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h b/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h index 761f4efb2..28d314e77 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h +++ b/src/theory/bv/theory_bv_rewrite_rules_constant_evaluation.h @@ -39,7 +39,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); BitVector res = a & b; @@ -58,7 +58,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); BitVector res = a | b; @@ -77,7 +77,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); BitVector res = a ^ b; @@ -93,7 +93,7 @@ Node RewriteRule::apply(TNode node) { // template<> inline // Node RewriteRule::apply(TNode node) { -// Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; +// Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; // BitVector a = node[0].getConst(); // BitVector b = node[1].getConst(); // BitVector res = ~ (a ^ b); @@ -108,7 +108,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector res = ~ a; return utils::mkConst(res); @@ -122,7 +122,7 @@ Node RewriteRule::apply(TNode node) { // template<> inline // Node RewriteRule::apply(TNode node) { -// Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; +// Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; // BitVector a = node[0].getConst(); // BitVector b = node[1].getConst(); // BitVector res; @@ -143,7 +143,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode::iterator child_it = node.begin(); BitVector res = (*child_it).getConst(); for(++child_it; child_it != node.end(); ++child_it) { @@ -161,7 +161,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode::iterator child_it = node.begin(); BitVector res = (*child_it).getConst(); for(++child_it; child_it != node.end(); ++child_it) { @@ -178,7 +178,7 @@ inline Node RewriteRule::apply(TNode node) // template<> inline // Node RewriteRule::apply(TNode node) { -// Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; +// Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; // BitVector a = node[0].getConst(); // BitVector b = node[1].getConst(); // BitVector res = a - b; @@ -193,7 +193,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector res = - a; @@ -206,7 +206,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); BitVector res = a.unsignedDivTotal(b); @@ -220,7 +220,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); BitVector res = a.unsignedRemTotal(b); @@ -235,7 +235,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); @@ -251,7 +251,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); @@ -267,7 +267,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); @@ -283,7 +283,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); @@ -301,7 +301,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); @@ -319,7 +319,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); @@ -338,7 +338,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); @@ -351,14 +351,14 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { - Debug("bv-rewrite") << "RewriteRule::applies(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule::applies(" << node << ")" << std::endl; return (node.getKind() == kind::BITVECTOR_ITE && utils::isBvConstTerm(node)); } template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector cond = node[0].getConst(); if (node[0] == utils::mkConst(1, 1)) { @@ -377,7 +377,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); @@ -395,7 +395,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); @@ -413,7 +413,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); unsigned lo = utils::getExtractLow(node); unsigned hi = utils::getExtractHigh(node); @@ -431,7 +431,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned num = node.getNumChildren(); BitVector res = node[0].getConst(); for(unsigned i = 1; i < num; ++i ) { @@ -449,7 +449,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); unsigned amount = node.getOperator().getConst().d_signExtendAmount; @@ -466,7 +466,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); if (a == b) { @@ -484,7 +484,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; BitVector a = node[0].getConst(); BitVector b = node[1].getConst(); if (a == b) { @@ -502,7 +502,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return node[0]; } } diff --git a/src/theory/bv/theory_bv_rewrite_rules_core.h b/src/theory/bv/theory_bv_rewrite_rules_core.h index d3caec63a..ea4cc2ec0 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_core.h +++ b/src/theory/bv/theory_bv_rewrite_rules_core.h @@ -36,7 +36,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeBuilder result(kind::BITVECTOR_CONCAT); std::vector processing_stack; processing_stack.push_back(node); @@ -51,7 +51,7 @@ Node RewriteRule::apply(TNode node) { } } Node resultNode = result; - Debug("bv-rewrite") << "RewriteRule(" << resultNode << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << resultNode << ")" << std::endl; return resultNode; } @@ -65,7 +65,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; std::vector mergedExtracts; @@ -128,7 +128,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; std::vector mergedConstants; for (unsigned i = 0, end = node.getNumChildren(); i < end;) { @@ -157,7 +157,7 @@ Node RewriteRule::apply(TNode node) { } } - Debug("bv-rewrite") << "RewriteRule(" << node << ") => " << utils::mkConcat(mergedConstants) << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ") => " << utils::mkConcat(mergedConstants) << std::endl; return utils::mkConcat(mergedConstants); } @@ -177,7 +177,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return node[0]; } @@ -192,7 +192,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; Node child = node[0]; BitVector childValue = child.getConst(); return utils::mkConst(childValue.extract(utils::getExtractHigh(node), utils::getExtractLow(node))); @@ -202,7 +202,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { - //Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + //Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; if (node.getKind() != kind::BITVECTOR_EXTRACT) return false; if (node[0].getKind() != kind::BITVECTOR_CONCAT) return false; return true; @@ -210,7 +210,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; int extract_high = utils::getExtractHigh(node); int extract_low = utils::getExtractLow(node); @@ -245,7 +245,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; // x[i:j][k:l] ~> x[k+j:l+j] uint32_t j = 0; @@ -266,7 +266,7 @@ Node RewriteRule::apply(TNode node) { template<> inline bool RewriteRule::applies(TNode node) { - //Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + //Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; if (node.getKind() != kind::EQUAL) return false; if (node[0].getKind() != kind::CONST_BITVECTOR) return false; if (node[1].getKind() != kind::CONST_BITVECTOR) return false; @@ -288,7 +288,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkTrue(); } @@ -301,7 +301,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; Node res = node[1].eqNode(node[0]); return res; } diff --git a/src/theory/bv/theory_bv_rewrite_rules_normalization.h b/src/theory/bv/theory_bv_rewrite_rules_normalization.h index d73497adf..bb54c2920 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_normalization.h +++ b/src/theory/bv/theory_bv_rewrite_rules_normalization.h @@ -48,7 +48,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned high = utils::getExtractHigh(node); unsigned low = utils::getExtractLow(node); std::vector children; @@ -73,7 +73,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned low = utils::getExtractLow(node); unsigned high = utils::getExtractHigh(node); Node a = utils::mkExtract(node[0][0], high, low); @@ -100,7 +100,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode extendee = node[0][0]; unsigned extendee_size = utils::getSize(extendee); @@ -134,7 +134,7 @@ inline Node RewriteRule::apply(TNode node) } resultNode = utils::mkConcat(bits); } - Debug("bv-rewrite") << " =>" << resultNode + Trace("bv-rewrite") << " =>" << resultNode << std::endl; return resultNode; } @@ -156,7 +156,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned low = utils::getExtractLow(node); Assert(low == 0); @@ -187,7 +187,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned low = utils::getExtractLow(node); unsigned high = utils::getExtractHigh(node); @@ -221,7 +221,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; std::vector processingStack; processingStack.push_back(node); @@ -379,7 +379,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned size = utils::getSize(node); BitVector constSum(size, (unsigned)0); @@ -431,7 +431,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); unsigned size = utils::getSize(node); @@ -515,7 +515,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); @@ -559,7 +559,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); @@ -604,7 +604,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned size = utils::getSize(node); Node factor = node[0][0]; @@ -631,7 +631,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode left = node[0]; TNode right = node[1]; @@ -901,7 +901,7 @@ static inline Node mkNodeKind(Kind k, TNode node, TNode c) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode term; BitVector c; @@ -984,7 +984,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode mult = node[0]; NodeBuilder nb(kind::BITVECTOR_MULT); BitVector bv(utils::getSize(node), (unsigned)1); @@ -1007,7 +1007,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return NodeManager::currentNM()->mkNode( kind::BITVECTOR_SUB, node[0][1], node[0][0]); } @@ -1022,7 +1022,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); std::vector children; for (unsigned i = 0; i < node[0].getNumChildren(); ++i) @@ -1066,7 +1066,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); @@ -1157,7 +1157,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; std::vector processingStack; processingStack.push_back(node); std::unordered_set processed; @@ -1193,7 +1193,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); // this will remove duplicates @@ -1275,7 +1275,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); @@ -1418,7 +1418,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); // get the constant @@ -1470,7 +1470,7 @@ inline Node RewriteRule::apply(TNode node) } } Node result = utils::mkConcat(concat_children); - Debug("bv-rewrite") << " =>" << result << std::endl; + Trace("bv-rewrite") << " =>" << result << std::endl; return result; } @@ -1485,7 +1485,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeBuilder nb_lhs(kind::BITVECTOR_ADD); @@ -1559,7 +1559,7 @@ inline Node RewriteRule::apply(TNode node) // template<> inline // Node RewriteRule<>::apply(TNode node) { -// Debug("bv-rewrite") << "RewriteRule<>(" << node << ")" << std::endl; +// Trace("bv-rewrite") << "RewriteRule<>(" << node << ")" << std::endl; // return resultNode; // } diff --git a/src/theory/bv/theory_bv_rewrite_rules_operator_elimination.h b/src/theory/bv/theory_bv_rewrite_rules_operator_elimination.h index a8ac27a81..6c57ebaa5 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_operator_elimination.h +++ b/src/theory/bv/theory_bv_rewrite_rules_operator_elimination.h @@ -39,7 +39,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode a = node[0]; TNode b = node[1]; @@ -56,7 +56,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode a = node[0]; TNode b = node[1]; @@ -73,7 +73,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode a = node[0]; TNode b = node[1]; @@ -90,7 +90,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode a = node[0]; TNode b = node[1]; @@ -107,7 +107,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); unsigned size = utils::getSize(node[0]); @@ -128,7 +128,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); TNode a = node[0]; @@ -146,7 +146,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); TNode a = node[0]; @@ -164,7 +164,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); Node comp = nm->mkNode(kind::EQUAL, node[0], node[1]); @@ -183,7 +183,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); Node negb = nm->mkNode(kind::BITVECTOR_NEG, node[1]); @@ -201,7 +201,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode a = node[0]; unsigned amount = node.getOperator().getConst().d_repeatAmount; @@ -226,7 +226,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode a = node[0]; unsigned amount = node.getOperator().getConst().d_rotateLeftAmount; @@ -251,7 +251,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode a = node[0]; unsigned amount = node.getOperator().getConst().d_rotateRightAmount; @@ -276,7 +276,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; //if( node[0].isConst() ){ //TODO? direct computation instead of term construction+rewriting @@ -293,7 +293,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; //if( node[0].isConst() ){ //TODO? direct computation instead of term construction+rewriting @@ -311,7 +311,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); TNode a = node[0]; @@ -330,7 +330,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); TNode a = node[0]; @@ -350,7 +350,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); TNode a = node[0]; @@ -369,7 +369,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); @@ -411,7 +411,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager* nm = NodeManager::currentNM(); @@ -442,7 +442,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); TNode a = node[0]; @@ -482,7 +482,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager* nm = NodeManager::currentNM(); TNode a = node[0]; @@ -511,7 +511,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); TNode s = node[0]; @@ -579,7 +579,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager* nm = NodeManager::currentNM(); TNode s = node[0]; @@ -640,7 +640,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode bv = node[0]; unsigned amount = @@ -663,7 +663,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned amount = node.getOperator().getConst().d_signExtendAmount; @@ -686,7 +686,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode a = node[0]; unsigned size = utils::getSize(node[0]); Node result = NodeManager::currentNM()->mkNode(kind::EQUAL, a, utils::mkConst( size, 0 ) ); @@ -702,7 +702,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode a = node[0]; unsigned size = utils::getSize(node[0]); Node result = NodeManager::currentNM()->mkNode(kind::EQUAL, a, utils::mkOnes( size ) ); diff --git a/src/theory/bv/theory_bv_rewrite_rules_simplification.h b/src/theory/bv/theory_bv_rewrite_rules_simplification.h index a43d42d95..37efab014 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_simplification.h +++ b/src/theory/bv/theory_bv_rewrite_rules_simplification.h @@ -63,7 +63,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::isZero(node[0]) ? node[2] : node[1]; } @@ -84,7 +84,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return node[1]; } @@ -107,7 +107,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; if (utils::isOne(node[1]) && utils::isZero(node[2])) { @@ -141,7 +141,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; Node t0 = node[1].getKind() == kind::BITVECTOR_ITE && node[0] == node[1][0] ? node[1][1] @@ -171,7 +171,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager* nm = NodeManager::currentNM(); Assert(node[1].getKind() == kind::BITVECTOR_ITE); @@ -200,7 +200,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager* nm = NodeManager::currentNM(); Assert(node[1].getKind() == kind::BITVECTOR_ITE); @@ -227,7 +227,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager* nm = NodeManager::currentNM(); Assert(node[2].getKind() == kind::BITVECTOR_ITE); @@ -256,7 +256,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager* nm = NodeManager::currentNM(); Assert(node[2].getKind() == kind::BITVECTOR_ITE); @@ -284,7 +284,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager* nm = NodeManager::currentNM(); if (node[0].isConst()) { @@ -311,7 +311,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; Integer amount = node[1].getConst().toInteger(); if (amount == 0) { return node[0]; @@ -352,7 +352,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; Integer amount = node[1].getConst().toInteger(); if (amount == 0) { return node[0]; @@ -393,7 +393,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; Integer amount = node[1].getConst().toInteger(); if (amount == 0) { return node[0]; @@ -443,7 +443,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return node[0]; } @@ -468,7 +468,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkConst(utils::getSize(node), 0); } @@ -494,7 +494,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned size = utils::getSize(node); if (node[0] == utils::mkOnes(size)) { @@ -552,7 +552,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; uint32_t m, my, mz; size_t nc; @@ -652,7 +652,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned size = utils::getSize(node); if (node[0] == utils::mkConst(size, 0)) { @@ -685,7 +685,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkOnes(utils::getSize(node)); } @@ -708,7 +708,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkZero(utils::getSize(node)); } @@ -737,7 +737,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); Node ones = utils::mkOnes(utils::getSize(node)); std::vector children; @@ -789,7 +789,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; std::vector children; Node zero = utils::mkConst(utils::getSize(node), 0); @@ -825,7 +825,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkZero(utils::getSize(node)); } @@ -849,7 +849,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; uint32_t size = utils::getSize(node); return utils::mkOnes(size); } @@ -871,7 +871,7 @@ template <> inline Node RewriteRule::apply(TNode node) { Unreachable(); - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; Node a = node[0][0]; Node b = node[1][0]; return NodeManager::currentNM()->mkNode(kind::BITVECTOR_XOR, a, b); @@ -894,7 +894,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; std::vector children; TNode::iterator child_it = node[0].begin(); children.push_back( @@ -922,7 +922,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode ret = node[0][0]; while (ret.getKind() == kind::BITVECTOR_NOT && ret[0].getKind() == kind::BITVECTOR_NOT) @@ -949,7 +949,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkFalse(); } @@ -970,7 +970,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkTrue(); } @@ -992,7 +992,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); return nm->mkNode(kind::NOT, nm->mkNode(kind::EQUAL, node[0], node[1])); } @@ -1013,7 +1013,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkFalse(); } @@ -1032,7 +1032,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return NodeManager::currentNM()->mkNode( kind::EQUAL, node[0], utils::mkZero(utils::getSize(node[0]))); } @@ -1051,7 +1051,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned size = utils::getSize(node[0]); Node most_significant_bit = utils::mkExtract(node[0], size - 1, size - 1); return NodeManager::currentNM()->mkNode( @@ -1074,7 +1074,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkFalse(); } @@ -1096,7 +1096,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return NodeManager::currentNM()->mkNode(kind::EQUAL, node[0], node[1]); } @@ -1116,7 +1116,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkTrue(); } @@ -1136,7 +1136,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkTrue(); } @@ -1160,7 +1160,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkTrue(); } @@ -1181,7 +1181,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; Node ult = node[0]; Node a = ult[0]; Node b = ult[1]; @@ -1205,7 +1205,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; Node ult = node[0]; Node a = ult[0]; Node b = ult[1]; @@ -1240,7 +1240,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); unsigned size = utils::getSize(node); std::vector children; @@ -1339,7 +1339,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned bitwidth = utils::getSize(node); @@ -1384,7 +1384,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return node[0][0]; } @@ -1411,7 +1411,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); unsigned size = utils::getSize(node); Node a = node[0]; @@ -1452,7 +1452,7 @@ inline bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkOnes(utils::getSize(node)); } @@ -1472,7 +1472,7 @@ inline bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return node[0]; } @@ -1499,7 +1499,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; TNode a = node[0]; bool isNeg = false; unsigned power = utils::isPow2Const(node[1], isNeg) - 1; @@ -1534,7 +1534,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkConst(utils::getSize(node), 0); } @@ -1553,7 +1553,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return utils::mkConst(utils::getSize(node), 0); } @@ -1575,7 +1575,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; return node[0]; } @@ -1603,7 +1603,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; const Node& T = node[0][0]; const Node& x = node[1]; Node zero = utils::mkConst(utils::getSize(x), 0); @@ -1642,7 +1642,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); std::vector children; unsigned neg_count = 0; @@ -1677,7 +1677,7 @@ bool RewriteRule::applies(TNode node) { template<> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; unsigned amount1 = node.getOperator().getConst().d_signExtendAmount; @@ -1990,7 +1990,7 @@ bool RewriteRule::applies(TNode node) { template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); unsigned bitwidth = utils::getSize(node[0]); Node zeros = utils::mkConst(bitwidth / 2, 0); @@ -2049,7 +2049,7 @@ inline bool RewriteRule::applies(TNode node) template <> inline Node RewriteRule::apply(TNode node) { - Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; + Trace("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; NodeManager *nm = NodeManager::currentNM(); TNode x = node[0]; TNode y1 = node[1]; diff --git a/src/theory/bv/theory_bv_rewriter.cpp b/src/theory/bv/theory_bv_rewriter.cpp index a968243c7..e881c17fc 100644 --- a/src/theory/bv/theory_bv_rewriter.cpp +++ b/src/theory/bv/theory_bv_rewriter.cpp @@ -36,8 +36,8 @@ RewriteResponse TheoryBVRewriter::preRewrite(TNode node) { RewriteResponse res = d_rewriteTable[node.getKind()](node, true); if (res.d_node != node) { - Debug("bitvector-rewrite") << "TheoryBV::preRewrite " << node << std::endl; - Debug("bitvector-rewrite") + Trace("bitvector-rewrite") << "TheoryBV::preRewrite " << node << std::endl; + Trace("bitvector-rewrite") << "TheoryBV::preRewrite to " << res.d_node << std::endl; } return res; @@ -47,8 +47,8 @@ RewriteResponse TheoryBVRewriter::postRewrite(TNode node) { RewriteResponse res = d_rewriteTable[node.getKind()](node, false); if (res.d_node != node) { - Debug("bitvector-rewrite") << "TheoryBV::postRewrite " << node << std::endl; - Debug("bitvector-rewrite") + Trace("bitvector-rewrite") << "TheoryBV::postRewrite " << node << std::endl; + Trace("bitvector-rewrite") << "TheoryBV::postRewrite to " << res.d_node << std::endl; } return res; @@ -56,7 +56,7 @@ RewriteResponse TheoryBVRewriter::postRewrite(TNode node) { TrustNode TheoryBVRewriter::expandDefinition(Node node) { - Debug("bitvector-expandDefinition") + Trace("bitvector-expandDefinition") << "TheoryBV::expandDefinition(" << node << ")" << std::endl; Node ret; switch (node.getKind()) @@ -711,7 +711,7 @@ RewriteResponse TheoryBVRewriter::IdentityRewrite(TNode node, bool prerewrite) { } RewriteResponse TheoryBVRewriter::UndefinedRewrite(TNode node, bool prerewrite) { - Debug("bv-rewrite") << "TheoryBV::UndefinedRewrite for" << node; + Trace("bv-rewrite") << "TheoryBV::UndefinedRewrite for" << node; Unimplemented(); } diff --git a/src/theory/combination_care_graph.cpp b/src/theory/combination_care_graph.cpp index c0d75ceaa..29d4a8017 100644 --- a/src/theory/combination_care_graph.cpp +++ b/src/theory/combination_care_graph.cpp @@ -54,7 +54,7 @@ void CombinationCareGraph::combineTheories() prop::PropEngine* propEngine = d_te.getPropEngine(); for (const CarePair& carePair : careGraph) { - Debug("combineTheories") + Trace("combineTheories") << "TheoryEngine::combineTheories(): checking " << carePair.d_a << " = " << carePair.d_b << " from " << carePair.d_theory << std::endl; @@ -62,7 +62,7 @@ void CombinationCareGraph::combineTheories() Node equality = carePair.d_a.eqNode(carePair.d_b); // We need to split on it - Debug("combineTheories") + Trace("combineTheories") << "TheoryEngine::combineTheories(): requesting a split " << std::endl; TrustNode tsplit; diff --git a/src/theory/datatypes/sygus_datatype_utils.cpp b/src/theory/datatypes/sygus_datatype_utils.cpp index 711cb0a3b..dee9d847c 100644 --- a/src/theory/datatypes/sygus_datatype_utils.cpp +++ b/src/theory/datatypes/sygus_datatype_utils.cpp @@ -554,7 +554,7 @@ TypeNode substituteAndGeneralizeSygusType(TypeNode sdt, std::vector datatypeTypes = nm->mkMutualDatatypeTypes( datatypes, unres, NodeManager::DATATYPE_FLAG_PLACEHOLDER); TypeNode sdtS = datatypeTypes[0]; - if (Trace.isOn("dtsygus-gen-debug")) + if (TraceIsOn("dtsygus-gen-debug")) { Trace("dtsygus-gen-debug") << "Made datatype types:" << std::endl; for (unsigned j = 0, ndts = datatypeTypes.size(); j < ndts; j++) diff --git a/src/theory/datatypes/sygus_extension.cpp b/src/theory/datatypes/sygus_extension.cpp index d46e6e28d..ca3ea33e0 100644 --- a/src/theory/datatypes/sygus_extension.cpp +++ b/src/theory/datatypes/sygus_extension.cpp @@ -251,7 +251,7 @@ void SygusExtension::assertTesterInternal(int tindex, TNode n, Node exp) d_currTermSize[a].set( d_currTermSize[a].get() + ( lb_add - lb_rem ) ); } if( (unsigned)d_currTermSize[a].get()>ssz ){ - if( Trace.isOn("sygus-sb-fair") ){ + if( TraceIsOn("sygus-sb-fair") ){ std::map< TypeNode, int > var_count; Node templ = getCurrentTemplate( a, var_count ); Trace("sygus-sb-fair") << "FAIRNESS : we have " << d_currTermSize[a].get() << " at search size " << ssz << ", template is " << templ << std::endl; @@ -1091,7 +1091,7 @@ Node SygusExtension::registerSearchValue(Node a, Assert(scasv.find(bvr_equiv) != scasv.end()); Trace("sygus-sb-debug") << "......search value was " << scasv[bvr_equiv] << std::endl; - if( Trace.isOn("sygus-sb-exc") ){ + if( TraceIsOn("sygus-sb-exc") ){ Node prev = d_tds->sygusToBuiltin(scasv[bvr_equiv], tn); Trace("sygus-sb-exc") << " ......programs " << prev << " and " << bv << " are equivalent up to examples." << std::endl; } @@ -1106,7 +1106,7 @@ Node SygusExtension::registerSearchValue(Node a, else { bad_val_bvr = bvr; - if( Trace.isOn("sygus-sb-exc") ){ + if( TraceIsOn("sygus-sb-exc") ){ Node prev_bv = d_tds->sygusToBuiltin( itsv->second, tn ); Trace("sygus-sb-exc") << " ......programs " << prev_bv << " and " << bv << " rewrite to " << bvr << "." << std::endl; } @@ -1146,7 +1146,7 @@ Node SygusExtension::registerSearchValue(Node a, scasvs[bad_val_bvr] = sz; bad_val = scasv[bad_val_bvr]; bad_val_o = nv; - if (Trace.isOn("sygus-sb-exc")) + if (TraceIsOn("sygus-sb-exc")) { Trace("sygus-sb-exc") << "Flip : exclude "; quantifiers::TermDbSygus::toStreamSygus("sygus-sb-exc", bad_val); @@ -1157,7 +1157,7 @@ Node SygusExtension::registerSearchValue(Node a, } sz = prev_sz; } - if( Trace.isOn("sygus-sb-exc") ){ + if( TraceIsOn("sygus-sb-exc") ){ Node bad_val_bv = d_tds->sygusToBuiltin( bad_val, tn ); Trace("sygus-sb-exc") << " ........exclude : " << bad_val_bv; if( by_examples ){ @@ -1600,7 +1600,7 @@ void SygusExtension::check() << std::endl; Assert(prog.getType().isDatatype()); Node progv = d_state.getValuation().getModel()->getValue(prog); - if (Trace.isOn("dt-sygus")) + if (TraceIsOn("dt-sygus")) { Trace("dt-sygus") << "* DT model : " << prog << " -> "; std::stringstream ss; @@ -1663,7 +1663,7 @@ void SygusExtension::check() return check(); } - if (Trace.isOn("sygus-engine") && !d_szinfo.empty()) + if (TraceIsOn("sygus-engine") && !d_szinfo.empty()) { if (d_im.hasSentLemma()) { @@ -1693,7 +1693,7 @@ bool SygusExtension::checkValue(Node n, TNode vn, int ind) return true; } NodeManager* nm = NodeManager::currentNM(); - if (Trace.isOn("sygus-sb-check-value")) + if (TraceIsOn("sygus-sb-check-value")) { Node prog_sz = nm->mkNode(DT_SIZE, n); Node prog_szv = d_state.getValuation().getModel()->getValue(prog_sz); diff --git a/src/theory/datatypes/theory_datatypes.cpp b/src/theory/datatypes/theory_datatypes.cpp index f3b1e0fba..8bdc92ebd 100644 --- a/src/theory/datatypes/theory_datatypes.cpp +++ b/src/theory/datatypes/theory_datatypes.cpp @@ -379,7 +379,7 @@ void TheoryDatatypes::postCheck(Effort level) } Trace("datatypes-check") << "Finished check effort " << level << std::endl; - Debug("datatypes") << "TheoryDatatypes::check(): done" << std::endl; + Trace("datatypes") << "TheoryDatatypes::check(): done" << std::endl; } bool TheoryDatatypes::needsCheckLastEffort() { @@ -482,7 +482,7 @@ void TheoryDatatypes::preRegisterTerm(TNode n) TrustNode TheoryDatatypes::ppRewrite(TNode in, std::vector& lems) { - Debug("tuprec") << "TheoryDatatypes::ppRewrite(" << in << ")" << endl; + Trace("tuprec") << "TheoryDatatypes::ppRewrite(" << in << ")" << endl; // first, see if we need to expand definitions TrustNode texp = d_rewriter.expandDefinition(in); if (!texp.isNull()) @@ -768,7 +768,7 @@ void TheoryDatatypes::addTester( unsigned ttindex, Node t, EqcInfo* eqc, Node n, Node t_arg) { Trace("datatypes-debug") << "Add tester : " << t << " to eqc(" << n << ")" << std::endl; - Debug("datatypes-labels") << "Add tester " << t << " " << n << " " << eqc << std::endl; + Trace("datatypes-labels") << "Add tester " << t << " " << n << " " << eqc << std::endl; bool tpolarity = t.getKind()!=NOT; Assert((tpolarity ? t : t[0]).getKind() == APPLY_TESTER); Node j, jt; @@ -822,7 +822,7 @@ void TheoryDatatypes::addTester( } } if( !makeConflict ){ - Debug("datatypes-labels") << "Add to labels " << t << std::endl; + Trace("datatypes-labels") << "Add to labels " << t << std::endl; d_labels[n] = n_lbl + 1; if (n_lbl < d_labels_data[n].size()) { @@ -838,7 +838,7 @@ void TheoryDatatypes::addTester( n_lbl++; const DType& dt = t_arg.getType().getDType(); - Debug("datatypes-labels") << "Labels at " << n_lbl << " / " << dt.getNumConstructors() << std::endl; + Trace("datatypes-labels") << "Labels at " << n_lbl << " / " << dt.getNumConstructors() << std::endl; if( tpolarity ){ instantiate(eqc, n); // We could propagate is-C1(x) => not is-C2(x) here for all other @@ -887,7 +887,7 @@ void TheoryDatatypes::addTester( } } if( makeConflict ){ - Debug("datatypes-labels") << "Explain " << j << " " << t << std::endl; + Trace("datatypes-labels") << "Explain " << j << " " << t << std::endl; std::vector conf; conf.push_back(j); conf.push_back(t); @@ -1364,7 +1364,7 @@ void TheoryDatatypes::collectTerms( Node n ) { Kind nk = n.getKind(); if (nk == APPLY_CONSTRUCTOR) { - Debug("datatypes") << " Found constructor " << n << endl; + Trace("datatypes") << " Found constructor " << n << endl; if (n.getNumChildren() > 0) { d_functionTerms.push_back(n); @@ -1443,7 +1443,7 @@ Node TheoryDatatypes::getInstantiateCons(Node n, const DType& dt, int index) // it may be a new term, so we collect terms and add it to the equality engine collectTerms( n_ic ); d_equalityEngine->addTerm(n_ic); - Debug("dt-enum") << "Made instantiate cons " << n_ic << std::endl; + Trace("dt-enum") << "Made instantiate cons " << n_ic << std::endl; return n_ic; } @@ -1832,7 +1832,7 @@ TNode TheoryDatatypes::getRepresentative( TNode a ){ } void TheoryDatatypes::printModelDebug( const char* c ){ - if(! (Trace.isOn(c))) { + if(! (TraceIsOn(c))) { return; } diff --git a/src/theory/datatypes/theory_datatypes.h b/src/theory/datatypes/theory_datatypes.h index ad3ced165..3463935bb 100644 --- a/src/theory/datatypes/theory_datatypes.h +++ b/src/theory/datatypes/theory_datatypes.h @@ -58,12 +58,12 @@ class TheoryDatatypes : public Theory { } void eqNotifyNewClass(TNode t) override { - Debug("dt") << "NotifyClass::eqNotifyNewClass(" << t << ")" << std::endl; + Trace("dt") << "NotifyClass::eqNotifyNewClass(" << t << ")" << std::endl; d_dt.eqNotifyNewClass(t); } void eqNotifyMerge(TNode t1, TNode t2) override { - Debug("dt") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2 << ")" + Trace("dt") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2 << ")" << std::endl; d_dt.eqNotifyMerge(t1, t2); } diff --git a/src/theory/datatypes/theory_datatypes_type_rules.cpp b/src/theory/datatypes/theory_datatypes_type_rules.cpp index 4d907b259..731e811ba 100644 --- a/src/theory/datatypes/theory_datatypes_type_rules.cpp +++ b/src/theory/datatypes/theory_datatypes_type_rules.cpp @@ -53,7 +53,7 @@ TypeNode DatatypeConstructorTypeRule::computeType(NodeManager* nodeManager, } if (t.isParametricDatatype()) { - Debug("typecheck-idt") << "typecheck parameterized datatype " << n + Trace("typecheck-idt") << "typecheck parameterized datatype " << n << std::endl; TypeMatcher m(t); for (; child_it != child_it_end; ++child_it, ++tchild_it) @@ -68,21 +68,21 @@ TypeNode DatatypeConstructorTypeRule::computeType(NodeManager* nodeManager, std::vector instTypes; m.getMatches(instTypes); TypeNode range = t.instantiateParametricDatatype(instTypes); - Debug("typecheck-idt") << "Return " << range << std::endl; + Trace("typecheck-idt") << "Return " << range << std::endl; return range; } else { if (check) { - Debug("typecheck-idt") + Trace("typecheck-idt") << "typecheck cons: " << n << " " << n.getNumChildren() << std::endl; - Debug("typecheck-idt") << "cons type: " << consType << " " + Trace("typecheck-idt") << "cons type: " << consType << " " << consType.getNumChildren() << std::endl; for (; child_it != child_it_end; ++child_it, ++tchild_it) { TypeNode childType = (*child_it).getType(check); - Debug("typecheck-idt") << "typecheck cons arg: " << childType << " " + Trace("typecheck-idt") << "typecheck cons arg: " << childType << " " << (*tchild_it) << std::endl; TypeNode argumentType = *tchild_it; if (!childType.isSubtypeOf(argumentType)) @@ -129,7 +129,7 @@ TypeNode DatatypeSelectorTypeRule::computeType(NodeManager* nodeManager, } if (t.isParametricDatatype()) { - Debug("typecheck-idt") << "typecheck parameterized sel: " << n << std::endl; + Trace("typecheck-idt") << "typecheck parameterized sel: " << n << std::endl; TypeMatcher m(t); TypeNode childType = n[0].getType(check); if (!childType.isInstantiatedDatatype()) @@ -148,19 +148,19 @@ TypeNode DatatypeSelectorTypeRule::computeType(NodeManager* nodeManager, TypeNode range = selType[1]; range = range.substitute( types.begin(), types.end(), matches.begin(), matches.end()); - Debug("typecheck-idt") << "Return " << range << std::endl; + Trace("typecheck-idt") << "Return " << range << std::endl; return range; } else { if (check) { - Debug("typecheck-idt") << "typecheck sel: " << n << std::endl; - Debug("typecheck-idt") << "sel type: " << selType << std::endl; + Trace("typecheck-idt") << "typecheck sel: " << n << std::endl; + Trace("typecheck-idt") << "sel type: " << selType << std::endl; TypeNode childType = n[0].getType(check); if (!selType[0].isComparableTo(childType)) { - Debug("typecheck-idt") << "ERROR: " << selType[0].getKind() << " " + Trace("typecheck-idt") << "ERROR: " << selType[0].getKind() << " " << childType.getKind() << std::endl; throw TypeCheckingExceptionPrivate(n, "bad type for selector argument"); } @@ -187,7 +187,7 @@ TypeNode DatatypeTesterTypeRule::computeType(NodeManager* nodeManager, Assert(t.isDatatype()); if (t.isParametricDatatype()) { - Debug("typecheck-idt") + Trace("typecheck-idt") << "typecheck parameterized tester: " << n << std::endl; TypeMatcher m(t); if (!m.doMatching(testType[0], childType)) @@ -198,8 +198,8 @@ TypeNode DatatypeTesterTypeRule::computeType(NodeManager* nodeManager, } else { - Debug("typecheck-idt") << "typecheck test: " << n << std::endl; - Debug("typecheck-idt") << "test type: " << testType << std::endl; + Trace("typecheck-idt") << "typecheck test: " << n << std::endl; + Trace("typecheck-idt") << "test type: " << testType << std::endl; if (!testType[0].isComparableTo(childType)) { throw TypeCheckingExceptionPrivate(n, "bad type for tester argument"); @@ -252,7 +252,7 @@ TypeNode DatatypeAscriptionTypeRule::computeType(NodeManager* nodeManager, TNode n, bool check) { - Debug("typecheck-idt") << "typechecking ascription: " << n << std::endl; + Trace("typecheck-idt") << "typechecking ascription: " << n << std::endl; Assert(n.getKind() == kind::APPLY_TYPE_ASCRIPTION); TypeNode t = n.getOperator().getConst().getType(); if (check) diff --git a/src/theory/datatypes/theory_datatypes_utils.cpp b/src/theory/datatypes/theory_datatypes_utils.cpp index d69ec9cd5..ea804e91d 100644 --- a/src/theory/datatypes/theory_datatypes_utils.cpp +++ b/src/theory/datatypes/theory_datatypes_utils.cpp @@ -61,7 +61,7 @@ Node mkApplyCons(TypeNode tn, if (dt.isParametric()) { // add type ascription for ambiguous constructor types - Debug("datatypes-parametric") + Trace("datatypes-parametric") << "Constructor is " << dt[index] << std::endl; cchildren[0] = dt[index].getInstantiatedConstructor(tn); } diff --git a/src/theory/datatypes/type_enumerator.cpp b/src/theory/datatypes/type_enumerator.cpp index 69ebc9c78..5e8edd9b7 100644 --- a/src/theory/datatypes/type_enumerator.cpp +++ b/src/theory/datatypes/type_enumerator.cpp @@ -30,7 +30,7 @@ Node DatatypesEnumerator::getTermEnum( TypeNode tn, unsigned i ){ if( i::iterator it = d_te_index.find( tn ); unsigned tei; if( it==d_te_index.end() ){ @@ -52,28 +52,28 @@ Node DatatypesEnumerator::getTermEnum( TypeNode tn, unsigned i ){ while( i>=d_terms[tn].size() ){ ++d_children[tei]; if( d_children[tei].isFinished() ){ - Debug("dt-enum-debug") << "...fail term enum " << tn << " " << i << std::endl; + Trace("dt-enum-debug") << "...fail term enum " << tn << " " << i << std::endl; return Node::null(); } d_terms[tn].push_back( *d_children[tei] ); } - Debug("dt-enum-debug") << "...return term enum " << tn << " " << i << " : " << d_terms[tn][i] << std::endl; + Trace("dt-enum-debug") << "...return term enum " << tn << " " << i << " : " << d_terms[tn][i] << std::endl; ret = d_terms[tn][i]; } return ret; } bool DatatypesEnumerator::increment( unsigned index ){ - Debug("dt-enum") << "Incrementing " << d_type << " " << d_ctor << " at size " << d_sel_sum[index] << "/" << d_size_limit << std::endl; + Trace("dt-enum") << "Incrementing " << d_type << " " << d_ctor << " at size " << d_sel_sum[index] << "/" << d_size_limit << std::endl; if( d_sel_sum[index]==-1 ){ //first time d_sel_sum[index] = 0; //special case: no children to iterate if( index>=d_has_debruijn && d_sel_types[index].empty() ){ - Debug("dt-enum") << "...success (nc) = " << (d_size_limit==0) << std::endl; + Trace("dt-enum") << "...success (nc) = " << (d_size_limit==0) << std::endl; return d_size_limit==0; }else{ - Debug("dt-enum") << "...success" << std::endl; + Trace("dt-enum") << "...success" << std::endl; return true; } }else{ @@ -83,26 +83,26 @@ Node DatatypesEnumerator::getTermEnum( TypeNode tn, unsigned i ){ if( d_sel_sum[index]<(int)d_size_limit ){ //also check if child enumerator has enough terms if( !getTermEnum( d_sel_types[index][i], d_sel_index[index][i]+1 ).isNull() ){ - Debug("dt-enum") << "...success increment child " << i << std::endl; + Trace("dt-enum") << "...success increment child " << i << std::endl; d_sel_index[index][i]++; d_sel_sum[index]++; return true; } } - Debug("dt-enum") << "......failed increment child " << i << std::endl; + Trace("dt-enum") << "......failed increment child " << i << std::endl; //reset child, iterate next d_sel_sum[index] -= d_sel_index[index][i]; d_sel_index[index][i] = 0; i++; } - Debug("dt-enum") << "...failure." << std::endl; + Trace("dt-enum") << "...failure." << std::endl; return false; } } Node DatatypesEnumerator::getCurrentTerm(unsigned index) { - Debug("dt-enum-debug") << "Get current term at " << index << " " << d_type + Trace("dt-enum-debug") << "Get current term at " << index << " " << d_type << std::endl; Node ret; if (index < d_has_debruijn) @@ -120,10 +120,10 @@ Node DatatypesEnumerator::getTermEnum( TypeNode tn, unsigned i ){ } else { - Debug("dt-enum-debug") + Trace("dt-enum-debug") << "Look at constructor " << (index - d_has_debruijn) << std::endl; const DTypeConstructor& ctor = d_datatype[index - d_has_debruijn]; - Debug("dt-enum-debug") << "Check last term..." << std::endl; + Trace("dt-enum-debug") << "Check last term..." << std::endl; // we first check if the last argument (which is forced to make sum of // iterated arguments equal to d_size_limit) is defined Node lc; @@ -135,11 +135,11 @@ Node DatatypesEnumerator::getTermEnum( TypeNode tn, unsigned i ){ d_size_limit - d_sel_sum[index]); if (lc.isNull()) { - Debug("dt-enum-debug") << "Current infeasible." << std::endl; + Trace("dt-enum-debug") << "Current infeasible." << std::endl; return Node::null(); } } - Debug("dt-enum-debug") << "Get constructor..." << std::endl; + Trace("dt-enum-debug") << "Get constructor..." << std::endl; NodeBuilder b(kind::APPLY_CONSTRUCTOR); if (d_datatype.isParametric()) { @@ -149,7 +149,7 @@ Node DatatypesEnumerator::getTermEnum( TypeNode tn, unsigned i ){ { b << ctor.getConstructor(); } - Debug("dt-enum-debug") << "Get arguments..." << std::endl; + Trace("dt-enum-debug") << "Get arguments..." << std::endl; if (ctor.getNumArgs() > 0) { Assert(index < d_sel_types.size()); @@ -165,7 +165,7 @@ Node DatatypesEnumerator::getTermEnum( TypeNode tn, unsigned i ){ b << lc; } Node nnn = Node(b); - Debug("dt-enum-debug") << "Return... " << nnn << std::endl; + Trace("dt-enum-debug") << "Return... " << nnn << std::endl; ret = nnn; } @@ -192,13 +192,13 @@ Node DatatypesEnumerator::getTermEnum( TypeNode tn, unsigned i ){ void DatatypesEnumerator::init() { - Debug("dt-enum") << "datatype is datatype? " << d_type.isDatatype() + Trace("dt-enum") << "datatype is datatype? " << d_type.isDatatype() << std::endl; - Debug("dt-enum") << "datatype is kind " << d_type.getKind() << std::endl; - Debug("dt-enum") << "datatype is " << d_type << std::endl; - Debug("dt-enum") << "properties : " << d_datatype.isCodatatype() << " " + Trace("dt-enum") << "datatype is kind " << d_type.getKind() << std::endl; + Trace("dt-enum") << "datatype is " << d_type << std::endl; + Trace("dt-enum") << "properties : " << d_datatype.isCodatatype() << " " << d_datatype.isRecursiveSingleton(d_type); - Debug("dt-enum") << " " << d_datatype.getCardinalityClass(d_type) + Trace("dt-enum") << " " << d_datatype.getCardinalityClass(d_type) << std::endl; // Start with the ground term constructed via mkGroundValue, which does // a traversal over the structure of the datatype to find a finite term. @@ -225,12 +225,12 @@ Node DatatypesEnumerator::getTermEnum( TypeNode tn, unsigned i ){ else { // find the "zero" term via mkGroundTerm - Debug("dt-enum-debug") << "make ground term..." << std::endl; - Debug("dt-enum-debug") << "done : " << d_zeroTerm << std::endl; + Trace("dt-enum-debug") << "make ground term..." << std::endl; + Trace("dt-enum-debug") << "done : " << d_zeroTerm << std::endl; Assert(d_zeroTerm.getKind() == kind::APPLY_CONSTRUCTOR); d_has_debruijn = 0; } - Debug("dt-enum") << "zero term : " << d_zeroTerm << std::endl; + Trace("dt-enum") << "zero term : " << d_zeroTerm << std::endl; d_ctor = 0; for (unsigned i = 0, ncons = d_datatype.getNumConstructors(); i < ncons; ++i) { @@ -277,7 +277,7 @@ Node DatatypesEnumerator::getTermEnum( TypeNode tn, unsigned i ){ DatatypesEnumerator& DatatypesEnumerator::operator++() { - Debug("dt-enum-debug") << ": increment " << this << std::endl; + Trace("dt-enum-debug") << ": increment " << this << std::endl; if (d_zeroTermActive) { d_zeroTermActive = false; diff --git a/src/theory/datatypes/type_enumerator.h b/src/theory/datatypes/type_enumerator.h index 759c50db0..568fe8087 100644 --- a/src/theory/datatypes/type_enumerator.h +++ b/src/theory/datatypes/type_enumerator.h @@ -141,7 +141,7 @@ class DatatypesEnumerator : public TypeEnumeratorBase { Node operator*() override { - Debug("dt-enum-debug") << ": get term " << this << std::endl; + Trace("dt-enum-debug") << ": get term " << this << std::endl; if (d_zeroTermActive) { return d_zeroTerm; diff --git a/src/theory/fp/theory_fp.cpp b/src/theory/fp/theory_fp.cpp index d5f665d1e..2080b2db7 100644 --- a/src/theory/fp/theory_fp.cpp +++ b/src/theory/fp/theory_fp.cpp @@ -413,9 +413,9 @@ void TheoryFp::wordBlastAndEquateTerm(TNode node) if (wordBlasted != node) { - Debug("fp-wordBlastTerm") + Trace("fp-wordBlastTerm") << "TheoryFp::wordBlastTerm(): before " << node << std::endl; - Debug("fp-wordBlastTerm") + Trace("fp-wordBlastTerm") << "TheoryFp::wordBlastTerm(): after " << wordBlasted << std::endl; } @@ -425,7 +425,7 @@ void TheoryFp::wordBlastAndEquateTerm(TNode node) { Node addA = d_wordBlaster->d_additionalAssertions[oldSize]; - Debug("fp-wordBlastTerm") + Trace("fp-wordBlastTerm") << "TheoryFp::wordBlastTerm(): additional assertion " << addA << std::endl; @@ -784,7 +784,7 @@ bool TheoryFp::collectModelValues(TheoryModel* m, { Trace("fp-collectModelInfo") << "TheoryFp::collectModelInfo(): begin" << std::endl; - if (Trace.isOn("fp-collectModelInfo")) { + if (TraceIsOn("fp-collectModelInfo")) { for (std::set::const_iterator i(relevantTerms.begin()); i != relevantTerms.end(); ++i) { Trace("fp-collectModelInfo") @@ -882,7 +882,7 @@ bool TheoryFp::collectModelValues(TheoryModel* m, bool TheoryFp::NotifyClass::eqNotifyTriggerPredicate(TNode predicate, bool value) { - Debug("fp-eq") + Trace("fp-eq") << "TheoryFp::eqNotifyTriggerPredicate(): call back as predicate " << predicate << " is " << value << std::endl; @@ -894,7 +894,7 @@ bool TheoryFp::NotifyClass::eqNotifyTriggerPredicate(TNode predicate, bool TheoryFp::NotifyClass::eqNotifyTriggerTermEquality(TheoryId tag, TNode t1, TNode t2, bool value) { - Debug("fp-eq") << "TheoryFp::eqNotifyTriggerTermEquality(): call back as " + Trace("fp-eq") << "TheoryFp::eqNotifyTriggerTermEquality(): call back as " << t1 << (value ? " = " : " != ") << t2 << std::endl; if (value) { @@ -904,7 +904,7 @@ bool TheoryFp::NotifyClass::eqNotifyTriggerTermEquality(TheoryId tag, TNode t1, } void TheoryFp::NotifyClass::eqNotifyConstantTermMerge(TNode t1, TNode t2) { - Debug("fp-eq") << "TheoryFp::eqNotifyConstantTermMerge(): call back as " << t1 + Trace("fp-eq") << "TheoryFp::eqNotifyConstantTermMerge(): call back as " << t1 << " = " << t2 << std::endl; d_theorySolver.conflictEqConstantMerge(t1, t2); } diff --git a/src/theory/fp/theory_fp_rewriter.cpp b/src/theory/fp/theory_fp_rewriter.cpp index 655299af9..ff455ff31 100644 --- a/src/theory/fp/theory_fp_rewriter.cpp +++ b/src/theory/fp/theory_fp_rewriter.cpp @@ -1405,8 +1405,8 @@ TheoryFpRewriter::TheoryFpRewriter(context::UserContext* u) : d_fpExpDef(u) RewriteResponse res = d_preRewriteTable[node.getKind()](node, true); if (res.d_node != node) { - Debug("fp-rewrite") << "TheoryFpRewriter::preRewrite(): before " << node << std::endl; - Debug("fp-rewrite") << "TheoryFpRewriter::preRewrite(): after " + Trace("fp-rewrite") << "TheoryFpRewriter::preRewrite(): before " << node << std::endl; + Trace("fp-rewrite") << "TheoryFpRewriter::preRewrite(): after " << res.d_node << std::endl; } return res; @@ -1440,8 +1440,8 @@ TheoryFpRewriter::TheoryFpRewriter(context::UserContext* u) : d_fpExpDef(u) RewriteResponse res = d_postRewriteTable[node.getKind()](node, false); if (res.d_node != node) { - Debug("fp-rewrite") << "TheoryFpRewriter::postRewrite(): before " << node << std::endl; - Debug("fp-rewrite") << "TheoryFpRewriter::postRewrite(): after " + Trace("fp-rewrite") << "TheoryFpRewriter::postRewrite(): before " << node << std::endl; + Trace("fp-rewrite") << "TheoryFpRewriter::postRewrite(): after " << res.d_node << std::endl; } @@ -1538,10 +1538,10 @@ TheoryFpRewriter::TheoryFpRewriter(context::UserContext* u) : d_fpExpDef(u) if (constRes.d_node != res.d_node) { - Debug("fp-rewrite") + Trace("fp-rewrite") << "TheoryFpRewriter::postRewrite(): before constant fold " << res.d_node << std::endl; - Debug("fp-rewrite") + Trace("fp-rewrite") << "TheoryFpRewriter::postRewrite(): after constant fold " << constRes.d_node << std::endl; } diff --git a/src/theory/model_manager.cpp b/src/theory/model_manager.cpp index 8c8d63231..21d6db9f0 100644 --- a/src/theory/model_manager.cpp +++ b/src/theory/model_manager.cpp @@ -94,7 +94,7 @@ bool ModelManager::buildModel() // now, finish building the model d_modelBuiltSuccess = finishBuildModel(); - if (Trace.isOn("model-final")) + if (TraceIsOn("model-final")) { Trace("model-final") << "Final model:" << std::endl; Trace("model-final") << d_model->debugPrintModelEqc() << std::endl; diff --git a/src/theory/quantifiers/candidate_rewrite_database.cpp b/src/theory/quantifiers/candidate_rewrite_database.cpp index 5f129f3fc..62d8e3cf4 100644 --- a/src/theory/quantifiers/candidate_rewrite_database.cpp +++ b/src/theory/quantifiers/candidate_rewrite_database.cpp @@ -231,7 +231,7 @@ Node CandidateRewriteDatabase::addTerm(Node sol, // we count this as printed, despite not literally printing it rew_print = true; // debugging information - if (Trace.isOn("sygus-rr-debug")) + if (TraceIsOn("sygus-rr-debug")) { Trace("sygus-rr-debug") << "; candidate #1 ext-rewrites to: " << solbr << std::endl; diff --git a/src/theory/quantifiers/candidate_rewrite_filter.cpp b/src/theory/quantifiers/candidate_rewrite_filter.cpp index 4f9a46181..973355534 100644 --- a/src/theory/quantifiers/candidate_rewrite_filter.cpp +++ b/src/theory/quantifiers/candidate_rewrite_filter.cpp @@ -165,7 +165,7 @@ bool CandidateRewriteFilter::filterPair(Node n, Node eq_n) { return false; } - if (Trace.isOn("sygus-rr-filter")) + if (TraceIsOn("sygus-rr-filter")) { std::stringstream ss; ss << "(redundant-rewrite "; @@ -231,7 +231,7 @@ bool CandidateRewriteFilter::notify(Node s, n = d_drewrite->toExternal(n); Assert(!n.isNull()); std::map >::iterator it = d_pairs.find(n); - if (Trace.isOn("crf-match")) + if (TraceIsOn("crf-match")) { Trace("crf-match") << " " << s << " matches " << n << " under:" << std::endl; diff --git a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp index a8dbbce67..33a5b4bb6 100644 --- a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp @@ -256,7 +256,7 @@ bool ArithInstantiator::processAssertion(CegInstantiator* ci, uires = is_upper ? CEG_TT_LOWER_STRICT : CEG_TT_UPPER_STRICT; } } - if (Trace.isOn("cegqi-arith-bound-inf")) + if (TraceIsOn("cegqi-arith-bound-inf")) { Node pvmod = pv_prop.getModifiedTerm(pv); Trace("cegqi-arith-bound-inf") << "From " << lit << ", got : "; @@ -352,7 +352,7 @@ bool ArithInstantiator::processAssertions(CegInstantiator* ci, for (unsigned j = 0, nbounds = d_mbp_bounds[rr].size(); j < nbounds; j++) { Node value[3]; - if (Trace.isOn("cegqi-arith-bound")) + if (TraceIsOn("cegqi-arith-bound")) { Assert(!d_mbp_bounds[rr][j].isNull()); Trace("cegqi-arith-bound") @@ -672,7 +672,7 @@ bool ArithInstantiator::postProcessInstantiationForVariable( std::find(sf.d_vars.begin(), sf.d_vars.end(), pv) - sf.d_vars.begin(); Assert(!sf.d_props[index].isBasic()); Node eq_lhs = sf.d_props[index].getModifiedTerm(sf.d_vars[index]); - if (Trace.isOn("cegqi-arith-debug")) + if (TraceIsOn("cegqi-arith-debug")) { Trace("cegqi-arith-debug") << "Normalize substitution for "; Trace("cegqi-arith-debug") @@ -753,7 +753,7 @@ CegTermType ArithInstantiator::solve_arith(CegInstantiator* ci, return CEG_TT_INVALID; } Trace("cegqi-arith-debug") << "got monomial sum: " << std::endl; - if (Trace.isOn("cegqi-arith-debug")) + if (TraceIsOn("cegqi-arith-debug")) { ArithMSum::debugPrintMonomialSum(msum, "cegqi-arith-debug"); } @@ -811,7 +811,7 @@ CegTermType ArithInstantiator::solve_arith(CegInstantiator* ci, Trace("cegqi-arith-debug") << "fail : isolate" << std::endl; return CEG_TT_INVALID; } - if (Trace.isOn("cegqi-arith-debug")) + if (TraceIsOn("cegqi-arith-debug")) { Trace("cegqi-arith-debug") << "Isolate : "; if (!veq_c.isNull()) diff --git a/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp index b5c4a94a0..6dbb1126f 100644 --- a/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp @@ -242,7 +242,7 @@ bool BvInstantiator::processAssertion(CegInstantiator* ci, // this should remove instances of non-invertible operators, and // "linearize" lit with respect to pv as much as possible Node rlit = rewriteAssertionForSolvePv(ci, pv, lit); - if (Trace.isOn("cegqi-bv")) + if (TraceIsOn("cegqi-bv")) { Trace("cegqi-bv") << "BvInstantiator::processAssertion : solve " << pv << " in " << lit << std::endl; @@ -290,7 +290,7 @@ bool BvInstantiator::processAssertions(CegInstantiator* ci, } bool firstVar = sf.empty(); // get inst id list - if (Trace.isOn("cegqi-bv")) + if (TraceIsOn("cegqi-bv")) { Trace("cegqi-bv") << " " << iti->second.size() << " candidate instantiations for " << pv << " : " @@ -308,7 +308,7 @@ bool BvInstantiator::processAssertions(CegInstantiator* ci, // we may find an invertible literal that leads to a useful instantiation. std::shuffle(iti->second.begin(), iti->second.end(), Random::getRandom()); - if (Trace.isOn("cegqi-bv")) + if (TraceIsOn("cegqi-bv")) { for (unsigned j = 0, size = iti->second.size(); j < size; j++) { @@ -506,7 +506,7 @@ Node BvInstantiator::rewriteAssertionForSolvePv(CegInstantiator* ci, Node result = visited.top()[lit]; - if (Trace.isOn("cegqi-bv-nl")) + if (TraceIsOn("cegqi-bv-nl")) { std::vector trace_visit; std::unordered_set trace_visited; diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp index 9cc3269e5..431bca649 100644 --- a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp @@ -932,7 +932,7 @@ bool CegInstantiator::constructInstantiationInc(Node pv, Node cnode = pv_prop.getCacheNode(); if( d_curr_subs_proc[pv][n].find( cnode )==d_curr_subs_proc[pv][n].end() ){ d_curr_subs_proc[pv][n][cnode] = true; - if( Trace.isOn("cegqi-inst-debug") ){ + if( TraceIsOn("cegqi-inst-debug") ){ for( unsigned j=0; j& vars, subs.push_back( n ); } } - if (Trace.isOn("cegqi-inst")) + if (TraceIsOn("cegqi-inst")) { Trace("cegqi-inst") << "Ceg Instantiator produced : " << std::endl; for (unsigned i = 0, size = d_input_vars.size(); i < size; ++i) @@ -1132,7 +1132,7 @@ Node CegInstantiator::applySubstitution( TypeNode tn, Node n, std::vector< Node n = rewrite(n); computeProgVars( n ); bool is_basic = canApplyBasicSubstitution( n, non_basic ); - if( Trace.isOn("sygus-si-apply-subs-debug") ){ + if( TraceIsOn("sygus-si-apply-subs-debug") ){ Trace("sygus-si-apply-subs-debug") << "is_basic = " << is_basic << " " << tn << std::endl; for( unsigned i=0; i " << subs[i] << " types : " << vars[i].getType() << " -> " << subs[i].getType() << std::endl; diff --git a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp index dd68d2de0..d54c8c866 100644 --- a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp +++ b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.cpp @@ -110,7 +110,7 @@ bool InstStrategyCegqi::registerCbqiLemma(Node q) Node lem = NodeManager::currentNM()->mkNode( OR, ceLit.negate(), ceBody.negate() ); //require any decision on cel to be phase=true d_qim.addPendingPhaseRequirement(ceLit, true); - Debug("cegqi-debug") << "Require phase " << ceLit << " = true." << std::endl; + Trace("cegqi-debug") << "Require phase " << ceLit << " = true." << std::endl; //add counterexample lemma lem = rewrite(lem); Trace("cegqi-lemma") << "Counterexample lemma : " << lem << std::endl; @@ -200,12 +200,12 @@ void InstStrategyCegqi::reset_round(Theory::Effort effort) if (fm->isQuantifierActive(q)) { d_active_quant[q] = true; - Debug("cegqi-debug") << "Check quantified formula " << q << "..." << std::endl; + Trace("cegqi-debug") << "Check quantified formula " << q << "..." << std::endl; Node cel = getCounterexampleLiteral(q); bool value; if (d_qstate.getValuation().hasSatValue(cel, value)) { - Debug("cegqi-debug") << "...CE Literal has value " << value << std::endl; + Trace("cegqi-debug") << "...CE Literal has value " << value << std::endl; if( !value ){ if (d_qstate.getValuation().isDecision(cel)) { @@ -218,7 +218,7 @@ void InstStrategyCegqi::reset_round(Theory::Effort effort) } } }else{ - Debug("cegqi-debug") << "...CE Literal does not have value " << std::endl; + Trace("cegqi-debug") << "...CE Literal does not have value " << std::endl; } } } @@ -260,7 +260,7 @@ void InstStrategyCegqi::check(Theory::Effort e, QEffort quant_e) { Assert(!d_qstate.isInConflict()); double clSet = 0; - if( Trace.isOn("cegqi-engine") ){ + if( TraceIsOn("cegqi-engine") ){ clSet = double(clock())/double(CLOCKS_PER_SEC); Trace("cegqi-engine") << "---Cbqi Engine Round, effort = " << e << "---" << std::endl; } @@ -283,7 +283,7 @@ void InstStrategyCegqi::check(Theory::Effort e, QEffort quant_e) break; } } - if( Trace.isOn("cegqi-engine") ){ + if( TraceIsOn("cegqi-engine") ){ if (d_qim.numPendingLemmas() > lastWaiting) { Trace("cegqi-engine") diff --git a/src/theory/quantifiers/cegqi/vts_term_cache.cpp b/src/theory/quantifiers/cegqi/vts_term_cache.cpp index 058b6a8bf..726eb74f3 100644 --- a/src/theory/quantifiers/cegqi/vts_term_cache.cpp +++ b/src/theory/quantifiers/cegqi/vts_term_cache.cpp @@ -177,7 +177,7 @@ Node VtsTermCache::rewriteVtsSymbols(Node n) std::map msum; if (ArithMSum::getMonomialSumLit(n, msum)) { - if (Trace.isOn("quant-vts-debug")) + if (TraceIsOn("quant-vts-debug")) { Trace("quant-vts-debug") << "VTS got monomial sum : " << std::endl; ArithMSum::debugPrintMonomialSum(msum, "quant-vts-debug"); diff --git a/src/theory/quantifiers/conjecture_generator.cpp b/src/theory/quantifiers/conjecture_generator.cpp index 7f2ddd35d..9e38ed3ec 100644 --- a/src/theory/quantifiers/conjecture_generator.cpp +++ b/src/theory/quantifiers/conjecture_generator.cpp @@ -376,7 +376,7 @@ void ConjectureGenerator::check(Theory::Effort e, QEffort quant_e) d_hasAddedLemma = false; d_tge.d_cg = this; double clSet = 0; - if( Trace.isOn("sg-engine") ){ + if( TraceIsOn("sg-engine") ){ clSet = double(clock())/double(CLOCKS_PER_SEC); Trace("sg-engine") << "---Conjecture Engine Round, effort = " << e << "---" << std::endl; } @@ -467,7 +467,7 @@ void ConjectureGenerator::check(Theory::Effort e, QEffort quant_e) Trace("sg-proc") << "...done determine ground EQC" << std::endl; //debug printing - if( Trace.isOn("sg-gen-eqc") ){ + if( TraceIsOn("sg-gen-eqc") ){ for( unsigned i=0; i::iterator it = subs.begin(); it != subs.end(); ++it ){ Assert(getRepresentative(it->second) == it->second); @@ -1460,7 +1460,7 @@ void TermGenerator::reset( TermGenEnv * s, TypeNode tn ) { } bool TermGenerator::getNextTerm( TermGenEnv * s, unsigned depth ) { - if( Trace.isOn("sg-gen-tg-debug2") ){ + if( TraceIsOn("sg-gen-tg-debug2") ){ Trace("sg-gen-tg-debug2") << this << " getNextTerm depth " << depth << " : status = " << d_status << ", num = " << d_status_num; if( d_status==5 ){ TNode f = s->getTgFunc( d_typ, d_status_num ); @@ -1605,7 +1605,7 @@ bool TermGenerator::getNextMatch( TermGenEnv * s, TNode eqc, std::map< TypeNode, if( d_match_status<0 ){ return false; } - if( Trace.isOn("sg-gen-tg-match") ){ + if( TraceIsOn("sg-gen-tg-match") ){ Trace("sg-gen-tg-match") << "Matching "; debugPrint( s, "sg-gen-tg-match", "sg-gen-tg-match" ); Trace("sg-gen-tg-match") << " with eqc e" << s->d_cg->d_em[eqc] << "..." << std::endl; diff --git a/src/theory/quantifiers/ematching/candidate_generator.cpp b/src/theory/quantifiers/ematching/candidate_generator.cpp index f32655eb2..7575b11b9 100644 --- a/src/theory/quantifiers/ematching/candidate_generator.cpp +++ b/src/theory/quantifiers/ematching/candidate_generator.cpp @@ -110,7 +110,7 @@ Node CandidateGeneratorQE::getNextCandidateInternal() d_mode = cand_term_none; return Node::null(); } - Debug("cand-gen-qe") << "...get next candidate in tbd" << std::endl; + Trace("cand-gen-qe") << "...get next candidate in tbd" << std::endl; //get next candidate term in the uf term database size_t tlLimit = d_termIterList->d_list.size(); while (d_termIter < tlLimit) @@ -125,7 +125,7 @@ Node CandidateGeneratorQE::getNextCandidateInternal() }else{ Node r = d_qs.getRepresentative(n); if( d_exclude_eqc.find( r )==d_exclude_eqc.end() ){ - Debug("cand-gen-qe") << "...returning " << n << std::endl; + Trace("cand-gen-qe") << "...returning " << n << std::endl; return n; } } @@ -133,17 +133,17 @@ Node CandidateGeneratorQE::getNextCandidateInternal() } } }else if( d_mode==cand_term_eqc ){ - Debug("cand-gen-qe") << "...get next candidate in eqc" << std::endl; + Trace("cand-gen-qe") << "...get next candidate in eqc" << std::endl; while( !d_eqc_iter.isFinished() ){ Node n = *d_eqc_iter; ++d_eqc_iter; if( isLegalOpCandidate( n ) ){ - Debug("cand-gen-qe") << "...returning " << n << std::endl; + Trace("cand-gen-qe") << "...returning " << n << std::endl; return n; } } }else if( d_mode==cand_term_ident ){ - Debug("cand-gen-qe") << "...get next candidate identity" << std::endl; + Trace("cand-gen-qe") << "...get next candidate identity" << std::endl; if (!d_eqc.isNull()) { Node n = d_eqc; diff --git a/src/theory/quantifiers/ematching/ho_trigger.cpp b/src/theory/quantifiers/ematching/ho_trigger.cpp index f6d245fd9..9e845827f 100644 --- a/src/theory/quantifiers/ematching/ho_trigger.cpp +++ b/src/theory/quantifiers/ematching/ho_trigger.cpp @@ -53,7 +53,7 @@ HigherOrderTrigger::HigherOrderTrigger( d_ho_var_list.push_back(n); TypeNode tn = n.getType(); Assert(tn.isFunction()); - if (Trace.isOn("ho-quant-trigger")) + if (TraceIsOn("ho-quant-trigger")) { Trace("ho-quant-trigger") << " have " << as.second.size(); Trace("ho-quant-trigger") << " patterns with variable operator " << n @@ -300,7 +300,7 @@ bool HigherOrderTrigger::sendInstantiation(std::vector& m, InferenceId id) } } } - if (Trace.isOn("ho-unif-debug")) + if (TraceIsOn("ho-unif-debug")) { for (std::map::iterator itf = fixed_vals.begin(); itf != fixed_vals.end(); diff --git a/src/theory/quantifiers/ematching/inst_match_generator_multi.cpp b/src/theory/quantifiers/ematching/inst_match_generator_multi.cpp index 10d296db0..6281f0974 100644 --- a/src/theory/quantifiers/ematching/inst_match_generator_multi.cpp +++ b/src/theory/quantifiers/ematching/inst_match_generator_multi.cpp @@ -101,7 +101,7 @@ InstMatchGeneratorMulti::InstMatchGeneratorMulti(Env& env, index = index == 0 ? patsSize - 1 : (index - 1); } vars.insert(vars.end(), unique_vars.begin(), unique_vars.end()); - if (Trace.isOn("multi-trigger-cache")) + if (TraceIsOn("multi-trigger-cache")) { Trace("multi-trigger-cache") << " Index[" << i << "]: "; for (uint64_t v : vars) diff --git a/src/theory/quantifiers/ematching/inst_match_generator_simple.cpp b/src/theory/quantifiers/ematching/inst_match_generator_simple.cpp index 82cb4a840..c1b7f58c1 100644 --- a/src/theory/quantifiers/ematching/inst_match_generator_simple.cpp +++ b/src/theory/quantifiers/ematching/inst_match_generator_simple.cpp @@ -110,7 +110,7 @@ uint64_t InstMatchGeneratorSimple::addInstantiations(Node q) tat = nullptr; } } - Debug("simple-trigger-debug") + Trace("simple-trigger-debug") << "Adding instantiations based on " << tat << " from " << d_op << " " << d_eqc << std::endl; if (tat && !d_qstate.isInConflict()) @@ -126,20 +126,20 @@ void InstMatchGeneratorSimple::addInstantiations(InstMatch& m, size_t argIndex, TNodeTrie* tat) { - Debug("simple-trigger-debug") + Trace("simple-trigger-debug") << "Add inst " << argIndex << " " << d_match_pattern << std::endl; if (argIndex == d_match_pattern.getNumChildren()) { Assert(!tat->d_data.empty()); TNode t = tat->getData(); - Debug("simple-trigger") << "Actual term is " << t << std::endl; + Trace("simple-trigger") << "Actual term is " << t << std::endl; // convert to actual used terms for (const auto& v : d_var_num) { if (v.second >= 0) { Assert(v.first < t.getNumChildren()); - Debug("simple-trigger") + Trace("simple-trigger") << "...set " << v.second << " " << t[v.first] << std::endl; m.setValue(v.second, t[v.first]); } @@ -149,7 +149,7 @@ void InstMatchGeneratorSimple::addInstantiations(InstMatch& m, if (sendInstantiation(m, InferenceId::QUANTIFIERS_INST_E_MATCHING_SIMPLE)) { addedLemmas++; - Debug("simple-trigger") << "-> Produced instantiation " << m << std::endl; + Trace("simple-trigger") << "-> Produced instantiation " << m << std::endl; } return; } diff --git a/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp b/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp index f1d80032b..8d88389b1 100644 --- a/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp +++ b/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp @@ -280,14 +280,14 @@ void InstStrategyAutoGenTriggers::generateTriggers( Node f ){ // sort based on # occurrences (this will cause Trigger to select rarer // symbols) std::sort(patTerms.begin(), patTerms.end(), sqfs); - if (Debug.isOn("relevant-trigger")) + if (TraceIsOn("relevant-trigger")) { - Debug("relevant-trigger") << "Terms based on relevance: " << std::endl; + Trace("relevant-trigger") << "Terms based on relevance: " << std::endl; for (const Node& p : patTerms) { - Debug("relevant-trigger") + Trace("relevant-trigger") << " " << p << " from " << d_pat_to_mpat[p] << " ("; - Debug("relevant-trigger") << d_quant_rel->getNumQuantifiersForSymbol( + Trace("relevant-trigger") << d_quant_rel->getNumQuantifiersForSymbol( d_pat_to_mpat[p].getOperator()) << ")" << std::endl; } @@ -421,7 +421,7 @@ bool InstStrategyAutoGenTriggers::generatePatternTerms(Node f) sortTriggers st; std::sort(patTermsF.begin(), patTermsF.end(), st); } - if (Trace.isOn("auto-gen-trigger-debug")) + if (TraceIsOn("auto-gen-trigger-debug")) { Trace("auto-gen-trigger-debug") << "Collected pat terms for " << bd @@ -587,7 +587,7 @@ bool InstStrategyAutoGenTriggers::generatePatternTerms(Node f) } // tinfo not used below this point d_made_multi_trigger[f] = false; - if (Trace.isOn("auto-gen-trigger")) + if (TraceIsOn("auto-gen-trigger")) { Trace("auto-gen-trigger") << "Single trigger pool for " << f << " : " << std::endl; diff --git a/src/theory/quantifiers/ematching/inst_strategy_e_matching_user.cpp b/src/theory/quantifiers/ematching/inst_strategy_e_matching_user.cpp index cdda020eb..7d347152d 100644 --- a/src/theory/quantifiers/ematching/inst_strategy_e_matching_user.cpp +++ b/src/theory/quantifiers/ematching/inst_strategy_e_matching_user.cpp @@ -122,7 +122,7 @@ InstStrategyStatus InstStrategyUserPatterns::process(Node q, std::vector& ug = d_user_gen[q]; for (Trigger* t : ug) { - if (Trace.isOn("process-trigger")) + if (TraceIsOn("process-trigger")) { Trace("process-trigger") << " Process (user) "; t->debugPrint("process-trigger"); diff --git a/src/theory/quantifiers/ematching/instantiation_engine.cpp b/src/theory/quantifiers/ematching/instantiation_engine.cpp index 5506f9e1d..0fd49a95a 100644 --- a/src/theory/quantifiers/ematching/instantiation_engine.cpp +++ b/src/theory/quantifiers/ematching/instantiation_engine.cpp @@ -83,12 +83,12 @@ void InstantiationEngine::doInstantiationRound( Theory::Effort effort ){ bool finished = false; //while unfinished, try effort level=0,1,2.... while( !finished && e<=eLimit ){ - Debug("inst-engine") << "IE: Prepare instantiation (" << e << ")." << std::endl; + Trace("inst-engine") << "IE: Prepare instantiation (" << e << ")." << std::endl; finished = true; //instantiate each quantifier for( unsigned i=0; igetRelevance( q )==-1 ? e - 1 : e; int e_use = e; if( e_use>=0 ){ @@ -143,7 +143,7 @@ void InstantiationEngine::check(Theory::Effort e, QEffort quant_e) return; } double clSet = 0; - if (Trace.isOn("inst-engine")) + if (TraceIsOn("inst-engine")) { clSet = double(clock()) / double(CLOCKS_PER_SEC); Trace("inst-engine") << "---Instantiation Engine Round, effort = " << e @@ -188,7 +188,7 @@ void InstantiationEngine::check(Theory::Effort e, QEffort quant_e) { d_quants.clear(); } - if (Trace.isOn("inst-engine")) + if (TraceIsOn("inst-engine")) { double clSet2 = double(clock()) / double(CLOCKS_PER_SEC); Trace("inst-engine") << "Finished instantiation engine, time = " diff --git a/src/theory/quantifiers/ematching/pattern_term_selector.cpp b/src/theory/quantifiers/ematching/pattern_term_selector.cpp index 405f1fd69..8a5956a58 100644 --- a/src/theory/quantifiers/ematching/pattern_term_selector.cpp +++ b/src/theory/quantifiers/ematching/pattern_term_selector.cpp @@ -415,7 +415,7 @@ void PatternTermSelector::collectInternal( std::vector temp; temp.insert(temp.begin(), patTerms2.begin(), patTerms2.end()); filterInstances(temp); - if (Trace.isOn("trigger-filter-instance")) + if (TraceIsOn("trigger-filter-instance")) { if (temp.size() != patTerms2.size()) { diff --git a/src/theory/quantifiers/ematching/trigger.cpp b/src/theory/quantifiers/ematching/trigger.cpp index 1a7946564..0b736ff34 100644 --- a/src/theory/quantifiers/ematching/trigger.cpp +++ b/src/theory/quantifiers/ematching/trigger.cpp @@ -60,7 +60,7 @@ Trigger::Trigger(Env& env, Node np = ensureGroundTermPreprocessed(val, n, d_groundTerms); d_nodes.push_back(np); } - if (Trace.isOn("trigger")) + if (TraceIsOn("trigger")) { QuantAttributes& qa = d_qreg.getQuantAttributes(); Trace("trigger") << "Trigger for " << qa.quantToString(q) << ": " @@ -104,7 +104,7 @@ Trigger::Trigger(Env& env, d_mg = InstMatchGenerator::mkInstMatchGeneratorMulti(env, this, q, d_nodes); } - if (Trace.isOn("multi-trigger")) + if (TraceIsOn("multi-trigger")) { Trace("multi-trigger") << "Trigger for " << q << ": " << std::endl; for (const Node& nc : d_nodes) @@ -156,11 +156,11 @@ uint64_t Trigger::addInstantiations() } } uint64_t addedLemmas = d_mg->addInstantiations(d_quant); - if (Debug.isOn("inst-trigger")) + if (TraceIsOn("inst-trigger")) { if (addedLemmas > 0) { - Debug("inst-trigger") << "Added " << addedLemmas + Trace("inst-trigger") << "Added " << addedLemmas << " lemmas, trigger was " << d_nodes << std::endl; } } diff --git a/src/theory/quantifiers/equality_query.cpp b/src/theory/quantifiers/equality_query.cpp index 2c5dd73d1..d09b90b6b 100644 --- a/src/theory/quantifiers/equality_query.cpp +++ b/src/theory/quantifiers/equality_query.cpp @@ -129,7 +129,7 @@ Node EqualityQuery::getInternalRepresentative(Node a, Node q, size_t index) << " and type " << r_best.getType() << std::endl; Assert(r_best.getType().isSubtypeOf(v_tn)); v_int_rep[r] = r_best; - if (Trace.isOn("internal-rep-debug")) + if (TraceIsOn("internal-rep-debug")) { if (r_best != a) { diff --git a/src/theory/quantifiers/extended_rewrite.cpp b/src/theory/quantifiers/extended_rewrite.cpp index 1152267e8..7f78eb7c7 100644 --- a/src/theory/quantifiers/extended_rewrite.cpp +++ b/src/theory/quantifiers/extended_rewrite.cpp @@ -273,7 +273,7 @@ Node ExtendedRewriter::extendedRewrite(Node n) const } Trace("q-ext-rewrite-debug") << "...ext-rewrite : " << n << " -> " << ret << std::endl; - if (Trace.isOn("q-ext-rewrite-nf")) + if (TraceIsOn("q-ext-rewrite-nf")) { if (n == ret) { @@ -1334,7 +1334,7 @@ Node ExtendedRewriter::extendedRewriteEqChain( // check subsumptions // sort by #atoms std::sort(atom_count.begin(), atom_count.end(), sortPairSecond); - if (Trace.isOn("ext-rew-eqchain")) + if (TraceIsOn("ext-rew-eqchain")) { for (const std::pair& ac : atom_count) { @@ -1755,7 +1755,7 @@ void ExtendedRewriter::debugExtendedRewrite(Node n, Node ret, const char* c) const { - if (Trace.isOn("q-ext-rewrite")) + if (TraceIsOn("q-ext-rewrite")) { if (!ret.isNull()) { diff --git a/src/theory/quantifiers/fmf/bounded_integers.cpp b/src/theory/quantifiers/fmf/bounded_integers.cpp index 330308946..9baecf24f 100644 --- a/src/theory/quantifiers/fmf/bounded_integers.cpp +++ b/src/theory/quantifiers/fmf/bounded_integers.cpp @@ -450,7 +450,7 @@ void BoundedIntegers::checkOwnership(Node f) } }while( success ); - if( Trace.isOn("bound-int") ){ + if( TraceIsOn("bound-int") ){ Trace("bound-int") << "Bounds are : " << std::endl; for( unsigned i=0; i & inst, int index ) { - Debug("fmc-entry-trie") << "Get generalization index " << inst.size() << " " << index << std::endl; + Trace("fmc-entry-trie") << "Get generalization index " << inst.size() << " " << index << std::endl; if (index==(int)inst.size()) { return d_data; }else{ @@ -375,7 +375,7 @@ bool FullModelChecker::processBuildModel(TheoryModel* m){ Trace("fmc") << "Cardinality( " << it->first << " )" << " = " << it->second.size() << std::endl; for( size_t a=0; asecond.size(); a++ ){ Node r = m->getRepresentative(it->second[a]); - if( Trace.isOn("fmc-model-debug") ){ + if( TraceIsOn("fmc-model-debug") ){ std::vector< Node > eqc; d_qstate.getEquivalenceClass(r, eqc); Trace("fmc-model-debug") << " " << (it->second[a]==r); @@ -697,7 +697,7 @@ int FullModelChecker::doExhaustiveInstantiation( FirstOrderModel * fm, Node f, i else { // for debugging - if (Trace.isOn("fmc-test-inst")) + if (TraceIsOn("fmc-test-inst")) { Node ev = d_quant_models[f].evaluate(fmfmc, inst); if (ev == d_true) @@ -767,7 +767,7 @@ int FullModelChecker::doExhaustiveInstantiation( FirstOrderModel * fm, Node f, i std::vector& mcond = d_quant_models[f].d_cond; if (!d_star_insts[f].empty()) { - if (Trace.isOn("fmc-exh")) + if (TraceIsOn("fmc-exh")) { Trace("fmc-exh") << "Exhaustive instantiate " << f << std::endl; Trace("fmc-exh") << "Definition was : " << std::endl; diff --git a/src/theory/quantifiers/fmf/model_builder.cpp b/src/theory/quantifiers/fmf/model_builder.cpp index 306c0c7ea..0c9bd213b 100644 --- a/src/theory/quantifiers/fmf/model_builder.cpp +++ b/src/theory/quantifiers/fmf/model_builder.cpp @@ -107,7 +107,7 @@ bool QModelBuilder::preProcessBuildModelStd(TheoryModel* m) { void QModelBuilder::debugModel( TheoryModel* m ){ //debug the model: cycle through all instantiations for all quantifiers, report ones that are not true - if( Trace.isOn("quant-check-model") ){ + if( TraceIsOn("quant-check-model") ){ FirstOrderModel* fm = d_model; Trace("quant-check-model") << "Testing quantifier instantiations..." << std::endl; int tests = 0; diff --git a/src/theory/quantifiers/fmf/model_engine.cpp b/src/theory/quantifiers/fmf/model_engine.cpp index 6e1fb9cc9..89677bb5e 100644 --- a/src/theory/quantifiers/fmf/model_engine.cpp +++ b/src/theory/quantifiers/fmf/model_engine.cpp @@ -87,14 +87,14 @@ void ModelEngine::check(Theory::Effort e, QEffort quant_e) //the following will test that the model satisfies all asserted universal quantifiers by // (model-based) exhaustive instantiation. double clSet = 0; - if( Trace.isOn("model-engine") ){ + if( TraceIsOn("model-engine") ){ Trace("model-engine") << "---Model Engine Round---" << std::endl; clSet = double(clock())/double(CLOCKS_PER_SEC); } Trace("model-engine-debug") << "Check model..." << std::endl; d_incomplete_check = false; // print debug - if (Trace.isOn("fmf-model-complete")) + if (TraceIsOn("fmf-model-complete")) { Trace("fmf-model-complete") << std::endl; debugPrint("fmf-model-complete"); @@ -102,7 +102,7 @@ void ModelEngine::check(Theory::Effort e, QEffort quant_e) // successfully built an acceptable model, now check it addedLemmas += checkModel(); - if( Trace.isOn("model-engine") ){ + if( TraceIsOn("model-engine") ){ double clSet2 = double(clock())/double(CLOCKS_PER_SEC); Trace("model-engine") << "Finished model engine, time = " << (clSet2-clSet) << std::endl; } @@ -112,7 +112,7 @@ void ModelEngine::check(Theory::Effort e, QEffort quant_e) << "No lemmas added, incomplete = " << (d_incomplete_check || !d_incompleteQuants.empty()) << std::endl; // cvc5 will answer SAT or unknown - if( Trace.isOn("fmf-consistent") ){ + if( TraceIsOn("fmf-consistent") ){ Trace("fmf-consistent") << std::endl; debugPrint("fmf-consistent"); } @@ -135,7 +135,7 @@ bool ModelEngine::checkCompleteFor( Node q ) { } void ModelEngine::registerQuantifier( Node f ){ - if( Trace.isOn("fmf-warn") ){ + if( TraceIsOn("fmf-warn") ){ bool canHandle = true; for( unsigned i=0; igetNumAssertedQuantifiers(); i++ ){ Node f = fm->getAssertedQuantifier( i ); if (fm->isQuantifierActive(f) && shouldProcess(f)) @@ -281,7 +281,7 @@ void ModelEngine::exhaustiveInstantiate( Node f, int effort ){ d_triedLemmas += d_builder->getNumTriedLemmas() - prev_tlem; d_addedLemmas += d_builder->getNumAddedLemmas() - prev_alem; }else{ - if( Trace.isOn("fmf-exh-inst-debug") ){ + if( TraceIsOn("fmf-exh-inst-debug") ){ Trace("fmf-exh-inst-debug") << " Instantiation Constants: "; for( size_t i=0; iaddInstantiation(f, @@ -324,7 +324,7 @@ void ModelEngine::exhaustiveInstantiate( Node f, int effort ){ break; } }else{ - Debug("fmf-model-eval") << "* Failed Add instantiation " << m << std::endl; + Trace("fmf-model-eval") << "* Failed Add instantiation " << m << std::endl; } riter.increment(); } @@ -342,7 +342,7 @@ void ModelEngine::exhaustiveInstantiate( Node f, int effort ){ } void ModelEngine::debugPrint( const char* c ){ - if (Trace.isOn(c)) + if (TraceIsOn(c)) { Trace(c) << "Quantifiers: " << std::endl; FirstOrderModel* m = d_treg.getModel(); diff --git a/src/theory/quantifiers/fun_def_evaluator.cpp b/src/theory/quantifiers/fun_def_evaluator.cpp index 27c11cca5..8194aa6d1 100644 --- a/src/theory/quantifiers/fun_def_evaluator.cpp +++ b/src/theory/quantifiers/fun_def_evaluator.cpp @@ -186,7 +186,7 @@ Node FunDefEvaluator::evaluateDefinitions(Node n) const { // invoke it on arguments using the evaluator sbody = evaluate(sbody, args, children); - if (Trace.isOn("fd-eval-debug2")) + if (TraceIsOn("fd-eval-debug2")) { Trace("fd-eval-debug2") << "FunDefEvaluator: evaluation with args:\n"; diff --git a/src/theory/quantifiers/inst_match.cpp b/src/theory/quantifiers/inst_match.cpp index f7cd39067..cdaab231c 100644 --- a/src/theory/quantifiers/inst_match.cpp +++ b/src/theory/quantifiers/inst_match.cpp @@ -47,7 +47,7 @@ void InstMatch::debugPrint( const char* c ){ for (unsigned i = 0, size = d_vals.size(); i < size; i++) { if( !d_vals[i].isNull() ){ - Debug( c ) << " " << i << " -> " << d_vals[i] << std::endl; + Trace( c ) << " " << i << " -> " << d_vals[i] << std::endl; } } } diff --git a/src/theory/quantifiers/inst_strategy_enumerative.cpp b/src/theory/quantifiers/inst_strategy_enumerative.cpp index ce671902c..7356bbdf8 100644 --- a/src/theory/quantifiers/inst_strategy_enumerative.cpp +++ b/src/theory/quantifiers/inst_strategy_enumerative.cpp @@ -93,7 +93,7 @@ void InstStrategyEnum::check(Theory::Effort e, QEffort quant_e) } Assert(!d_qstate.isInConflict()); double clSet = 0; - if (Trace.isOn("enum-engine")) + if (TraceIsOn("enum-engine")) { clSet = double(clock()) / double(CLOCKS_PER_SEC); Trace("enum-engine") << "---Full Saturation Round, effort = " << e << "---" @@ -160,7 +160,7 @@ void InstStrategyEnum::check(Theory::Effort e, QEffort quant_e) } } } - if (Trace.isOn("enum-engine")) + if (TraceIsOn("enum-engine")) { Trace("enum-engine") << "Added lemmas = " << addedLemmas << std::endl; double clSet2 = double(clock()) / double(CLOCKS_PER_SEC); diff --git a/src/theory/quantifiers/inst_strategy_pool.cpp b/src/theory/quantifiers/inst_strategy_pool.cpp index 2a13b13ff..65d63c6d1 100644 --- a/src/theory/quantifiers/inst_strategy_pool.cpp +++ b/src/theory/quantifiers/inst_strategy_pool.cpp @@ -72,7 +72,7 @@ void InstStrategyPool::check(Theory::Effort e, QEffort quant_e) return; } double clSet = 0; - if (Trace.isOn("pool-engine")) + if (TraceIsOn("pool-engine")) { clSet = double(clock()) / double(CLOCKS_PER_SEC); Trace("pool-engine") << "---Pool instantiation, effort = " << e << "---" @@ -111,7 +111,7 @@ void InstStrategyPool::check(Theory::Effort e, QEffort quant_e) break; } } - if (Trace.isOn("pool-engine")) + if (TraceIsOn("pool-engine")) { Trace("pool-engine") << "Added lemmas = " << addedLemmas << std::endl; double clSet2 = double(clock()) / double(CLOCKS_PER_SEC); diff --git a/src/theory/quantifiers/instantiate.cpp b/src/theory/quantifiers/instantiate.cpp index 1af2b3f75..21b647c36 100644 --- a/src/theory/quantifiers/instantiate.cpp +++ b/src/theory/quantifiers/instantiate.cpp @@ -345,15 +345,15 @@ bool Instantiate::addInstantiation(Node q, ill->d_list.push_back(body); // add to temporary debug statistics (# inst on this round) d_instDebugTemp[q]++; - if (Trace.isOn("inst")) + if (TraceIsOn("inst")) { Trace("inst") << "*** Instantiate " << q << " with " << std::endl; for (unsigned i = 0, size = terms.size(); i < size; i++) { - if (Trace.isOn("inst")) + if (TraceIsOn("inst")) { Trace("inst") << " " << terms[i]; - if (Trace.isOn("inst-debug")) + if (TraceIsOn("inst-debug")) { Trace("inst-debug") << ", type=" << terms[i].getType() << ", var_type=" << q[0][i].getType(); @@ -477,7 +477,7 @@ bool Instantiate::addInstantiationExpFail(Node q, } } } - if (Trace.isOn("inst-exp-fail")) + if (TraceIsOn("inst-exp-fail")) { Trace("inst-exp-fail") << "Fail mask: "; for (bool b : failMask) @@ -698,7 +698,7 @@ bool Instantiate::isProofEnabled() const void Instantiate::notifyEndRound() { // debug information - if (Trace.isOn("inst-per-quant-round")) + if (TraceIsOn("inst-per-quant-round")) { for (std::pair& i : d_instDebugTemp) { @@ -724,7 +724,7 @@ void Instantiate::notifyEndRound() void Instantiate::debugPrintModel() { - if (Trace.isOn("inst-per-quant")) + if (TraceIsOn("inst-per-quant")) { for (NodeInstListMap::iterator it = d_insts.begin(); it != d_insts.end(); ++it) diff --git a/src/theory/quantifiers/lazy_trie.cpp b/src/theory/quantifiers/lazy_trie.cpp index 7a0b650fb..7ae055bc1 100644 --- a/src/theory/quantifiers/lazy_trie.cpp +++ b/src/theory/quantifiers/lazy_trie.cpp @@ -91,7 +91,7 @@ void LazyTrieMulti::addClassifier(LazyTrieEvaluator* ev, unsigned ntotal) // apply new classifier Assert(d_rep_to_class.find(trie->d_lazy_child) != d_rep_to_class.end()); std::vector prev_sep_class = d_rep_to_class[trie->d_lazy_child]; - if (Trace.isOn("lazy-trie-multi")) + if (TraceIsOn("lazy-trie-multi")) { Trace("lazy-trie-multi") << "...last level. Prev sep class: \n"; for (const Node& n : prev_sep_class) diff --git a/src/theory/quantifiers/quant_conflict_find.cpp b/src/theory/quantifiers/quant_conflict_find.cpp index f24a1d646..dc5c89791 100644 --- a/src/theory/quantifiers/quant_conflict_find.cpp +++ b/src/theory/quantifiers/quant_conflict_find.cpp @@ -358,7 +358,7 @@ bool QuantInfo::getCurrentCanBeEqual(size_t v, TNode n, bool chDiseq) for (std::pair& dd : itd->second) { Node cv = getCurrentValue(dd.first); - Debug("qcf-ccbe") << "compare " << cv << " " << n << std::endl; + Trace("qcf-ccbe") << "compare " << cv << " " << n << std::endl; if (cv == n) { return false; @@ -394,8 +394,8 @@ int QuantInfo::addConstraint( { Assert(v < d_match.size()); //for handling equalities between variables, and disequalities involving variables - Debug("qcf-match-debug") << "- " << (doRemove ? "un" : "" ) << "constrain : " << v << " -> " << n << " (cv=" << getCurrentValue( n ) << ")"; - Debug("qcf-match-debug") << ", (vn=" << vn << "), polarity = " << polarity << std::endl; + Trace("qcf-match-debug") << "- " << (doRemove ? "un" : "" ) << "constrain : " << v << " -> " << n << " (cv=" << getCurrentValue( n ) << ")"; + Trace("qcf-match-debug") << ", (vn=" << vn << "), polarity = " << polarity << std::endl; Assert(doRemove || n == getCurrentValue(n)); Assert(doRemove || v == getCurrentRepVar(v)); Assert(doRemove || (vn == -1 && getVarNum(n) == -1) @@ -438,7 +438,7 @@ int QuantInfo::addConstraint( bool isGroundRep = false; bool isGround = false; if( vn!=-1 ){ - Debug("qcf-match-debug") << " ...Variable bound to variable" << std::endl; + Trace("qcf-match-debug") << " ...Variable bound to variable" << std::endl; if( d_match[v].isNull() ){ //setting variables equal bool alreadySet = false; @@ -463,7 +463,7 @@ int QuantInfo::addConstraint( } else if (d_match[vn] == dv) { - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " -> fail, conflicting disequality" << std::endl; return -1; } @@ -474,47 +474,47 @@ int QuantInfo::addConstraint( } }else{ if( d_match[vn].isNull() ){ - Debug("qcf-match-debug") << " ...Reverse direction" << std::endl; + Trace("qcf-match-debug") << " ...Reverse direction" << std::endl; //set the opposite direction return addConstraint(vn, d_vars[v], v, true, false); }else{ - Debug("qcf-match-debug") << " -> Both variables bound, compare" << std::endl; + Trace("qcf-match-debug") << " -> Both variables bound, compare" << std::endl; //are they currently equal return d_match[v] == d_match[vn] ? 0 : -1; } } }else{ - Debug("qcf-match-debug") << " ...Variable bound to ground" << std::endl; + Trace("qcf-match-debug") << " ...Variable bound to ground" << std::endl; if( d_match[v].isNull() ){ //isGroundRep = true; ?? isGround = true; }else{ //compare ground values - Debug("qcf-match-debug") << " -> Ground value, compare " << d_match[v] << " "<< n << std::endl; + Trace("qcf-match-debug") << " -> Ground value, compare " << d_match[v] << " "<< n << std::endl; return d_match[v] == n ? 0 : -1; } } if (setMatch(v, n, isGroundRep, isGround)) { - Debug("qcf-match-debug") << " -> success" << std::endl; + Trace("qcf-match-debug") << " -> success" << std::endl; return 1; } else { - Debug("qcf-match-debug") << " -> fail, conflicting disequality" << std::endl; + Trace("qcf-match-debug") << " -> fail, conflicting disequality" << std::endl; return -1; } } } else { - Debug("qcf-match-debug") << " -> redundant, variable identity" << std::endl; + Trace("qcf-match-debug") << " -> redundant, variable identity" << std::endl; return 0; } }else{ if (vn == static_cast(v)) { - Debug("qcf-match-debug") << " -> fail, variable identity" << std::endl; + Trace("qcf-match-debug") << " -> fail, variable identity" << std::endl; return -1; } else @@ -530,15 +530,15 @@ int QuantInfo::addConstraint( TNode nv = getCurrentValue( n ); if (nv == d_match[v]) { - Debug("qcf-match-debug") << " -> fail, conflicting disequality" << std::endl; + Trace("qcf-match-debug") << " -> fail, conflicting disequality" << std::endl; return -1; } } d_curr_var_deq[v][n] = v; - Debug("qcf-match-debug") << " -> success" << std::endl; + Trace("qcf-match-debug") << " -> success" << std::endl; return 1; }else{ - Debug("qcf-match-debug") << " -> redundant disequality" << std::endl; + Trace("qcf-match-debug") << " -> redundant disequality" << std::endl; return 0; } } @@ -592,11 +592,11 @@ bool QuantInfo::setMatch(size_t v, TNode n, bool isGroundRep, bool isGround) { for (size_t index : rd.second) { - Debug("qcf-match-debug2") << n << " in relevant domain " << rd.first + Trace("qcf-match-debug2") << n << " in relevant domain " << rd.first << "." << index << "?" << std::endl; if (!tdb->inRelevantDomain(rd.first, index, n)) { - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " -> fail, since " << n << " is not in relevant domain of " << rd.first << "." << index << std::endl; return false; @@ -605,7 +605,7 @@ bool QuantInfo::setMatch(size_t v, TNode n, bool isGroundRep, bool isGround) } } } - Debug("qcf-match-debug") << "-- bind : " << v << " -> " << n << ", checked " + Trace("qcf-match-debug") << "-- bind : " << v << " -> " << n << ", checked " << d_curr_var_deq[v].size() << " disequalities" << std::endl; if (isGround) @@ -613,7 +613,7 @@ bool QuantInfo::setMatch(size_t v, TNode n, bool isGroundRep, bool isGround) if (d_vars[v].getKind() == BOUND_VARIABLE) { d_vars_set.insert(v); - Debug("qcf-match-debug") + Trace("qcf-match-debug") << "---- now bound " << d_vars_set.size() << " / " << d_q[0].getNumChildren() << " base variables." << std::endl; } @@ -624,7 +624,7 @@ bool QuantInfo::setMatch(size_t v, TNode n, bool isGroundRep, bool isGround) void QuantInfo::unsetMatch(size_t v) { - Debug("qcf-match-debug") << "-- unbind : " << v << std::endl; + Trace("qcf-match-debug") << "-- unbind : " << v << std::endl; if( d_vars[v].getKind()==BOUND_VARIABLE && d_vars_set.find( v )!=d_vars_set.end() ){ d_vars_set.erase( v ); } @@ -677,7 +677,7 @@ bool QuantInfo::isTConstraintSpurious(const std::vector& terms) // the helper method evaluateTerm from the entailment check utility. Node inst_eval = echeck->evaluateTerm( d_q[1], subs, false, options().quantifiers.qcfTConstraint, true); - if( Trace.isOn("qcf-instance-check") ){ + if( TraceIsOn("qcf-instance-check") ){ Trace("qcf-instance-check") << "Possible propagating instance for " << d_q << " : " << std::endl; Trace("qcf-instance-check") << " " << terms << std::endl; Trace("qcf-instance-check") << "...evaluates to " << inst_eval << std::endl; @@ -997,7 +997,7 @@ bool QuantInfo::completeMatch(std::vector& assigned, bool doContinue) if( success ){ doFail = true; Trace("qcf-check-unassign") << " Try: " << std::endl; - if (Trace.isOn("qcf-check")) + if (TraceIsOn("qcf-check")) { for (int ui : d_unassigned) { @@ -1014,7 +1014,7 @@ bool QuantInfo::completeMatch(std::vector& assigned, bool doContinue) Trace("qcf-check") << "done assigning." << std::endl; } if( success ){ - if (Trace.isOn("qcf-check")) + if (TraceIsOn("qcf-check")) { for (int ui : d_unassigned) { @@ -1042,7 +1042,7 @@ void QuantInfo::getMatch( std::vector< Node >& terms ){ }else{ cv = d_match[repVar]; } - Debug("qcf-check-inst") << "INST : " << i << " -> " << cv << ", from " << d_match[i] << std::endl; + Trace("qcf-check-inst") << "INST : " << i << " -> " << cv << ", from " << d_match[i] << std::endl; terms.push_back( cv ); } } @@ -1206,7 +1206,7 @@ MatchGen::MatchGen(QuantConflictFind* p, QuantInfo* qi, Node n, bool isVar) } } Trace("qcf-qregister-debug") << "Done make match gen " << n << ", type = "; - debugPrintType( "qcf-qregister-debug", d_type, true ); + debugPrintType( "qcf-qregister-debug", d_type ); Trace("qcf-qregister-debug") << std::endl; } @@ -1395,9 +1395,9 @@ bool MatchGen::reset_round() void MatchGen::reset(bool tgt) { d_tgt = d_type_not ? !tgt : tgt; - Debug("qcf-match") << " Reset for : " << d_n << ", type : "; + Trace("qcf-match") << " Reset for : " << d_n << ", type : "; debugPrintType( "qcf-match", d_type ); - Debug("qcf-match") << ", tgt = " << d_tgt << ", children = " << d_children.size() << " " << d_children_order.size() << std::endl; + Trace("qcf-match") << ", tgt = " << d_tgt << ", children = " << d_children.size() << " " << d_children_order.size() << std::endl; d_qn.clear(); d_qni.clear(); d_qni_bound.clear(); @@ -1452,7 +1452,7 @@ void MatchGen::reset(bool tgt) { Assert(isHandledUfTerm(d_n)); TNode f = d_parent->getTermDatabase()->getMatchOperator(d_n); - Debug("qcf-match-debug") << " reset: Var will match operators of " << f << std::endl; + Trace("qcf-match-debug") << " reset: Var will match operators of " << f << std::endl; TNodeTrie* qni = d_parent->getTermDatabase()->getTermArgTrie(Node::null(), f); if (qni == nullptr || qni->empty()) @@ -1473,7 +1473,7 @@ void MatchGen::reset(bool tgt) size_t repVar = d_qi->getCurrentRepVar(qvn.second); if (d_qi->d_match[repVar].isNull()) { - Debug("qcf-match-debug") << "Force matching on child #" << qvn.first + Trace("qcf-match-debug") << "Force matching on child #" << qvn.first << ", which is var #" << repVar << std::endl; d_qni_bound[qvn.first] = repVar; } @@ -1512,7 +1512,7 @@ void MatchGen::reset(bool tgt) bool success; if( vn[0]==-1 && vn[1]==-1 ){ //Trace("qcf-explain") << " reset : " << d_n << " check ground values " << nn[0] << " " << nn[1] << " (tgt=" << d_tgt << ")" << std::endl; - Debug("qcf-match-debug") << " reset: check ground values " << nn[0] << " " << nn[1] << " (" << d_tgt << ")" << std::endl; + Trace("qcf-match-debug") << " reset: check ground values " << nn[0] << " " << nn[1] << " (" << d_tgt << ")" << std::endl; //just compare values if( d_tgt ){ success = nn[0] == nn[1]; @@ -1536,7 +1536,7 @@ void MatchGen::reset(bool tgt) vn[0] = vn[1]; vn[1] = -1; } - Debug("qcf-match-debug") << " reset: add constraint " << vn[0] << " -> " << nn[1] << " (vn=" << vn[1] << ")" << std::endl; + Trace("qcf-match-debug") << " reset: add constraint " << vn[0] << " -> " << nn[1] << " (vn=" << vn[1] << ")" << std::endl; //add some constraint int addc = d_qi->addConstraint(vn[0], nn[1], vn[1], d_tgt, false); success = addc!=-1; @@ -1582,14 +1582,14 @@ void MatchGen::reset(bool tgt) } d_binding = false; d_wasSet = true; - Debug("qcf-match") << " reset: Finished reset for " << d_n << ", success = " << ( !d_qn.empty() || d_child_counter!=-1 ) << std::endl; + Trace("qcf-match") << " reset: Finished reset for " << d_n << ", success = " << ( !d_qn.empty() || d_child_counter!=-1 ) << std::endl; } bool MatchGen::getNextMatch() { - Debug("qcf-match") << " Get next match for : " << d_n << ", type = "; + Trace("qcf-match") << " Get next match for : " << d_n << ", type = "; debugPrintType( "qcf-match", d_type ); - Debug("qcf-match") << ", children = " << d_children.size() << ", binding = " << d_binding << std::endl; + Trace("qcf-match") << ", children = " << d_children.size() << ", binding = " << d_binding << std::endl; if( !d_use_children ){ if( d_child_counter==0 ){ d_child_counter = -1; @@ -1607,7 +1607,7 @@ bool MatchGen::getNextMatch() if( !d_binding ){ if (doMatching()) { - Debug("qcf-match-debug") << " - Matching succeeded" << std::endl; + Trace("qcf-match-debug") << " - Matching succeeded" << std::endl; d_binding = true; d_binding_it = d_qni_bound.begin(); doReset = true; @@ -1629,7 +1629,7 @@ bool MatchGen::getNextMatch() } else { - Debug("qcf-match-debug") << " - Matching failed" << std::endl; + Trace("qcf-match-debug") << " - Matching failed" << std::endl; success = false; terminate = true; } @@ -1639,19 +1639,19 @@ bool MatchGen::getNextMatch() if( d_binding ){ //also need to create match for each variable we bound success = true; - Debug("qcf-match-debug") << " Produce matches for bound variables by " << d_n << ", type = "; + Trace("qcf-match-debug") << " Produce matches for bound variables by " << d_n << ", type = "; debugPrintType( "qcf-match-debug", d_type ); - Debug("qcf-match-debug") << "..." << std::endl; + Trace("qcf-match-debug") << "..." << std::endl; while( ( success && d_binding_it!=d_qni_bound.end() ) || doFail ){ QuantInfo::VarMgMap::const_iterator itm; if( !doFail ){ - Debug("qcf-match-debug") << " check variable " << d_binding_it->second << std::endl; + Trace("qcf-match-debug") << " check variable " << d_binding_it->second << std::endl; itm = d_qi->var_mg_find(d_binding_it->second); } if (doFail || (d_binding_it->first != 0 && itm != d_qi->var_mg_end())) { - Debug("qcf-match-debug") << " we had bound variable " << d_binding_it->second << ", reset = " << doReset << std::endl; + Trace("qcf-match-debug") << " we had bound variable " << d_binding_it->second << ", reset = " << doReset << std::endl; if( doReset ){ itm->second->reset(true); } @@ -1659,11 +1659,11 @@ bool MatchGen::getNextMatch() { do { if( d_binding_it==d_qni_bound.begin() ){ - Debug("qcf-match-debug") << " failed." << std::endl; + Trace("qcf-match-debug") << " failed." << std::endl; success = false; }else{ --d_binding_it; - Debug("qcf-match-debug") << " decrement..." << std::endl; + Trace("qcf-match-debug") << " decrement..." << std::endl; } } while (success && (d_binding_it->first == 0 @@ -1673,14 +1673,14 @@ bool MatchGen::getNextMatch() } else { - Debug("qcf-match-debug") << " increment..." << std::endl; + Trace("qcf-match-debug") << " increment..." << std::endl; ++d_binding_it; doReset = true; } } else { - Debug("qcf-match-debug") << " skip..." << d_binding_it->second << std::endl; + Trace("qcf-match-debug") << " skip..." << d_binding_it->second << std::endl; ++d_binding_it; doReset = true; } @@ -1704,7 +1704,7 @@ bool MatchGen::getNextMatch() { if (!qb.second.isNull()) { - Debug("qcf-match") + Trace("qcf-match") << " Clean up bound var " << qb.first << (d_tgt ? "!" : "") << " = " << qb.second << std::endl; itb = d_qni_bound_cons_var.find(qb.first); @@ -1719,7 +1719,7 @@ bool MatchGen::getNextMatch() //clean up the matches you set for (const std::pair& qb : d_qni_bound) { - Debug("qcf-match") + Trace("qcf-match") << " Clean up bound var " << qb.second << std::endl; Assert(qb.second < d_qi->getNumVars()); d_qi->unsetMatch(qb.second); @@ -1735,7 +1735,7 @@ bool MatchGen::getNextMatch() } } } - Debug("qcf-match") << " ...finished matching for " << d_n << ", success = " << success << std::endl; + Trace("qcf-match") << " ...finished matching for " << d_n << ", success = " << success << std::endl; d_wasSet = success; return success; } @@ -1757,7 +1757,7 @@ bool MatchGen::getNextMatch() { if( d_child_counter<(int)(getNumChildren()-1) ){ d_child_counter++; - Debug("qcf-match-debug") << " Reset child " << d_child_counter << " of " << d_n << std::endl; + Trace("qcf-match-debug") << " Reset child " << d_child_counter << " of " << d_n << std::endl; getChild(d_child_counter)->reset(d_tgt); }else{ success = true; @@ -1773,7 +1773,7 @@ bool MatchGen::getNextMatch() { if( d_child_counter<(int)(getNumChildren()-1) ){ d_child_counter++; - Debug("qcf-match-debug") << " Reset child " << d_child_counter << " of " << d_n << ", one match" << std::endl; + Trace("qcf-match-debug") << " Reset child " << d_child_counter << " of " << d_n << ", one match" << std::endl; getChild(d_child_counter)->reset(d_tgt); }else{ d_child_counter = -1; @@ -1858,11 +1858,11 @@ bool MatchGen::getNextMatch() } } d_wasSet = success; - Debug("qcf-match") << " ...finished construct match for " << d_n << ", success = " << success << std::endl; + Trace("qcf-match") << " ...finished construct match for " << d_n << ", success = " << success << std::endl; return success; } } - Debug("qcf-match") << " ...already finished for " << d_n << std::endl; + Trace("qcf-match") << " ...already finished for " << d_n << std::endl; return false; } @@ -1883,7 +1883,7 @@ bool MatchGen::doMatching() do { invalidMatch = false; - Debug("qcf-match-debug") << " Do matching " << d_n << " " + Trace("qcf-match-debug") << " Do matching " << d_n << " " << d_qn.size() << " " << d_qni.size() << std::endl; if (d_qn.size() == d_qni.size() + 1) { @@ -1895,14 +1895,14 @@ bool MatchGen::doMatching() { // get the representative variable this variable is equal to size_t repVar = d_qi->getCurrentRepVar(itv->second); - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " Match " << index << " is a variable " << itv->second << ", which is repVar " << repVar << std::endl; // get the value the rep variable if (!d_qi->d_match[repVar].isNull()) { val = d_qi->d_match[repVar]; - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " Variable is already bound to " << val << std::endl; } else @@ -1917,7 +1917,7 @@ bool MatchGen::doMatching() if (it->first.getType().isComparableTo(d_qi->d_var_types[repVar]) && d_qi->setMatch(d_qni_bound[index], it->first, true, true)) { - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " Binding variable" << std::endl; if( d_qn.size()second ); @@ -1925,14 +1925,14 @@ bool MatchGen::doMatching() } else { - Debug("qcf-match") + Trace("qcf-match") << " Binding variable, currently fail." << std::endl; invalidMatch = true; } } else { - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " Binding variable, fail, no more variables to bind" << std::endl; d_qn.pop_back(); @@ -1941,7 +1941,7 @@ bool MatchGen::doMatching() } else { - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " Match " << index << " is ground term" << std::endl; Assert(d_qni_gterm.find(index) != d_qni_gterm.end()); val = d_qni_gterm[index]; @@ -1955,7 +1955,7 @@ bool MatchGen::doMatching() d_qn[index]->d_data.find(valr); if (it != d_qn[index]->d_data.end()) { - Debug("qcf-match-debug") << " Match" << std::endl; + Trace("qcf-match-debug") << " Match" << std::endl; d_qni.push_back(it); if (d_qn.size() < d_qni_size) { @@ -1964,7 +1964,7 @@ bool MatchGen::doMatching() } else { - Debug("qcf-match-debug") << " Failed to match" << std::endl; + Trace("qcf-match-debug") << " Failed to match" << std::endl; d_qn.pop_back(); } } @@ -1984,7 +1984,7 @@ bool MatchGen::doMatching() success = true; if (d_qi->setMatch(itb->second, d_qni[index]->first, true, true)) { - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " Bind next variable" << std::endl; if (d_qn.size() < d_qni_size) { @@ -1993,7 +1993,7 @@ bool MatchGen::doMatching() } else { - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " Bind next variable, currently fail" << std::endl; invalidMatch = true; } @@ -2002,7 +2002,7 @@ bool MatchGen::doMatching() { d_qi->unsetMatch(itb->second); d_qi->d_match_term[itb->second] = TNode::null(); - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " Bind next variable, no more variables to bind" << std::endl; } @@ -2023,14 +2023,14 @@ bool MatchGen::doMatching() { Assert(!d_qni[d_qni.size() - 1]->second.d_data.empty()); TNode t = d_qni[d_qni.size() - 1]->second.d_data.begin()->first; - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " " << d_n << " matched " << t << std::endl; d_qi->d_match_term[d_qni_var_num[0]] = t; // set the match terms Node q = d_qi->getQuantifiedFormula(); for (const std::pair& qb : d_qni_bound) { - Debug("qcf-match-debug") + Trace("qcf-match-debug") << " position " << qb.first << " bounded " << qb.second << " / " << q[0].getNumChildren() << std::endl; if (qb.first > 0) @@ -2044,8 +2044,7 @@ bool MatchGen::doMatching() return !d_qn.empty(); } -void MatchGen::debugPrintType( const char * c, short typ, bool isTrace ) { - if( isTrace ){ +void MatchGen::debugPrintType( const char * c, short typ) { switch( typ ){ case typ_invalid: Trace(c) << "invalid";break; case typ_ground: Trace(c) << "ground";break; @@ -2055,17 +2054,6 @@ void MatchGen::debugPrintType( const char * c, short typ, bool isTrace ) { case typ_var: Trace(c) << "var";break; case typ_bool_var: Trace(c) << "bool_var";break; } - }else{ - switch( typ ){ - case typ_invalid: Debug(c) << "invalid";break; - case typ_ground: Debug(c) << "ground";break; - case typ_eq: Debug(c) << "eq";break; - case typ_pred: Debug(c) << "pred";break; - case typ_formula: Debug(c) << "formula";break; - case typ_var: Debug(c) << "var";break; - case typ_bool_var: Debug(c) << "bool_var";break; - } - } } void MatchGen::setInvalid() { @@ -2116,7 +2104,7 @@ void QuantConflictFind::registerQuantifier( Node q ) { } d_quants.push_back(q); d_quant_id[q] = d_quants.size(); - if (Trace.isOn("qcf-qregister")) + if (TraceIsOn("qcf-qregister")) { Trace("qcf-qregister") << "Register "; debugPrintQuant("qcf-qregister", q); @@ -2129,7 +2117,7 @@ void QuantConflictFind::registerQuantifier( Node q ) { d_qinfo[q].reset(new QuantInfo(d_env, this, q)); // debug print - if (Trace.isOn("qcf-qregister")) + if (TraceIsOn("qcf-qregister")) { QuantInfo* qi = d_qinfo[q].get(); Trace("qcf-qregister") << "- Flattened structure is :" << std::endl; @@ -2247,7 +2235,7 @@ void QuantConflictFind::check(Theory::Effort level, QEffort quant_e) ++(d_statistics.d_inst_rounds); double clSet = 0; int prevEt = 0; - if (Trace.isOn("qcf-engine")) + if (TraceIsOn("qcf-engine")) { prevEt = d_statistics.d_entailment_checks.get(); clSet = double(clock()) / double(CLOCKS_PER_SEC); @@ -2259,7 +2247,7 @@ void QuantConflictFind::check(Theory::Effort level, QEffort quant_e) d_irr_func.clear(); d_irr_quant.clear(); - if (Trace.isOn("qcf-debug")) + if (TraceIsOn("qcf-debug")) { Trace("qcf-debug") << std::endl; debugPrint("qcf-debug"); @@ -2303,7 +2291,7 @@ void QuantConflictFind::check(Theory::Effort level, QEffort quant_e) { d_conflict.set(true); } - if (Trace.isOn("qcf-engine")) + if (TraceIsOn("qcf-engine")) { double clSet2 = double(clock()) / double(CLOCKS_PER_SEC); Trace("qcf-engine") << "Finished conflict find engine, time = " @@ -2339,7 +2327,7 @@ void QuantConflictFind::checkQuantifiedFormula(Node q, // quantified formula is not properly set up for matching return; } - if (Trace.isOn("qcf-check")) + if (TraceIsOn("qcf-check")) { Trace("qcf-check") << "Check quantified formula "; debugPrintQuant("qcf-check", q); @@ -2366,7 +2354,7 @@ void QuantConflictFind::checkQuantifiedFormula(Node q, << std::endl; return; } - if (Trace.isOn("qcf-inst")) + if (TraceIsOn("qcf-inst")) { Trace("qcf-inst") << "*** Produced match at effort " << d_effort << " : " << std::endl; @@ -2401,10 +2389,10 @@ void QuantConflictFind::checkQuantifiedFormula(Node q, { // otherwise, we have a conflict/propagating instance // for debugging - if (Debug.isOn("qcf-check-inst")) + if (TraceIsOn("qcf-check-inst")) { Node inst = qinst->getInstantiation(q, terms); - Debug("qcf-check-inst") + Trace("qcf-check-inst") << "Check instantiation " << inst << "..." << std::endl; Assert(!d_treg.getEntailmentCheck()->isEntailed(inst, true)); Assert(d_treg.getEntailmentCheck()->isEntailed(inst, false) @@ -2424,7 +2412,7 @@ void QuantConflictFind::checkQuantifiedFormula(Node q, return; } Trace("qcf-check") << " ... Added instantiation" << std::endl; - if (Trace.isOn("qcf-inst")) + if (TraceIsOn("qcf-inst")) { Trace("qcf-inst") << "*** Was from effort " << d_effort << " : " << std::endl; diff --git a/src/theory/quantifiers/quant_conflict_find.h b/src/theory/quantifiers/quant_conflict_find.h index b546aacd5..592320f99 100644 --- a/src/theory/quantifiers/quant_conflict_find.h +++ b/src/theory/quantifiers/quant_conflict_find.h @@ -52,7 +52,7 @@ class MatchGen { typ_tconstraint, typ_tsym, }; - void debugPrintType( const char * c, short typ, bool isTrace = false ); + void debugPrintType( const char * c, short typ); bool d_tgt; bool d_tgt_orig; diff --git a/src/theory/quantifiers/quant_util.cpp b/src/theory/quantifiers/quant_util.cpp index cbe09af2e..e8fe29a1e 100644 --- a/src/theory/quantifiers/quant_util.cpp +++ b/src/theory/quantifiers/quant_util.cpp @@ -38,22 +38,22 @@ void QuantPhaseReq::initialize( Node n, bool computeEq ){ d_phase_reqs[ it->first ] = false; } } - Debug("inst-engine-phase-req") << "Phase requirements for " << n << ":" << std::endl; + Trace("inst-engine-phase-req") << "Phase requirements for " << n << ":" << std::endl; //now, compute if any patterns are equality required if( computeEq ){ for( std::map< Node, bool >::iterator it = d_phase_reqs.begin(); it != d_phase_reqs.end(); ++it ){ - Debug("inst-engine-phase-req") << " " << it->first << " -> " << it->second << std::endl; + Trace("inst-engine-phase-req") << " " << it->first << " -> " << it->second << std::endl; if( it->first.getKind()==EQUAL ){ if( quantifiers::TermUtil::hasInstConstAttr(it->first[0]) ){ if( !quantifiers::TermUtil::hasInstConstAttr(it->first[1]) ){ d_phase_reqs_equality_term[ it->first[0] ] = it->first[1]; d_phase_reqs_equality[ it->first[0] ] = it->second; - Debug("inst-engine-phase-req") << " " << it->first[0] << ( it->second ? " == " : " != " ) << it->first[1] << std::endl; + Trace("inst-engine-phase-req") << " " << it->first[0] << ( it->second ? " == " : " != " ) << it->first[1] << std::endl; } }else if( quantifiers::TermUtil::hasInstConstAttr(it->first[1]) ){ d_phase_reqs_equality_term[ it->first[1] ] = it->first[0]; d_phase_reqs_equality[ it->first[1] ] = it->second; - Debug("inst-engine-phase-req") << " " << it->first[1] << ( it->second ? " == " : " != " ) << it->first[0] << std::endl; + Trace("inst-engine-phase-req") << " " << it->first[1] << ( it->second ? " == " : " != " ) << it->first[0] << std::endl; } } } diff --git a/src/theory/quantifiers/quantifiers_registry.cpp b/src/theory/quantifiers/quantifiers_registry.cpp index 87a5eff4d..17998c1d1 100644 --- a/src/theory/quantifiers/quantifiers_registry.cpp +++ b/src/theory/quantifiers/quantifiers_registry.cpp @@ -40,7 +40,7 @@ void QuantifiersRegistry::registerQuantifier(Node q) } Assert(q.getKind() == kind::FORALL); NodeManager* nm = NodeManager::currentNM(); - Debug("quantifiers-engine") + Trace("quantifiers-engine") << "Instantiation constants for " << q << " : " << std::endl; for (size_t i = 0, nvars = q[0].getNumChildren(); i < nvars; i++) { @@ -49,7 +49,7 @@ void QuantifiersRegistry::registerQuantifier(Node q) Node ic = nm->mkInstConstant(q[0][i].getType()); d_inst_constants_map[ic] = q; d_inst_constants[q].push_back(ic); - Debug("quantifiers-engine") << " " << ic << std::endl; + Trace("quantifiers-engine") << " " << ic << std::endl; // set the var number attribute InstVarNumAttribute ivna; ic.setAttribute(ivna, i); diff --git a/src/theory/quantifiers/quantifiers_rewriter.cpp b/src/theory/quantifiers/quantifiers_rewriter.cpp index 0f423828c..255cd77a2 100644 --- a/src/theory/quantifiers/quantifiers_rewriter.cpp +++ b/src/theory/quantifiers/quantifiers_rewriter.cpp @@ -896,7 +896,7 @@ Node QuantifiersRewriter::getVarElimEqBv(Node lit, const std::vector& args, Node& var) { - if (Trace.isOn("quant-velim-bv")) + if (TraceIsOn("quant-velim-bv")) { Trace("quant-velim-bv") << "Bv-Elim : " << lit << " varList = { "; for (const Node& v : args) diff --git a/src/theory/quantifiers/quantifiers_state.cpp b/src/theory/quantifiers/quantifiers_state.cpp index bdf689581..8492fd621 100644 --- a/src/theory/quantifiers/quantifiers_state.cpp +++ b/src/theory/quantifiers/quantifiers_state.cpp @@ -112,7 +112,7 @@ uint64_t QuantifiersState::getInstRounds() const { return d_ierCounter; } void QuantifiersState::debugPrintEqualityEngine(const char* c) const { - bool traceEnabled = Trace.isOn(c); + bool traceEnabled = TraceIsOn(c); if (!traceEnabled) { return; diff --git a/src/theory/quantifiers/sygus/cegis.cpp b/src/theory/quantifiers/sygus/cegis.cpp index 6bb94f41e..f3d6268e0 100644 --- a/src/theory/quantifiers/sygus/cegis.cpp +++ b/src/theory/quantifiers/sygus/cegis.cpp @@ -242,7 +242,7 @@ bool Cegis::constructCandidates(const std::vector& enums, const std::vector& candidates, std::vector& candidate_values) { - if (Trace.isOn("cegis")) + if (TraceIsOn("cegis")) { Trace("cegis") << " Enumerators :\n"; for (unsigned i = 0, size = enums.size(); i < size; ++i) @@ -461,7 +461,7 @@ void Cegis::addRefinementLemmaConjunct(unsigned wcounter, } else { - if (Trace.isOn("cegis-rl")) + if (TraceIsOn("cegis-rl")) { if (d_refinement_lemma_conj.find(lem) == d_refinement_lemma_conj.end()) { @@ -631,7 +631,7 @@ bool Cegis::sampleAddRefinementLemma(const std::vector& candidates, const std::vector& vals) { Trace("sygus-engine") << " *** Do sample add refinement..." << std::endl; - if (Trace.isOn("cegis-sample")) + if (TraceIsOn("cegis-sample")) { Trace("cegis-sample") << "Check sampling for candidate solution" << std::endl; @@ -675,7 +675,7 @@ bool Cegis::sampleAddRefinementLemma(const std::vector& candidates, d_refinement_lemmas.begin(), d_refinement_lemmas.end(), rlem) == d_refinement_lemmas.end()) { - if (Trace.isOn("cegis-sample")) + if (TraceIsOn("cegis-sample")) { Trace("cegis-sample") << " false for point #" << i << " : "; for (const Node& cn : pt) diff --git a/src/theory/quantifiers/sygus/cegis_core_connective.cpp b/src/theory/quantifiers/sygus/cegis_core_connective.cpp index 5a5ae074b..c0b87a406 100644 --- a/src/theory/quantifiers/sygus/cegis_core_connective.cpp +++ b/src/theory/quantifiers/sygus/cegis_core_connective.cpp @@ -261,7 +261,7 @@ bool CegisCoreConnective::constructSolution( Assert(candidates.size() == candidate_values.size()); Trace("sygus-ccore-summary") << "CegisCoreConnective: construct solution..." << std::endl; - if (Trace.isOn("sygus-ccore")) + if (TraceIsOn("sygus-ccore")) { Trace("sygus-ccore") << "CegisCoreConnective: Construct candidate solutions..." << std::endl; @@ -338,7 +338,7 @@ bool CegisCoreConnective::constructSolution( Trace("sygus-ccore-summary") << "...success" << std::endl; return true; } - if (Trace.isOn("sygus-ccore-summary")) + if (TraceIsOn("sygus-ccore-summary")) { std::stringstream ss; ccheck.debugPrintSummary(ss); diff --git a/src/theory/quantifiers/sygus/cegis_unif.cpp b/src/theory/quantifiers/sygus/cegis_unif.cpp index 69d3b9f7a..c97e28e5b 100644 --- a/src/theory/quantifiers/sygus/cegis_unif.cpp +++ b/src/theory/quantifiers/sygus/cegis_unif.cpp @@ -174,7 +174,7 @@ bool CegisUnif::getEnumValues(const std::vector& enums, { Assert(mvMap.find(eu) != mvMap.end()); Node m_eu = mvMap[eu]; - if (Trace.isOn("cegis-unif")) + if (TraceIsOn("cegis-unif")) { Trace("cegis-unif") << " " << eu << " -> "; TermDbSygus::toStreamSygus("cegis-unif", m_eu); @@ -293,7 +293,7 @@ bool CegisUnif::processConstructCandidates(const std::vector& enums, return Cegis::processConstructCandidates( enums, enum_values, candidates, candidate_values, satisfiedRl); } - if (Trace.isOn("cegis-unif")) + if (TraceIsOn("cegis-unif")) { for (const Node& c : d_unif_candidates) { @@ -351,7 +351,7 @@ bool CegisUnif::processConstructCandidates(const std::vector& enums, if (d_sygus_unif.constructSolution(sols, lemmas)) { candidate_values.insert(candidate_values.end(), sols.begin(), sols.end()); - if (Trace.isOn("cegis-unif")) + if (TraceIsOn("cegis-unif")) { Trace("cegis-unif") << "* Candidate solutions are:\n"; for (const Node& sol : sols) diff --git a/src/theory/quantifiers/sygus/enum_stream_substitution.cpp b/src/theory/quantifiers/sygus/enum_stream_substitution.cpp index a4b65ab30..6899bc580 100644 --- a/src/theory/quantifiers/sygus/enum_stream_substitution.cpp +++ b/src/theory/quantifiers/sygus/enum_stream_substitution.cpp @@ -95,7 +95,7 @@ void EnumStreamPermutation::reset(Node value) for (const std::pair>& p : d_var_classes) { d_perm_state_class.push_back(PermutationState(p.second)); - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { Trace("synth-stream-concrete") << " " << p.first << " -> ["; for (const Node& var : p.second) @@ -112,7 +112,7 @@ void EnumStreamPermutation::reset(Node value) Node EnumStreamPermutation::getNext() { - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, d_value); @@ -202,7 +202,7 @@ Node EnumStreamPermutation::getNext() // if permuted value is equivalent modulo rewriting to a previous one, look // for another } while (!d_perm_values.insert(bultin_perm_value).second); - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, perm_value); @@ -288,7 +288,7 @@ void EnumStreamPermutation::PermutationState::getLastPerm( { for (unsigned i = 0, size = d_last_perm.size(); i < size; ++i) { - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, d_vars[d_last_perm[i]]); @@ -369,7 +369,7 @@ void EnumStreamSubstitution::initialize(TypeNode tn) void EnumStreamSubstitution::resetValue(Node value) { - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, value); @@ -394,7 +394,7 @@ void EnumStreamSubstitution::resetValue(Node value) } d_comb_state_class.push_back(CombinationState( p.second.size(), perm_var_class_sz, p.first, p.second)); - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { Trace("synth-stream-concrete") << " " << p.first << " -> " << perm_var_class_sz << " from [ "; @@ -412,7 +412,7 @@ void EnumStreamSubstitution::resetValue(Node value) Node EnumStreamSubstitution::getNext() { - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, d_value); @@ -467,7 +467,7 @@ Node EnumStreamSubstitution::getNext() } } } - if (Trace.isOn("synth-stream-concrete-debug")) + if (TraceIsOn("synth-stream-concrete-debug")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, d_last); @@ -516,7 +516,7 @@ Node EnumStreamSubstitution::getNext() { builtin_comb_value = d_tds->rewriteNode(builtin_comb_value); } - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, comb_value); @@ -528,7 +528,7 @@ Node EnumStreamSubstitution::getNext() if (!builtin_comb_value.isConst() && !d_comb_values.insert(builtin_comb_value).second) { - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { std::stringstream ss, ss1; TermDbSygus::toStreamSygus(ss, comb_value); @@ -539,7 +539,7 @@ Node EnumStreamSubstitution::getNext() } return Node::null(); } - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, comb_value); @@ -576,7 +576,7 @@ void EnumStreamSubstitution::CombinationState::getLastComb( { for (unsigned i = 0, size = d_last_comb.size(); i < size; ++i) { - if (Trace.isOn("synth-stream-concrete")) + if (TraceIsOn("synth-stream-concrete")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, d_vars[d_last_comb[i]]); diff --git a/src/theory/quantifiers/sygus/enum_value_manager.cpp b/src/theory/quantifiers/sygus/enum_value_manager.cpp index d9078bfaf..cf7ee36a6 100644 --- a/src/theory/quantifiers/sygus/enum_value_manager.cpp +++ b/src/theory/quantifiers/sygus/enum_value_manager.cpp @@ -147,7 +147,7 @@ Node EnumValueManager::getEnumeratedValue(bool& activeIncomplete) { // None currently exist. The next abstract value is the model value for e. absE = getModelValue(e); - if (Trace.isOn("sygus-active-gen")) + if (TraceIsOn("sygus-active-gen")) { Trace("sygus-active-gen") << "Active-gen: new abstract value : "; TermDbSygus::toStreamSygus("sygus-active-gen", e); @@ -207,7 +207,7 @@ Node EnumValueManager::getEnumeratedValue(bool& activeIncomplete) Trace("cegqi-lemma") << "Cegqi::Lemma : actively-generated enumerator " "exclude current solution : " << lem << std::endl; - if (Trace.isOn("sygus-active-gen-debug")) + if (TraceIsOn("sygus-active-gen-debug")) { Trace("sygus-active-gen-debug") << "Active-gen: block "; TermDbSygus::toStreamSygus("sygus-active-gen-debug", absE); @@ -226,7 +226,7 @@ Node EnumValueManager::getEnumeratedValue(bool& activeIncomplete) { d_evActiveGenWaiting = v; } - if (Trace.isOn("sygus-active-gen")) + if (TraceIsOn("sygus-active-gen")) { Trace("sygus-active-gen") << "Active-gen : " << e << " : "; TermDbSygus::toStreamSygus("sygus-active-gen", absE); diff --git a/src/theory/quantifiers/sygus/example_infer.cpp b/src/theory/quantifiers/sygus/example_infer.cpp index d701fe6d9..e8eae6c78 100644 --- a/src/theory/quantifiers/sygus/example_infer.cpp +++ b/src/theory/quantifiers/sygus/example_infer.cpp @@ -49,7 +49,7 @@ bool ExampleInfer::initialize(Node n, const std::vector& candidates) return false; } - if (Trace.isOn("ex-infer")) + if (TraceIsOn("ex-infer")) { for (unsigned i = 0; i < candidates.size(); i++) { diff --git a/src/theory/quantifiers/sygus/sygus_enumerator.cpp b/src/theory/quantifiers/sygus/sygus_enumerator.cpp index ba4496a7b..bd8684929 100644 --- a/src/theory/quantifiers/sygus/sygus_enumerator.cpp +++ b/src/theory/quantifiers/sygus/sygus_enumerator.cpp @@ -166,7 +166,7 @@ Node SygusEnumerator::getCurrent() ret = Node::null(); } } - if (Trace.isOn("sygus-enum")) + if (TraceIsOn("sygus-enum")) { Trace("sygus-enum") << "Enumerate : "; TermDbSygus::toStreamSygus("sygus-enum", ret); @@ -809,7 +809,7 @@ bool SygusEnumerator::TermEnumMaster::incrementInternal() d_currSize++; Trace("sygus-enum-debug2") << "master(" << d_tn << "): size++ : " << d_currSize << "\n"; - if (Trace.isOn("sygus-engine")) + if (TraceIsOn("sygus-engine")) { // am i the master enumerator? if so, print if (d_se->d_tlEnum == this) diff --git a/src/theory/quantifiers/sygus/sygus_grammar_norm.cpp b/src/theory/quantifiers/sygus/sygus_grammar_norm.cpp index ddd16e605..082789bdf 100644 --- a/src/theory/quantifiers/sygus/sygus_grammar_norm.cpp +++ b/src/theory/quantifiers/sygus/sygus_grammar_norm.cpp @@ -186,7 +186,7 @@ void SygusGrammarNorm::TransfChain::buildType(SygusGrammarNorm* sygus_norm, claimed.end(), std::back_inserter(difference)); op_pos = difference; - if (Trace.isOn("sygus-grammar-normalize-chain")) + if (TraceIsOn("sygus-grammar-normalize-chain")) { Trace("sygus-grammar-normalize-chain") << "OP at " << d_chain_op_pos << "\n" @@ -247,7 +247,7 @@ void SygusGrammarNorm::TransfChain::buildType(SygusGrammarNorm* sygus_norm, /* Creates a type do be added to root representing next step in the chain */ /* Add + to elems */ d_elem_pos.push_back(d_chain_op_pos); - if (Trace.isOn("sygus-grammar-normalize-chain")) + if (TraceIsOn("sygus-grammar-normalize-chain")) { Trace("sygus-grammar-normalize-chain") << "\tCreating type for next entry with sygus_ops "; @@ -377,7 +377,7 @@ TypeNode SygusGrammarNorm::normalizeSygusRec(TypeNode tn, /* Corresponding type node to tn with the given operator positions. To be * retrieved (if cached) or defined (otherwise) */ TypeNode unres_tn; - if (Trace.isOn("sygus-grammar-normalize-trie")) + if (TraceIsOn("sygus-grammar-normalize-trie")) { Trace("sygus-grammar-normalize-trie") << "\tRecursing on " << tn << " with op_positions "; @@ -392,7 +392,7 @@ TypeNode SygusGrammarNorm::normalizeSygusRec(TypeNode tn, std::sort(op_pos.begin(), op_pos.end()); if (d_tries[tn].getOrMakeType(tn, unres_tn, op_pos)) { - if (Trace.isOn("sygus-grammar-normalize-trie")) + if (TraceIsOn("sygus-grammar-normalize-trie")) { Trace("sygus-grammar-normalize-trie") << "\tTypenode " << tn << " has already been normalized with op_pos "; @@ -404,7 +404,7 @@ TypeNode SygusGrammarNorm::normalizeSygusRec(TypeNode tn, } return unres_tn; } - if (Trace.isOn("sygus-grammar-normalize-trie")) + if (TraceIsOn("sygus-grammar-normalize-trie")) { Trace("sygus-grammar-normalize-trie") << "\tTypenode " << tn << " not yet normalized with op_pos "; @@ -471,7 +471,7 @@ TypeNode SygusGrammarNorm::normalizeSygusRec(TypeNode tn, to.addConsInfo(this, dt[oi]); } /* Build normalize datatype */ - if (Trace.isOn("sygus-grammar-normalize")) + if (TraceIsOn("sygus-grammar-normalize")) { Trace("sygus-grammar-normalize") << "\nFor positions "; for (unsigned i = 0, size = op_pos.size(); i < size; ++i) @@ -511,7 +511,7 @@ TypeNode SygusGrammarNorm::normalizeSygusType(TypeNode tn, Node sygus_vars) normalizeSygusRec(tn); /* Resolve created types */ Assert(!d_dt_all.empty() && !d_unres_t_all.empty()); - if (Trace.isOn("sygus-grammar-normalize-build")) + if (TraceIsOn("sygus-grammar-normalize-build")) { Trace("sygus-grammar-normalize-build") << "making mutual datatyes with datatypes \n"; diff --git a/src/theory/quantifiers/sygus/sygus_invariance.cpp b/src/theory/quantifiers/sygus/sygus_invariance.cpp index b35b23c90..8ecec8933 100644 --- a/src/theory/quantifiers/sygus/sygus_invariance.cpp +++ b/src/theory/quantifiers/sygus/sygus_invariance.cpp @@ -228,7 +228,7 @@ bool NegContainsSygusInvarianceTest::invariant(TermDbSygus* tds, } else if (contr.getConst() == d_isUniversal) { - if (Trace.isOn("sygus-pbe-cterm")) + if (TraceIsOn("sygus-pbe-cterm")) { Trace("sygus-pbe-cterm") << "PBE-cterm : enumerator : do not consider "; diff --git a/src/theory/quantifiers/sygus/sygus_process_conj.cpp b/src/theory/quantifiers/sygus/sygus_process_conj.cpp index 18845665c..86ae04199 100644 --- a/src/theory/quantifiers/sygus/sygus_process_conj.cpp +++ b/src/theory/quantifiers/sygus/sygus_process_conj.cpp @@ -407,7 +407,7 @@ void SynthConjectureProcessFun::processTerms( { Node nn = it->first; arg_list.push_back(nn); - if (Trace.isOn("sygus-process-arg-deps")) + if (TraceIsOn("sygus-process-arg-deps")) { Trace("sygus-process-arg-deps") << " argument " << nn; Trace("sygus-process-arg-deps") << " (" << it->second.size() @@ -573,7 +573,7 @@ Node SynthConjectureProcess::postSimplify(Node q) void SynthConjectureProcess::initialize(Node n, std::vector& candidates) { - if (Trace.isOn("sygus-process")) + if (TraceIsOn("sygus-process")) { Trace("sygus-process") << "Process conjecture : " << n << " with candidates: " << std::endl; diff --git a/src/theory/quantifiers/sygus/sygus_repair_const.cpp b/src/theory/quantifiers/sygus/sygus_repair_const.cpp index ddb46aec7..9059fe8d0 100644 --- a/src/theory/quantifiers/sygus/sygus_repair_const.cpp +++ b/src/theory/quantifiers/sygus/sygus_repair_const.cpp @@ -125,7 +125,7 @@ bool SygusRepairConst::repairSolution(Node sygusBody, { return false; } - if (Trace.isOn("sygus-repair-const")) + if (TraceIsOn("sygus-repair-const")) { Trace("sygus-repair-const") << "Repair candidate solutions..." << std::endl; for (unsigned i = 0, size = candidates.size(); i < size; i++) @@ -147,7 +147,7 @@ bool SygusRepairConst::repairSolution(Node sygusBody, Node cv = candidate_values[i]; Node skeleton = getSkeleton( cv, free_var_count, sk_vars, sk_vars_to_subs, useConstantsAsHoles); - if (Trace.isOn("sygus-repair-const")) + if (TraceIsOn("sygus-repair-const")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, cv); @@ -268,7 +268,7 @@ bool SygusRepairConst::repairSolution(Node sygusBody, Node scsk = csk.substitute( sk_vars.begin(), sk_vars.end(), sk_sygus_m.begin(), sk_sygus_m.end()); repair_cv.push_back(scsk); - if (Trace.isOn("sygus-repair-const") || Trace.isOn("sygus-engine")) + if (TraceIsOn("sygus-repair-const") || TraceIsOn("sygus-engine")) { std::stringstream sss; TermDbSygus::toStreamSygus(sss, repair_cv[i]); diff --git a/src/theory/quantifiers/sygus/sygus_unif.cpp b/src/theory/quantifiers/sygus/sygus_unif.cpp index 0787b7913..2db9695fe 100644 --- a/src/theory/quantifiers/sygus/sygus_unif.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif.cpp @@ -119,7 +119,7 @@ Node SygusUnif::constructBestStringToConcat( void SygusUnif::indent(const char* c, int ind) { - if (Trace.isOn(c)) + if (TraceIsOn(c)) { for (int i = 0; i < ind; i++) { @@ -130,7 +130,7 @@ void SygusUnif::indent(const char* c, int ind) void SygusUnif::print_val(const char* c, std::vector& vals, bool pol) { - if (Trace.isOn(c)) + if (TraceIsOn(c)) { for (unsigned i = 0; i < vals.size(); i++) { diff --git a/src/theory/quantifiers/sygus/sygus_unif_io.cpp b/src/theory/quantifiers/sygus/sygus_unif_io.cpp index 2144b324c..6e7cb627f 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_io.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif_io.cpp @@ -679,7 +679,7 @@ void SygusUnifIo::notifyEnumeration(Node e, Node v, std::vector& lemmas) } cond_vals[resb] = true; results.push_back(resb); - if (Trace.isOn("sygus-sui-enum")) + if (TraceIsOn("sygus-sui-enum")) { if (resb.isNull()) { @@ -839,7 +839,7 @@ Node SygusUnifIo::constructSolutionNode(std::vector& lemmas) && datatypes::utils::getSygusTermSize(vcc) < d_sol_term_size))) { - if (Trace.isOn("sygus-pbe")) + if (TraceIsOn("sygus-pbe")) { Trace("sygus-pbe") << "**** SygusUnif SOLVED : " << c << " = "; TermDbSygus::toStreamSygus("sygus-pbe", vcc); @@ -935,7 +935,7 @@ bool SygusUnifIo::getExplanationForEnumeratorExclude( // if the enumerator is in a conditional context, then we are stricter // about when to exclude bool isConditional = d_use_str_contains_eexc_conditional[e]; - if (Trace.isOn("sygus-sui-cterm-debug")) + if (TraceIsOn("sygus-sui-cterm-debug")) { Trace("sygus-sui-enum") << std::endl; } @@ -1019,7 +1019,7 @@ Node SygusUnifIo::constructSol( Assert(d_candidate == f); UnifContextIo& x = d_context; TypeNode etn = e.getType(); - if (Trace.isOn("sygus-sui-dt-debug")) + if (TraceIsOn("sygus-sui-dt-debug")) { indent("sygus-sui-dt-debug", ind); Trace("sygus-sui-dt-debug") << "ConstructPBE: (" << e << ", " << nrole @@ -1185,7 +1185,7 @@ Node SygusUnifIo::constructSol( { ret_dt = *intersection.begin(); } - if (Trace.isOn("sygus-sui-dt")) + if (TraceIsOn("sygus-sui-dt")) { indent("sygus-sui-dt", ind); Trace("sygus-sui-dt") << "ConstructPBE: found in cache: "; @@ -1213,7 +1213,7 @@ Node SygusUnifIo::constructSol( // make the value of the examples std::vector ex_vals; x.getCurrentStrings(this, d_examples_out, ex_vals); - if (Trace.isOn("sygus-sui-dt-debug")) + if (TraceIsOn("sygus-sui-dt-debug")) { indent("sygus-sui-dt-debug", ind); Trace("sygus-sui-dt-debug") << "current strings : " << std::endl; @@ -1408,7 +1408,7 @@ Node SygusUnifIo::constructSol( possible_cond.find(0); if (itpc != possible_cond.end()) { - if (Trace.isOn("sygus-sui-dt-debug")) + if (TraceIsOn("sygus-sui-dt-debug")) { indent("sygus-sui-dt-debug", ind + 1); Trace("sygus-sui-dt-debug") @@ -1535,7 +1535,7 @@ Node SygusUnifIo::constructSol( } } Assert(ret_dt.isNull() || ret_dt.getType() == e.getType()); - if (Trace.isOn("sygus-sui-dt")) + if (TraceIsOn("sygus-sui-dt")) { indent("sygus-sui-dt", ind); Trace("sygus-sui-dt") << "ConstructPBE: returned "; @@ -1551,7 +1551,7 @@ Node SygusUnifIo::constructSol( { if (x.d_vals[i].getConst()) { - if (Trace.isOn("sygus-sui-cache")) + if (TraceIsOn("sygus-sui-cache")) { indent("sygus-sui-cache", ind); Trace("sygus-sui-cache") << "Cache solution (#" << i << ") : "; diff --git a/src/theory/quantifiers/sygus/sygus_unif_rl.cpp b/src/theory/quantifiers/sygus/sygus_unif_rl.cpp index 687c69f8f..e56c5cecc 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_rl.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif_rl.cpp @@ -161,7 +161,7 @@ Node SygusUnifRl::purifyLemma(Node n, << "Node " << n << " is parameterized\n"; children.insert(children.begin(), n.getOperator()); } - if (Trace.isOn("sygus-unif-rl-purify-debug")) + if (TraceIsOn("sygus-unif-rl-purify-debug")) { Trace("sygus-unif-rl-purify-debug") << "...rebuilding " << n << " with kind " << k << " and children:\n"; @@ -197,7 +197,7 @@ Node SygusUnifRl::purifyLemma(Node n, // Maps new enumerator to its respective tuple of arguments d_hd_to_pt[new_f] = std::vector(children.begin() + 1, children.end()); - if (Trace.isOn("sygus-unif-rl-purify-debug")) + if (TraceIsOn("sygus-unif-rl-purify-debug")) { Trace("sygus-unif-rl-purify-debug") << "...[" << new_f << "] --> ( "; for (const Node& pt_i : d_hd_to_pt[new_f]) @@ -409,7 +409,7 @@ void SygusUnifRl::registerStrategy( std::vector& enums, std::map>& unused_strats) { - if (Trace.isOn("sygus-unif-rl-strat")) + if (TraceIsOn("sygus-unif-rl-strat")) { Trace("sygus-unif-rl-strat") << "Strategy for " << f << " is : " << std::endl; @@ -537,7 +537,7 @@ void SygusUnifRl::DecisionTreeInfo::setConditions( if (d_unif->usingConditionPool()) { d_cond_mvs.insert(conds.begin(), conds.end()); - if (Trace.isOn("sygus-unif-cond-pool")) + if (TraceIsOn("sygus-unif-cond-pool")) { for (const Node& condv : conds) { @@ -715,7 +715,7 @@ Node SygusUnifRl::DecisionTreeInfo::buildSolMinCond(Node cons, // add the head to the trie e = d_hds[hd_counter]; hd_mv[e] = d_unif->d_parent->getModelValue(e); - if (Trace.isOn("sygus-unif-sol")) + if (TraceIsOn("sygus-unif-sol")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, hd_mv[e]); @@ -767,7 +767,7 @@ Node SygusUnifRl::DecisionTreeInfo::buildSolMinCond(Node cons, Node ce = d_enums[c_counter]; Node cv = d_conds[c_counter]; Assert(ce.getType() == cv.getType()); - if (Trace.isOn("sygus-unif-sol")) + if (TraceIsOn("sygus-unif-sol")) { std::stringstream ss; TermDbSygus::toStreamSygus(ss, cv); @@ -1183,7 +1183,7 @@ Node SygusUnifRl::DecisionTreeInfo::PointSeparator::computeCond(Node cond, Assert(d_dt->d_unif->d_hd_to_pt.find(hd) != d_dt->d_unif->d_hd_to_pt.end()); std::vector pt = d_dt->d_unif->d_hd_to_pt[hd]; // compute the result - if (Trace.isOn("sygus-unif-rl-sep")) + if (TraceIsOn("sygus-unif-rl-sep")) { Trace("sygus-unif-rl-sep") << "Evaluate cond " << builtin_cond << " on pt " << hd << " ( "; diff --git a/src/theory/quantifiers/sygus/sygus_unif_strat.cpp b/src/theory/quantifiers/sygus/sygus_unif_strat.cpp index d1f29d207..5c10fa26d 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_strat.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif_strat.cpp @@ -622,7 +622,7 @@ void SygusUnifStrategy::buildStrategyGraph(TypeNode tn, NodeRole nrole) std::reverse(cons_strat->d_sol_templ_args.begin(), cons_strat->d_sol_templ_args.end()); } - if (Trace.isOn("sygus-unif")) + if (TraceIsOn("sygus-unif")) { Trace("sygus-unif") << "Initialized strategy " << strat; Trace("sygus-unif") @@ -751,7 +751,7 @@ void SygusUnifStrategy::staticLearnRedundantOps( void SygusUnifStrategy::debugPrint(const char* c) { - if (Trace.isOn(c)) + if (TraceIsOn(c)) { std::map > visited; debugPrint(c, getRootEnumerator(), role_equal, visited, 0); @@ -1042,7 +1042,7 @@ StrategyNode::~StrategyNode() void SygusUnifStrategy::indent(const char* c, int ind) { - if (Trace.isOn(c)) + if (TraceIsOn(c)) { for (int i = 0; i < ind; i++) { diff --git a/src/theory/quantifiers/sygus/synth_conjecture.cpp b/src/theory/quantifiers/sygus/synth_conjecture.cpp index 55611ad74..bb671bb02 100644 --- a/src/theory/quantifiers/sygus/synth_conjecture.cpp +++ b/src/theory/quantifiers/sygus/synth_conjecture.cpp @@ -369,7 +369,7 @@ bool SynthConjecture::doCheck() if (d_repair_index < ninst) { std::vector fail_cvs = d_solutionValues[d_repair_index]; - if (Trace.isOn("sygus-engine")) + if (TraceIsOn("sygus-engine")) { Trace("sygus-engine") << "CegConjuncture : repair previous solution "; for (const Node& fc : fail_cvs) @@ -419,8 +419,8 @@ bool SynthConjecture::doCheck() if (modelSuccess) { // Must separately compute whether trace is on due to compilation of - // Trace.isOn. - bool traceIsOn = Trace.isOn("sygus-engine"); + // TraceIsOn. + bool traceIsOn = TraceIsOn("sygus-engine"); if (printDebug || traceIsOn) { Trace("sygus-engine") << " * Value is : "; @@ -445,7 +445,7 @@ bool SynthConjecture::doCheck() else { Trace("sygus-engine") << ss.str() << " "; - if (Trace.isOn("sygus-engine-rr")) + if (TraceIsOn("sygus-engine-rr")) { Node bv = d_tds->sygusToBuiltin(nv, tn); bv = rewrite(bv); @@ -493,7 +493,7 @@ bool SynthConjecture::doCheck() Node query; if (constructed_cand) { - if (Trace.isOn("cegqi-check")) + if (TraceIsOn("cegqi-check")) { Trace("cegqi-check") << "CegConjuncture : check candidate : " << std::endl; diff --git a/src/theory/quantifiers/sygus/synth_engine.cpp b/src/theory/quantifiers/sygus/synth_engine.cpp index a98343bef..33defbbce 100644 --- a/src/theory/quantifiers/sygus/synth_engine.cpp +++ b/src/theory/quantifiers/sygus/synth_engine.cpp @@ -200,7 +200,7 @@ void SynthEngine::registerQuantifier(Node q) bool SynthEngine::checkConjecture(SynthConjecture* conj) { - if (Trace.isOn("sygus-engine-debug")) + if (TraceIsOn("sygus-engine-debug")) { conj->debugPrint("sygus-engine-debug"); Trace("sygus-engine-debug") << std::endl; diff --git a/src/theory/quantifiers/sygus/synth_verify.cpp b/src/theory/quantifiers/sygus/synth_verify.cpp index 8b6e24a1f..c01df10a6 100644 --- a/src/theory/quantifiers/sygus/synth_verify.cpp +++ b/src/theory/quantifiers/sygus/synth_verify.cpp @@ -114,7 +114,7 @@ Result SynthVerify::verify(Node query, Trace("sygus-engine") << " ...got " << r << std::endl; if (r.asSatisfiabilityResult().isSat() == Result::SAT) { - if (Trace.isOn("sygus-engine")) + if (TraceIsOn("sygus-engine")) { Trace("sygus-engine") << " * Verification lemma failed for:\n "; for (unsigned i = 0, size = vars.size(); i < size; i++) diff --git a/src/theory/quantifiers/sygus/term_database_sygus.cpp b/src/theory/quantifiers/sygus/term_database_sygus.cpp index 4bea7b26b..8ecfc4e50 100644 --- a/src/theory/quantifiers/sygus/term_database_sygus.cpp +++ b/src/theory/quantifiers/sygus/term_database_sygus.cpp @@ -711,7 +711,7 @@ TypeNode TermDbSygus::sygusToBuiltinType( TypeNode tn ) { void TermDbSygus::toStreamSygus(const char* c, Node n) { - if (Trace.isOn(c)) + if (TraceIsOn(c)) { std::stringstream ss; toStreamSygus(ss, n); @@ -900,7 +900,7 @@ bool TermDbSygus::canConstructKind(TypeNode tn, argts.push_back(ntn); argts.push_back(disj_types[r][d]); argts.push_back(disj_types[1 - r][1 - dd]); - if (Trace.isOn("sygus-cons-kind")) + if (TraceIsOn("sygus-cons-kind")) { Trace("sygus-cons-kind") << "Can construct kind " << k << " in " << tn diff --git a/src/theory/quantifiers/sygus/type_info.cpp b/src/theory/quantifiers/sygus/type_info.cpp index f9023ba62..b4a852c26 100644 --- a/src/theory/quantifiers/sygus/type_info.cpp +++ b/src/theory/quantifiers/sygus/type_info.cpp @@ -191,7 +191,7 @@ void SygusTypeInfo::initialize(TermDbSygus* tds, TypeNode tn) { d_hasBoolConnective = true; } - if (Trace.isOn("sygus-db")) + if (TraceIsOn("sygus-db")) { Node eop = datatypes::utils::getExpandedDefinitionForm(sop); Trace("sygus-db") << "Expanded form: "; diff --git a/src/theory/quantifiers/sygus_sampler.cpp b/src/theory/quantifiers/sygus_sampler.cpp index b2320481f..ae74b94a1 100644 --- a/src/theory/quantifiers/sygus_sampler.cpp +++ b/src/theory/quantifiers/sygus_sampler.cpp @@ -231,7 +231,7 @@ void SygusSampler::initializeSamples(unsigned nsamples) } if (d_samples_trie.add(sample_pt)) { - if (Trace.isOn("sygus-sample")) + if (TraceIsOn("sygus-sample")) { Trace("sygus-sample") << "Sample point #" << i << " : "; for (const Node& r : sample_pt) diff --git a/src/theory/quantifiers/term_database.cpp b/src/theory/quantifiers/term_database.cpp index b12acf942..767c74c92 100644 --- a/src/theory/quantifiers/term_database.cpp +++ b/src/theory/quantifiers/term_database.cpp @@ -398,7 +398,7 @@ void TermDb::computeUfTerms( TNode f ) { } } Node lem = nm->mkOr(lits); - if (Trace.isOn("term-db-lemma")) + if (TraceIsOn("term-db-lemma")) { Trace("term-db-lemma") << "Disequal congruent terms : " << at << " " << n << "!!!!" << std::endl; @@ -418,7 +418,7 @@ void TermDb::computeUfTerms( TNode f ) { nonCongruentCount++; d_op_nonred_count[f]++; } - if (Trace.isOn("tdb")) + if (TraceIsOn("tdb")) { Trace("tdb") << "Term db size [" << f << "] : " << nonCongruentCount << " / "; diff --git a/src/theory/quantifiers/term_tuple_enumerator.cpp b/src/theory/quantifiers/term_tuple_enumerator.cpp index 6982fc806..313ee2015 100644 --- a/src/theory/quantifiers/term_tuple_enumerator.cpp +++ b/src/theory/quantifiers/term_tuple_enumerator.cpp @@ -269,7 +269,7 @@ bool TermTupleEnumeratorBase::hasNext() void TermTupleEnumeratorBase::failureReason(const std::vector& mask) { - if (Trace.isOn("inst-alg")) + if (TraceIsOn("inst-alg")) { traceMaskedVector("inst-alg", "failureReason", mask, d_termIndex); } diff --git a/src/theory/quantifiers/theory_quantifiers.cpp b/src/theory/quantifiers/theory_quantifiers.cpp index d726d6db9..f134e5c42 100644 --- a/src/theory/quantifiers/theory_quantifiers.cpp +++ b/src/theory/quantifiers/theory_quantifiers.cpp @@ -89,18 +89,18 @@ void TheoryQuantifiers::preRegisterTerm(TNode n) { return; } - Debug("quantifiers-prereg") + Trace("quantifiers-prereg") << "TheoryQuantifiers::preRegisterTerm() " << n << std::endl; // Preregister the quantified formula. // This initializes the modules used for handling n in this user context. getQuantifiersEngine()->preRegisterQuantifier(n); - Debug("quantifiers-prereg") + Trace("quantifiers-prereg") << "TheoryQuantifiers::preRegisterTerm() done " << n << std::endl; } void TheoryQuantifiers::presolve() { - Debug("quantifiers-presolve") << "TheoryQuantifiers::presolve()" << std::endl; + Trace("quantifiers-presolve") << "TheoryQuantifiers::presolve()" << std::endl; if( getQuantifiersEngine() ){ getQuantifiersEngine()->presolve(); } @@ -141,7 +141,7 @@ bool TheoryQuantifiers::collectModelValues(TheoryModel* m, for(assertions_iterator i = facts_begin(); i != facts_end(); ++i) { if ((*i).d_assertion.getKind() == NOT) { - Debug("quantifiers::collectModelInfo") + Trace("quantifiers::collectModelInfo") << "got quant FALSE: " << (*i).d_assertion[0] << std::endl; if (!m->assertPredicate((*i).d_assertion[0], false)) { @@ -150,7 +150,7 @@ bool TheoryQuantifiers::collectModelValues(TheoryModel* m, } else { - Debug("quantifiers::collectModelInfo") + Trace("quantifiers::collectModelInfo") << "got quant TRUE : " << *i << std::endl; if (!m->assertPredicate(*i, true)) { diff --git a/src/theory/quantifiers/theory_quantifiers_type_rules.cpp b/src/theory/quantifiers/theory_quantifiers_type_rules.cpp index 14f066ce1..be8677465 100644 --- a/src/theory/quantifiers/theory_quantifiers_type_rules.cpp +++ b/src/theory/quantifiers/theory_quantifiers_type_rules.cpp @@ -23,7 +23,7 @@ TypeNode QuantifierTypeRule::computeType(NodeManager* nodeManager, TNode n, bool check) { - Debug("typecheck-q") << "type check for fa " << n << std::endl; + Trace("typecheck-q") << "type check for fa " << n << std::endl; Assert((n.getKind() == kind::FORALL || n.getKind() == kind::EXISTS) && n.getNumChildren() > 0); if (check) diff --git a/src/theory/quantifiers_engine.cpp b/src/theory/quantifiers_engine.cpp index dd510a861..e5d019a76 100644 --- a/src/theory/quantifiers_engine.cpp +++ b/src/theory/quantifiers_engine.cpp @@ -270,12 +270,12 @@ void QuantifiersEngine::check( Theory::Effort e ){ } double clSet = 0; - if( Trace.isOn("quant-engine") ){ + if( TraceIsOn("quant-engine") ){ clSet = double(clock())/double(CLOCKS_PER_SEC); Trace("quant-engine") << ">>>>> Quantifiers Engine Round, effort = " << e << " <<<<<" << std::endl; } - if( Trace.isOn("quant-engine-debug") ){ + if( TraceIsOn("quant-engine-debug") ){ Trace("quant-engine-debug") << "Quantifiers Engine check, level = " << e << std::endl; Trace("quant-engine-debug") << " depth : " << d_qstate.getInstRoundDepth() << std::endl; @@ -297,11 +297,11 @@ void QuantifiersEngine::check( Theory::Effort e ){ Trace("quant-engine-debug") << " In conflict : " << d_qstate.isInConflict() << std::endl; } - if( Trace.isOn("quant-engine-ee-pre") ){ + if( TraceIsOn("quant-engine-ee-pre") ){ Trace("quant-engine-ee-pre") << "Equality engine (pre-inference): " << std::endl; d_qstate.debugPrintEqualityEngine("quant-engine-ee-pre"); } - if( Trace.isOn("quant-engine-assert") ){ + if( TraceIsOn("quant-engine-assert") ){ Trace("quant-engine-assert") << "Assertions : " << std::endl; d_te->printAssertions("quant-engine-assert"); } @@ -325,7 +325,7 @@ void QuantifiersEngine::check( Theory::Effort e ){ } } - if( Trace.isOn("quant-engine-ee") ){ + if( TraceIsOn("quant-engine-ee") ){ Trace("quant-engine-ee") << "Equality engine : " << std::endl; d_qstate.debugPrintEqualityEngine("quant-engine-ee"); } @@ -485,7 +485,7 @@ void QuantifiersEngine::check( Theory::Effort e ){ d_qim.getInstantiate()->notifyEndRound(); d_numInstRoundsLemma++; } - if( Trace.isOn("quant-engine") ){ + if( TraceIsOn("quant-engine") ){ double clSet2 = double(clock())/double(CLOCKS_PER_SEC); Trace("quant-engine") << "Finished quantifiers engine, total time = " << (clSet2-clSet); Trace("quant-engine") << ", sent lemma = " << d_qim.hasSentLemma(); @@ -629,7 +629,7 @@ void QuantifiersEngine::assertQuantifier( Node f, bool pol ){ TrustNode lem = d_qim.getSkolemize()->process(f); if (!lem.isNull()) { - if (Trace.isOn("quantifiers-sk-debug")) + if (TraceIsOn("quantifiers-sk-debug")) { Node slem = rewrite(lem.getNode()); Trace("quantifiers-sk-debug") diff --git a/src/theory/relevance_manager.cpp b/src/theory/relevance_manager.cpp index b501deffc..f7ff74098 100644 --- a/src/theory/relevance_manager.cpp +++ b/src/theory/relevance_manager.cpp @@ -171,7 +171,7 @@ void RelevanceManager::computeRelevance() return; } } - if (Trace.isOn("rel-manager")) + if (TraceIsOn("rel-manager")) { if (d_inFullEffortCheck) { diff --git a/src/theory/rep_set.cpp b/src/theory/rep_set.cpp index f6af5b680..87d4bac3c 100644 --- a/src/theory/rep_set.cpp +++ b/src/theory/rep_set.cpp @@ -287,7 +287,7 @@ bool RepSetIterator::initialize() std::vector varOrder; if (d_rext->getVariableOrder(d_owner, varOrder)) { - if (Trace.isOn("bound-int-rsi")) + if (TraceIsOn("bound-int-rsi")) { Trace("bound-int-rsi") << "Variable order : "; for (unsigned i = 0; i < varOrder.size(); i++) @@ -303,7 +303,7 @@ bool RepSetIterator::initialize() Assert(varOrder[i] < indexOrder.size()); indexOrder[varOrder[i]] = i; } - if (Trace.isOn("bound-int-rsi")) + if (TraceIsOn("bound-int-rsi")) { Trace("bound-int-rsi") << "Will use index order : "; for (unsigned i = 0; i < indexOrder.size(); i++) @@ -453,16 +453,16 @@ void RepSetIterator::getCurrentTerms(std::vector& terms) const void RepSetIterator::debugPrint( const char* c ){ for( unsigned v=0; v()" << endl; + Trace("sharing") << "Theory::computeCareGraph<" << getId() << ">()" << endl; for (unsigned i = 0; i < d_sharedTerms.size(); ++ i) { TNode a = d_sharedTerms[i]; TypeNode aType = a.getType(); @@ -645,7 +645,7 @@ void TheorySep::postCheck(Effort level) } } // debug print - if (Trace.isOn("sep-process")) + if (TraceIsOn("sep-process")) { Trace("sep-process") << "--- Current spatial assertions : " << std::endl; for( NodeList::const_iterator i = d_spatial_assertions.begin(); i != d_spatial_assertions.end(); ++i ) { @@ -659,7 +659,7 @@ void TheorySep::postCheck(Effort level) } Trace("sep-process") << "---" << std::endl; } - if (Trace.isOn("sep-eqc")) + if (TraceIsOn("sep-eqc")) { Trace("sep-eqc") << d_equalityEngine->debugPrintEqc(); } @@ -1377,7 +1377,7 @@ Node TheorySep::instantiateLabel(Node n, } else { - if( Trace.isOn("sep-inst") ){ + if( TraceIsOn("sep-inst") ){ if( n.getKind()==kind::SEP_STAR || n.getKind()==kind::SEP_WAND || n.getKind()==kind::SEP_PTO || n.getKind()==kind::SEP_EMP ){ for( unsigned j=0; j= prvs) @@ -114,7 +114,7 @@ class NormalForm { << " not due to final " << n << std::endl; return false; } - Debug("sets-checknormal") + Trace("sets-checknormal") << "[sets-checknormal] lst element = " << n[0] << " " << n[0].getId() << std::endl; // compare last ID diff --git a/src/theory/sets/theory_sets.cpp b/src/theory/sets/theory_sets.cpp index dbc52f387..7b62f0589 100644 --- a/src/theory/sets/theory_sets.cpp +++ b/src/theory/sets/theory_sets.cpp @@ -164,7 +164,7 @@ Theory::PPAssertStatus TheorySets::ppAssert( TrustNode tin, TrustSubstitutionMap& outSubstitutions) { TNode in = tin.getNode(); - Debug("sets-proc") << "ppAssert : " << in << std::endl; + Trace("sets-proc") << "ppAssert : " << in << std::endl; Theory::PPAssertStatus status = Theory::PP_ASSERT_STATUS_UNSOLVED; // this is based off of Theory::ppAssert @@ -213,21 +213,21 @@ bool TheorySets::isEntailed( Node n, bool pol ) { void TheorySets::NotifyClass::eqNotifyNewClass(TNode t) { - Debug("sets-eq") << "[sets-eq] eqNotifyNewClass:" + Trace("sets-eq") << "[sets-eq] eqNotifyNewClass:" << " t = " << t << std::endl; d_theory.eqNotifyNewClass(t); } void TheorySets::NotifyClass::eqNotifyMerge(TNode t1, TNode t2) { - Debug("sets-eq") << "[sets-eq] eqNotifyMerge:" + Trace("sets-eq") << "[sets-eq] eqNotifyMerge:" << " t1 = " << t1 << " t2 = " << t2 << std::endl; d_theory.eqNotifyMerge(t1, t2); } void TheorySets::NotifyClass::eqNotifyDisequal(TNode t1, TNode t2, TNode reason) { - Debug("sets-eq") << "[sets-eq] eqNotifyDisequal:" + Trace("sets-eq") << "[sets-eq] eqNotifyDisequal:" << " t1 = " << t1 << " t2 = " << t2 << " reason = " << reason << std::endl; d_theory.eqNotifyDisequal(t1, t2, reason); diff --git a/src/theory/sets/theory_sets_private.cpp b/src/theory/sets/theory_sets_private.cpp index 6bc582700..df6f17e80 100644 --- a/src/theory/sets/theory_sets_private.cpp +++ b/src/theory/sets/theory_sets_private.cpp @@ -335,7 +335,7 @@ void TheorySetsPrivate::fullEffortCheck() Trace("sets-eqc") << "...finished equality engine." << std::endl; - if (Trace.isOn("sets-state")) + if (TraceIsOn("sets-state")) { Trace("sets-state") << "Equivalence class counters:" << std::endl; for (std::pair& ec : eqcTypeCount) @@ -351,7 +351,7 @@ void TheorySetsPrivate::fullEffortCheck() { continue; } - if (Trace.isOn("sets-mem")) + if (TraceIsOn("sets-mem")) { const std::vector& sec = d_state.getSetsEqClasses(); for (const Node& s : sec) @@ -1254,7 +1254,7 @@ bool TheorySetsPrivate::isEntailed(Node n, bool pol) Node TheorySetsPrivate::explain(TNode literal) { - Debug("sets") << "TheorySetsPrivate::explain(" << literal << ")" << std::endl; + Trace("sets") << "TheorySetsPrivate::explain(" << literal << ")" << std::endl; bool polarity = literal.getKind() != kind::NOT; TNode atom = polarity ? literal : literal[0]; @@ -1270,7 +1270,7 @@ Node TheorySetsPrivate::explain(TNode literal) } else { - Debug("sets") << "unhandled: " << literal << "; (" << atom << ", " + Trace("sets") << "unhandled: " << literal << "; (" << atom << ", " << polarity << "); kind" << atom.getKind() << std::endl; Unhandled(); } @@ -1280,7 +1280,7 @@ Node TheorySetsPrivate::explain(TNode literal) void TheorySetsPrivate::preRegisterTerm(TNode node) { - Debug("sets") << "TheorySetsPrivate::preRegisterTerm(" << node << ")" + Trace("sets") << "TheorySetsPrivate::preRegisterTerm(" << node << ")" << std::endl; TypeNode tn = node.getType(); if (tn.isSet()) @@ -1324,7 +1324,7 @@ void TheorySetsPrivate::preRegisterTerm(TNode node) TrustNode TheorySetsPrivate::ppRewrite(Node node, std::vector& lems) { - Debug("sets-proc") << "ppRewrite : " << node << std::endl; + Trace("sets-proc") << "ppRewrite : " << node << std::endl; switch (node.getKind()) { diff --git a/src/theory/sets/theory_sets_rels.cpp b/src/theory/sets/theory_sets_rels.cpp index d6a52b76e..c113f0b83 100644 --- a/src/theory/sets/theory_sets_rels.cpp +++ b/src/theory/sets/theory_sets_rels.cpp @@ -1397,8 +1397,8 @@ void TheorySetsRels::check(Theory::Effort level) void TupleTrie::debugPrint( const char * c, Node n, unsigned depth ) { for( std::map< Node, TupleTrie >::iterator it = d_data.begin(); it != d_data.end(); ++it ){ - for( unsigned i=0; ifirst << std::endl; + for( unsigned i=0; ifirst << std::endl; it->second.debugPrint( c, n, depth+1 ); } } diff --git a/src/theory/shared_terms_database.cpp b/src/theory/shared_terms_database.cpp index 9503d1378..8f6317ef8 100644 --- a/src/theory/shared_terms_database.cpp +++ b/src/theory/shared_terms_database.cpp @@ -77,7 +77,7 @@ void SharedTermsDatabase::addSharedTerm(TNode atom, TNode term, TheoryIdSet theories) { - Debug("register") << "SharedTermsDatabase::addSharedTerm(" << atom << ", " + Trace("register") << "SharedTermsDatabase::addSharedTerm(" << atom << ", " << term << ", " << TheoryIdSetUtil::setToString(theories) << ")" << std::endl; @@ -154,7 +154,7 @@ TheoryIdSet SharedTermsDatabase::getNotifiedTheories(TNode term) const bool SharedTermsDatabase::propagateSharedEquality(TheoryId theory, TNode a, TNode b, bool value) { - Debug("shared-terms-database") << "SharedTermsDatabase::newEquality(" << theory << "," << a << "," << b << ", " << (value ? "true" : "false") << ")" << endl; + Trace("shared-terms-database") << "SharedTermsDatabase::newEquality(" << theory << "," << a << "," << b << ", " << (value ? "true" : "false") << ")" << endl; if (d_inConflict) { return false; @@ -188,7 +188,7 @@ void SharedTermsDatabase::markNotified(TNode term, TheoryIdSet theories) return; } - Debug("shared-terms-database") << "SharedTermsDatabase::markNotified(" << term << ")" << endl; + Trace("shared-terms-database") << "SharedTermsDatabase::markNotified(" << term << ")" << endl; // First update the set of notified theories for this term d_alreadyNotifiedMap[term] = @@ -246,7 +246,7 @@ theory::eq::EqualityEngine* SharedTermsDatabase::getEqualityEngine() void SharedTermsDatabase::assertShared(TNode n, bool polarity, TNode reason) { Assert(d_equalityEngine != nullptr); - Debug("shared-terms-database::assert") + Trace("shared-terms-database::assert") << "SharedTermsDatabase::assertShared(" << n << ", " << (polarity ? "true" : "false") << ", " << reason << ")" << endl; // Add it to the equality engine diff --git a/src/theory/sort_inference.cpp b/src/theory/sort_inference.cpp index d44492259..bf2542fe5 100644 --- a/src/theory/sort_inference.cpp +++ b/src/theory/sort_inference.cpp @@ -277,7 +277,7 @@ void SortInference::getNewAssertions(std::vector& new_asserts) } } } - if (Trace.isOn("sort-inference-rewrite")) + if (TraceIsOn("sort-inference-rewrite")) { Trace("sort-inference-rewrite") << "Add the following injections for " << tss.first diff --git a/src/theory/strings/arith_entail.cpp b/src/theory/strings/arith_entail.cpp index eb9e07bdc..7db30b921 100644 --- a/src/theory/strings/arith_entail.cpp +++ b/src/theory/strings/arith_entail.cpp @@ -215,7 +215,7 @@ bool ArithEntail::checkApprox(Node ar) { return false; } - if (Trace.isOn("strings-ent-approx")) + if (TraceIsOn("strings-ent-approx")) { Trace("strings-ent-approx") << "---- Check arithmetic entailment by under-approximation " << ar diff --git a/src/theory/strings/array_core_solver.cpp b/src/theory/strings/array_core_solver.cpp index a895b9083..ce92b5323 100644 --- a/src/theory/strings/array_core_solver.cpp +++ b/src/theory/strings/array_core_solver.cpp @@ -218,7 +218,7 @@ void ArrayCoreSolver::check(const std::vector& nthTerms, NodeManager* nm = NodeManager::currentNM(); Trace("seq-array-debug") << "NTH SIZE: " << nthTerms.size() << std::endl; - if (Trace.isOn("seq-array-terms")) + if (TraceIsOn("seq-array-terms")) { for (const Node& n : nthTerms) { @@ -227,7 +227,7 @@ void ArrayCoreSolver::check(const std::vector& nthTerms, } Trace("seq-array-debug") << "UPDATE SIZE: " << updateTerms.size() << std::endl; - if (Trace.isOn("seq-array-terms")) + if (TraceIsOn("seq-array-terms")) { for (const Node& n : updateTerms) { @@ -320,7 +320,7 @@ void ArrayCoreSolver::computeConnected(const std::vector& updateTerms) const std::map& ArrayCoreSolver::getWriteModel(Node eqc) { - if (Trace.isOn("seq-write-model")) + if (TraceIsOn("seq-write-model")) { Trace("seq-write-model") << "write model of " << eqc << ":" << std::endl; for (auto& x : d_writeModel[eqc]) diff --git a/src/theory/strings/base_solver.cpp b/src/theory/strings/base_solver.cpp index 3f3c5ed01..7008c7107 100644 --- a/src/theory/strings/base_solver.cpp +++ b/src/theory/strings/base_solver.cpp @@ -290,7 +290,7 @@ void BaseSolver::checkInit() } ++eqcs_i; } - if (Trace.isOn("strings-base")) + if (TraceIsOn("strings-base")) { for (const std::pair>& cc : congruentCount) @@ -351,7 +351,7 @@ void BaseSolver::checkConstantEquivalenceClasses(TermIndex* ti, } if (!isConst || !d_state.areEqual(n, c)) { - if (Trace.isOn("strings-debug")) + if (TraceIsOn("strings-debug")) { Trace("strings-debug") << "Constant eqc : " << c << " for " << n << std::endl; diff --git a/src/theory/strings/core_solver.cpp b/src/theory/strings/core_solver.cpp index 4bf2406dd..3a00752d5 100644 --- a/src/theory/strings/core_solver.cpp +++ b/src/theory/strings/core_solver.cpp @@ -127,7 +127,7 @@ void CoreSolver::checkCycles() void CoreSolver::checkFlatForms() { // debug print flat forms - if (Trace.isOn("strings-ff")) + if (TraceIsOn("strings-ff")) { Trace("strings-ff") << "Flat forms : " << std::endl; debugPrintFlatForms("strings-ff"); @@ -343,7 +343,7 @@ void CoreSolver::checkFlatForm(std::vector& eqc, Node lcc = d_state.getLength(bc, lexp2); if (d_state.areEqual(lcurr, lcc)) { - if (Trace.isOn("strings-ff-debug")) + if (TraceIsOn("strings-ff-debug")) { Trace("strings-ff-debug") << "Infer " << ac << " == " << bc << " since " << lcurr @@ -569,7 +569,7 @@ void CoreSolver::checkNormalFormsEq() Trace("strings-process-debug") << "Done verifying normal forms are the same for " << eqc << std::endl; } - if (Trace.isOn("strings-nf")) + if (TraceIsOn("strings-nf")) { Trace("strings-nf") << "**** Normal forms are : " << std::endl; for (std::map::iterator it = eqc_to_exp.begin(); @@ -893,7 +893,7 @@ void CoreSolver::getNormalForms(Node eqc, { for (const Node& nn : nfrv) { - if (Trace.isOn("strings-error")) + if (TraceIsOn("strings-error")) { if (nn.getKind() == STRING_CONCAT) { @@ -957,7 +957,7 @@ void CoreSolver::getNormalForms(Node eqc, { for (unsigned i = 0; i < currv.size(); i++) { - if (Trace.isOn("strings-error")) + if (TraceIsOn("strings-error")) { Trace("strings-error") << "Cycle for normal form "; utils::printConcatTrace(currv, "strings-error"); @@ -1005,7 +1005,7 @@ void CoreSolver::getNormalForms(Node eqc, nf_triv.init(eqc_non_c); normal_forms.push_back(nf_triv); }else{ - if(Trace.isOn("strings-solve")) { + if(TraceIsOn("strings-solve")) { Trace("strings-solve") << "--- Normal forms for equivalance class " << eqc << " : " << std::endl; for (unsigned i = 0, size = normal_forms.size(); i < size; i++) { @@ -2595,7 +2595,7 @@ void CoreSolver::checkNormalFormsDeq() { n[i] = ee->getRepresentative(eq[i]); } - if (Trace.isOn("strings-solve")) + if (TraceIsOn("strings-solve")) { Trace("strings-solve") << "- Compare " << n[0] << ", nf "; utils::printConcatTrace(getNormalForm(n[0]).d_nf, "strings-solve"); @@ -2631,7 +2631,7 @@ void CoreSolver::checkLengthsEqc() { if (ei->d_normalizedLength.get().isNull()) { Node nf = d_termReg.mkNConcat(nfi.d_nf, stype); - if (Trace.isOn("strings-process-debug")) + if (TraceIsOn("strings-process-debug")) { Trace("strings-process-debug") << " normal form is " << nf << " from base " << nfi.d_base diff --git a/src/theory/strings/extf_solver.cpp b/src/theory/strings/extf_solver.cpp index 101814102..be8e2de5b 100644 --- a/src/theory/strings/extf_solver.cpp +++ b/src/theory/strings/extf_solver.cpp @@ -474,7 +474,7 @@ void ExtfSolver::checkExtfEval(int effort) { checkExtfInference(n, to_reduce, einfo, effort); } - if (Trace.isOn("strings-extf-list")) + if (TraceIsOn("strings-extf-list")) { Trace("strings-extf-list") << " * " << to_reduce; if (!einfo.d_const.isNull()) diff --git a/src/theory/strings/infer_proof_cons.cpp b/src/theory/strings/infer_proof_cons.cpp index 9f0c2cb3f..73aa484fd 100644 --- a/src/theory/strings/infer_proof_cons.cpp +++ b/src/theory/strings/infer_proof_cons.cpp @@ -149,7 +149,7 @@ void InferProofCons::convert(InferenceId infer, utils::flattenOp(AND, ec, ps.d_children); } // debug print - if (Trace.isOn("strings-ipc-debug")) + if (TraceIsOn("strings-ipc-debug")) { Trace("strings-ipc-debug") << "InferProofCons::convert: " << infer << (isRev ? " :rev " : " ") << conc << std::endl; @@ -1035,7 +1035,7 @@ void InferProofCons::convert(InferenceId infer, if (!success) { // debug print - if (Trace.isOn("strings-ipc-fail")) + if (TraceIsOn("strings-ipc-fail")) { Trace("strings-ipc-fail") << "InferProofCons::convert: Failed " << infer @@ -1054,7 +1054,7 @@ void InferProofCons::convert(InferenceId infer, // use the trust rule ps.d_rule = PfRule::THEORY_INFERENCE; } - if (Trace.isOn("strings-ipc-debug")) + if (TraceIsOn("strings-ipc-debug")) { if (useBuffer) { diff --git a/src/theory/strings/inference_manager.cpp b/src/theory/strings/inference_manager.cpp index b12833b05..1580df5e7 100644 --- a/src/theory/strings/inference_manager.cpp +++ b/src/theory/strings/inference_manager.cpp @@ -206,7 +206,7 @@ void InferenceManager::sendInference(InferInfo& ii, bool asLemma) InferInfo iiSubsLem(ii.getId()); iiSubsLem.d_sim = this; iiSubsLem.d_conc = eqs; - if (Trace.isOn("strings-lemma-debug")) + if (TraceIsOn("strings-lemma-debug")) { Trace("strings-lemma-debug") << "Strings::Infer " << iiSubsLem << std::endl; @@ -217,7 +217,7 @@ void InferenceManager::sendInference(InferInfo& ii, bool asLemma) addPendingLemma(std::unique_ptr(new InferInfo(iiSubsLem))); return; } - if (Trace.isOn("strings-lemma-debug")) + if (TraceIsOn("strings-lemma-debug")) { for (const Node& u : unproc) { @@ -254,7 +254,7 @@ void InferenceManager::addToExplanation(Node a, { if (a != b) { - Debug("strings-explain") + Trace("strings-explain") << "Add to explanation : " << a << " == " << b << std::endl; Assert(d_state.areEqual(a, b)); exp.push_back(a.eqNode(b)); diff --git a/src/theory/strings/regexp_operation.cpp b/src/theory/strings/regexp_operation.cpp index 2b6c4a697..f8c175595 100644 --- a/src/theory/strings/regexp_operation.cpp +++ b/src/theory/strings/regexp_operation.cpp @@ -820,7 +820,7 @@ void RegExpOpr::firstChars(Node r, std::set &pcset, SetNodes &pvset) d_fset_cache[r] = p; } - if(Trace.isOn("regexp-fset")) { + if(TraceIsOn("regexp-fset")) { Trace("regexp-fset") << "END FSET(" << mkString(r) << ") = {"; for (std::set::const_iterator it = pcset.begin(); it != pcset.end(); @@ -1280,7 +1280,7 @@ Node RegExpOpr::intersectInternal( Node r1, Node r2, std::map< PairNodes, Node > Unreachable(); } } - if(Trace.isOn("regexp-int-debug")) { + if(TraceIsOn("regexp-int-debug")) { Trace("regexp-int-debug") << "Try CSET(" << cset.size() << ") = {"; for (std::vector::const_iterator it = cset.begin(); it != cset.end(); @@ -1424,7 +1424,7 @@ Node RegExpOpr::removeIntersection(Node r) { } while (!visit.empty()); Assert(visited.find(r) != visited.end()); Assert(!visited.find(r)->second.isNull()); - if (Trace.isOn("regexp-intersect")) + if (TraceIsOn("regexp-intersect")) { Trace("regexp-intersect") << "Remove INTERSECTION( " << mkString(r) << " ) = " << mkString(visited[r]) << std::endl; diff --git a/src/theory/strings/solver_state.cpp b/src/theory/strings/solver_state.cpp index 96e143244..6a64a57d5 100644 --- a/src/theory/strings/solver_state.cpp +++ b/src/theory/strings/solver_state.cpp @@ -95,7 +95,7 @@ Node SolverState::getLengthExp(Node t, std::vector& exp, Node te) { lengthTerm = lengthTerm[0]; } - Debug("strings") << "SolverState::getLengthTerm " << t << " is " << lengthTerm + Trace("strings") << "SolverState::getLengthTerm " << t << " is " << lengthTerm << std::endl; if (te != lengthTerm) { diff --git a/src/theory/strings/theory_strings.cpp b/src/theory/strings/theory_strings.cpp index 0f1a2f415..740e32434 100644 --- a/src/theory/strings/theory_strings.cpp +++ b/src/theory/strings/theory_strings.cpp @@ -190,12 +190,12 @@ bool TheoryStrings::propagateLit(TNode literal) TrustNode TheoryStrings::explain(TNode literal) { - Debug("strings-explain") << "explain called on " << literal << std::endl; + Trace("strings-explain") << "explain called on " << literal << std::endl; return d_im.explainLit(literal); } void TheoryStrings::presolve() { - Debug("strings-presolve") + Trace("strings-presolve") << "TheoryStrings::Presolving : get fmf options " << (options().strings.stringFMF ? "true" : "false") << std::endl; d_strat.initializeStrategy(); @@ -211,7 +211,7 @@ void TheoryStrings::presolve() { d_stringsFmf.getDecisionStrategy(), DecisionManager::STRAT_SCOPE_LOCAL_SOLVE); } - Debug("strings-presolve") << "Finished presolve" << std::endl; + Trace("strings-presolve") << "Finished presolve" << std::endl; } ///////////////////////////////////////////////////////////////////////////// @@ -221,7 +221,7 @@ void TheoryStrings::presolve() { bool TheoryStrings::collectModelValues(TheoryModel* m, const std::set& termSet) { - if (Trace.isOn("strings-debug-model")) + if (TraceIsOn("strings-debug-model")) { Trace("strings-debug-model") << "TheoryStrings::collectModelValues" << std::endl; @@ -701,7 +701,7 @@ bool TheoryStrings::collectModelInfoType( if (processed.find(rn) == processed.end()) { NormalForm& nf = d_csolver.getNormalForm(rn); - if (Trace.isOn("strings-model")) + if (TraceIsOn("strings-model")) { Trace("strings-model") << "Construct model for " << rn << " based on normal form "; @@ -875,7 +875,7 @@ void TheoryStrings::postCheck(Effort e) { Trace("strings-check-debug") << "Theory of strings " << e << " effort check " << std::endl; - if (Trace.isOn("strings-eqc")) + if (TraceIsOn("strings-eqc")) { Trace("strings-eqc") << debugPrintStringsEqc() << std::endl; } @@ -900,7 +900,7 @@ void TheoryStrings::postCheck(Effort e) // (2) unsuccessfully processed pending lemmas. // In either case, we repeat the strategy if we are not in conflict. sentLemma = d_im.hasSentLemma(); - if (Trace.isOn("strings-check")) + if (TraceIsOn("strings-check")) { Trace("strings-check") << " ...finish run strategy: "; Trace("strings-check") << (hadPending ? "hadPending " : ""); diff --git a/src/theory/strings/theory_strings.h b/src/theory/strings/theory_strings.h index 9d15af896..ac04d0ed6 100644 --- a/src/theory/strings/theory_strings.h +++ b/src/theory/strings/theory_strings.h @@ -122,7 +122,7 @@ class TheoryStrings : public Theory { NotifyClass(TheoryStrings& ts) : d_str(ts) {} bool eqNotifyTriggerPredicate(TNode predicate, bool value) override { - Debug("strings") << "NotifyClass::eqNotifyTriggerPredicate(" << predicate + Trace("strings") << "NotifyClass::eqNotifyTriggerPredicate(" << predicate << ", " << (value ? "true" : "false") << ")" << std::endl; if (value) { @@ -135,7 +135,7 @@ class TheoryStrings : public Theory { TNode t2, bool value) override { - Debug("strings") << "NotifyClass::eqNotifyTriggerTermMerge(" << tag << ", " << t1 << ", " << t2 << ")" << std::endl; + Trace("strings") << "NotifyClass::eqNotifyTriggerTermMerge(" << tag << ", " << t1 << ", " << t2 << ")" << std::endl; if (value) { return d_str.propagateLit(t1.eqNode(t2)); } @@ -143,17 +143,17 @@ class TheoryStrings : public Theory { } void eqNotifyConstantTermMerge(TNode t1, TNode t2) override { - Debug("strings") << "NotifyClass::eqNotifyConstantTermMerge(" << t1 << ", " << t2 << ")" << std::endl; + Trace("strings") << "NotifyClass::eqNotifyConstantTermMerge(" << t1 << ", " << t2 << ")" << std::endl; d_str.conflict(t1, t2); } void eqNotifyNewClass(TNode t) override { - Debug("strings") << "NotifyClass::eqNotifyNewClass(" << t << std::endl; + Trace("strings") << "NotifyClass::eqNotifyNewClass(" << t << std::endl; d_str.eqNotifyNewClass(t); } void eqNotifyMerge(TNode t1, TNode t2) override { - Debug("strings") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2 + Trace("strings") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2 << std::endl; d_str.eqNotifyMerge(t1, t2); } diff --git a/src/theory/substitutions.cpp b/src/theory/substitutions.cpp index 4e1e219d4..1f7000850 100644 --- a/src/theory/substitutions.cpp +++ b/src/theory/substitutions.cpp @@ -54,7 +54,7 @@ Node SubstitutionMap::internalSubstitute(TNode t, std::set* tracker, const ShouldTraverseCallback* stc) { - Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << ")" << endl; + Trace("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << ")" << endl; if (d_substitutions.empty()) { return t; @@ -70,7 +70,7 @@ Node SubstitutionMap::internalSubstitute(TNode t, substitution_stack_element& stackHead = toVisit.back(); TNode current = stackHead.d_node; - Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): processing " << current << endl; + Trace("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): processing " << current << endl; // If node already in the cache we're done, pop from the stack NodeCache::iterator find = cache.find(current); @@ -132,7 +132,7 @@ Node SubstitutionMap::internalSubstitute(TNode t, } } } - Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): setting " << current << " -> " << result << endl; + Trace("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): setting " << current << " -> " << result << endl; cache[current] = result; toVisit.pop_back(); } @@ -165,7 +165,7 @@ Node SubstitutionMap::internalSubstitute(TNode t, else { // No children, so we're done - Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): setting " << current << " -> " << current << endl; + Trace("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): setting " << current << " -> " << current << endl; cache[current] = current; toVisit.pop_back(); } @@ -178,7 +178,7 @@ Node SubstitutionMap::internalSubstitute(TNode t, void SubstitutionMap::addSubstitution(TNode x, TNode t, bool invalidateCache) { - Debug("substitution") << "SubstitutionMap::addSubstitution(" << x << ", " << t << ")" << endl; + Trace("substitution") << "SubstitutionMap::addSubstitution(" << x << ", " << t << ")" << endl; Assert(d_substitutions.find(x) == d_substitutions.end()); // this causes a later assert-fail (the rhs != current one, above) anyway @@ -218,18 +218,18 @@ Node SubstitutionMap::apply(TNode t, std::set* tracker, const ShouldTraverseCallback* stc) { - Debug("substitution") << "SubstitutionMap::apply(" << t << ")" << endl; + Trace("substitution") << "SubstitutionMap::apply(" << t << ")" << endl; // Setup the cache if (d_cacheInvalidated) { d_substitutionCache.clear(); d_cacheInvalidated = false; - Debug("substitution") << "-- reset the cache" << endl; + Trace("substitution") << "-- reset the cache" << endl; } // Perform the substitution Node result = internalSubstitute(t, d_substitutionCache, tracker, stc); - Debug("substitution") << "SubstitutionMap::apply(" << t << ") => " << result << endl; + Trace("substitution") << "SubstitutionMap::apply(" << t << ") => " << result << endl; if (r != nullptr) { diff --git a/src/theory/term_registration_visitor.cpp b/src/theory/term_registration_visitor.cpp index bcc22b646..4301251bf 100644 --- a/src/theory/term_registration_visitor.cpp +++ b/src/theory/term_registration_visitor.cpp @@ -86,7 +86,7 @@ PreRegisterVisitor::PreRegisterVisitor(Env& env, TheoryEngine* engine) bool PreRegisterVisitor::alreadyVisited(TNode current, TNode parent) { - Debug("register::internal") << "PreRegisterVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl; + Trace("register::internal") << "PreRegisterVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl; if ((parent.isClosure() || parent.getKind() == kind::SEP_STAR @@ -95,7 +95,7 @@ bool PreRegisterVisitor::alreadyVisited(TNode current, TNode parent) { ) && current != parent) { - Debug("register::internal") << "quantifier:true" << std::endl; + Trace("register::internal") << "quantifier:true" << std::endl; return true; } @@ -112,9 +112,9 @@ bool PreRegisterVisitor::alreadyVisited(TNode current, TNode parent) { void PreRegisterVisitor::visit(TNode current, TNode parent) { - Debug("register") << "PreRegisterVisitor::visit(" << current << "," << parent << ")" << std::endl; - if (Debug.isOn("register::internal")) { - Debug("register::internal") << toString() << std::endl; + Trace("register") << "PreRegisterVisitor::visit(" << current << "," << parent << ")" << std::endl; + if (TraceIsOn("register::internal")) { + Trace("register::internal") << toString() << std::endl; } // get the theories we already preregistered with @@ -126,7 +126,7 @@ void PreRegisterVisitor::visit(TNode current, TNode parent) { preRegister( d_env, d_engine, visitedTheories, current, parent, visitedTheories); - Debug("register::internal") + Trace("register::internal") << "PreRegisterVisitor::visit(" << current << "," << parent << "): now registered with " << TheoryIdSetUtil::setToString(visitedTheories) << std::endl; @@ -187,7 +187,7 @@ void PreRegisterVisitor::preRegisterWithTheory(TheoryEngine* te, } if (Configuration::isAssertionBuild()) { - Debug("register::internal") + Trace("register::internal") << "PreRegisterVisitor::visit(" << current << "," << parent << "): adding " << id << std::endl; // This should never throw an exception, since theories should be @@ -236,7 +236,7 @@ std::string SharedTermsVisitor::toString() const { bool SharedTermsVisitor::alreadyVisited(TNode current, TNode parent) const { - Debug("register::internal") << "SharedTermsVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl; + Trace("register::internal") << "SharedTermsVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl; if ((parent.isClosure() || parent.getKind() == kind::SEP_STAR @@ -245,13 +245,13 @@ bool SharedTermsVisitor::alreadyVisited(TNode current, TNode parent) const { ) && current != parent) { - Debug("register::internal") << "quantifier:true" << std::endl; + Trace("register::internal") << "quantifier:true" << std::endl; return true; } TNodeVisitedMap::const_iterator find = d_visited.find(current); // If node is not visited at all, just return false if (find == d_visited.end()) { - Debug("register::internal") << "1:false" << std::endl; + Trace("register::internal") << "1:false" << std::endl; return false; } @@ -261,9 +261,9 @@ bool SharedTermsVisitor::alreadyVisited(TNode current, TNode parent) const { void SharedTermsVisitor::visit(TNode current, TNode parent) { - Debug("register") << "SharedTermsVisitor::visit(" << current << "," << parent << ")" << std::endl; - if (Debug.isOn("register::internal")) { - Debug("register::internal") << toString() << std::endl; + Trace("register") << "SharedTermsVisitor::visit(" << current << "," << parent << ")" << std::endl; + if (TraceIsOn("register::internal")) { + Trace("register::internal") << toString() << std::endl; } TheoryIdSet visitedTheories = d_visited[current]; TheoryIdSet preregTheories = d_preregistered[current]; diff --git a/src/theory/theory.cpp b/src/theory/theory.cpp index 54bdebbba..8d90f25a6 100644 --- a/src/theory/theory.cpp +++ b/src/theory/theory.cpp @@ -270,7 +270,7 @@ void Theory::notifyInConflict() } void Theory::computeCareGraph() { - Debug("sharing") << "Theory::computeCareGraph<" << getId() << ">()" << endl; + Trace("sharing") << "Theory::computeCareGraph<" << getId() << ">()" << endl; for (unsigned i = 0; i < d_sharedTerms.size(); ++ i) { TNode a = d_sharedTerms[i]; TypeNode aType = a.getType(); @@ -304,8 +304,8 @@ void Theory::printFacts(std::ostream& os) const { } void Theory::debugPrintFacts() const{ - DebugChannel.getStream() << "Theory::debugPrintFacts()" << endl; - printFacts(DebugChannel.getStream()); + TraceChannel.getStream() << "Theory::debugPrintFacts()" << endl; + printFacts(TraceChannel.getStream()); } bool Theory::isLegalElimination(TNode x, TNode val) @@ -623,9 +623,9 @@ void Theory::preRegisterTerm(TNode node) {} void Theory::addSharedTerm(TNode n) { - Debug("sharing") << "Theory::addSharedTerm<" << getId() << ">(" << n << ")" + Trace("sharing") << "Theory::addSharedTerm<" << getId() << ">(" << n << ")" << std::endl; - Debug("theory::assertions") + Trace("theory::assertions") << "Theory::addSharedTerm<" << getId() << ">(" << n << ")" << std::endl; d_sharedTerms.push_back(n); // now call theory-specific method notifySharedTerm diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp index cc705109e..2dd9d6a2c 100644 --- a/src/theory/theory_engine.cpp +++ b/src/theory/theory_engine.cpp @@ -265,7 +265,7 @@ TheoryEngine::~TheoryEngine() { void TheoryEngine::interrupt() { d_interrupted = true; } void TheoryEngine::preRegister(TNode preprocessed) { - Debug("theory") << "TheoryEngine::preRegister( " << preprocessed << ")" + Trace("theory") << "TheoryEngine::preRegister( " << preprocessed << ")" << std::endl; d_preregisterQueue.push(preprocessed); @@ -280,7 +280,7 @@ void TheoryEngine::preRegister(TNode preprocessed) { d_preregisterQueue.pop(); // the atom should not have free variables - Debug("theory") << "TheoryEngine::preRegister: " << preprocessed + Trace("theory") << "TheoryEngine::preRegister: " << preprocessed << std::endl; if (Configuration::isAssertionBuild()) { @@ -308,7 +308,7 @@ void TheoryEngine::preRegister(TNode preprocessed) { } void TheoryEngine::printAssertions(const char* tag) { - if (Trace.isOn(tag)) { + if (TraceIsOn(tag)) { for (TheoryId theoryId = THEORY_FIRST; theoryId < THEORY_LAST; ++theoryId) { Theory* theory = d_theoryTable[theoryId]; @@ -365,7 +365,7 @@ void TheoryEngine::check(Theory::Effort effort) { theoryOf(THEORY)->check(effort); \ if (d_inConflict) \ { \ - Debug("conflict") << THEORY << " in conflict. " << std::endl; \ + Trace("conflict") << THEORY << " in conflict. " << std::endl; \ break; \ } \ } @@ -380,7 +380,7 @@ void TheoryEngine::check(Theory::Effort effort) { // Mark the lemmas flag (no lemmas added) d_lemmasAdded = false; - Debug("theory") << "TheoryEngine::check(" << effort << "): d_factsAsserted = " << (d_factsAsserted ? "true" : "false") << endl; + Trace("theory") << "TheoryEngine::check(" << effort << "): d_factsAsserted = " << (d_factsAsserted ? "true" : "false") << endl; // If in full effort, we have a fake new assertion just to jumpstart the checking if (Theory::fullEffort(effort)) { @@ -397,16 +397,16 @@ void TheoryEngine::check(Theory::Effort effort) { // Check until done while (d_factsAsserted && !d_inConflict && !d_lemmasAdded) { - Debug("theory") << "TheoryEngine::check(" << effort << "): running check" << endl; + Trace("theory") << "TheoryEngine::check(" << effort << "): running check" << endl; Trace("theory::assertions") << endl; - if (Trace.isOn("theory::assertions")) { + if (TraceIsOn("theory::assertions")) { printAssertions("theory::assertions"); } if(Theory::fullEffort(effort)) { Trace("theory::assertions::fulleffort") << endl; - if (Trace.isOn("theory::assertions::fulleffort")) { + if (TraceIsOn("theory::assertions::fulleffort")) { printAssertions("theory::assertions::fulleffort"); } } @@ -417,7 +417,7 @@ void TheoryEngine::check(Theory::Effort effort) { // Do the checking CVC5_FOR_EACH_THEORY; - Debug("theory") << "TheoryEngine::check(" << effort << "): running propagation after the initial check" << endl; + Trace("theory") << "TheoryEngine::check(" << effort << "): running propagation after the initial check" << endl; // We are still satisfiable, propagate as much as possible propagate(effort); @@ -427,7 +427,7 @@ void TheoryEngine::check(Theory::Effort effort) { && !d_factsAsserted && !needCheck() && !d_inConflict) { // Do the combination - Debug("theory") << "TheoryEngine::check(" << effort << "): running combination" << endl; + Trace("theory") << "TheoryEngine::check(" << effort << "): running combination" << endl; { TimerStat::CodeTimer combineTheoriesTimer(d_combineTheoriesTime); d_tc->combineTheories(); @@ -441,7 +441,7 @@ void TheoryEngine::check(Theory::Effort effort) { // Must consult quantifiers theory for last call to ensure sat, or otherwise add a lemma if( Theory::fullEffort(effort) && ! d_inConflict && ! needCheck() ) { Trace("theory::assertions-model") << endl; - if (Trace.isOn("theory::assertions-model")) { + if (TraceIsOn("theory::assertions-model")) { printAssertions("theory::assertions-model"); } // reset the model in the combination engine @@ -481,8 +481,8 @@ void TheoryEngine::check(Theory::Effort effort) { } } - Debug("theory") << "TheoryEngine::check(" << effort << "): done, we are " << (d_inConflict ? "unsat" : "sat") << (d_lemmasAdded ? " with new lemmas" : " with no new lemmas"); - Debug("theory") << ", need check = " << (needCheck() ? "YES" : "NO") << endl; + Trace("theory") << "TheoryEngine::check(" << effort << "): done, we are " << (d_inConflict ? "unsat" : "sat") << (d_lemmasAdded ? " with new lemmas" : " with no new lemmas"); + Trace("theory") << ", need check = " << (needCheck() ? "YES" : "NO") << endl; if (Theory::fullEffort(effort)) { @@ -535,18 +535,18 @@ bool TheoryEngine::properConflict(TNode conflict) const { if (conflict.getKind() == kind::AND) { for (unsigned i = 0; i < conflict.getNumChildren(); ++ i) { if (! getPropEngine()->hasValue(conflict[i], value)) { - Debug("properConflict") << "Bad conflict is due to unassigned atom: " + Trace("properConflict") << "Bad conflict is due to unassigned atom: " << conflict[i] << endl; return false; } if (! value) { - Debug("properConflict") << "Bad conflict is due to false atom: " + Trace("properConflict") << "Bad conflict is due to false atom: " << conflict[i] << endl; return false; } if (conflict[i] != rewrite(conflict[i])) { - Debug("properConflict") + Trace("properConflict") << "Bad conflict is due to atom not in normal form: " << conflict[i] << " vs " << rewrite(conflict[i]) << endl; return false; @@ -554,18 +554,18 @@ bool TheoryEngine::properConflict(TNode conflict) const { } } else { if (! getPropEngine()->hasValue(conflict, value)) { - Debug("properConflict") << "Bad conflict is due to unassigned atom: " + Trace("properConflict") << "Bad conflict is due to unassigned atom: " << conflict << endl; return false; } if(! value) { - Debug("properConflict") << "Bad conflict is due to false atom: " + Trace("properConflict") << "Bad conflict is due to false atom: " << conflict << endl; return false; } if (conflict != rewrite(conflict)) { - Debug("properConflict") + Trace("properConflict") << "Bad conflict is due to atom not in normal form: " << conflict << " vs " << rewrite(conflict) << endl; return false; @@ -1001,7 +1001,7 @@ void TheoryEngine::assertFact(TNode literal) const AtomRequests::Request& request = it.get(); Node toAssert = polarity ? (Node)request.d_atom : request.d_atom.notNode(); - Debug("theory::atoms") << "TheoryEngine::assertFact(" << literal + Trace("theory::atoms") << "TheoryEngine::assertFact(" << literal << "): sending requested " << toAssert << endl; assertToTheory( toAssert, literal, request.d_toTheory, THEORY_SAT_SOLVER); @@ -1025,7 +1025,7 @@ void TheoryEngine::assertFact(TNode literal) } bool TheoryEngine::propagate(TNode literal, theory::TheoryId theory) { - Debug("theory::propagate") + Trace("theory::propagate") << "TheoryEngine::propagate(" << literal << ", " << theory << ")" << endl; Trace("dtview::prop") << std::string(context()->getLevel(), ' ') @@ -1134,7 +1134,7 @@ Node TheoryEngine::getModelValue(TNode var) { TrustNode TheoryEngine::getExplanation(TNode node) { - Debug("theory::explain") << "TheoryEngine::getExplanation(" << node + Trace("theory::explain") << "TheoryEngine::getExplanation(" << node << "): current propagation index = " << d_propagationMapTimestamp << endl; bool polarity = node.getKind() != kind::NOT; @@ -1143,13 +1143,13 @@ TrustNode TheoryEngine::getExplanation(TNode node) // If we're not in shared mode, explanations are simple if (!d_logicInfo.isSharingEnabled()) { - Debug("theory::explain") + Trace("theory::explain") << "TheoryEngine::getExplanation: sharing is NOT enabled. " << " Responsible theory is: " << theoryOf(atom)->getId() << std::endl; TrustNode texplanation = theoryOf(atom)->explain(node); Node explanation = texplanation.getNode(); - Debug("theory::explain") << "TheoryEngine::getExplanation(" << node + Trace("theory::explain") << "TheoryEngine::getExplanation(" << node << ") => " << explanation << endl; if (isProofEnabled()) { @@ -1169,7 +1169,7 @@ TrustNode TheoryEngine::getExplanation(TNode node) return texplanation; } - Debug("theory::explain") << "TheoryEngine::getExplanation: sharing IS enabled" + Trace("theory::explain") << "TheoryEngine::getExplanation: sharing IS enabled" << std::endl; // Initial thing to explain @@ -1177,7 +1177,7 @@ TrustNode TheoryEngine::getExplanation(TNode node) Assert(d_propagationMap.find(toExplain) != d_propagationMap.end()); NodeTheoryPair nodeExplainerPair = d_propagationMap[toExplain]; - Debug("theory::explain") + Trace("theory::explain") << "TheoryEngine::getExplanation: explainer for node " << nodeExplainerPair.d_node << " is theory: " << nodeExplainerPair.d_theory << std::endl; @@ -1186,7 +1186,7 @@ TrustNode TheoryEngine::getExplanation(TNode node) std::vector vec{d_propagationMap[toExplain]}; // Process the explanation TrustNode texplanation = getExplanation(vec); - Debug("theory::explain") << "TheoryEngine::getExplanation(" << node << ") => " + Trace("theory::explain") << "TheoryEngine::getExplanation(" << node << ") => " << texplanation.getNode() << endl; return texplanation; } @@ -1226,7 +1226,7 @@ struct AtomsCollect { void TheoryEngine::ensureLemmaAtoms(TNode n, theory::TheoryId atomsTo) { Assert(atomsTo != THEORY_LAST); - Debug("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(" << n << ", " + Trace("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(" << n << ", " << atomsTo << ")" << endl; AtomsCollect collectAtoms; NodeVisitor::run(collectAtoms, n); @@ -1251,7 +1251,7 @@ void TheoryEngine::ensureLemmaAtoms(const std::vector& atoms, theory::The // Rewrite the equality Node eqNormalized = rewrite(atoms[i]); - Debug("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(): " << eq + Trace("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(): " << eq << " with nf " << eqNormalized << endl; // If the equality is a boolean constant, we send immediately @@ -1373,7 +1373,7 @@ void TheoryEngine::conflict(TrustNode tconflict, TheoryId theoryId) Assert(tconflict.getKind() == TrustNodeKind::CONFLICT); TNode conflict = tconflict.getNode(); - Debug("theory::conflict") << "TheoryEngine::conflict(" << conflict << ", " + Trace("theory::conflict") << "TheoryEngine::conflict(" << conflict << ", " << theoryId << ")" << endl; Trace("te-proof-debug") << "Check closed conflict" << std::endl; // doesn't require proof generator, yet, since THEORY_LEMMA is added below @@ -1458,7 +1458,7 @@ void TheoryEngine::conflict(TrustNode tconflict, TheoryId theoryId) // pass the processed trust node TrustNode tconf = TrustNode::mkTrustConflict(fullConflict, d_lazyProof.get()); - Debug("theory::conflict") + Trace("theory::conflict") << "TheoryEngine::conflict(" << conflict << ", " << theoryId << "): full = " << fullConflict << endl; Assert(properConflict(fullConflict)); @@ -1536,7 +1536,7 @@ TrustNode TheoryEngine::getExplanation( // Get the current literal to explain NodeTheoryPair toExplain = explanationVector[i]; - Debug("theory::explain") + Trace("theory::explain") << "[i=" << i << "] TheoryEngine::explain(): processing [" << toExplain.d_timestamp << "] " << toExplain.d_node << " sent from " << toExplain.d_theory << endl; @@ -1575,7 +1575,7 @@ TrustNode TheoryEngine::getExplanation( // If from the SAT solver, keep it if (toExplain.d_theory == THEORY_SAT_SOLVER) { - Debug("theory::explain") + Trace("theory::explain") << "\tLiteral came from THEORY_SAT_SOLVER. Keeping it." << endl; exp.insert(explanationVector[i++].d_node); // it will be a free assumption in the proof @@ -1586,7 +1586,7 @@ TrustNode TheoryEngine::getExplanation( // If an and, expand it if (toExplain.d_node.getKind() == kind::AND) { - Debug("theory::explain") + Trace("theory::explain") << "TheoryEngine::explain(): expanding " << toExplain.d_node << " got from " << toExplain.d_theory << endl; size_t nchild = toExplain.d_node.getNumChildren(); @@ -1613,13 +1613,13 @@ TrustNode TheoryEngine::getExplanation( // See if it was sent to the theory by another theory PropagationMap::const_iterator find = d_propagationMap.find(toExplain); if (find != d_propagationMap.end()) { - Debug("theory::explain") + Trace("theory::explain") << "\tTerm was propagated by another theory (theory = " << getTheoryString((*find).second.d_theory) << ")" << std::endl; // There is some propagation, check if its a timely one if ((*find).second.d_timestamp < toExplain.d_timestamp) { - Debug("theory::explain") + Trace("theory::explain") << "\tRelevant timetsamp, pushing " << (*find).second.d_node << "to index = " << explanationVector.size() << std::endl; explanationVector.push_back((*find).second); @@ -1665,7 +1665,7 @@ TrustNode TheoryEngine::getExplanation( } Node explanation = texplanation.getNode(); - Debug("theory::explain") + Trace("theory::explain") << "TheoryEngine::explain(): got explanation " << explanation << " got from " << toExplain.d_theory << endl; Assert(explanation != toExplain.d_node) @@ -1708,7 +1708,7 @@ TrustNode TheoryEngine::getExplanation( // build the proof if (lcp != nullptr) { - if (Trace.isOn("te-proof-exp")) + if (TraceIsOn("te-proof-exp")) { Trace("te-proof-exp") << "Explanation is:" << std::endl; for (TNode e : exp) diff --git a/src/theory/theory_engine.h b/src/theory/theory_engine.h index 75defade5..290ad096b 100644 --- a/src/theory/theory_engine.h +++ b/src/theory/theory_engine.h @@ -262,7 +262,7 @@ class TheoryEngine : protected EnvObj for (; d_propagatedLiteralsIndex < d_propagatedLiterals.size(); d_propagatedLiteralsIndex = d_propagatedLiteralsIndex + 1) { - Debug("getPropagatedLiterals") + Trace("getPropagatedLiterals") << "TheoryEngine::getPropagatedLiterals: propagating: " << d_propagatedLiterals[d_propagatedLiteralsIndex] << std::endl; literals.push_back(d_propagatedLiterals[d_propagatedLiteralsIndex]); diff --git a/src/theory/theory_model.cpp b/src/theory/theory_model.cpp index e9ecf16ac..3e603c5a8 100644 --- a/src/theory/theory_model.cpp +++ b/src/theory/theory_model.cpp @@ -130,7 +130,7 @@ Node TheoryModel::getValue(TNode n) const //apply substitutions Node nn = d_env.getTopLevelSubstitutions().apply(n); nn = rewrite(nn); - Debug("model-getvalue-debug") << "[model-getvalue] getValue : substitute " << n << " to " << nn << std::endl; + Trace("model-getvalue-debug") << "[model-getvalue] getValue : substitute " << n << " to " << nn << std::endl; //get value in model nn = getModelValue(nn); if (nn.isNull()) @@ -152,7 +152,7 @@ Node TheoryModel::getValue(TNode n) const //normalize nn = rewrite(nn); } - Debug("model-getvalue") << "[model-getvalue] getValue( " << n << " ): " << std::endl + Trace("model-getvalue") << "[model-getvalue] getValue( " << n << " ): " << std::endl << "[model-getvalue] returning " << nn << std::endl; Assert(nn.getType().isSubtypeOf(n.getType())); return nn; @@ -173,18 +173,18 @@ Cardinality TheoryModel::getCardinality(TypeNode tn) const //for now, we only handle cardinalities for uninterpreted sorts if (!tn.isSort()) { - Debug("model-getvalue-debug") + Trace("model-getvalue-debug") << "Get cardinality other sort, unknown." << std::endl; return Cardinality( CardinalityUnknown() ); } if (d_rep_set.hasType(tn)) { - Debug("model-getvalue-debug") + Trace("model-getvalue-debug") << "Get cardinality sort, #rep : " << d_rep_set.getNumRepresentatives(tn) << std::endl; return Cardinality(d_rep_set.getNumRepresentatives(tn)); } - Debug("model-getvalue-debug") + Trace("model-getvalue-debug") << "Get cardinality sort, unconstrained, return 1." << std::endl; return Cardinality(1); } @@ -195,8 +195,8 @@ Node TheoryModel::getModelValue(TNode n) const if (it != d_modelCache.end()) { return (*it).second; } - Debug("model-getvalue-debug") << "Get model value " << n << " ... "; - Debug("model-getvalue-debug") << d_equalityEngine->hasTerm(n) << std::endl; + Trace("model-getvalue-debug") << "Get model value " << n << " ... "; + Trace("model-getvalue-debug") << d_equalityEngine->hasTerm(n) << std::endl; Kind nk = n.getKind(); if (n.isConst() || nk == BOUND_VARIABLE) { @@ -215,13 +215,13 @@ Node TheoryModel::getModelValue(TNode n) const // e.g. forall x. P(x) where P = lambda x. true. if (n.getNumChildren() > 0) { - Debug("model-getvalue-debug") + Trace("model-getvalue-debug") << "Get model value children " << n << std::endl; std::vector children; if (n.getKind() == APPLY_UF) { Node op = getModelValue(n.getOperator()); - Debug("model-getvalue-debug") << " operator : " << op << std::endl; + Trace("model-getvalue-debug") << " operator : " << op << std::endl; children.push_back(op); } else if (n.getMetaKind() == kind::metakind::PARAMETERIZED) @@ -240,20 +240,20 @@ Node TheoryModel::getModelValue(TNode n) const { ret = getModelValue(n[i]); } - Debug("model-getvalue-debug") + Trace("model-getvalue-debug") << " " << n << "[" << i << "] is " << ret << std::endl; children.push_back(ret); } ret = nm->mkNode(n.getKind(), children); - Debug("model-getvalue-debug") << "ret (pre-rewrite): " << ret << std::endl; + Trace("model-getvalue-debug") << "ret (pre-rewrite): " << ret << std::endl; ret = rewrite(ret); - Debug("model-getvalue-debug") << "ret (post-rewrite): " << ret << std::endl; + Trace("model-getvalue-debug") << "ret (post-rewrite): " << ret << std::endl; // special cases if (ret.getKind() == kind::CARDINALITY_CONSTRAINT) { const CardinalityConstraint& cc = ret.getOperator().getConst(); - Debug("model-getvalue-debug") + Trace("model-getvalue-debug") << "get cardinality constraint " << cc.getType() << std::endl; ret = nm->mkConst(getCardinality(cc.getType()).getFiniteCardinality() <= cc.getUpperBound()); @@ -290,7 +290,7 @@ Node TheoryModel::getModelValue(TNode n) const } if (eeHasTerm) { - Debug("model-getvalue-debug") + Trace("model-getvalue-debug") << "get value from representative " << ret << "..." << std::endl; ret = d_equalityEngine->getRepresentative(ret); Assert(d_reps.find(ret) != d_reps.end()); diff --git a/src/theory/theory_model_builder.cpp b/src/theory/theory_model_builder.cpp index acef0e9b4..6b5216650 100644 --- a/src/theory/theory_model_builder.cpp +++ b/src/theory/theory_model_builder.cpp @@ -1437,7 +1437,7 @@ void TheoryEngineModelBuilder::assignFunctions(TheoryModel* m) std::sort(funcs_to_assign.begin(), funcs_to_assign.end(), sts); } - if (Trace.isOn("model-builder")) + if (TraceIsOn("model-builder")) { Trace("model-builder") << "...have " << funcs_to_assign.size() << " functions to assign:" << std::endl; diff --git a/src/theory/theory_preprocessor.cpp b/src/theory/theory_preprocessor.cpp index 26f9e759f..75f03a445 100644 --- a/src/theory/theory_preprocessor.cpp +++ b/src/theory/theory_preprocessor.cpp @@ -96,7 +96,7 @@ TrustNode TheoryPreprocessor::preprocessInternal( TrustNode tpp = theoryPreprocess(irNode, newLemmas); Node ppNode = tpp.getNode(); - if (Trace.isOn("tpp-debug")) + if (TraceIsOn("tpp-debug")) { if (node != irNode) { diff --git a/src/theory/uf/cardinality_extension.cpp b/src/theory/uf/cardinality_extension.cpp index 2ebdf5a24..c52fce677 100644 --- a/src/theory/uf/cardinality_extension.cpp +++ b/src/theory/uf/cardinality_extension.cpp @@ -157,7 +157,7 @@ void Region::setEqual( Node a, Node b ){ } void Region::setDisequal( Node n1, Node n2, int type, bool valid ){ - //Debug("uf-ss-region-debug") << "set disequal " << n1 << " " << n2 << " " + //Trace("uf-ss-region-debug") << "set disequal " << n1 << " " << n2 << " " // << type << " " << valid << std::endl; //debugPrint("uf-ss-region-debug"); //Assert( isDisequal( n1, n2, type )!=valid ); @@ -173,7 +173,7 @@ void Region::setDisequal( Node n1, Node n2, int type, bool valid ){ d_testClique.find( n2 )!=d_testClique.end() && d_testClique[n2] ){ Node eq = NodeManager::currentNM()->mkNode( EQUAL, n1, n2 ); if( d_splits.find( eq )!=d_splits.end() && d_splits[ eq ] ){ - Debug("uf-ss-debug") << "removing split for " << n1 << " " << n2 + Trace("uf-ss-debug") << "removing split for " << n1 << " " << n2 << std::endl; d_splits[ eq ] = false; d_splitsSize = d_splitsSize - 1; @@ -335,7 +335,7 @@ bool Region::check( Theory::Effort level, int cardinality, } //check splits internal to new members for( int j=0; j<(int)newClique.size(); j++ ){ - Debug("uf-ss-debug") << "Choose to add clique member " + Trace("uf-ss-debug") << "Choose to add clique member " << newClique[j] << std::endl; for( int k=(j+1); k<(int)newClique.size(); k++ ){ if( !isDisequal( newClique[j], newClique[k], 1 ) ){ @@ -400,49 +400,49 @@ void Region::getNumExternalDisequalities( } void Region::debugPrint( const char* c, bool incClique ) { - Debug( c ) << "Num reps: " << d_reps_size << std::endl; + Trace( c ) << "Num reps: " << d_reps_size << std::endl; for( Region::iterator it = begin(); it != end(); ++it ){ RegionNodeInfo* rni = it->second; if( rni->valid() ){ Node n = it->first; - Debug( c ) << " " << n << std::endl; + Trace( c ) << " " << n << std::endl; for( int i=0; i<2; i++ ){ - Debug( c ) << " " << ( i==0 ? "Ext" : "Int" ) << " disequal:"; + Trace( c ) << " " << ( i==0 ? "Ext" : "Int" ) << " disequal:"; DiseqList* del = rni->get(i); for( DiseqList::iterator it2 = del->begin(); it2 != del->end(); ++it2 ){ if( (*it2).second ){ - Debug( c ) << " " << (*it2).first; + Trace( c ) << " " << (*it2).first; } } - Debug( c ) << ", total = " << del->size() << std::endl; + Trace( c ) << ", total = " << del->size() << std::endl; } } } - Debug( c ) << "Total disequal: " << d_total_diseq_external << " external,"; - Debug( c ) << " " << d_total_diseq_internal << " internal." << std::endl; + Trace( c ) << "Total disequal: " << d_total_diseq_external << " external,"; + Trace( c ) << " " << d_total_diseq_internal << " internal." << std::endl; if( incClique ){ if( !d_testClique.empty() ){ - Debug( c ) << "Candidate clique members: " << std::endl; - Debug( c ) << " "; + Trace( c ) << "Candidate clique members: " << std::endl; + Trace( c ) << " "; for( NodeBoolMap::iterator it = d_testClique.begin(); it != d_testClique.end(); ++ it ){ if( (*it).second ){ - Debug( c ) << (*it).first << " "; + Trace( c ) << (*it).first << " "; } } - Debug( c ) << ", size = " << d_testCliqueSize << std::endl; + Trace( c ) << ", size = " << d_testCliqueSize << std::endl; } if( !d_splits.empty() ){ - Debug( c ) << "Required splits: " << std::endl; - Debug( c ) << " "; + Trace( c ) << "Required splits: " << std::endl; + Trace( c ) << " "; for( NodeBoolMap::iterator it = d_splits.begin(); it != d_splits.end(); ++ it ){ if( (*it).second ){ - Debug( c ) << (*it).first << " "; + Trace( c ) << (*it).first << " "; } } - Debug( c ) << ", size = " << d_splitsSize << std::endl; + Trace( c ) << ", size = " << d_splitsSize << std::endl; } } } @@ -524,8 +524,8 @@ void SortModel::newEqClass( Node n ){ { if( d_regions_map.find( n )==d_regions_map.end() ){ d_regions_map[n] = d_regions_index; - Debug("uf-ss") << "CardinalityExtension: New Eq Class " << n << std::endl; - Debug("uf-ss-debug") << d_regions_index << " " << (int)d_regions.size() + Trace("uf-ss") << "CardinalityExtension: New Eq Class " << n << std::endl; + Trace("uf-ss-debug") << d_regions_index << " " << (int)d_regions.size() << std::endl; if (d_regions_index < d_regions.size()) { @@ -549,7 +549,7 @@ void SortModel::merge( Node a, Node b ){ { return; } - Debug("uf-ss") << "CardinalityExtension: Merging " << a << " = " << b << "..." + Trace("uf-ss") << "CardinalityExtension: Merging " << a << " = " << b << "..." << std::endl; if (a != b) { @@ -557,7 +557,7 @@ void SortModel::merge( Node a, Node b ){ Assert(d_regions_map.find(b) != d_regions_map.end()); int ai = d_regions_map[a]; int bi = d_regions_map[b]; - Debug("uf-ss") << " regions: " << ai << " " << bi << std::endl; + Trace("uf-ss") << " regions: " << ai << " " << bi << std::endl; if (ai != bi) { if (d_regions[ai]->getNumReps() == 1) @@ -622,9 +622,9 @@ void SortModel::assertDisequal( Node a, Node b, Node reason ){ // already disequal return; } - Debug("uf-ss") << "Assert disequal " << a << " != " << b << "..." + Trace("uf-ss") << "Assert disequal " << a << " != " << b << "..." << std::endl; - Debug("uf-ss-disequal") << "Assert disequal " << a << " != " << b << "..." + Trace("uf-ss-disequal") << "Assert disequal " << a << " != " << b << "..." << std::endl; // add to list of disequalities if (d_disequalities_index < d_disequalities.size()) @@ -639,7 +639,7 @@ void SortModel::assertDisequal( Node a, Node b, Node reason ){ // now, add disequalities to regions Assert(d_regions_map.find(a) != d_regions_map.end()); Assert(d_regions_map.find(b) != d_regions_map.end()); - Debug("uf-ss") << " regions: " << ai << " " << bi << std::endl; + Trace("uf-ss") << " regions: " << ai << " " << bi << std::endl; if (ai == bi) { // internal disequality @@ -679,22 +679,22 @@ void SortModel::check(Theory::Effort level) // not necessary to check return; } - Debug("uf-ss") << "CardinalityExtension: Check " << level << " " << d_type + Trace("uf-ss") << "CardinalityExtension: Check " << level << " " << d_type << std::endl; if (level == Theory::EFFORT_FULL) { - Debug("fmf-full-check") << std::endl; - Debug("fmf-full-check") + Trace("fmf-full-check") << std::endl; + Trace("fmf-full-check") << "Full check for SortModel " << d_type << ", status : " << std::endl; debugPrint("fmf-full-check"); - Debug("fmf-full-check") << std::endl; + Trace("fmf-full-check") << std::endl; } if (d_reps <= (unsigned)d_cardinality) { - Debug("uf-ss-debug") << "We have " << d_reps << " representatives for type " + Trace("uf-ss-debug") << "We have " << d_reps << " representatives for type " << d_type << ", <= " << d_cardinality << std::endl; if( level==Theory::EFFORT_FULL ){ - Debug("uf-ss-sat") << "We have " << d_reps << " representatives for type " + Trace("uf-ss-sat") << "We have " << d_reps << " representatives for type " << d_type << ", <= " << d_cardinality << std::endl; } return; @@ -763,7 +763,7 @@ void SortModel::check(Theory::Effort level) int sort_id = si->getSortId(op); if (sortsFound.find(sort_id) != sortsFound.end()) { - Debug("fmf-full-check") << "Combined regions " << i << " " + Trace("fmf-full-check") << "Combined regions " << i << " " << sortsFound[sort_id] << std::endl; combineRegions(sortsFound[sort_id], i); recheck = true; @@ -785,7 +785,7 @@ void SortModel::check(Theory::Effort level) if (d_regions[i]->valid()) { int fcr = forceCombineRegion(i, false); - Debug("fmf-full-check") + Trace("fmf-full-check") << "Combined regions " << i << " " << fcr << std::endl; Trace("uf-ss-debug") << "Combined regions " << i << " " << fcr << std::endl; @@ -936,8 +936,8 @@ int SortModel::forceCombineRegion( int ri, bool useDensity ){ return -1; }else{ //this region must merge with another - if( Debug.isOn("uf-ss-check-region") ){ - Debug("uf-ss-check-region") << "We must combine Region #" << ri << ". " << std::endl; + if( TraceIsOn("uf-ss-check-region") ){ + Trace("uf-ss-check-region") << "We must combine Region #" << ri << ". " << std::endl; d_regions[ri]->debugPrint("uf-ss-check-region"); } //take region with maximum disequality density @@ -946,7 +946,7 @@ int SortModel::forceCombineRegion( int ri, bool useDensity ){ std::map< int, int > regions_diseq; getDisequalitiesToRegions( ri, regions_diseq ); for( std::map< int, int >::iterator it = regions_diseq.begin(); it != regions_diseq.end(); ++it ){ - Debug("uf-ss-check-region") << it->first << " : " << it->second << std::endl; + Trace("uf-ss-check-region") << it->first << " : " << it->second << std::endl; } for( std::map< int, int >::iterator it = regions_diseq.begin(); it != regions_diseq.end(); ++it ){ Assert(it->first != ri); @@ -959,8 +959,8 @@ int SortModel::forceCombineRegion( int ri, bool useDensity ){ } } if( maxRegion!=-1 ){ - if( Debug.isOn("uf-ss-check-region") ){ - Debug("uf-ss-check-region") << "Combine with region #" << maxRegion << ":" << std::endl; + if( TraceIsOn("uf-ss-check-region") ){ + Trace("uf-ss-check-region") << "Combine with region #" << maxRegion << ":" << std::endl; d_regions[maxRegion]->debugPrint("uf-ss-check-region"); } return combineRegions( ri, maxRegion ); @@ -971,7 +971,7 @@ int SortModel::forceCombineRegion( int ri, bool useDensity ){ int SortModel::combineRegions( int ai, int bi ){ - Debug("uf-ss-region") << "uf-ss: Combine Region #" << bi << " with Region #" << ai << std::endl; + Trace("uf-ss-region") << "uf-ss: Combine Region #" << bi << " with Region #" << ai << std::endl; Assert(isValid(ai) && isValid(bi)); Region* region_bi = d_regions[bi]; for(Region::iterator it = region_bi->begin(); it != region_bi->end(); ++it){ @@ -987,7 +987,7 @@ int SortModel::combineRegions( int ai, int bi ){ } void SortModel::moveNode( Node n, int ri ){ - Debug("uf-ss-region") << "uf-ss: Move node " << n << " to Region #" << ri << std::endl; + Trace("uf-ss-region") << "uf-ss: Move node " << n << " to Region #" << ri << std::endl; Assert(isValid(d_regions_map[n])); Assert(isValid(ri)); //move node to region ri @@ -1029,7 +1029,7 @@ int SortModel::addSplit(Region* r) AlwaysAssert(false) << "Bad split " << s << std::endl; } } - if (Trace.isOn("uf-ss-split-si")) + if (TraceIsOn("uf-ss-split-si")) { SortInference* si = d_state.getSortInference(); if (si != nullptr) @@ -1098,20 +1098,20 @@ void SortModel::simpleCheckCardinality() { } void SortModel::debugPrint( const char* c ){ - if( Debug.isOn( c ) ){ - Debug( c ) << "Number of reps = " << d_reps << std::endl; - Debug( c ) << "Cardinality req = " << d_cardinality << std::endl; + if( TraceIsOn( c ) ){ + Trace( c ) << "Number of reps = " << d_reps << std::endl; + Trace( c ) << "Cardinality req = " << d_cardinality << std::endl; unsigned debugReps = 0; for( unsigned i=0; ivalid() ){ - Debug( c ) << "Region #" << i << ": " << std::endl; + Trace( c ) << "Region #" << i << ": " << std::endl; region->debugPrint( c, true ); - Debug( c ) << std::endl; + Trace( c ) << std::endl; for( Region::iterator it = region->begin(); it != region->end(); ++it ){ if( it->second->valid() ){ if( d_regions_map[ it->first ]!=(int)i ){ - Debug( c ) << "***Bad regions map : " << it->first + Trace( c ) << "***Bad regions map : " << it->first << " " << d_regions_map[ it->first ].get() << std::endl; } } @@ -1121,7 +1121,7 @@ void SortModel::debugPrint( const char* c ){ } if( debugReps!=d_reps ){ - Debug( c ) << "***Bad reps: " << d_reps << ", " + Trace( c ) << "***Bad reps: " << d_reps << ", " << "actual = " << debugReps << std::endl; } } @@ -1132,7 +1132,7 @@ bool SortModel::checkLastCall() NodeManager* nm = NodeManager::currentNM(); SkolemManager* sm = nm->getSkolemManager(); TheoryModel* m = d_state.getModel(); - if( Trace.isOn("uf-ss-warn") ){ + if( TraceIsOn("uf-ss-warn") ){ std::vector< Node > eqcs; eq::EqClassesIterator eqcs_i = eq::EqClassesIterator(m->getEqualityEngine()); @@ -1425,7 +1425,7 @@ void CardinalityExtension::assertNode(Node n, bool isDecision) } } }else{ - if( Trace.isOn("uf-ss-warn") ){ + if( TraceIsOn("uf-ss-warn") ){ ////FIXME: this is too strict: theory propagations are showing up as isDecision=true, but //// a theory propagation is not a decision. if( isDecision ){ @@ -1492,11 +1492,11 @@ void CardinalityExtension::check(Theory::Effort level) << "CardinalityExtension: check " << level << std::endl; if (level == Theory::EFFORT_FULL) { - if (Debug.isOn("uf-ss-debug")) + if (TraceIsOn("uf-ss-debug")) { debugPrint("uf-ss-debug"); } - if (Trace.isOn("uf-ss-state")) + if (TraceIsOn("uf-ss-state")) { Trace("uf-ss-state") << "CardinalityExtension::check " << level << std::endl; @@ -1677,9 +1677,9 @@ int CardinalityExtension::getCardinality(TypeNode tn) void CardinalityExtension::debugPrint(const char* c) { for( std::map< TypeNode, SortModel* >::iterator it = d_rep_model.begin(); it != d_rep_model.end(); ++it ){ - Debug( c ) << "Conflict find structure for " << it->first << ": " << std::endl; + Trace( c ) << "Conflict find structure for " << it->first << ": " << std::endl; it->second->debugPrint( c ); - Debug( c ) << std::endl; + Trace( c ) << std::endl; } } diff --git a/src/theory/uf/eq_proof.cpp b/src/theory/uf/eq_proof.cpp index ab091cffd..52579e223 100644 --- a/src/theory/uf/eq_proof.cpp +++ b/src/theory/uf/eq_proof.cpp @@ -28,7 +28,7 @@ void EqProof::debug_print(const char* c, unsigned tb) const { std::stringstream ss; debug_print(ss, tb); - Debug(c) << ss.str(); + Trace(c) << ss.str(); } void EqProof::debug_print(std::ostream& os, unsigned tb) const @@ -1319,7 +1319,7 @@ Node EqProof::addToProof(CDProof* p, << "EqProof::addToProof: New conclusion " << conclusion << "\n"; } } - if (Trace.isOn("eqproof-conv")) + if (TraceIsOn("eqproof-conv")) { Trace("eqproof-conv") << "EqProof::addToProof: premises from reduced cong of " << conclusion diff --git a/src/theory/uf/equality_engine.cpp b/src/theory/uf/equality_engine.cpp index 4180fb674..b220164e3 100644 --- a/src/theory/uf/equality_engine.cpp +++ b/src/theory/uf/equality_engine.cpp @@ -74,9 +74,9 @@ class ScopedBool { EqualityEngineNotifyNone EqualityEngine::s_notifyNone; void EqualityEngine::init() { - Debug("equality") << "EqualityEdge::EqualityEngine(): id_null = " << +null_id << std::endl; - Debug("equality") << "EqualityEdge::EqualityEngine(): edge_null = " << +null_edge << std::endl; - Debug("equality") << "EqualityEdge::EqualityEngine(): trigger_null = " << +null_trigger << std::endl; + Trace("equality") << "EqualityEdge::EqualityEngine(): id_null = " << +null_id << std::endl; + Trace("equality") << "EqualityEdge::EqualityEngine(): edge_null = " << +null_edge << std::endl; + Trace("equality") << "EqualityEdge::EqualityEngine(): trigger_null = " << +null_trigger << std::endl; // If we are not at level zero when we initialize this equality engine, we // may remove true/false from the equality engine when we pop to level zero, @@ -182,7 +182,7 @@ ProofEqEngine* EqualityEngine::getProofEqualityEngine() } void EqualityEngine::enqueue(const MergeCandidate& candidate, bool back) { - Debug("equality") << d_name << "::eq::enqueue({" << candidate.d_t1Id << "} " + Trace("equality") << d_name << "::eq::enqueue({" << candidate.d_t1Id << "} " << d_nodes[candidate.d_t1Id] << ", {" << candidate.d_t2Id << "} " << d_nodes[candidate.d_t2Id] << ", " << static_cast(candidate.d_type) @@ -195,7 +195,7 @@ void EqualityEngine::enqueue(const MergeCandidate& candidate, bool back) { } EqualityNodeId EqualityEngine::newApplicationNode(TNode original, EqualityNodeId t1, EqualityNodeId t2, FunctionApplicationType type) { - Debug("equality") << d_name << "::eq::newApplicationNode(" << original + Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", {" << t1 << "} " << d_nodes[t1] << ", {" << t2 << "} " << d_nodes[t2] << ")" << std::endl; @@ -209,7 +209,7 @@ EqualityNodeId EqualityEngine::newApplicationNode(TNode original, EqualityNodeId EqualityNodeId t2ClassId = getEqualityNode(t2).getFind(); FunctionApplication funNormalized(type, t1ClassId, t2ClassId); - Debug("equality") << d_name << "::eq::newApplicationNode: funOriginal: (" + Trace("equality") << d_name << "::eq::newApplicationNode: funOriginal: (" << type << " " << d_nodes[t1] << " " << d_nodes[t2] << "), funNorm: (" << type << " " << d_nodes[t1ClassId] << " " << d_nodes[t2ClassId] << ")\n"; @@ -220,7 +220,7 @@ EqualityNodeId EqualityEngine::newApplicationNode(TNode original, EqualityNodeId // Add the lookup data, if it's not already there ApplicationIdsMap::iterator find = d_applicationLookup.find(funNormalized); if (find == d_applicationLookup.end()) { - Debug("equality") << d_name << "::eq::newApplicationNode(" << original + Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): no lookup, setting up funNorm: (" << type << " " << d_nodes[t1ClassId] << " " << d_nodes[t2ClassId] @@ -229,26 +229,26 @@ EqualityNodeId EqualityEngine::newApplicationNode(TNode original, EqualityNodeId storeApplicationLookup(funNormalized, funId); } else { // If it's there, we need to merge these two - Debug("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): lookup exists, adding to queue" << std::endl; - Debug("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): lookup = " << d_nodes[find->second] << std::endl; + Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): lookup exists, adding to queue" << std::endl; + Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): lookup = " << d_nodes[find->second] << std::endl; enqueue(MergeCandidate(funId, find->second, MERGED_THROUGH_CONGRUENCE, TNode::null())); } // Add to the use lists - Debug("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): adding " << original << " to the uselist of " << d_nodes[t1] << std::endl; + Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): adding " << original << " to the uselist of " << d_nodes[t1] << std::endl; d_equalityNodes[t1].usedIn(funId, d_useListNodes); - Debug("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): adding " << original << " to the uselist of " << d_nodes[t2] << std::endl; + Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): adding " << original << " to the uselist of " << d_nodes[t2] << std::endl; d_equalityNodes[t2].usedIn(funId, d_useListNodes); // Return the new id - Debug("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << ") => " << funId << std::endl; + Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << ") => " << funId << std::endl; return funId; } EqualityNodeId EqualityEngine::newNode(TNode node) { - Debug("equality") << d_name << "::eq::newNode(" << node << ")" << std::endl; + Trace("equality") << d_name << "::eq::newNode(" << node << ")" << std::endl; ++d_stats.d_termsCount; @@ -279,7 +279,7 @@ EqualityNodeId EqualityEngine::newNode(TNode node) { // Increase the counters d_nodesCount = d_nodesCount + 1; - Debug("equality") << d_name << "::eq::newNode(" << node << ") => " << newId << std::endl; + Trace("equality") << d_name << "::eq::newNode(" << node << ") => " << newId << std::endl; return newId; } @@ -293,14 +293,14 @@ void EqualityEngine::addFunctionKind(Kind fun, { if (interpreted) { - Debug("equality::evaluation") + Trace("equality::evaluation") << d_name << "::eq::addFunctionKind(): " << fun << " is interpreted " << std::endl; d_congruenceKindsInterpreted.set(fun); } if (extOperator) { - Debug("equality::extoperator") + Trace("equality::extoperator") << d_name << "::eq::addFunctionKind(): " << fun << " is an external operator kind " << std::endl; d_congruenceKindsExtOperators.set(fun); @@ -309,7 +309,7 @@ void EqualityEngine::addFunctionKind(Kind fun, } void EqualityEngine::subtermEvaluates(EqualityNodeId id) { - Debug("equality::evaluation") << d_name << "::eq::subtermEvaluates(" << d_nodes[id] << "): " << d_subtermsToEvaluate[id] << std::endl; + Trace("equality::evaluation") << d_name << "::eq::subtermEvaluates(" << d_nodes[id] << "): " << d_subtermsToEvaluate[id] << std::endl; Assert(!d_isInternal[id]); Assert(d_subtermsToEvaluate[id] > 0); if ((-- d_subtermsToEvaluate[id]) == 0) { @@ -317,16 +317,16 @@ void EqualityEngine::subtermEvaluates(EqualityNodeId id) { } d_subtermEvaluates.push_back(id); d_subtermEvaluatesSize = d_subtermEvaluates.size(); - Debug("equality::evaluation") << d_name << "::eq::subtermEvaluates(" << d_nodes[id] << "): new " << d_subtermsToEvaluate[id] << std::endl; + Trace("equality::evaluation") << d_name << "::eq::subtermEvaluates(" << d_nodes[id] << "): new " << d_subtermsToEvaluate[id] << std::endl; } void EqualityEngine::addTermInternal(TNode t, bool isOperator) { - Debug("equality") << d_name << "::eq::addTermInternal(" << t << ")" << std::endl; + Trace("equality") << d_name << "::eq::addTermInternal(" << t << ")" << std::endl; // If there already, we're done if (hasTerm(t)) { - Debug("equality") << d_name << "::eq::addTermInternal(" << t << "): already there" << std::endl; + Trace("equality") << d_name << "::eq::addTermInternal(" << t << "): already there" << std::endl; return; } @@ -370,7 +370,7 @@ void EqualityEngine::addTermInternal(TNode t, bool isOperator) { d_subtermsToEvaluate[result] = t.getNumChildren(); for (unsigned i = 0; i < t.getNumChildren(); ++ i) { if (isConstant(getNodeId(t[i]))) { - Debug("equality::evaluation") << d_name << "::eq::addTermInternal(" << t << "): evaluates " << t[i] << std::endl; + Trace("equality::evaluation") << d_name << "::eq::addTermInternal(" << t << "): evaluates " << t[i] << std::endl; subtermEvaluates(result); } } @@ -429,7 +429,7 @@ void EqualityEngine::addTermInternal(TNode t, bool isOperator) { Assert(hasTerm(t)); - Debug("equality") << d_name << "::eq::addTermInternal(" << t << ") => " << result << std::endl; + Trace("equality") << d_name << "::eq::addTermInternal(" << t << ") => " << result << std::endl; } bool EqualityEngine::hasTerm(TNode t) const { @@ -460,7 +460,7 @@ const EqualityNode& EqualityEngine::getEqualityNode(EqualityNodeId nodeId) const } void EqualityEngine::assertEqualityInternal(TNode t1, TNode t2, TNode reason, unsigned pid) { - Debug("equality") << d_name << "::eq::addEqualityInternal(" << t1 << "," << t2 + Trace("equality") << d_name << "::eq::addEqualityInternal(" << t1 << "," << t2 << "), reason = " << reason << ", pid = " << static_cast(pid) << std::endl; @@ -484,7 +484,7 @@ bool EqualityEngine::assertPredicate(TNode t, TNode reason, unsigned pid) { - Debug("equality") << d_name << "::eq::addPredicate(" << t << "," << (polarity ? "true" : "false") << ")" << std::endl; + Trace("equality") << d_name << "::eq::addPredicate(" << t << "," << (polarity ? "true" : "false") << ")" << std::endl; Assert(t.getKind() != kind::EQUAL) << "Use assertEquality instead"; TNode b = polarity ? d_true : d_false; if (hasTerm(t) && areEqual(t, b)) @@ -501,7 +501,7 @@ bool EqualityEngine::assertEquality(TNode eq, TNode reason, unsigned pid) { - Debug("equality") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ")" << std::endl; + Trace("equality") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ")" << std::endl; if (polarity) { // If two terms are already equal, don't assert anything if (hasTerm(eq[0]) && hasTerm(eq[1]) && areEqual(eq[0], eq[1])) { @@ -519,7 +519,7 @@ bool EqualityEngine::assertEquality(TNode eq, // notify the theory d_notify->eqNotifyDisequal(eq[0], eq[1], reason); - Debug("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ")" << std::endl; + Trace("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ")" << std::endl; assertEqualityInternal(eq, d_false, reason, pid); propagate(); @@ -542,7 +542,7 @@ bool EqualityEngine::assertEquality(TNode eq, TriggerTermSetRef aTriggerRef = d_nodeIndividualTrigger[aClassId]; TriggerTermSetRef bTriggerRef = d_nodeIndividualTrigger[bClassId]; if (aTriggerRef != +null_set_id && bTriggerRef != +null_set_id) { - Debug("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ": have triggers" << std::endl; + Trace("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ": have triggers" << std::endl; // The sets of trigger terms TriggerTermSet& aTriggerTerms = getTriggerTermSet(aTriggerRef); TriggerTermSet& bTriggerTerms = getTriggerTermSet(bTriggerRef); @@ -574,7 +574,7 @@ bool EqualityEngine::assertEquality(TNode eq, // Store the propagation storePropagatedDisequality(aTag, aSharedId, bSharedId); // Notify - Debug("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ": notifying " << aTag << " for " << d_nodes[aSharedId] << " != " << d_nodes[bSharedId] << std::endl; + Trace("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ": notifying " << aTag << " for " << d_nodes[aSharedId] << " != " << d_nodes[bSharedId] << std::endl; if (!d_notify->eqNotifyTriggerTermEquality(aTag, d_nodes[aSharedId], d_nodes[bSharedId], false)) { break; } @@ -590,17 +590,17 @@ bool EqualityEngine::assertEquality(TNode eq, } TNode EqualityEngine::getRepresentative(TNode t) const { - Debug("equality::internal") << d_name << "::eq::getRepresentative(" << t << ")" << std::endl; + Trace("equality::internal") << d_name << "::eq::getRepresentative(" << t << ")" << std::endl; Assert(hasTerm(t)); EqualityNodeId representativeId = getEqualityNode(t).getFind(); Assert(!d_isInternal[representativeId]); - Debug("equality::internal") << d_name << "::eq::getRepresentative(" << t << ") => " << d_nodes[representativeId] << std::endl; + Trace("equality::internal") << d_name << "::eq::getRepresentative(" << t << ") => " << d_nodes[representativeId] << std::endl; return d_nodes[representativeId]; } bool EqualityEngine::merge(EqualityNode& class1, EqualityNode& class2, std::vector& triggersFired) { - Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << ")" << std::endl; + Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << ")" << std::endl; Assert(triggersFired.empty()); @@ -658,14 +658,14 @@ bool EqualityEngine::merge(EqualityNode& class1, EqualityNode& class2, std::vect } // Update class2 representative information - Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating class " << class2Id << std::endl; + Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating class " << class2Id << std::endl; EqualityNodeId currentId = class2Id; do { // Get the current node EqualityNode& currentNode = getEqualityNode(currentId); // Update it's find to class1 id - Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): " << currentId << "->" << class1Id << std::endl; + Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): " << currentId << "->" << class1Id << std::endl; currentNode.setFind(class1Id); // Go through the triggers and inform if necessary @@ -698,11 +698,11 @@ bool EqualityEngine::merge(EqualityNode& class1, EqualityNode& class2, std::vect // Update class2 table lookup and information if not a boolean // since booleans can't be in an application if (!d_isEquality[class2Id]) { - Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating lookups of " << class2Id << std::endl; + Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating lookups of " << class2Id << std::endl; do { // Get the current node EqualityNode& currentNode = getEqualityNode(currentId); - Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating lookups of node " << currentId << std::endl; + Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating lookups of node " << currentId << std::endl; // Go through the uselist and check for congruences UseListNodeId currentUseId = currentNode.getUseList(); @@ -711,7 +711,7 @@ bool EqualityEngine::merge(EqualityNode& class1, EqualityNode& class2, std::vect UseListNode& useNode = d_useListNodes[currentUseId]; // Get the function application EqualityNodeId funId = useNode.getApplicationId(); - Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): " << d_nodes[currentId] << " in " << d_nodes[funId] << std::endl; + Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): " << d_nodes[currentId] << " in " << d_nodes[funId] << std::endl; const FunctionApplication& fun = d_applications[useNode.getApplicationId()].d_normalized; // If it's interpreted and we can interpret @@ -836,14 +836,14 @@ bool EqualityEngine::merge(EqualityNode& class1, EqualityNode& class2, std::vect void EqualityEngine::undoMerge(EqualityNode& class1, EqualityNode& class2, EqualityNodeId class2Id) { - Debug("equality") << d_name << "::eq::undoMerge(" << class1.getFind() << "," << class2Id << ")" << std::endl; + Trace("equality") << d_name << "::eq::undoMerge(" << class1.getFind() << "," << class2Id << ")" << std::endl; // Now unmerge the lists (same as merge) class1.merge(class2); // Update class2 representative information EqualityNodeId currentId = class2Id; - Debug("equality") << d_name << "::eq::undoMerge(" << class1.getFind() << "," << class2Id << "): undoing representative info" << std::endl; + Trace("equality") << d_name << "::eq::undoMerge(" << class1.getFind() << "," << class2Id << "): undoing representative info" << std::endl; do { // Get the current node EqualityNode& currentNode = getEqualityNode(currentId); @@ -868,7 +868,7 @@ void EqualityEngine::undoMerge(EqualityNode& class1, EqualityNode& class2, Equal void EqualityEngine::backtrack() { - Debug("equality::backtrack") << "backtracking" << std::endl; + Trace("equality::backtrack") << "backtracking" << std::endl; // If we need to backtrack then do it if (d_assertedEqualitiesCount < d_assertedEqualities.size()) { @@ -878,7 +878,7 @@ void EqualityEngine::backtrack() { d_propagationQueue.pop_front(); } - Debug("equality") << d_name << "::eq::backtrack(): nodes" << std::endl; + Trace("equality") << d_name << "::eq::backtrack(): nodes" << std::endl; for (int i = (int)d_assertedEqualities.size() - 1, i_end = (int)d_assertedEqualitiesCount; i >= i_end; --i) { // Get the ids of the merged classes @@ -893,7 +893,7 @@ void EqualityEngine::backtrack() { d_assertedEqualities.resize(d_assertedEqualitiesCount); - Debug("equality") << d_name << "::eq::backtrack(): edges" << std::endl; + Trace("equality") << d_name << "::eq::backtrack(): edges" << std::endl; for (int i = (int)d_equalityEdges.size() - 2, i_end = (int)(2*d_assertedEqualitiesCount); i >= i_end; i -= 2) { EqualityEdge& edge1 = d_equalityEdges[i]; @@ -943,7 +943,7 @@ void EqualityEngine::backtrack() { // Go down the nodes, check the application nodes and remove them from use-lists for(int i = d_nodes.size() - 1, i_end = (int)d_nodesCount; i >= i_end; -- i) { // Remove from the node -> id map - Debug("equality") << d_name << "::eq::backtrack(): removing node " << d_nodes[i] << std::endl; + Trace("equality") << d_name << "::eq::backtrack(): removing node " << d_nodes[i] << std::endl; d_nodeIds.erase(d_nodes[i]); const FunctionApplication& app = d_applications[i].d_original; @@ -985,7 +985,7 @@ void EqualityEngine::backtrack() { } void EqualityEngine::addGraphEdge(EqualityNodeId t1, EqualityNodeId t2, unsigned type, TNode reason) { - Debug("equality") << d_name << "::eq::addGraphEdge({" << t1 << "} " + Trace("equality") << d_name << "::eq::addGraphEdge({" << t1 << "} " << d_nodes[t1] << ", {" << t2 << "} " << d_nodes[t2] << "," << reason << ")" << std::endl; EqualityEdgeId edge = d_equalityEdges.size(); @@ -994,7 +994,7 @@ void EqualityEngine::addGraphEdge(EqualityNodeId t1, EqualityNodeId t2, unsigned d_equalityGraph[t1] = edge; d_equalityGraph[t2] = edge | 1; - if (Debug.isOn("equality::internal")) { + if (TraceIsOn("equality::internal")) { debugPrintGraph(); } } @@ -1033,9 +1033,9 @@ void EqualityEngine::buildEqConclusion(EqualityNodeId id1, { return; } - Debug("equality") << "buildEqConclusion: {" << id1 << "} " << d_nodes[id1] + Trace("equality") << "buildEqConclusion: {" << id1 << "} " << d_nodes[id1] << "\n"; - Debug("equality") << "buildEqConclusion: {" << id2 << "} " << d_nodes[id2] + Trace("equality") << "buildEqConclusion: {" << id2 << "} " << d_nodes[id2] << "\n"; Node eq[2]; NodeManager* nm = NodeManager::currentNM(); @@ -1096,14 +1096,14 @@ void EqualityEngine::buildEqConclusion(EqualityNodeId id1, void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, std::vector& equalities, EqProof* eqp) const { - Debug("pf::ee") << d_name << "::eq::explainEquality(" << t1 << ", " << t2 + Trace("pf::ee") << d_name << "::eq::explainEquality(" << t1 << ", " << t2 << ", " << (polarity ? "true" : "false") << ")" << ", proof = " << (eqp ? "ON" : "OFF") << std::endl; // The terms must be there already Assert(hasTerm(t1) && hasTerm(t2)); - if (Debug.isOn("equality::internal")) + if (TraceIsOn("equality::internal")) { debugPrintGraph(); } @@ -1128,7 +1128,7 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, DisequalityReasonRef reasonRef = d_disequalityReasonsMap.find(pair)->second; if (eqp) { - Debug("pf::ee") << "Deq reason for " << eqp->d_node << " " + Trace("pf::ee") << "Deq reason for " << eqp->d_node << " " << reasonRef.d_mergesStart << "..." << reasonRef.d_mergesEnd << std::endl; } @@ -1140,7 +1140,7 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, // If we're constructing a (transitivity) proof, we don't need to include an explanation for x=x. if (eqp && toExplain.first != toExplain.second) { eqpc = std::make_shared(); - Debug("pf::ee") << "Deq getExplanation #" << i << " for " << eqp->d_node + Trace("pf::ee") << "Deq getExplanation #" << i << " for " << eqp->d_node << " : " << toExplain.first << " " << toExplain.second << std::endl; } @@ -1149,9 +1149,9 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, toExplain.first, toExplain.second, equalities, cache, eqpc.get()); if (eqpc) { - if (Debug.isOn("pf::ee")) + if (TraceIsOn("pf::ee")) { - Debug("pf::ee") << "Child proof is:" << std::endl; + Trace("pf::ee") << "Child proof is:" << std::endl; eqpc->debug_print("pf::ee", 1); } if (eqpc->d_id == MERGED_THROUGH_TRANS) @@ -1164,7 +1164,7 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, && child->d_node.isNull()) { nullCongruenceFound = true; - Debug("pf::ee") + Trace("pf::ee") << "Have congruence with empty d_node. Splitting..." << std::endl; orderedChildren.insert(orderedChildren.begin(), @@ -1179,9 +1179,9 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, if (nullCongruenceFound) { eqpc->d_children = orderedChildren; - if (Debug.isOn("pf::ee")) + if (TraceIsOn("pf::ee")) { - Debug("pf::ee") + Trace("pf::ee") << "Child proof's children have been reordered. It is now:" << std::endl; eqpc->debug_print("pf::ee", 1); @@ -1196,14 +1196,14 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, if (eqp) { if (eqp->d_children.size() == 0) { // Corner case where this is actually a disequality between two constants - Debug("pf::ee") << "Encountered a constant disequality (not a transitivity proof): " + Trace("pf::ee") << "Encountered a constant disequality (not a transitivity proof): " << eqp->d_node << std::endl; Assert(eqp->d_node[0][0].isConst()); Assert(eqp->d_node[0][1].isConst()); eqp->d_id = MERGED_THROUGH_CONSTANTS; } else if (eqp->d_children.size() == 1) { Node cnode = eqp->d_children[0]->d_node; - Debug("pf::ee") << "Simplifying " << cnode << " from " << eqp->d_node + Trace("pf::ee") << "Simplifying " << cnode << " from " << eqp->d_node << std::endl; bool simpTrans = true; if (cnode.getKind() == kind::EQUAL) @@ -1246,9 +1246,9 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, } } - if (Debug.isOn("pf::ee")) + if (TraceIsOn("pf::ee")) { - Debug("pf::ee") << "Disequality explanation final proof: " << std::endl; + Trace("pf::ee") << "Disequality explanation final proof: " << std::endl; eqp->debug_print("pf::ee", 1); } } @@ -1258,12 +1258,12 @@ void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity, void EqualityEngine::explainPredicate(TNode p, bool polarity, std::vector& assertions, EqProof* eqp) const { - Debug("equality") << d_name << "::eq::explainPredicate(" << p << ")" + Trace("equality") << d_name << "::eq::explainPredicate(" << p << ")" << std::endl; // Must have the term Assert(hasTerm(p)); std::map, EqProof*> cache; - if (Debug.isOn("equality::internal")) + if (TraceIsOn("equality::internal")) { debugPrintGraph(); } @@ -1437,15 +1437,15 @@ void EqualityEngine::getExplanation( BfsData current = bfsQueue[currentIndex]; EqualityNodeId currentNode = current.d_nodeId; - Debug("equality") << d_name << "::eq::getExplanation(): currentNode = {" + Trace("equality") << d_name << "::eq::getExplanation(): currentNode = {" << currentNode << "} " << d_nodes[currentNode] << std::endl; // Go through the equality edges of this node EqualityEdgeId currentEdge = d_equalityGraph[currentNode]; - if (Debug.isOn("equality")) { - Debug("equality") << d_name << "::eq::getExplanation(): edgesId = " << currentEdge << std::endl; - Debug("equality") << d_name << "::eq::getExplanation(): edges = " << edgesToString(currentEdge) << std::endl; + if (TraceIsOn("equality")) { + Trace("equality") << d_name << "::eq::getExplanation(): edgesId = " << currentEdge << std::endl; + Trace("equality") << d_name << "::eq::getExplanation(): edges = " << edgesToString(currentEdge) << std::endl; } while (currentEdge != null_edge) { @@ -1455,7 +1455,7 @@ void EqualityEngine::getExplanation( // If not just the backwards edge if ((currentEdge | 1u) != (current.d_edgeId | 1u)) { - Debug("equality") << d_name + Trace("equality") << d_name << "::eq::getExplanation(): currentEdge = ({" << currentNode << "} " << d_nodes[currentNode] << ", {" << edge.getNodeId() << "} " @@ -1464,7 +1464,7 @@ void EqualityEngine::getExplanation( // Did we find the path if (edge.getNodeId() == t2Id) { - Debug("equality") << d_name << "::eq::getExplanation(): path found: " << std::endl; + Trace("equality") << d_name << "::eq::getExplanation(): path found: " << std::endl; std::vector> eqp_trans; @@ -1477,19 +1477,19 @@ void EqualityEngine::getExplanation( d_equalityEdges[currentEdge].getReasonType()); Node reason = d_equalityEdges[currentEdge].getReason(); - Debug("equality") + Trace("equality") << d_name << "::eq::getExplanation(): currentEdge = " << currentEdge << ", currentNode = " << currentNode << std::endl; - Debug("equality") + Trace("equality") << d_name << " targetNode = {" << edgeNode << "} " << d_nodes[edgeNode] << std::endl; - Debug("equality") + Trace("equality") << d_name << " in currentEdge = ({" << currentNode << "} " << d_nodes[currentNode] << ", {" << edge.getNodeId() << "} " << d_nodes[edge.getNodeId()] << ")" << std::endl; - Debug("equality") + Trace("equality") << d_name << " reason type = " << reasonType << "\n"; @@ -1505,7 +1505,7 @@ void EqualityEngine::getExplanation( switch (reasonType) { case MERGED_THROUGH_CONGRUENCE: { // f(x1, x2) == f(y1, y2) because x1 = y1 and x2 = y2 - Debug("equality") + Trace("equality") << d_name << "::eq::getExplanation(): due to congruence, going deeper" << std::endl; @@ -1514,12 +1514,12 @@ void EqualityEngine::getExplanation( const FunctionApplication& f2 = d_applications[edgeNode].d_original; - Debug("equality") << push; - Debug("equality") << "Explaining left hand side equalities" << std::endl; + Trace("equality") << push; + Trace("equality") << "Explaining left hand side equalities" << std::endl; std::shared_ptr eqpc1 = eqpc ? std::make_shared() : nullptr; getExplanation(f1.d_a, f2.d_a, equalities, cache, eqpc1.get()); - Debug("equality") << "Explaining right hand side equalities" << std::endl; + Trace("equality") << "Explaining right hand side equalities" << std::endl; std::shared_ptr eqpc2 = eqpc ? std::make_shared() : nullptr; getExplanation(f1.d_b, f2.d_b, equalities, cache, eqpc2.get()); @@ -1544,34 +1544,34 @@ void EqualityEngine::getExplanation( << " with non-congruence with " << k << "\n"; } } - Debug("equality") << pop; + Trace("equality") << pop; break; } case MERGED_THROUGH_REFLEXIVITY: { // x1 == x1 - Debug("equality") << d_name << "::eq::getExplanation(): due to reflexivity, going deeper" << std::endl; + Trace("equality") << d_name << "::eq::getExplanation(): due to reflexivity, going deeper" << std::endl; EqualityNodeId eqId = currentNode == d_trueId ? edgeNode : currentNode; const FunctionApplication& eq = d_applications[eqId].d_original; Assert(eq.isEquality()) << "Must be an equality"; // Explain why a = b constant - Debug("equality") << push; + Trace("equality") << push; std::shared_ptr eqpc1 = eqpc ? std::make_shared() : nullptr; getExplanation(eq.d_a, eq.d_b, equalities, cache, eqpc1.get()); if( eqpc ){ eqpc->d_children.push_back( eqpc1 ); } - Debug("equality") << pop; + Trace("equality") << pop; break; } case MERGED_THROUGH_CONSTANTS: { // f(c1, ..., cn) = c semantically, we can just ignore it - Debug("equality") << d_name << "::eq::getExplanation(): due to constants, explain the constants" << std::endl; - Debug("equality") << push; + Trace("equality") << d_name << "::eq::getExplanation(): due to constants, explain the constants" << std::endl; + Trace("equality") << push; // Get the node we interpreted TNode interpreted; @@ -1609,9 +1609,9 @@ void EqualityEngine::getExplanation( eqpcc.get()); if( eqpc ) { eqpc->d_children.push_back( eqpcc ); - if (Debug.isOn("pf::ee")) + if (TraceIsOn("pf::ee")) { - Debug("pf::ee") + Trace("pf::ee") << "MERGED_THROUGH_CONSTANTS. Dumping the child proof" << std::endl; eqpc->debug_print("pf::ee", 1); @@ -1619,15 +1619,15 @@ void EqualityEngine::getExplanation( } } - Debug("equality") << pop; + Trace("equality") << pop; break; } default: { // Construct the equality - Debug("equality") << d_name << "::eq::getExplanation(): adding: " + Trace("equality") << d_name << "::eq::getExplanation(): adding: " << reason << std::endl; - Debug("equality") + Trace("equality") << d_name << "::eq::getExplanation(): reason type = " << reasonType << "\n"; @@ -1691,7 +1691,7 @@ void EqualityEngine::getExplanation( // EqProof::reduceNestedCongruence for more details. buildEqConclusion(t1Id, t2Id, eqp); } - if (Debug.isOn("pf::ee")) + if (TraceIsOn("pf::ee")) { eqp->debug_print("pf::ee", 1); } @@ -1792,7 +1792,7 @@ void EqualityEngine::addTriggerPredicate(TNode predicate) { void EqualityEngine::addTriggerEqualityInternal(TNode t1, TNode t2, TNode trigger, bool polarity) { - Debug("equality") << d_name << "::eq::addTrigger(" << t1 << ", " << t2 << ", " << trigger << ")" << std::endl; + Trace("equality") << d_name << "::eq::addTrigger(" << t1 << ", " << t2 << ", " << trigger << ")" << std::endl; Assert(hasTerm(t1)); Assert(hasTerm(t2)); @@ -1813,7 +1813,7 @@ void EqualityEngine::addTriggerEqualityInternal(TNode t1, TNode t2, TNode trigge // We will attach it to the class representative, since then we know how to backtrack it TriggerId t2TriggerId = d_nodeTriggers[t2classId]; - Debug("equality") << d_name << "::eq::addTrigger(" << trigger << "): " << t1Id << " (" << t1classId << ") = " << t2Id << " (" << t2classId << ")" << std::endl; + Trace("equality") << d_name << "::eq::addTrigger(" << trigger << "): " << t1Id << " (" << t1classId << ") = " << t2Id << " (" << t2classId << ")" << std::endl; // Create the triggers TriggerId t1NewTriggerId = d_equalityTriggers.size(); @@ -1832,15 +1832,15 @@ void EqualityEngine::addTriggerEqualityInternal(TNode t1, TNode t2, TNode trigge d_nodeTriggers[t1classId] = t1NewTriggerId; d_nodeTriggers[t2classId] = t2NewTriggerId; - if (Debug.isOn("equality::internal")) { + if (TraceIsOn("equality::internal")) { debugPrintGraph(); } - Debug("equality") << d_name << "::eq::addTrigger(" << t1 << "," << t2 << ") => (" << t1NewTriggerId << ", " << t2NewTriggerId << ")" << std::endl; + Trace("equality") << d_name << "::eq::addTrigger(" << t1 << "," << t2 << ") => (" << t1NewTriggerId << ", " << t2NewTriggerId << ")" << std::endl; } Node EqualityEngine::evaluateTerm(TNode node) { - Debug("equality::evaluation") << d_name << "::eq::evaluateTerm(" << node << ")" << std::endl; + Trace("equality::evaluation") << d_name << "::eq::evaluateTerm(" << node << ")" << std::endl; NodeBuilder builder; builder << node.getKind(); if (node.getMetaKind() == kind::metakind::PARAMETERIZED) { @@ -1849,7 +1849,7 @@ Node EqualityEngine::evaluateTerm(TNode node) { for (unsigned i = 0; i < node.getNumChildren(); ++ i) { TNode child = node[i]; TNode childRep = getRepresentative(child); - Debug("equality::evaluation") << d_name << "::eq::evaluateTerm: " << child << " -> " << childRep << std::endl; + Trace("equality::evaluation") << d_name << "::eq::evaluateTerm: " << child << " -> " << childRep << std::endl; Assert(childRep.isConst()); builder << childRep; } @@ -1859,7 +1859,7 @@ Node EqualityEngine::evaluateTerm(TNode node) { void EqualityEngine::processEvaluationQueue() { - Debug("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): start" << std::endl; + Trace("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): start" << std::endl; while (!d_evaluationQueue.empty()) { // Get the node @@ -1868,7 +1868,7 @@ void EqualityEngine::processEvaluationQueue() { // Replace the children with their representatives (must be constants) Node nodeEvaluated = evaluateTerm(d_nodes[id]); - Debug("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): " << d_nodes[id] << " evaluates to " << nodeEvaluated << std::endl; + Trace("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): " << d_nodes[id] << " evaluates to " << nodeEvaluated << std::endl; Assert(nodeEvaluated.isConst()); addTermInternal(nodeEvaluated); EqualityNodeId nodeEvaluatedId = getNodeId(nodeEvaluated); @@ -1877,7 +1877,7 @@ void EqualityEngine::processEvaluationQueue() { enqueue(MergeCandidate(id, nodeEvaluatedId, MERGED_THROUGH_CONSTANTS, TNode::null())); } - Debug("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): done" << std::endl; + Trace("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): done" << std::endl; } void EqualityEngine::propagate() { @@ -1890,7 +1890,7 @@ void EqualityEngine::propagate() { // Make sure we don't get in again ScopedBool inPropagate(d_inPropagate, true); - Debug("equality") << d_name << "::eq::propagate()" << std::endl; + Trace("equality") << d_name << "::eq::propagate()" << std::endl; while (!d_propagationQueue.empty() || !d_evaluationQueue.empty()) { @@ -1920,8 +1920,8 @@ void EqualityEngine::propagate() { continue; } - Debug("equality::internal") << d_name << "::eq::propagate(): t1: " << (d_isInternal[t1classId] ? "internal" : "proper") << std::endl; - Debug("equality::internal") << d_name << "::eq::propagate(): t2: " << (d_isInternal[t2classId] ? "internal" : "proper") << std::endl; + Trace("equality::internal") << d_name << "::eq::propagate(): t1: " << (d_isInternal[t1classId] ? "internal" : "proper") << std::endl; + Trace("equality::internal") << d_name << "::eq::propagate(): t2: " << (d_isInternal[t2classId] ? "internal" : "proper") << std::endl; // Get the nodes of the representatives EqualityNode& node1 = getEqualityNode(t1classId); @@ -1977,7 +1977,7 @@ void EqualityEngine::propagate() { } if (mergeInto == t2classId) { - Debug("equality") << d_name << "::eq::propagate(): merging " + Trace("equality") << d_name << "::eq::propagate(): merging " << d_nodes[current.d_t1Id] << " into " << d_nodes[current.d_t2Id] << std::endl; d_assertedEqualities.push_back(Equality(t2classId, t1classId)); @@ -1986,7 +1986,7 @@ void EqualityEngine::propagate() { d_done = true; } } else { - Debug("equality") << d_name << "::eq::propagate(): merging " + Trace("equality") << d_name << "::eq::propagate(): merging " << d_nodes[current.d_t2Id] << " into " << d_nodes[current.d_t1Id] << std::endl; d_assertedEqualities.push_back(Equality(t1classId, t2classId)); @@ -2058,21 +2058,21 @@ void EqualityEngine::propagate() { } void EqualityEngine::debugPrintGraph() const { - Debug("equality::graph") << std::endl << "Dumping graph" << std::endl; + Trace("equality::graph") << std::endl << "Dumping graph" << std::endl; for (EqualityNodeId nodeId = 0; nodeId < d_nodes.size(); ++ nodeId) { - Debug("equality::graph") << d_nodes[nodeId] << " " << nodeId << "(" << getEqualityNode(nodeId).getFind() << "):"; + Trace("equality::graph") << d_nodes[nodeId] << " " << nodeId << "(" << getEqualityNode(nodeId).getFind() << "):"; EqualityEdgeId edgeId = d_equalityGraph[nodeId]; while (edgeId != null_edge) { const EqualityEdge& edge = d_equalityEdges[edgeId]; - Debug("equality::graph") << " [" << edge.getNodeId() << "] " << d_nodes[edge.getNodeId()] << ":" << edge.getReason(); + Trace("equality::graph") << " [" << edge.getNodeId() << "] " << d_nodes[edge.getNodeId()] << ":" << edge.getReason(); edgeId = edge.getNext(); } - Debug("equality::graph") << std::endl; + Trace("equality::graph") << std::endl; } - Debug("equality::graph") << std::endl; + Trace("equality::graph") << std::endl; } std::string EqualityEngine::debugPrintEqc() const @@ -2099,19 +2099,19 @@ std::string EqualityEngine::debugPrintEqc() const } bool EqualityEngine::areEqual(TNode t1, TNode t2) const { - Debug("equality") << d_name << "::eq::areEqual(" << t1 << "," << t2 << ")"; + Trace("equality") << d_name << "::eq::areEqual(" << t1 << "," << t2 << ")"; Assert(hasTerm(t1)); Assert(hasTerm(t2)); bool result = getEqualityNode(t1).getFind() == getEqualityNode(t2).getFind(); - Debug("equality") << (result ? "\t(YES)" : "\t(NO)") << std::endl; + Trace("equality") << (result ? "\t(YES)" : "\t(NO)") << std::endl; return result; } bool EqualityEngine::areDisequal(TNode t1, TNode t2, bool ensureProof) const { - Debug("equality") << d_name << "::eq::areDisequal(" << t1 << "," << t2 << ")"; + Trace("equality") << d_name << "::eq::areDisequal(" << t1 << "," << t2 << ")"; // Add the terms Assert(hasTerm(t1)); @@ -2123,7 +2123,7 @@ bool EqualityEngine::areDisequal(TNode t1, TNode t2, bool ensureProof) const // If we propagated this disequality we're true if (hasPropagatedDisequality(t1Id, t2Id)) { - Debug("equality") << "\t(YES)" << std::endl; + Trace("equality") << "\t(YES)" << std::endl; return true; } @@ -2141,7 +2141,7 @@ bool EqualityEngine::areDisequal(TNode t1, TNode t2, bool ensureProof) const nonConst->d_deducedDisequalityReasons.push_back(EqualityPair(t2Id, t2ClassId)); nonConst->storePropagatedDisequality(THEORY_LAST, t1Id, t2Id); } - Debug("equality") << "\t(YES)" << std::endl; + Trace("equality") << "\t(YES)" << std::endl; return true; } @@ -2160,7 +2160,7 @@ bool EqualityEngine::areDisequal(TNode t1, TNode t2, bool ensureProof) const EqualityPair(t2Id, original.d_b)); nonConst->storePropagatedDisequality(THEORY_LAST, t1Id, t2Id); } - Debug("equality") << "\t(YES)" << std::endl; + Trace("equality") << "\t(YES)" << std::endl; return true; } } @@ -2180,13 +2180,13 @@ bool EqualityEngine::areDisequal(TNode t1, TNode t2, bool ensureProof) const EqualityPair(t1Id, original.d_b)); nonConst->storePropagatedDisequality(THEORY_LAST, t1Id, t2Id); } - Debug("equality") << "\t(YES)" << std::endl; + Trace("equality") << "\t(YES)" << std::endl; return true; } } // Couldn't deduce dis-equalityReturn whether the terms are disequal - Debug("equality") << "\t(NO)" << std::endl; + Trace("equality") << "\t(NO)" << std::endl; return false; } @@ -2200,7 +2200,7 @@ std::string EqualityEngine::identify() const { return d_name; } void EqualityEngine::addTriggerTerm(TNode t, TheoryId tag) { - Debug("equality::trigger") << d_name << "::eq::addTriggerTerm(" << t << ", " << tag << ")" << std::endl; + Trace("equality::trigger") << d_name << "::eq::addTriggerTerm(" << t << ", " << tag << ")" << std::endl; Assert(tag != THEORY_LAST); @@ -2227,7 +2227,7 @@ void EqualityEngine::addTriggerTerm(TNode t, TheoryId tag) if (triggerSetRef != +null_set_id && getTriggerTermSet(triggerSetRef).hasTrigger(tag)) { // If the term already is in the equivalence class that a tagged representative, just notify EqualityNodeId triggerId = getTriggerTermSet(triggerSetRef).getTrigger(tag); - Debug("equality::trigger") + Trace("equality::trigger") << d_name << "::eq::addTriggerTerm(" << t << ", " << tag << "): already have this trigger in class with " << d_nodes[triggerId] << std::endl; @@ -2284,7 +2284,7 @@ void EqualityEngine::addTriggerTerm(TNode t, TheoryId tag) d_nodeIndividualTrigger[classId] = triggerSetRef = newTriggerTermSet(newSetTags, newSetTriggers, newSetTriggersSize); // Propagate trigger term disequalities we remembered - Debug("equality::trigger") << d_name << "::eq::addTriggerTerm(" << t << ", " << tag << "): propagating " << disequalitiesToNotify.size() << " disequalities " << std::endl; + Trace("equality::trigger") << d_name << "::eq::addTriggerTerm(" << t << ", " << tag << "): propagating " << disequalitiesToNotify.size() << " disequalities " << std::endl; propagateTriggerTermDisequalities(tags, triggerSetRef, disequalitiesToNotify); } } @@ -2315,8 +2315,8 @@ void EqualityEngine::storeApplicationLookup(FunctionApplication& funNormalized, d_applicationLookup[funNormalized] = funId; d_applicationLookups.push_back(funNormalized); d_applicationLookupsCount = d_applicationLookupsCount + 1; - Debug("equality::backtrack") << "d_applicationLookupsCount = " << d_applicationLookupsCount << std::endl; - Debug("equality::backtrack") << "d_applicationLookups.size() = " << d_applicationLookups.size() << std::endl; + Trace("equality::backtrack") << "d_applicationLookupsCount = " << d_applicationLookupsCount << std::endl; + Trace("equality::backtrack") << "d_applicationLookups.size() = " << d_applicationLookups.size() << std::endl; Assert(d_applicationLookupsCount == d_applicationLookups.size()); // If an equality over constants we merge to false @@ -2393,7 +2393,7 @@ bool EqualityEngine::hasPropagatedDisequality(EqualityNodeId lhsId, EqualityNode bool stored = d_disequalityReasonsMap.find(eq) != d_disequalityReasonsMap.end(); Assert(propagated == stored) << "These two should be in sync"; #endif - Debug("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => " << (propagated ? "true" : "false") << std::endl; + Trace("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => " << (propagated ? "true" : "false") << std::endl; return propagated; } @@ -2405,13 +2405,13 @@ bool EqualityEngine::hasPropagatedDisequality(TheoryId tag, EqualityNodeId lhsId if (it == d_propagatedDisequalities.end()) { Assert(d_disequalityReasonsMap.find(eq) == d_disequalityReasonsMap.end()) << "Why do we have a proof if not propagated"; - Debug("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => false" << std::endl; + Trace("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => false" << std::endl; return false; } Assert(d_disequalityReasonsMap.find(eq) != d_disequalityReasonsMap.end()) << "We propagated but there is no proof"; bool result = TheoryIdSetUtil::setContains(tag, (*it).second); - Debug("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => " << (result ? "true" : "false") << std::endl; + Trace("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => " << (result ? "true" : "false") << std::endl; return result; } @@ -2421,7 +2421,7 @@ void EqualityEngine::storePropagatedDisequality(TheoryId tag, EqualityNodeId lhs << "Check before you store it"; Assert(lhsId != rhsId) << "Wow, wtf!"; - Debug("equality::disequality") << d_name << "::eq::storePropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ")" << std::endl; + Trace("equality::disequality") << d_name << "::eq::storePropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ")" << std::endl; EqualityPair pair1(lhsId, rhsId); EqualityPair pair2(rhsId, lhsId); @@ -2439,7 +2439,7 @@ void EqualityEngine::storePropagatedDisequality(TheoryId tag, EqualityNodeId lhs // Store the proof if provided if (d_deducedDisequalityReasons.size() > d_deducedDisequalityReasonsSize) { - Debug("equality::disequality") << d_name << "::eq::storePropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << "): storing proof" << std::endl; + Trace("equality::disequality") << d_name << "::eq::storePropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << "): storing proof" << std::endl; Assert(d_disequalityReasonsMap.find(pair1) == d_disequalityReasonsMap.end()) << "There can't be a proof if you're adding a new one"; DisequalityReasonRef ref(d_deducedDisequalityReasonsSize, d_deducedDisequalityReasons.size()); @@ -2452,12 +2452,12 @@ void EqualityEngine::storePropagatedDisequality(TheoryId tag, EqualityNodeId lhs == getEqualityNode(d_deducedDisequalityReasons[i].second).getFind()); } #endif - if (Debug.isOn("equality::disequality")) { + if (TraceIsOn("equality::disequality")) { for (unsigned i = ref.d_mergesStart; i < ref.d_mergesEnd; ++i) { TNode lhs = d_nodes[d_deducedDisequalityReasons[i].first]; TNode rhs = d_nodes[d_deducedDisequalityReasons[i].second]; - Debug("equality::disequality") << d_name << "::eq::storePropagatedDisequality(): because " << lhs << " == " << rhs << std::endl; + Trace("equality::disequality") << d_name << "::eq::storePropagatedDisequality(): because " << lhs << " == " << rhs << std::endl; } } @@ -2499,7 +2499,7 @@ void EqualityEngine::getDisequalities(bool allowConstants, EqualityNodeId currentId = classId; do { - Debug("equality::trigger") << d_name << "::getDisequalities() : going through uselist of " << d_nodes[currentId] << std::endl; + Trace("equality::trigger") << d_name << "::getDisequalities() : going through uselist of " << d_nodes[currentId] << std::endl; // Current node in the equivalence class EqualityNode& currentNode = getEqualityNode(currentId); @@ -2510,7 +2510,7 @@ void EqualityEngine::getDisequalities(bool allowConstants, UseListNode& useListNode = d_useListNodes[currentUseId]; EqualityNodeId funId = useListNode.getApplicationId(); - Debug("equality::trigger") << d_name << "::getDisequalities() : checking " << d_nodes[funId] << std::endl; + Trace("equality::trigger") << d_name << "::getDisequalities() : checking " << d_nodes[funId] << std::endl; const FunctionApplication& fun = d_applications[useListNode.getApplicationId()].d_original; diff --git a/src/theory/uf/proof_equality_engine.cpp b/src/theory/uf/proof_equality_engine.cpp index 856dce011..53a91d52b 100644 --- a/src/theory/uf/proof_equality_engine.cpp +++ b/src/theory/uf/proof_equality_engine.cpp @@ -414,7 +414,7 @@ TrustNode ProofEqEngine::ensureProofForFact(Node conc, << std::endl; // should always be non-null Assert(pf != nullptr); - if (Trace.isOn("pfee-proof") || Trace.isOn("pfee-proof-final")) + if (TraceIsOn("pfee-proof") || TraceIsOn("pfee-proof-final")) { Trace("pfee-proof") << "pfee::ensureProofForFact: printing proof" << std::endl; @@ -541,7 +541,7 @@ void ProofEqEngine::explainWithProof(Node lit, assumps.push_back(a); } } - if (Trace.isOn("pfee-proof")) + if (TraceIsOn("pfee-proof")) { Trace("pfee-proof") << "pfee::explainWithProof: add to proof ---" << std::endl; diff --git a/src/theory/uf/symmetry_breaker.cpp b/src/theory/uf/symmetry_breaker.cpp index 94ba490c5..a1494aead 100644 --- a/src/theory/uf/symmetry_breaker.cpp +++ b/src/theory/uf/symmetry_breaker.cpp @@ -68,54 +68,54 @@ TNode SymmetryBreaker::Template::find(TNode n) { } bool SymmetryBreaker::Template::matchRecursive(TNode t, TNode n) { - IndentedScope scope(Debug("ufsymm:match")); + IndentedScope scope(Trace("ufsymm:match")); - Debug("ufsymm:match") << "UFSYMM matching " << t << endl + Trace("ufsymm:match") << "UFSYMM matching " << t << endl << "UFSYMM to " << n << endl; if(t.getKind() != n.getKind() || t.getNumChildren() != n.getNumChildren()) { - Debug("ufsymm:match") << "UFSYMM BAD MATCH on kind, #children" << endl; + Trace("ufsymm:match") << "UFSYMM BAD MATCH on kind, #children" << endl; return false; } if(t.getNumChildren() == 0) { if (!t.isVar()) { - Debug("ufsymm:match") << "UFSYMM non-variables, failing match" << endl; + Trace("ufsymm:match") << "UFSYMM non-variables, failing match" << endl; return false; } t = find(t); n = find(n); - Debug("ufsymm:match") << "UFSYMM variable match " << t << " , " << n << endl; - Debug("ufsymm:match") << "UFSYMM sets: " << t << " =>"; + Trace("ufsymm:match") << "UFSYMM variable match " << t << " , " << n << endl; + Trace("ufsymm:match") << "UFSYMM sets: " << t << " =>"; if(d_sets.find(t) != d_sets.end()) { for(set::iterator i = d_sets[t].begin(); i != d_sets[t].end(); ++i) { - Debug("ufsymm:match") << " " << *i; + Trace("ufsymm:match") << " " << *i; } } - Debug("ufsymm:match") << endl; + Trace("ufsymm:match") << endl; if(t != n) { - Debug("ufsymm:match") << "UFSYMM sets: " << n << " =>"; + Trace("ufsymm:match") << "UFSYMM sets: " << n << " =>"; if(d_sets.find(n) != d_sets.end()) { for(set::iterator i = d_sets[n].begin(); i != d_sets[n].end(); ++i) { - Debug("ufsymm:match") << " " << *i; + Trace("ufsymm:match") << " " << *i; } } - Debug("ufsymm:match") << endl; + Trace("ufsymm:match") << endl; if(d_sets.find(t) == d_sets.end()) { - Debug("ufsymm:match") << "UFSYMM inserting " << t << " in with " << n << endl; + Trace("ufsymm:match") << "UFSYMM inserting " << t << " in with " << n << endl; d_reps[t] = n; d_sets[n].insert(t); } else { if(d_sets.find(n) != d_sets.end()) { - Debug("ufsymm:match") << "UFSYMM merging " << n << " and " << t << " in with " << n << endl; + Trace("ufsymm:match") << "UFSYMM merging " << n << " and " << t << " in with " << n << endl; d_sets[n].insert(d_sets[t].begin(), d_sets[t].end()); d_sets[n].insert(t); d_reps[t] = n; d_sets.erase(t); } else { - Debug("ufsymm:match") << "UFSYMM inserting " << n << " in with " << t << endl; + Trace("ufsymm:match") << "UFSYMM inserting " << n << " in with " << t << endl; d_sets[t].insert(n); d_reps[n] = t; } @@ -126,7 +126,7 @@ bool SymmetryBreaker::Template::matchRecursive(TNode t, TNode n) { if(t.getMetaKind() == kind::metakind::PARAMETERIZED) { if(t.getOperator() != n.getOperator()) { - Debug("ufsymm:match") << "UFSYMM BAD MATCH on operators: " << t.getOperator() << " != " << n.getOperator() << endl; + Trace("ufsymm:match") << "UFSYMM BAD MATCH on operators: " << t.getOperator() << " != " << n.getOperator() << endl; return false; } } @@ -135,7 +135,7 @@ bool SymmetryBreaker::Template::matchRecursive(TNode t, TNode n) { while(ti != t.end()) { if(*ti != *ni) { // nothing to do if equal if(!matchRecursive(*ti, *ni)) { - Debug("ufsymm:match") << "UFSYMM BAD MATCH, withdrawing.." << endl; + Trace("ufsymm:match") << "UFSYMM BAD MATCH, withdrawing.." << endl; return false; } } @@ -149,7 +149,7 @@ bool SymmetryBreaker::Template::matchRecursive(TNode t, TNode n) { bool SymmetryBreaker::Template::match(TNode n) { // try to "match" n and d_template if(d_template.isNull()) { - Debug("ufsymm") << "UFSYMM setting template " << n << endl; + Trace("ufsymm") << "UFSYMM setting template " << n << endl; d_template = n; return true; } else { @@ -186,7 +186,7 @@ class SBGuard { bool d_old; public: SBGuard(bool& b) : d_ref(b), d_old(b) {} - ~SBGuard() { Debug("uf") << "reset to " << d_old << std::endl; d_ref = d_old; } + ~SBGuard() { Trace("uf") << "reset to " << d_old << std::endl; d_ref = d_old; } };/* class SBGuard */ void SymmetryBreaker::rerunAssertionsIfNecessary() { @@ -197,13 +197,13 @@ void SymmetryBreaker::rerunAssertionsIfNecessary() { SBGuard g(d_rerunningAssertions); d_rerunningAssertions = true; - Debug("ufsymm") << "UFSYMM: rerunning assertions..." << std::endl; + Trace("ufsymm") << "UFSYMM: rerunning assertions..." << std::endl; for(CDList::const_iterator i = d_assertionsToRerun.begin(); i != d_assertionsToRerun.end(); ++i) { assertFormula(*i); } - Debug("ufsymm") << "UFSYMM: DONE rerunning assertions..." << std::endl; + Trace("ufsymm") << "UFSYMM: DONE rerunning assertions..." << std::endl; } Node SymmetryBreaker::norm(TNode phi) { @@ -232,7 +232,7 @@ Node SymmetryBreaker::normInternal(TNode n, size_t level) { kids.reserve(n.getNumChildren()); queue work; work.push(n); - Debug("ufsymm:norm") << "UFSYMM processing " << n << endl; + Trace("ufsymm:norm") << "UFSYMM processing " << n << endl; do { TNode m = work.front(); work.pop(); @@ -251,7 +251,7 @@ Node SymmetryBreaker::normInternal(TNode n, size_t level) { if(level == 0) { d_termEqsOnly[(*i)[0]].insert((*i)[1]); d_termEqsOnly[(*i)[1]].insert((*i)[0]); - Debug("ufsymm:eq") << "UFSYMM " << (*i)[0] << " <==> " << (*i)[1] << endl; + Trace("ufsymm:eq") << "UFSYMM " << (*i)[0] << " <==> " << (*i)[1] << endl; } } } else { @@ -260,7 +260,7 @@ Node SymmetryBreaker::normInternal(TNode n, size_t level) { } } } while(!work.empty()); - Debug("ufsymm:norm") << "UFSYMM got " << kids.size() << " kids for the " << k << "-kinded Node" << endl; + Trace("ufsymm:norm") << "UFSYMM got " << kids.size() << " kids for the " << k << "-kinded Node" << endl; sort(kids.begin(), kids.end()); return result = NodeManager::currentNM()->mkNode(k, kids); } @@ -271,7 +271,7 @@ Node SymmetryBreaker::normInternal(TNode n, size_t level) { kids.reserve(n.getNumChildren()); queue work; work.push(n); - Debug("ufsymm:norm") << "UFSYMM processing " << n << endl; + Trace("ufsymm:norm") << "UFSYMM processing " << n << endl; TNode matchingTerm = TNode::null(); vector matchingTermEquals; bool first = true, matchedVar = false; @@ -342,16 +342,16 @@ Node SymmetryBreaker::normInternal(TNode n, size_t level) { } } while(!work.empty()); if(!matchingTerm.isNull()) { - if(Debug.isOn("ufsymm:eq")) { - Debug("ufsymm:eq") << "UFSYMM here we can conclude that " << matchingTerm << " is one of {"; + if(TraceIsOn("ufsymm:eq")) { + Trace("ufsymm:eq") << "UFSYMM here we can conclude that " << matchingTerm << " is one of {"; for(vector::const_iterator i = matchingTermEquals.begin(); i != matchingTermEquals.end(); ++i) { - Debug("ufsymm:eq") << " " << *i; + Trace("ufsymm:eq") << " " << *i; } - Debug("ufsymm:eq") << " }" << endl; + Trace("ufsymm:eq") << " }" << endl; } d_termEqsOnly[matchingTerm].insert(matchingTermEquals.begin(), matchingTermEquals.end()); } - Debug("ufsymm:norm") << "UFSYMM got " << kids.size() << " kids for the " << k << "-kinded Node" << endl; + Trace("ufsymm:norm") << "UFSYMM got " << kids.size() << " kids for the " << k << "-kinded Node" << endl; sort(kids.begin(), kids.end()); return result = NodeManager::currentNM()->mkNode(k, kids); } @@ -364,7 +364,7 @@ Node SymmetryBreaker::normInternal(TNode n, size_t level) { if(level == 0) { d_termEqsOnly[n[0]].insert(n[1]); d_termEqsOnly[n[1]].insert(n[0]); - Debug("ufsymm:eq") << "UFSYMM " << n[0] << " <==> " << n[1] << endl; + Trace("ufsymm:eq") << "UFSYMM " << n[0] << " <==> " << n[1] << endl; } } CVC5_FALLTHROUGH; @@ -385,7 +385,7 @@ void SymmetryBreaker::assertFormula(TNode phi) { d_assertionsToRerun.push_back(phi); } // use d_phi, put into d_permutations - Debug("ufsymm") << "UFSYMM assertFormula(): phi is " << phi << endl; + Trace("ufsymm") << "UFSYMM assertFormula(): phi is " << phi << endl; d_phi.push_back(phi); if(phi.getKind() == kind::OR) { Template t; @@ -399,14 +399,14 @@ void SymmetryBreaker::assertFormula(TNode phi) { unordered_map>& ps = t.partitions(); for (auto& kv : ps) { - Debug("ufsymm") << "UFSYMM partition*: " << kv.first; + Trace("ufsymm") << "UFSYMM partition*: " << kv.first; set& p = kv.second; for(set::iterator j = p.begin(); j != p.end(); ++j) { - Debug("ufsymm") << " " << *j; + Trace("ufsymm") << " " << *j; } - Debug("ufsymm") << endl; + Trace("ufsymm") << endl; p.insert(kv.first); Permutations::iterator pi = d_permutations.find(p); if(pi == d_permutations.end()) { @@ -417,21 +417,21 @@ void SymmetryBreaker::assertFormula(TNode phi) { if(!d_template.match(phi)) { // we hit a bad match, extract the partitions and reset the template unordered_map>& ps = d_template.partitions(); - Debug("ufsymm") << "UFSYMM hit a bad match---have " << ps.size() << " partitions:" << endl; + Trace("ufsymm") << "UFSYMM hit a bad match---have " << ps.size() << " partitions:" << endl; for (unordered_map>::iterator i = ps.begin(); i != ps.end(); ++i) { - Debug("ufsymm") << "UFSYMM partition: " << (*i).first; + Trace("ufsymm") << "UFSYMM partition: " << (*i).first; set& p = (*i).second; - if(Debug.isOn("ufsymm")) { + if(TraceIsOn("ufsymm")) { for(set::iterator j = p.begin(); j != p.end(); ++j) { - Debug("ufsymm") << " " << *j; + Trace("ufsymm") << " " << *j; } } - Debug("ufsymm") << endl; + Trace("ufsymm") << endl; p.insert((*i).first); d_permutations.insert(p); } @@ -455,7 +455,7 @@ void SymmetryBreaker::clear() { void SymmetryBreaker::apply(std::vector& newClauses) { rerunAssertionsIfNecessary(); guessPermutations(); - Debug("ufsymm") << "UFSYMM =====================================================" << endl + Trace("ufsymm") << "UFSYMM =====================================================" << endl << "UFSYMM have " << d_permutations.size() << " permutation sets" << endl; if(!d_permutations.empty()) { { TimerStat::CodeTimer codeTimer(d_stats.d_initNormalizationTimer); @@ -465,7 +465,7 @@ void SymmetryBreaker::apply(std::vector& newClauses) { Node n = *i; *i = norm(n); d_phiSet.insert(*i); - Debug("ufsymm:norm") << "UFSYMM init-norm-rewrite " << n << endl + Trace("ufsymm:norm") << "UFSYMM init-norm-rewrite " << n << endl << "UFSYMM to " << *i << endl; } } @@ -473,56 +473,56 @@ void SymmetryBreaker::apply(std::vector& newClauses) { for (const Permutation& p : d_permutations) { ++(d_stats.d_permutationSetsConsidered); - Debug("ufsymm") << "UFSYMM looking at permutation: " << p << endl; + Trace("ufsymm") << "UFSYMM looking at permutation: " << p << endl; size_t n = p.size() - 1; if(invariantByPermutations(p)) { ++(d_stats.d_permutationSetsInvariant); selectTerms(p); set cts; while(!d_terms.empty() && cts.size() <= n) { - Debug("ufsymm") << "UFSYMM ==== top of loop, d_terms.size() == " << d_terms.size() << " , cts.size() == " << cts.size() << " , n == " << n << endl; + Trace("ufsymm") << "UFSYMM ==== top of loop, d_terms.size() == " << d_terms.size() << " , cts.size() == " << cts.size() << " , n == " << n << endl; Terms::iterator ti = selectMostPromisingTerm(d_terms); Node t = *ti; - Debug("ufsymm") << "UFSYMM promising term is " << t << endl; + Trace("ufsymm") << "UFSYMM promising term is " << t << endl; d_terms.erase(ti); insertUsedIn(t, p, cts); - if(Debug.isOn("ufsymm")) { + if(TraceIsOn("ufsymm")) { if(cts.empty()) { - Debug("ufsymm") << "UFSYMM cts is empty" << endl; + Trace("ufsymm") << "UFSYMM cts is empty" << endl; } else { for(set::iterator ctsi = cts.begin(); ctsi != cts.end(); ++ctsi) { - Debug("ufsymm") << "UFSYMM cts: " << *ctsi << endl; + Trace("ufsymm") << "UFSYMM cts: " << *ctsi << endl; } } } TNode c; - Debug("ufsymm") << "UFSYMM looking for c \\in " << p << " \\ cts" << endl; + Trace("ufsymm") << "UFSYMM looking for c \\in " << p << " \\ cts" << endl; set::const_iterator i; for(i = p.begin(); i != p.end(); ++i) { if(cts.find(*i) == cts.end()) { if(c.isNull()) { c = *i; - Debug("ufsymm") << "UFSYMM found first: " << c << endl; + Trace("ufsymm") << "UFSYMM found first: " << c << endl; } else { - Debug("ufsymm") << "UFSYMM found second: " << *i << endl; + Trace("ufsymm") << "UFSYMM found second: " << *i << endl; break; } } } if(c.isNull()) { - Debug("ufsymm") << "UFSYMM can't find a c, restart outer loop" << endl; + Trace("ufsymm") << "UFSYMM can't find a c, restart outer loop" << endl; break; } - Debug("ufsymm") << "UFSYMM inserting into cts: " << c << endl; + Trace("ufsymm") << "UFSYMM inserting into cts: " << c << endl; cts.insert(c); // This tests cts != p: if "i == p.end()", we got all the way // through p without seeing two elements not in cts (on the // second one, we break from the above loop). We know we // found at least one (and subsequently added it to cts). So // now cts == p. - Debug("ufsymm") << "UFSYMM p == " << p << endl; + Trace("ufsymm") << "UFSYMM p == " << p << endl; if(i != p.end() || p.size() != cts.size()) { - Debug("ufsymm") << "UFSYMM cts != p" << endl; + Trace("ufsymm") << "UFSYMM cts != p" << endl; NodeBuilder disj(kind::OR); NodeManager* nm = NodeManager::currentNM(); for (const Node& nn : cts) @@ -541,16 +541,16 @@ void SymmetryBreaker::apply(std::vector& newClauses) { disj.clear(); ++(d_stats.d_units); } - if(Debug.isOn("ufsymm")) { - Debug("ufsymm") << "UFSYMM symmetry-breaking clause: " << d << endl; + if(TraceIsOn("ufsymm")) { + Trace("ufsymm") << "UFSYMM symmetry-breaking clause: " << d << endl; } else { - Debug("ufsymm:clauses") << "UFSYMM symmetry-breaking clause: " << d << endl; + Trace("ufsymm:clauses") << "UFSYMM symmetry-breaking clause: " << d << endl; } newClauses.push_back(d); } else { - Debug("ufsymm") << "UFSYMM cts == p" << endl; + Trace("ufsymm") << "UFSYMM cts == p" << endl; } - Debug("ufsymm") << "UFSYMM ==== end of loop, d_terms.size() == " << d_terms.size() << " , cts.size() == " << cts.size() << " , n == " << n << endl; + Trace("ufsymm") << "UFSYMM ==== end of loop, d_terms.size() == " << d_terms.size() << " , cts.size() == " << cts.size() << " , n == " << n << endl; } } } @@ -561,14 +561,14 @@ void SymmetryBreaker::apply(std::vector& newClauses) { void SymmetryBreaker::guessPermutations() { // use d_phi, put into d_permutations - Debug("ufsymm") << "UFSYMM guessPermutations()" << endl; + Trace("ufsymm") << "UFSYMM guessPermutations()" << endl; } bool SymmetryBreaker::invariantByPermutations(const Permutation& p) { TimerStat::CodeTimer codeTimer(d_stats.d_invariantByPermutationsTimer); // use d_phi - Debug("ufsymm") << "UFSYMM invariantByPermutations()? " << p << endl; + Trace("ufsymm") << "UFSYMM invariantByPermutations()? " << p << endl; Assert(p.size() > 1); @@ -577,7 +577,7 @@ bool SymmetryBreaker::invariantByPermutations(const Permutation& p) { TypeNode type = (*permIt++).getType(); do { if(type != (*permIt++).getType()) { - Debug("ufsymm") << "UFSYMM types don't match, aborting.." << endl; + Trace("ufsymm") << "UFSYMM types don't match, aborting.." << endl; return false; } } while(permIt != p.end()); @@ -599,28 +599,28 @@ bool SymmetryBreaker::invariantByPermutations(const Permutation& p) { Node n = norm(s); if (nn != n && d_phiSet.find(n) == d_phiSet.end()) { - Debug("ufsymm") + Trace("ufsymm") << "UFSYMM P_swap is NOT an inv perm op for " << p << endl << "UFSYMM because this node: " << nn << endl << "UFSYMM rewrite-norms to : " << n << endl << "UFSYMM which is not in our set of normalized assertions" << endl; return false; } - else if (Debug.isOn("ufsymm:p")) + else if (TraceIsOn("ufsymm:p")) { if (nn == s) { - Debug("ufsymm:p") << "UFSYMM P_swap passes trivially: " << nn << endl; + Trace("ufsymm:p") << "UFSYMM P_swap passes trivially: " << nn << endl; } else { - Debug("ufsymm:p") << "UFSYMM P_swap passes: " << nn << endl + Trace("ufsymm:p") << "UFSYMM P_swap passes: " << nn << endl << "UFSYMM rewrites: " << s << endl << "UFSYMM norms: " << n << endl; } } } - Debug("ufsymm") << "UFSYMM P_swap is an inv perm op for " << p << endl; + Trace("ufsymm") << "UFSYMM P_swap is an inv perm op for " << p << endl; // check P_circ, unless size == 2 in which case P_circ == P_swap if(p.size() > 2) { @@ -645,7 +645,7 @@ bool SymmetryBreaker::invariantByPermutations(const Permutation& p) { Node n = norm(s); if (nn != n && d_phiSet.find(n) == d_phiSet.end()) { - Debug("ufsymm") + Trace("ufsymm") << "UFSYMM P_circ is NOT an inv perm op for " << p << endl << "UFSYMM because this node: " << nn << endl << "UFSYMM rewrite-norms to : " << n << endl @@ -653,23 +653,23 @@ bool SymmetryBreaker::invariantByPermutations(const Permutation& p) { << endl; return false; } - else if (Debug.isOn("ufsymm:p")) + else if (TraceIsOn("ufsymm:p")) { if (nn == s) { - Debug("ufsymm:p") << "UFSYMM P_circ passes trivially: " << nn << endl; + Trace("ufsymm:p") << "UFSYMM P_circ passes trivially: " << nn << endl; } else { - Debug("ufsymm:p") << "UFSYMM P_circ passes: " << nn << endl + Trace("ufsymm:p") << "UFSYMM P_circ passes: " << nn << endl << "UFSYMM rewrites: " << s << endl << "UFSYMM norms: " << n << endl; } } } - Debug("ufsymm") << "UFSYMM P_circ is an inv perm op for " << p << endl; + Trace("ufsymm") << "UFSYMM P_circ is an inv perm op for " << p << endl; } else { - Debug("ufsymm") << "UFSYMM no need to check P_circ, since P_circ == P_swap for perm sets of size 2" << endl; + Trace("ufsymm") << "UFSYMM no need to check P_circ, since P_circ == P_swap for perm sets of size 2" << endl; } return true; @@ -679,13 +679,13 @@ bool SymmetryBreaker::invariantByPermutations(const Permutation& p) { template static bool isSubset(const T1& s, const T2& t) { if(s.size() > t.size()) { - //Debug("ufsymm") << "DEBUG ASSERTION FAIL: s not a subset of t " + //Trace("ufsymm") << "DEBUG ASSERTION FAIL: s not a subset of t " // << "because size(s) > size(t)" << endl; return false; } for(typename T1::const_iterator si = s.begin(); si != s.end(); ++si) { if(t.find(*si) == t.end()) { - //Debug("ufsymm") << "DEBUG ASSERTION FAIL: s not a subset of t " + //Trace("ufsymm") << "DEBUG ASSERTION FAIL: s not a subset of t " // << "because s element \"" << *si << "\" not in t" << endl; return false; } @@ -700,13 +700,13 @@ void SymmetryBreaker::selectTerms(const Permutation& p) { TimerStat::CodeTimer codeTimer(d_stats.d_selectTermsTimer); // use d_phi, put into d_terms - Debug("ufsymm") << "UFSYMM selectTerms(): " << p << endl; + Trace("ufsymm") << "UFSYMM selectTerms(): " << p << endl; d_terms.clear(); set terms; for(Permutation::iterator i = p.begin(); i != p.end(); ++i) { const TermEq& teq = d_termEqs[*i]; for(TermEq::const_iterator j = teq.begin(); j != teq.end(); ++j) { - Debug("ufsymm") << "selectTerms: insert in terms " << *j << std::endl; + Trace("ufsymm") << "selectTerms: insert in terms " << *j << std::endl; } terms.insert(teq.begin(), teq.end()); } @@ -714,25 +714,25 @@ void SymmetryBreaker::selectTerms(const Permutation& p) { if(d_termEqsOnly.find(*i) != d_termEqsOnly.end()) { const TermEq& teq = d_termEqsOnly[*i]; if(isSubset(teq, p)) { - Debug("ufsymm") << "selectTerms: teq = {"; + Trace("ufsymm") << "selectTerms: teq = {"; for(TermEq::const_iterator j = teq.begin(); j != teq.end(); ++j) { - Debug("ufsymm") << " " << *j << std::endl; + Trace("ufsymm") << " " << *j << std::endl; } - Debug("ufsymm") << " } is subset of p " << p << std::endl; + Trace("ufsymm") << " } is subset of p " << p << std::endl; d_terms.insert(d_terms.end(), *i); } else { - if(Debug.isOn("ufsymm")) { - Debug("ufsymm") << "UFSYMM selectTerms() threw away candidate: " << *i << endl; - Debug("ufsymm:eq") << "UFSYMM selectTerms() #teq == " << teq.size() << " #p == " << p.size() << endl; + if(TraceIsOn("ufsymm")) { + Trace("ufsymm") << "UFSYMM selectTerms() threw away candidate: " << *i << endl; + Trace("ufsymm:eq") << "UFSYMM selectTerms() #teq == " << teq.size() << " #p == " << p.size() << endl; TermEq::iterator j; for(j = teq.begin(); j != teq.end(); ++j) { - Debug("ufsymm:eq") << "UFSYMM -- teq " << *j << " in " << p << " ?" << endl; + Trace("ufsymm:eq") << "UFSYMM -- teq " << *j << " in " << p << " ?" << endl; if(p.find(*j) == p.end()) { - Debug("ufsymm") << "UFSYMM -- because its teq " << *j + Trace("ufsymm") << "UFSYMM -- because its teq " << *j << " isn't in " << p << endl; break; } else { - Debug("ufsymm:eq") << "UFSYMM -- yep" << endl; + Trace("ufsymm:eq") << "UFSYMM -- yep" << endl; } } Assert(j != teq.end()) @@ -740,12 +740,12 @@ void SymmetryBreaker::selectTerms(const Permutation& p) { } } } else { - Debug("ufsymm") << "selectTerms: don't have data for " << *i << " so can't conclude anything" << endl; + Trace("ufsymm") << "selectTerms: don't have data for " << *i << " so can't conclude anything" << endl; } } - if(Debug.isOn("ufsymm")) { + if(TraceIsOn("ufsymm")) { for(list::iterator i = d_terms.begin(); i != d_terms.end(); ++i) { - Debug("ufsymm") << "UFSYMM selectTerms() returning: " << *i << endl; + Trace("ufsymm") << "UFSYMM selectTerms() returning: " << *i << endl; } } } @@ -769,13 +769,13 @@ SymmetryBreaker::Statistics::Statistics(const std::string& name) SymmetryBreaker::Terms::iterator SymmetryBreaker::selectMostPromisingTerm(Terms& terms) { // use d_phi - Debug("ufsymm") << "UFSYMM selectMostPromisingTerm()" << endl; + Trace("ufsymm") << "UFSYMM selectMostPromisingTerm()" << endl; return terms.begin(); } void SymmetryBreaker::insertUsedIn(Term term, const Permutation& p, set& cts) { // insert terms from p used in term into cts - //Debug("ufsymm") << "UFSYMM usedIn(): " << term << " , " << p << endl; + //Trace("ufsymm") << "UFSYMM usedIn(): " << term << " , " << p << endl; if (p.find(term) != p.end()) { cts.insert(term); } else { diff --git a/src/theory/uf/symmetry_breaker.h b/src/theory/uf/symmetry_breaker.h index 7dca823dd..80a5a592d 100644 --- a/src/theory/uf/symmetry_breaker.h +++ b/src/theory/uf/symmetry_breaker.h @@ -153,7 +153,7 @@ public: protected: void contextNotifyPop() override { - Debug("ufsymm") << "UFSYMM: clearing state due to pop" << std::endl; + Trace("ufsymm") << "UFSYMM: clearing state due to pop" << std::endl; clear(); } diff --git a/src/theory/uf/theory_uf.cpp b/src/theory/uf/theory_uf.cpp index e22698bc0..1b1624598 100644 --- a/src/theory/uf/theory_uf.cpp +++ b/src/theory/uf/theory_uf.cpp @@ -263,7 +263,7 @@ TrustNode TheoryUF::ppRewrite(TNode node, std::vector& lems) void TheoryUF::preRegisterTerm(TNode node) { - Debug("uf") << "TheoryUF::preRegisterTerm(" << node << ")" << std::endl; + Trace("uf") << "TheoryUF::preRegisterTerm(" << node << ")" << std::endl; if (d_thss != nullptr) { @@ -338,7 +338,7 @@ void TheoryUF::preRegisterTerm(TNode node) void TheoryUF::explain(TNode literal, Node& exp) { - Debug("uf") << "TheoryUF::explain(" << literal << ")" << std::endl; + Trace("uf") << "TheoryUF::explain(" << literal << ")" << std::endl; std::vector assumptions; // Do the work bool polarity = literal.getKind() != kind::NOT; @@ -370,14 +370,14 @@ bool TheoryUF::collectModelValues(TheoryModel* m, const std::set& termSet) } } - Debug("uf") << "UF : finish collectModelInfo " << std::endl; + Trace("uf") << "UF : finish collectModelInfo " << std::endl; return true; } void TheoryUF::presolve() { // TimerStat::CodeTimer codeTimer(d_presolveTimer); - Debug("uf") << "uf: begin presolve()" << endl; + Trace("uf") << "uf: begin presolve()" << endl; if (options().uf.ufSymmetryBreaker) { vector newClauses; @@ -385,7 +385,7 @@ void TheoryUF::presolve() { for(vector::const_iterator i = newClauses.begin(); i != newClauses.end(); ++i) { - Debug("uf") << "uf: generating a lemma: " << *i << std::endl; + Trace("uf") << "uf: generating a lemma: " << *i << std::endl; // no proof generator provided d_im.lemma(*i, InferenceId::UF_BREAK_SYMMETRY); } @@ -393,7 +393,7 @@ void TheoryUF::presolve() { if( d_thss ){ d_thss->presolve(); } - Debug("uf") << "uf: end presolve()" << endl; + Trace("uf") << "uf: end presolve()" << endl; } void TheoryUF::ppStaticLearn(TNode n, NodeBuilder& learned) @@ -437,7 +437,7 @@ void TheoryUF::ppStaticLearn(TNode n, NodeBuilder& learned) // == DIAMONDS == - Debug("diamonds") << "===================== looking at" << endl + Trace("diamonds") << "===================== looking at" << endl << n << endl; // binary OR of binary ANDs of EQUALities @@ -450,7 +450,7 @@ void TheoryUF::ppStaticLearn(TNode n, NodeBuilder& learned) (n[1][1].getKind() == kind::EQUAL)) { // now we have (a = b && c = d) || (e = f && g = h) - Debug("diamonds") << "has form of a diamond!" << endl; + Trace("diamonds") << "has form of a diamond!" << endl; TNode a = n[0][0][0], b = n[0][0][1], @@ -473,11 +473,11 @@ void TheoryUF::ppStaticLearn(TNode n, NodeBuilder& learned) d = c; } else { // condition not satisfied - Debug("diamonds") << "+ A fails" << endl; + Trace("diamonds") << "+ A fails" << endl; continue; } - Debug("diamonds") << "+ A holds" << endl; + Trace("diamonds") << "+ A holds" << endl; // same: one of {e, f} = one of {g, h}, and make "f" the // shared node (i.e. put in the form (e = f && f = h)) @@ -492,23 +492,23 @@ void TheoryUF::ppStaticLearn(TNode n, NodeBuilder& learned) h = g; } else { // condition not satisfied - Debug("diamonds") << "+ B fails" << endl; + Trace("diamonds") << "+ B fails" << endl; continue; } - Debug("diamonds") << "+ B holds" << endl; + Trace("diamonds") << "+ B holds" << endl; // now we have (a = b && b = d) || (e = f && f = h) // test that {a, d} == {e, h} if( (a == e && d == h) || (a == h && d == e) ) { // learn: n implies a == d - Debug("diamonds") << "+ C holds" << endl; + Trace("diamonds") << "+ C holds" << endl; Node newEquality = a.eqNode(d); - Debug("diamonds") << " ==> " << newEquality << endl; + Trace("diamonds") << " ==> " << newEquality << endl; learned << n.impNode(newEquality); } else { - Debug("diamonds") << "+ C fails" << endl; + Trace("diamonds") << "+ C fails" << endl; } } } @@ -583,7 +583,7 @@ void TheoryUF::addCarePairs(const TNodeTrie* t1, Node f2 = t2->getData(); if (!d_state.areEqual(f1, f2)) { - Debug("uf::sharing") << "TheoryUf::computeCareGraph(): checking function " << f1 << " and " << f2 << std::endl; + Trace("uf::sharing") << "TheoryUf::computeCareGraph(): checking function " << f1 << " and " << f2 << std::endl; vector< pair > currentPairs; for (size_t k = 0, nchildren = f1.getNumChildren(); k < nchildren; ++k) { @@ -605,7 +605,7 @@ void TheoryUF::addCarePairs(const TNodeTrie* t1, } } for (unsigned c = 0; c < currentPairs.size(); ++ c) { - Debug("uf::sharing") << "TheoryUf::computeCareGraph(): adding to care-graph" << std::endl; + Trace("uf::sharing") << "TheoryUf::computeCareGraph(): adding to care-graph" << std::endl; addCarePair(currentPairs[c].first, currentPairs[c].second); } } @@ -663,7 +663,7 @@ void TheoryUF::computeCareGraph() { // Use term indexing. We build separate indices for APPLY_UF and HO_APPLY. // We maintain indices per operator for the former, and indices per // function type for the latter. - Debug("uf::sharing") << "TheoryUf::computeCareGraph(): Build term indices..." + Trace("uf::sharing") << "TheoryUf::computeCareGraph(): Build term indices..." << std::endl; // temporary keep set for higher-order indexing below std::vector keep; @@ -720,19 +720,19 @@ void TheoryUF::computeCareGraph() { // for each index for (std::pair& tt : index) { - Debug("uf::sharing") << "TheoryUf::computeCareGraph(): Process index " + Trace("uf::sharing") << "TheoryUf::computeCareGraph(): Process index " << tt.first << "..." << std::endl; Assert(arity.find(tt.first) != arity.end()); addCarePairs(&tt.second, nullptr, arity[tt.first], 0); } for (std::pair& tt : hoIndex) { - Debug("uf::sharing") << "TheoryUf::computeCareGraph(): Process ho index " + Trace("uf::sharing") << "TheoryUf::computeCareGraph(): Process ho index " << tt.first << "..." << std::endl; // the arity of HO_APPLY is always two addCarePairs(&tt.second, nullptr, 2, 0); } - Debug("uf::sharing") << "TheoryUf::computeCareGraph(): finished." + Trace("uf::sharing") << "TheoryUf::computeCareGraph(): finished." << std::endl; }/* TheoryUF::computeCareGraph() */ diff --git a/src/theory/uf/theory_uf.h b/src/theory/uf/theory_uf.h index b72262164..58e949aef 100644 --- a/src/theory/uf/theory_uf.h +++ b/src/theory/uf/theory_uf.h @@ -49,21 +49,21 @@ class TheoryUF : public Theory { void eqNotifyNewClass(TNode t) override { - Debug("uf-notify") << "NotifyClass::eqNotifyNewClass(" << t << ")" + Trace("uf-notify") << "NotifyClass::eqNotifyNewClass(" << t << ")" << std::endl; d_uf.eqNotifyNewClass(t); } void eqNotifyMerge(TNode t1, TNode t2) override { - Debug("uf-notify") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2 + Trace("uf-notify") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2 << ")" << std::endl; d_uf.eqNotifyMerge(t1, t2); } void eqNotifyDisequal(TNode t1, TNode t2, TNode reason) override { - Debug("uf-notify") << "NotifyClass::eqNotifyDisequal(" << t1 << ", " << t2 << ", " << reason << ")" << std::endl; + Trace("uf-notify") << "NotifyClass::eqNotifyDisequal(" << t1 << ", " << t2 << ", " << reason << ")" << std::endl; d_uf.eqNotifyDisequal(t1, t2, reason); } diff --git a/src/theory/uf/theory_uf_rewriter.cpp b/src/theory/uf/theory_uf_rewriter.cpp index b331d22c4..b052ced62 100644 --- a/src/theory/uf/theory_uf_rewriter.cpp +++ b/src/theory/uf/theory_uf_rewriter.cpp @@ -73,7 +73,7 @@ RewriteResponse TheoryUfRewriter::postRewrite(TNode node) { subs.push_back(s); } - if (Trace.isOn("uf-ho-beta")) + if (TraceIsOn("uf-ho-beta")) { Trace("uf-ho-beta") << "uf-ho-beta: ..sub of " << subs.size() << " vars into " << subs.size() << " terms :\n"; diff --git a/src/util/resource_manager.cpp b/src/util/resource_manager.cpp index 797d5515e..0640cad32 100644 --- a/src/util/resource_manager.cpp +++ b/src/util/resource_manager.cpp @@ -205,7 +205,7 @@ void ResourceManager::spendResource(uint64_t amount) ++d_statistics->d_spendResourceCalls; d_cumulativeResourceUsed += amount; - Debug("limit") << "ResourceManager::spendResource()" << std::endl; + Trace("limit") << "ResourceManager::spendResource()" << std::endl; d_thisCallResourceUsed += amount; if (out()) { diff --git a/test/unit/node/attribute_white.cpp b/test/unit/node/attribute_white.cpp index b69ba203c..5a1343833 100644 --- a/test/unit/node/attribute_white.cpp +++ b/test/unit/node/attribute_white.cpp @@ -120,49 +120,49 @@ TEST_F(TestNodeWhiteAttribute, attributes) c.setAttribute(VarNameAttr(), "c"); // test that all boolean flags are FALSE to start - Debug("boolattr") << "get flag 1 on a (should be F)\n"; + Trace("boolattr") << "get flag 1 on a (should be F)\n"; ASSERT_FALSE(a.getAttribute(TestFlag1())); - Debug("boolattr") << "get flag 1 on b (should be F)\n"; + Trace("boolattr") << "get flag 1 on b (should be F)\n"; ASSERT_FALSE(b.getAttribute(TestFlag1())); - Debug("boolattr") << "get flag 1 on c (should be F)\n"; + Trace("boolattr") << "get flag 1 on c (should be F)\n"; ASSERT_FALSE(c.getAttribute(TestFlag1())); - Debug("boolattr") << "get flag 1 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 1 on unnamed (should be F)\n"; ASSERT_FALSE(unnamed.getAttribute(TestFlag1())); - Debug("boolattr") << "get flag 2 on a (should be F)\n"; + Trace("boolattr") << "get flag 2 on a (should be F)\n"; ASSERT_FALSE(a.getAttribute(TestFlag2())); - Debug("boolattr") << "get flag 2 on b (should be F)\n"; + Trace("boolattr") << "get flag 2 on b (should be F)\n"; ASSERT_FALSE(b.getAttribute(TestFlag2())); - Debug("boolattr") << "get flag 2 on c (should be F)\n"; + Trace("boolattr") << "get flag 2 on c (should be F)\n"; ASSERT_FALSE(c.getAttribute(TestFlag2())); - Debug("boolattr") << "get flag 2 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 2 on unnamed (should be F)\n"; ASSERT_FALSE(unnamed.getAttribute(TestFlag2())); - Debug("boolattr") << "get flag 3 on a (should be F)\n"; + Trace("boolattr") << "get flag 3 on a (should be F)\n"; ASSERT_FALSE(a.getAttribute(TestFlag3())); - Debug("boolattr") << "get flag 3 on b (should be F)\n"; + Trace("boolattr") << "get flag 3 on b (should be F)\n"; ASSERT_FALSE(b.getAttribute(TestFlag3())); - Debug("boolattr") << "get flag 3 on c (should be F)\n"; + Trace("boolattr") << "get flag 3 on c (should be F)\n"; ASSERT_FALSE(c.getAttribute(TestFlag3())); - Debug("boolattr") << "get flag 3 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 3 on unnamed (should be F)\n"; ASSERT_FALSE(unnamed.getAttribute(TestFlag3())); - Debug("boolattr") << "get flag 4 on a (should be F)\n"; + Trace("boolattr") << "get flag 4 on a (should be F)\n"; ASSERT_FALSE(a.getAttribute(TestFlag4())); - Debug("boolattr") << "get flag 4 on b (should be F)\n"; + Trace("boolattr") << "get flag 4 on b (should be F)\n"; ASSERT_FALSE(b.getAttribute(TestFlag4())); - Debug("boolattr") << "get flag 4 on c (should be F)\n"; + Trace("boolattr") << "get flag 4 on c (should be F)\n"; ASSERT_FALSE(c.getAttribute(TestFlag4())); - Debug("boolattr") << "get flag 4 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 4 on unnamed (should be F)\n"; ASSERT_FALSE(unnamed.getAttribute(TestFlag4())); - Debug("boolattr") << "get flag 5 on a (should be F)\n"; + Trace("boolattr") << "get flag 5 on a (should be F)\n"; ASSERT_FALSE(a.getAttribute(TestFlag5())); - Debug("boolattr") << "get flag 5 on b (should be F)\n"; + Trace("boolattr") << "get flag 5 on b (should be F)\n"; ASSERT_FALSE(b.getAttribute(TestFlag5())); - Debug("boolattr") << "get flag 5 on c (should be F)\n"; + Trace("boolattr") << "get flag 5 on c (should be F)\n"; ASSERT_FALSE(c.getAttribute(TestFlag5())); - Debug("boolattr") << "get flag 5 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 5 on unnamed (should be F)\n"; ASSERT_FALSE(unnamed.getAttribute(TestFlag5())); // test that they all HAVE the boolean attributes @@ -193,115 +193,115 @@ TEST_F(TestNodeWhiteAttribute, attributes) // test two-arg version of hasAttribute() bool bb = false; - Debug("boolattr") << "get flag 1 on a (should be F)\n"; + Trace("boolattr") << "get flag 1 on a (should be F)\n"; ASSERT_TRUE(a.getAttribute(TestFlag1(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 1 on b (should be F)\n"; + Trace("boolattr") << "get flag 1 on b (should be F)\n"; ASSERT_TRUE(b.getAttribute(TestFlag1(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 1 on c (should be F)\n"; + Trace("boolattr") << "get flag 1 on c (should be F)\n"; ASSERT_TRUE(c.getAttribute(TestFlag1(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 1 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 1 on unnamed (should be F)\n"; ASSERT_TRUE(unnamed.getAttribute(TestFlag1(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 2 on a (should be F)\n"; + Trace("boolattr") << "get flag 2 on a (should be F)\n"; ASSERT_TRUE(a.getAttribute(TestFlag2(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 2 on b (should be F)\n"; + Trace("boolattr") << "get flag 2 on b (should be F)\n"; ASSERT_TRUE(b.getAttribute(TestFlag2(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 2 on c (should be F)\n"; + Trace("boolattr") << "get flag 2 on c (should be F)\n"; ASSERT_TRUE(c.getAttribute(TestFlag2(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 2 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 2 on unnamed (should be F)\n"; ASSERT_TRUE(unnamed.getAttribute(TestFlag2(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 3 on a (should be F)\n"; + Trace("boolattr") << "get flag 3 on a (should be F)\n"; ASSERT_TRUE(a.getAttribute(TestFlag3(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 3 on b (should be F)\n"; + Trace("boolattr") << "get flag 3 on b (should be F)\n"; ASSERT_TRUE(b.getAttribute(TestFlag3(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 3 on c (should be F)\n"; + Trace("boolattr") << "get flag 3 on c (should be F)\n"; ASSERT_TRUE(c.getAttribute(TestFlag3(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 3 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 3 on unnamed (should be F)\n"; ASSERT_TRUE(unnamed.getAttribute(TestFlag3(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 4 on a (should be F)\n"; + Trace("boolattr") << "get flag 4 on a (should be F)\n"; ASSERT_TRUE(a.getAttribute(TestFlag4(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 4 on b (should be F)\n"; + Trace("boolattr") << "get flag 4 on b (should be F)\n"; ASSERT_TRUE(b.getAttribute(TestFlag4(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 4 on c (should be F)\n"; + Trace("boolattr") << "get flag 4 on c (should be F)\n"; ASSERT_TRUE(c.getAttribute(TestFlag4(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 4 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 4 on unnamed (should be F)\n"; ASSERT_TRUE(unnamed.getAttribute(TestFlag4(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 5 on a (should be F)\n"; + Trace("boolattr") << "get flag 5 on a (should be F)\n"; ASSERT_TRUE(a.getAttribute(TestFlag5(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 5 on b (should be F)\n"; + Trace("boolattr") << "get flag 5 on b (should be F)\n"; ASSERT_TRUE(b.getAttribute(TestFlag5(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 5 on c (should be F)\n"; + Trace("boolattr") << "get flag 5 on c (should be F)\n"; ASSERT_TRUE(c.getAttribute(TestFlag5(), bb)); ASSERT_FALSE(bb); - Debug("boolattr") << "get flag 5 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 5 on unnamed (should be F)\n"; ASSERT_TRUE(unnamed.getAttribute(TestFlag5(), bb)); ASSERT_FALSE(bb); // setting boolean flags - Debug("boolattr") << "set flag 1 on a to T\n"; + Trace("boolattr") << "set flag 1 on a to T\n"; a.setAttribute(TestFlag1(), true); - Debug("boolattr") << "set flag 1 on b to F\n"; + Trace("boolattr") << "set flag 1 on b to F\n"; b.setAttribute(TestFlag1(), false); - Debug("boolattr") << "set flag 1 on c to F\n"; + Trace("boolattr") << "set flag 1 on c to F\n"; c.setAttribute(TestFlag1(), false); - Debug("boolattr") << "set flag 1 on unnamed to T\n"; + Trace("boolattr") << "set flag 1 on unnamed to T\n"; unnamed.setAttribute(TestFlag1(), true); - Debug("boolattr") << "set flag 2 on a to F\n"; + Trace("boolattr") << "set flag 2 on a to F\n"; a.setAttribute(TestFlag2(), false); - Debug("boolattr") << "set flag 2 on b to T\n"; + Trace("boolattr") << "set flag 2 on b to T\n"; b.setAttribute(TestFlag2(), true); - Debug("boolattr") << "set flag 2 on c to T\n"; + Trace("boolattr") << "set flag 2 on c to T\n"; c.setAttribute(TestFlag2(), true); - Debug("boolattr") << "set flag 2 on unnamed to F\n"; + Trace("boolattr") << "set flag 2 on unnamed to F\n"; unnamed.setAttribute(TestFlag2(), false); - Debug("boolattr") << "set flag 3 on a to T\n"; + Trace("boolattr") << "set flag 3 on a to T\n"; a.setAttribute(TestFlag3(), true); - Debug("boolattr") << "set flag 3 on b to T\n"; + Trace("boolattr") << "set flag 3 on b to T\n"; b.setAttribute(TestFlag3(), true); - Debug("boolattr") << "set flag 3 on c to T\n"; + Trace("boolattr") << "set flag 3 on c to T\n"; c.setAttribute(TestFlag3(), true); - Debug("boolattr") << "set flag 3 on unnamed to T\n"; + Trace("boolattr") << "set flag 3 on unnamed to T\n"; unnamed.setAttribute(TestFlag3(), true); - Debug("boolattr") << "set flag 4 on a to T\n"; + Trace("boolattr") << "set flag 4 on a to T\n"; a.setAttribute(TestFlag4(), true); - Debug("boolattr") << "set flag 4 on b to T\n"; + Trace("boolattr") << "set flag 4 on b to T\n"; b.setAttribute(TestFlag4(), true); - Debug("boolattr") << "set flag 4 on c to T\n"; + Trace("boolattr") << "set flag 4 on c to T\n"; c.setAttribute(TestFlag4(), true); - Debug("boolattr") << "set flag 4 on unnamed to T\n"; + Trace("boolattr") << "set flag 4 on unnamed to T\n"; unnamed.setAttribute(TestFlag4(), true); - Debug("boolattr") << "set flag 5 on a to T\n"; + Trace("boolattr") << "set flag 5 on a to T\n"; a.setAttribute(TestFlag5(), true); - Debug("boolattr") << "set flag 5 on b to T\n"; + Trace("boolattr") << "set flag 5 on b to T\n"; b.setAttribute(TestFlag5(), true); - Debug("boolattr") << "set flag 5 on c to F\n"; + Trace("boolattr") << "set flag 5 on c to F\n"; c.setAttribute(TestFlag5(), false); - Debug("boolattr") << "set flag 5 on unnamed to T\n"; + Trace("boolattr") << "set flag 5 on unnamed to T\n"; unnamed.setAttribute(TestFlag5(), true); ASSERT_EQ(a.getAttribute(VarNameAttr()), "a"); @@ -336,49 +336,49 @@ TEST_F(TestNodeWhiteAttribute, attributes) ASSERT_FALSE(c.hasAttribute(TestStringAttr2())); ASSERT_FALSE(unnamed.hasAttribute(TestStringAttr2())); - Debug("boolattr") << "get flag 1 on a (should be T)\n"; + Trace("boolattr") << "get flag 1 on a (should be T)\n"; ASSERT_TRUE(a.getAttribute(TestFlag1())); - Debug("boolattr") << "get flag 1 on b (should be F)\n"; + Trace("boolattr") << "get flag 1 on b (should be F)\n"; ASSERT_FALSE(b.getAttribute(TestFlag1())); - Debug("boolattr") << "get flag 1 on c (should be F)\n"; + Trace("boolattr") << "get flag 1 on c (should be F)\n"; ASSERT_FALSE(c.getAttribute(TestFlag1())); - Debug("boolattr") << "get flag 1 on unnamed (should be T)\n"; + Trace("boolattr") << "get flag 1 on unnamed (should be T)\n"; ASSERT_TRUE(unnamed.getAttribute(TestFlag1())); - Debug("boolattr") << "get flag 2 on a (should be F)\n"; + Trace("boolattr") << "get flag 2 on a (should be F)\n"; ASSERT_FALSE(a.getAttribute(TestFlag2())); - Debug("boolattr") << "get flag 2 on b (should be T)\n"; + Trace("boolattr") << "get flag 2 on b (should be T)\n"; ASSERT_TRUE(b.getAttribute(TestFlag2())); - Debug("boolattr") << "get flag 2 on c (should be T)\n"; + Trace("boolattr") << "get flag 2 on c (should be T)\n"; ASSERT_TRUE(c.getAttribute(TestFlag2())); - Debug("boolattr") << "get flag 2 on unnamed (should be F)\n"; + Trace("boolattr") << "get flag 2 on unnamed (should be F)\n"; ASSERT_FALSE(unnamed.getAttribute(TestFlag2())); - Debug("boolattr") << "get flag 3 on a (should be T)\n"; + Trace("boolattr") << "get flag 3 on a (should be T)\n"; ASSERT_TRUE(a.getAttribute(TestFlag3())); - Debug("boolattr") << "get flag 3 on b (should be T)\n"; + Trace("boolattr") << "get flag 3 on b (should be T)\n"; ASSERT_TRUE(b.getAttribute(TestFlag3())); - Debug("boolattr") << "get flag 3 on c (should be T)\n"; + Trace("boolattr") << "get flag 3 on c (should be T)\n"; ASSERT_TRUE(c.getAttribute(TestFlag3())); - Debug("boolattr") << "get flag 3 on unnamed (should be T)\n"; + Trace("boolattr") << "get flag 3 on unnamed (should be T)\n"; ASSERT_TRUE(unnamed.getAttribute(TestFlag3())); - Debug("boolattr") << "get flag 4 on a (should be T)\n"; + Trace("boolattr") << "get flag 4 on a (should be T)\n"; ASSERT_TRUE(a.getAttribute(TestFlag4())); - Debug("boolattr") << "get flag 4 on b (should be T)\n"; + Trace("boolattr") << "get flag 4 on b (should be T)\n"; ASSERT_TRUE(b.getAttribute(TestFlag4())); - Debug("boolattr") << "get flag 4 on c (should be T)\n"; + Trace("boolattr") << "get flag 4 on c (should be T)\n"; ASSERT_TRUE(c.getAttribute(TestFlag4())); - Debug("boolattr") << "get flag 4 on unnamed (should be T)\n"; + Trace("boolattr") << "get flag 4 on unnamed (should be T)\n"; ASSERT_TRUE(unnamed.getAttribute(TestFlag4())); - Debug("boolattr") << "get flag 5 on a (should be T)\n"; + Trace("boolattr") << "get flag 5 on a (should be T)\n"; ASSERT_TRUE(a.getAttribute(TestFlag5())); - Debug("boolattr") << "get flag 5 on b (should be T)\n"; + Trace("boolattr") << "get flag 5 on b (should be T)\n"; ASSERT_TRUE(b.getAttribute(TestFlag5())); - Debug("boolattr") << "get flag 5 on c (should be F)\n"; + Trace("boolattr") << "get flag 5 on c (should be F)\n"; ASSERT_FALSE(c.getAttribute(TestFlag5())); - Debug("boolattr") << "get flag 5 on unnamed (should be T)\n"; + Trace("boolattr") << "get flag 5 on unnamed (should be T)\n"; ASSERT_TRUE(unnamed.getAttribute(TestFlag5())); a.setAttribute(TestStringAttr1(), "foo"); diff --git a/test/unit/parser/parser_black.cpp b/test/unit/parser/parser_black.cpp index 97d3959ab..e0337a802 100644 --- a/test/unit/parser/parser_black.cpp +++ b/test/unit/parser/parser_black.cpp @@ -87,7 +87,7 @@ class TestParserBlackParser : public TestInternal Command* cmd; while ((cmd = parser->nextCommand()) != NULL) { - Debug("parser") << "Parsed command: " << (*cmd) << std::endl; + Trace("parser") << "Parsed command: " << (*cmd) << std::endl; delete cmd; } @@ -108,7 +108,7 @@ class TestParserBlackParser : public TestInternal Command* cmd; while ((cmd = parser->nextCommand()) != NULL) { - Debug("parser") << "Parsed command: " << (*cmd) << std::endl; + Trace("parser") << "Parsed command: " << (*cmd) << std::endl; delete cmd; } std::cout << "\nBad input succeeded:\n" << badInput << std::endl; diff --git a/test/unit/theory/theory_arith_rewriter_black.cpp b/test/unit/theory/theory_arith_rewriter_black.cpp index 059923769..a2967697e 100644 --- a/test/unit/theory/theory_arith_rewriter_black.cpp +++ b/test/unit/theory/theory_arith_rewriter_black.cpp @@ -31,7 +31,6 @@ class TestTheoryArithRewriterBlack : public TestSmt TEST_F(TestTheoryArithRewriterBlack, RealAlgebraicNumber) { - Trace.on("arith-rewriter"); { RealAlgebraicNumber two({-8, 0, 0, 1}, 1, 3); Node n = d_nodeManager->mkRealAlgebraicNumber(two); diff --git a/test/unit/util/datatype_black.cpp b/test/unit/util/datatype_black.cpp index 336190b8e..490def60e 100644 --- a/test/unit/util/datatype_black.cpp +++ b/test/unit/util/datatype_black.cpp @@ -32,8 +32,8 @@ class TestUtilBlackDatatype : public TestSmt void SetUp() override { TestSmt::SetUp(); - Debug.on("datatypes"); - Debug.on("groundterms"); + TraceChannel.on("datatypes"); + TraceChannel.on("groundterms"); } }; @@ -55,13 +55,13 @@ TEST_F(TestUtilBlackDatatype, enumeration) colors.addConstructor(green); colors.addConstructor(red); - Debug("datatypes") << colors << std::endl; + Trace("datatypes") << colors << std::endl; TypeNode colorsType = d_nodeManager->mkDatatypeType(colors); - Debug("datatypes") << colorsType << std::endl; + Trace("datatypes") << colorsType << std::endl; Node ctor = colorsType.getDType()[1].getConstructor(); Node apply = d_nodeManager->mkNode(kind::APPLY_CONSTRUCTOR, ctor); - Debug("datatypes") << apply << std::endl; + Trace("datatypes") << apply << std::endl; ASSERT_FALSE(colorsType.getDType().isParametric()); ASSERT_TRUE(colorsType.getDType().isFinite()); @@ -69,7 +69,7 @@ TEST_F(TestUtilBlackDatatype, enumeration) Cardinality::EQUAL); ASSERT_EQ(ctor.getType().getCardinality().compare(1), Cardinality::EQUAL); ASSERT_TRUE(colorsType.getDType().isWellFounded()); - Debug("groundterms") << "ground term of " << colorsType.getDType().getName() + Trace("groundterms") << "ground term of " << colorsType.getDType().getName() << std::endl << " is " << d_nodeManager->mkGroundTerm(colorsType) << std::endl; @@ -89,20 +89,20 @@ TEST_F(TestUtilBlackDatatype, nat) std::make_shared("zero"); nat.addConstructor(zero); - Debug("datatypes") << nat << std::endl; + Trace("datatypes") << nat << std::endl; TypeNode natType = d_nodeManager->mkDatatypeType(nat); - Debug("datatypes") << natType << std::endl; + Trace("datatypes") << natType << std::endl; Node ctor = natType.getDType()[1].getConstructor(); Node apply = d_nodeManager->mkNode(kind::APPLY_CONSTRUCTOR, ctor); - Debug("datatypes") << apply << std::endl; + Trace("datatypes") << apply << std::endl; ASSERT_FALSE(natType.getDType().isParametric()); ASSERT_FALSE(natType.getDType().isFinite()); ASSERT_TRUE(natType.getDType().getCardinality().compare(Cardinality::INTEGERS) == Cardinality::EQUAL); ASSERT_TRUE(natType.getDType().isWellFounded()); - Debug("groundterms") << "ground term of " << natType.getDType().getName() + Trace("groundterms") << "ground term of " << natType.getDType().getName() << std::endl << " is " << d_nodeManager->mkGroundTerm(natType) << std::endl; @@ -125,9 +125,9 @@ TEST_F(TestUtilBlackDatatype, tree) leaf->addArg("leaf", integerType); tree.addConstructor(leaf); - Debug("datatypes") << tree << std::endl; + Trace("datatypes") << tree << std::endl; TypeNode treeType = d_nodeManager->mkDatatypeType(tree); - Debug("datatypes") << treeType << std::endl; + Trace("datatypes") << treeType << std::endl; ASSERT_FALSE(treeType.getDType().isParametric()); ASSERT_FALSE(treeType.getDType().isFinite()); @@ -135,7 +135,7 @@ TEST_F(TestUtilBlackDatatype, tree) treeType.getDType().getCardinality().compare(Cardinality::INTEGERS) == Cardinality::EQUAL); ASSERT_TRUE(treeType.getDType().isWellFounded()); - Debug("groundterms") << "ground term of " << treeType.getDType().getName() + Trace("groundterms") << "ground term of " << treeType.getDType().getName() << std::endl << " is " << d_nodeManager->mkGroundTerm(treeType) << std::endl; @@ -157,9 +157,9 @@ TEST_F(TestUtilBlackDatatype, list_int) std::make_shared("nil"); list.addConstructor(nil); - Debug("datatypes") << list << std::endl; + Trace("datatypes") << list << std::endl; TypeNode listType = d_nodeManager->mkDatatypeType(list); - Debug("datatypes") << listType << std::endl; + Trace("datatypes") << listType << std::endl; ASSERT_FALSE(listType.getDType().isParametric()); ASSERT_FALSE(listType.getDType().isFinite()); @@ -167,7 +167,7 @@ TEST_F(TestUtilBlackDatatype, list_int) listType.getDType().getCardinality().compare(Cardinality::INTEGERS) == Cardinality::EQUAL); ASSERT_TRUE(listType.getDType().isWellFounded()); - Debug("groundterms") << "ground term of " << listType.getDType().getName() + Trace("groundterms") << "ground term of " << listType.getDType().getName() << std::endl << " is " << d_nodeManager->mkGroundTerm(listType) << std::endl; @@ -189,16 +189,16 @@ TEST_F(TestUtilBlackDatatype, list_real) std::make_shared("nil"); list.addConstructor(nil); - Debug("datatypes") << list << std::endl; + Trace("datatypes") << list << std::endl; TypeNode listType = d_nodeManager->mkDatatypeType(list); - Debug("datatypes") << listType << std::endl; + Trace("datatypes") << listType << std::endl; ASSERT_FALSE(listType.getDType().isParametric()); ASSERT_FALSE(listType.getDType().isFinite()); ASSERT_TRUE(listType.getDType().getCardinality().compare(Cardinality::REALS) == Cardinality::EQUAL); ASSERT_TRUE(listType.getDType().isWellFounded()); - Debug("groundterms") << "ground term of " << listType.getDType().getName() + Trace("groundterms") << "ground term of " << listType.getDType().getName() << std::endl << " is " << d_nodeManager->mkGroundTerm(listType) << std::endl; @@ -220,16 +220,16 @@ TEST_F(TestUtilBlackDatatype, list_boolean) std::make_shared("nil"); list.addConstructor(nil); - Debug("datatypes") << list << std::endl; + Trace("datatypes") << list << std::endl; TypeNode listType = d_nodeManager->mkDatatypeType(list); - Debug("datatypes") << listType << std::endl; + Trace("datatypes") << listType << std::endl; ASSERT_FALSE(listType.getDType().isFinite()); ASSERT_TRUE( listType.getDType().getCardinality().compare(Cardinality::INTEGERS) == Cardinality::EQUAL); ASSERT_TRUE(listType.getDType().isWellFounded()); - Debug("groundterms") << "ground term of " << listType.getDType().getName() + Trace("groundterms") << "ground term of " << listType.getDType().getName() << std::endl << " is " << d_nodeManager->mkGroundTerm(listType) << std::endl; @@ -295,7 +295,7 @@ TEST_F(TestUtilBlackDatatype, mutual_list_trees1) leaf->addArg("leaf", unresList); tree.addConstructor(leaf); - Debug("datatypes") << tree << std::endl; + Trace("datatypes") << tree << std::endl; DType list("list"); std::shared_ptr cons = @@ -308,7 +308,7 @@ TEST_F(TestUtilBlackDatatype, mutual_list_trees1) std::make_shared("nil"); list.addConstructor(nil); - Debug("datatypes") << list << std::endl; + Trace("datatypes") << list << std::endl; ASSERT_FALSE(tree.isResolved()); ASSERT_FALSE(list.isResolved()); @@ -326,7 +326,7 @@ TEST_F(TestUtilBlackDatatype, mutual_list_trees1) ASSERT_TRUE(dtts[0].getDType().getCardinality().compare(Cardinality::INTEGERS) == Cardinality::EQUAL); ASSERT_TRUE(dtts[0].getDType().isWellFounded()); - Debug("groundterms") << "ground term of " << dtts[0].getDType().getName() + Trace("groundterms") << "ground term of " << dtts[0].getDType().getName() << std::endl << " is " << d_nodeManager->mkGroundTerm(dtts[0]) << std::endl; @@ -336,7 +336,7 @@ TEST_F(TestUtilBlackDatatype, mutual_list_trees1) ASSERT_TRUE(dtts[1].getDType().getCardinality().compare(Cardinality::INTEGERS) == Cardinality::EQUAL); ASSERT_TRUE(dtts[1].getDType().isWellFounded()); - Debug("groundterms") << "ground term of " << dtts[1].getDType().getName() + Trace("groundterms") << "ground term of " << dtts[1].getDType().getName() << std::endl << " is " << d_nodeManager->mkGroundTerm(dtts[1]) << std::endl; @@ -394,7 +394,7 @@ TEST_F(TestUtilBlackDatatype, mutual_list_trees2) dtts2[0].getDType().getCardinality().compare(Cardinality::INTEGERS) == Cardinality::EQUAL); ASSERT_TRUE(dtts2[0].getDType().isWellFounded()); - Debug("groundterms") << "ground term of " << dtts2[0].getDType().getName() + Trace("groundterms") << "ground term of " << dtts2[0].getDType().getName() << std::endl << " is " << d_nodeManager->mkGroundTerm(dtts2[0]) << std::endl; @@ -406,7 +406,7 @@ TEST_F(TestUtilBlackDatatype, mutual_list_trees2) dtts2[1].getDType().getCardinality().compare(Cardinality::INTEGERS) == Cardinality::EQUAL); ASSERT_TRUE(dtts2[1].getDType().isWellFounded()); - Debug("groundterms") << "ground term of " << dtts2[1].getDType().getName() + Trace("groundterms") << "ground term of " << dtts2[1].getDType().getName() << std::endl << " is " << d_nodeManager->mkGroundTerm(dtts2[1]) << std::endl; @@ -423,9 +423,9 @@ TEST_F(TestUtilBlackDatatype, not_so_well_founded) node->addArgSelf("right"); tree.addConstructor(node); - Debug("datatypes") << tree << std::endl; + Trace("datatypes") << tree << std::endl; TypeNode treeType = d_nodeManager->mkDatatypeType(tree); - Debug("datatypes") << treeType << std::endl; + Trace("datatypes") << treeType << std::endl; ASSERT_FALSE(treeType.getDType().isParametric()); ASSERT_FALSE(treeType.getDType().isFinite()); diff --git a/test/unit/util/output_black.cpp b/test/unit/util/output_black.cpp index 54b1570d6..1182ae3ab 100644 --- a/test/unit/util/output_black.cpp +++ b/test/unit/util/output_black.cpp @@ -28,7 +28,6 @@ class TestUtilBlackOutput : public TestInternal void SetUp() override { TestInternal::SetUp(); - DebugChannel.setStream(&d_debugStream); TraceChannel.setStream(&d_traceStream); WarningChannel.setStream(&d_warningStream); @@ -53,36 +52,22 @@ class TestUtilBlackOutput : public TestInternal TEST_F(TestUtilBlackOutput, output) { - Debug.on("foo"); - Debug("foo") << "testing1"; - Debug.off("foo"); - Debug("foo") << "testing2"; - Debug.on("foo"); - Debug("foo") << "testing3"; - Warning() << "bad warning!"; - Trace.on("foo"); + TraceChannel.on("foo"); Trace("foo") << "tracing1"; - Trace.off("foo"); + TraceChannel.off("foo"); Trace("foo") << "tracing2"; - Trace.on("foo"); + TraceChannel.on("foo"); Trace("foo") << "tracing3"; #ifdef CVC5_MUZZLE - ASSERT_EQ(d_debugStream.str(), ""); ASSERT_EQ(d_warningStream.str(), ""); ASSERT_EQ(d_traceStream.str(), ""); #else /* CVC5_MUZZLE */ -#ifdef CVC5_DEBUG - ASSERT_EQ(d_debugStream.str(), "testing1testing3"); -#else /* CVC5_DEBUG */ - ASSERT_EQ(d_debugStream.str(), ""); -#endif /* CVC5_DEBUG */ - ASSERT_EQ(d_warningStream.str(), "bad warning!"); #ifdef CVC5_TRACING @@ -96,31 +81,22 @@ TEST_F(TestUtilBlackOutput, output) TEST_F(TestUtilBlackOutput, evaluation_off_when_it_is_supposed_to_be) { - Debug.on("foo"); -#ifndef CVC5_DEBUG - ASSERT_FALSE(Debug.isOn("foo")); - Debug("foo") << failure() << std::endl; -#else - ASSERT_TRUE(Debug.isOn("foo")); -#endif - Debug.off("foo"); - - Trace.on("foo"); + TraceChannel.on("foo"); #ifndef CVC5_TRACING - ASSERT_FALSE(Trace.isOn("foo")); + ASSERT_FALSE(TraceIsOn("foo")); Trace("foo") << failure() << std::endl; #else - ASSERT_TRUE(Trace.isOn("foo")); + ASSERT_TRUE(TraceIsOn("foo")); #endif - Trace.off("foo"); + TraceChannel.off("foo"); #ifdef CVC5_MUZZLE - ASSERT_FALSE(Debug.isOn("foo")); - ASSERT_FALSE(Trace.isOn("foo")); + ASSERT_FALSE(TraceIsOn("foo")); + ASSERT_FALSE(TraceIsOn("foo")); ASSERT_FALSE(Warning.isOn()); cout << "debug" << std::endl; - Debug("foo") << failure() << std::endl; + Trace("foo") << failure() << std::endl; cout << "trace" << std::endl; Trace("foo") << failure() << std::endl; cout << "warning" << std::endl; @@ -132,20 +108,11 @@ TEST_F(TestUtilBlackOutput, simple_print) { #ifdef CVC5_MUZZLE - Debug.off("yo"); - Debug("yo") << "foobar"; - ASSERT_EQ(d_debugStream.str(), std::string()); - d_debugStream.str(""); - Debug.on("yo"); - Debug("yo") << "baz foo"; - ASSERT_EQ(d_debugStream.str(), std::string()); - d_debugStream.str(""); - - Trace.off("yo"); + TraceChannel.off("yo"); Trace("yo") << "foobar"; ASSERT_EQ(d_traceStream.str(), std::string()); d_traceStream.str(""); - Trace.on("yo"); + TraceChannel.on("yo"); Trace("yo") << "baz foo"; ASSERT_EQ(d_traceStream.str(), std::string()); d_traceStream.str(""); @@ -156,24 +123,11 @@ TEST_F(TestUtilBlackOutput, simple_print) #else /* CVC5_MUZZLE */ - Debug.off("yo"); - Debug("yo") << "foobar"; - ASSERT_EQ(d_debugStream.str(), std::string()); - d_debugStream.str(""); - Debug.on("yo"); - Debug("yo") << "baz foo"; -#ifdef CVC5_DEBUG - ASSERT_EQ(d_debugStream.str(), std::string("baz foo")); -#else /* CVC5_DEBUG */ - ASSERT_EQ(d_debugStream.str(), std::string()); -#endif /* CVC5_DEBUG */ - d_debugStream.str(""); - - Trace.off("yo"); + TraceChannel.off("yo"); Trace("yo") << "foobar"; ASSERT_EQ(d_traceStream.str(), std::string()); d_traceStream.str(""); - Trace.on("yo"); + TraceChannel.on("yo"); Trace("yo") << "baz foo"; #ifdef CVC5_TRACING ASSERT_EQ(d_traceStream.str(), std::string("baz foo")); -- 2.30.2