From 31242de4b423d7225174dd1672edb2dacb68f5b8 Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Wed, 12 May 2021 23:33:00 -0700 Subject: [PATCH] Add std::hash overloads for Node, TNode and TypeNode. (#6534) Eliminates NodeHashFunction, TNodeHashFunction and TypeNodeHashFunction. --- src/api/cpp/cvc5.cpp | 10 +- src/context/cdhashset.h | 7 +- src/decision/assertion_list.cpp | 3 +- src/decision/assertion_list.h | 2 +- src/decision/justification_heuristic.h | 22 +- src/expr/array_store_all.cpp | 4 +- src/expr/ascription_type.cpp | 2 +- src/expr/bound_var_manager.h | 2 +- src/expr/buffered_proof_generator.h | 3 +- src/expr/dtype.cpp | 13 +- src/expr/dtype.h | 7 +- src/expr/emptybag.cpp | 2 +- src/expr/emptyset.cpp | 2 +- src/expr/lazy_proof.h | 3 +- src/expr/lazy_proof_chain.cpp | 9 +- src/expr/lazy_proof_chain.h | 2 +- src/expr/node.cpp | 14 + src/expr/node.h | 241 +++++++++--------- src/expr/node_algorithm.cpp | 76 +++--- src/expr/node_algorithm.h | 35 ++- src/expr/node_traversal.h | 2 +- src/expr/proof.h | 3 +- src/expr/proof_node_algorithm.cpp | 2 +- src/expr/proof_node_manager.cpp | 9 +- src/expr/sequence.cpp | 2 +- src/expr/skolem_manager.cpp | 4 +- src/expr/tconv_seq_proof_generator.h | 2 +- src/expr/term_conversion_proof_generator.cpp | 8 +- src/expr/term_conversion_proof_generator.h | 2 +- src/expr/type_node.cpp | 19 +- src/expr/type_node.h | 55 ++-- src/expr/uninterpreted_constant.cpp | 2 +- src/preprocessing/passes/ackermann.cpp | 12 +- src/preprocessing/passes/ackermann.h | 8 +- src/preprocessing/passes/bool_to_bv.cpp | 4 +- src/preprocessing/passes/bool_to_bv.h | 4 +- src/preprocessing/passes/bv_gauss.cpp | 19 +- src/preprocessing/passes/bv_gauss.h | 5 +- src/preprocessing/passes/bv_intro_pow2.cpp | 4 +- src/preprocessing/passes/bv_to_bool.h | 2 +- src/preprocessing/passes/bv_to_int.h | 4 +- .../passes/foreign_theory_rewrite.h | 2 +- src/preprocessing/passes/global_negate.cpp | 2 +- src/preprocessing/passes/ho_elim.cpp | 8 +- src/preprocessing/passes/ho_elim.h | 6 +- src/preprocessing/passes/int_to_bv.cpp | 2 +- src/preprocessing/passes/miplib_trick.cpp | 2 +- src/preprocessing/passes/nl_ext_purify.cpp | 4 +- src/preprocessing/passes/nl_ext_purify.h | 2 +- src/preprocessing/passes/non_clausal_simp.cpp | 2 +- .../passes/pseudo_boolean_processor.h | 5 +- src/preprocessing/passes/real_to_int.h | 2 +- src/preprocessing/passes/sygus_inference.cpp | 2 +- src/preprocessing/passes/synth_rew_rules.cpp | 4 +- .../passes/theory_rewrite_eq.cpp | 4 +- .../passes/unconstrained_simplifier.h | 6 +- .../preprocessing_pass_context.cpp | 4 +- .../preprocessing_pass_context.h | 7 +- src/preprocessing/util/ite_utilities.cpp | 6 +- src/preprocessing/util/ite_utilities.h | 21 +- src/printer/let_binding.cpp | 4 +- src/printer/let_binding.h | 2 +- src/proof/cnf_proof.h | 4 +- src/proof/proof_manager.h | 4 +- src/prop/cnf_stream.h | 5 +- src/prop/sat_proof_manager.cpp | 14 +- src/prop/sat_proof_manager.h | 5 +- src/prop/skolem_def_manager.cpp | 14 +- src/prop/skolem_def_manager.h | 7 +- src/prop/theory_proxy.cpp | 2 +- src/prop/theory_proxy.h | 2 +- src/smt/abstract_values.h | 3 +- src/smt/check_models.cpp | 2 +- src/smt/expand_definitions.cpp | 14 +- src/smt/expand_definitions.h | 10 +- src/smt/model_blocker.cpp | 10 +- src/smt/model_core_builder.cpp | 2 +- src/smt/preprocess_proof_generator.cpp | 2 +- src/smt/preprocess_proof_generator.h | 3 +- src/smt/preprocessor.cpp | 6 +- src/smt/preprocessor.h | 3 +- src/smt/process_assertions.h | 2 +- src/smt/proof_post_processor.cpp | 4 +- src/smt/smt_engine.cpp | 2 +- src/smt/smt_engine.h | 1 - src/smt/sygus_solver.cpp | 4 +- src/smt/term_formula_removal.cpp | 2 +- src/smt/term_formula_removal.h | 4 +- src/smt/witness_form.cpp | 5 +- src/smt/witness_form.h | 6 +- src/smt_util/nary_builder.h | 2 +- src/theory/arith/arith_ite_utils.h | 6 +- src/theory/arith/arith_preprocess.cpp | 6 +- src/theory/arith/arith_preprocess.h | 2 +- src/theory/arith/arith_static_learner.h | 6 +- src/theory/arith/arith_utilities.cpp | 4 +- src/theory/arith/arith_utilities.h | 8 +- src/theory/arith/congruence_manager.h | 2 +- src/theory/arith/constraint.h | 2 +- src/theory/arith/dio_solver.cpp | 2 +- src/theory/arith/dio_solver.h | 3 +- src/theory/arith/inference_manager.h | 2 +- src/theory/arith/nl/ext/ext_state.h | 2 +- src/theory/arith/nl/ext/monomial_check.cpp | 2 +- src/theory/arith/nl/ext/split_zero_check.h | 2 +- src/theory/arith/nl/iand_solver.h | 2 +- src/theory/arith/nl/icp/icp_solver.cpp | 4 +- src/theory/arith/nl/nl_model.cpp | 8 +- src/theory/arith/nl/nl_model.h | 2 +- src/theory/arith/nl/nonlinear_extension.cpp | 2 +- src/theory/arith/nl/nonlinear_extension.h | 2 +- .../transcendental/transcendental_solver.cpp | 3 +- .../nl/transcendental/transcendental_state.h | 8 +- src/theory/arith/theory_arith_private.cpp | 4 +- src/theory/arith/theory_arith_private.h | 7 +- src/theory/arrays/array_info.h | 3 +- src/theory/arrays/theory_arrays.cpp | 125 +++++---- src/theory/arrays/theory_arrays.h | 12 +- src/theory/arrays/theory_arrays_rewriter.cpp | 6 +- src/theory/arrays/union_find.cpp | 4 +- src/theory/atom_requests.h | 2 +- src/theory/bags/inference_manager.h | 2 +- src/theory/bags/make_bag_op.cpp | 2 +- src/theory/bags/term_registry.h | 2 +- src/theory/booleans/circuit_propagator.h | 8 +- src/theory/booleans/proof_checker.cpp | 15 +- src/theory/booleans/theory_bool_rewriter.cpp | 2 +- .../builtin/theory_builtin_rewriter.cpp | 12 +- src/theory/builtin/theory_builtin_rewriter.h | 7 +- src/theory/bv/abstraction.h | 29 +-- src/theory/bv/bitblast/aig_bitblaster.h | 4 +- src/theory/bv/bitblast/bitblaster.h | 10 +- src/theory/bv/bitblast/eager_bitblaster.h | 2 +- src/theory/bv/bitblast/proof_bitblaster.cpp | 2 +- src/theory/bv/bitblast/proof_bitblaster.h | 2 +- src/theory/bv/bitblast/simple_bitblaster.h | 2 +- src/theory/bv/bv_eager_solver.h | 4 +- src/theory/bv/bv_inequality_graph.h | 15 +- src/theory/bv/bv_quick_check.h | 3 +- src/theory/bv/bv_solver_bitblast.cpp | 2 +- src/theory/bv/bv_solver_bitblast.h | 5 +- src/theory/bv/bv_solver_lazy.h | 12 +- src/theory/bv/bv_solver_simple.cpp | 6 +- src/theory/bv/bv_subtheory_algebraic.cpp | 2 +- src/theory/bv/bv_subtheory_algebraic.h | 14 +- src/theory/bv/bv_subtheory_bitblast.h | 2 +- src/theory/bv/bv_subtheory_core.h | 13 +- src/theory/bv/bv_subtheory_inequality.h | 6 +- src/theory/bv/int_blaster.h | 6 +- .../theory_bv_rewrite_rules_normalization.h | 22 +- src/theory/bv/theory_bv_utils.cpp | 2 +- src/theory/bv/theory_bv_utils.h | 8 +- src/theory/datatypes/infer_proof_cons.h | 5 +- src/theory/datatypes/sygus_datatype_utils.cpp | 13 +- src/theory/datatypes/sygus_datatype_utils.h | 3 +- src/theory/datatypes/sygus_extension.cpp | 28 +- src/theory/datatypes/sygus_extension.h | 24 +- src/theory/datatypes/theory_datatypes.h | 6 +- .../datatypes/theory_datatypes_type_rules.cpp | 2 +- src/theory/eager_proof_generator.h | 3 +- src/theory/evaluator.cpp | 44 ++-- src/theory/evaluator.h | 22 +- src/theory/ext_theory.h | 7 +- src/theory/fp/fp_converter.h | 10 +- src/theory/fp/fp_expand_defs.h | 7 +- src/theory/fp/theory_fp.cpp | 2 +- src/theory/fp/theory_fp.h | 7 +- src/theory/quantifiers/bv_inverter.cpp | 13 +- src/theory/quantifiers/bv_inverter.h | 2 +- .../candidate_rewrite_database.cpp | 3 +- .../quantifiers/candidate_rewrite_database.h | 2 +- .../quantifiers/candidate_rewrite_filter.cpp | 3 +- .../quantifiers/candidate_rewrite_filter.h | 2 +- .../quantifiers/cegqi/ceg_bv_instantiator.cpp | 31 ++- .../quantifiers/cegqi/ceg_bv_instantiator.h | 20 +- .../cegqi/ceg_bv_instantiator_utils.cpp | 28 +- .../cegqi/ceg_bv_instantiator_utils.h | 21 +- .../quantifiers/cegqi/ceg_instantiator.cpp | 13 +- .../quantifiers/cegqi/ceg_instantiator.h | 17 +- .../quantifiers/cegqi/inst_strategy_cegqi.h | 4 +- src/theory/quantifiers/cegqi/nested_qe.cpp | 7 +- src/theory/quantifiers/cegqi/nested_qe.h | 5 +- src/theory/quantifiers/conjecture_generator.h | 8 +- .../quantifiers/ematching/ho_trigger.cpp | 6 +- src/theory/quantifiers/ematching/ho_trigger.h | 2 +- .../ematching/pattern_term_selector.cpp | 4 +- src/theory/quantifiers/ematching/trigger.cpp | 4 +- src/theory/quantifiers/equality_query.cpp | 9 +- src/theory/quantifiers/equality_query.h | 4 +- src/theory/quantifiers/extended_rewrite.cpp | 6 +- src/theory/quantifiers/fmf/bounded_integers.h | 6 +- .../quantifiers/fmf/full_model_check.cpp | 2 +- src/theory/quantifiers/fmf/full_model_check.h | 2 +- src/theory/quantifiers/fun_def_evaluator.cpp | 8 +- src/theory/quantifiers/instantiate.h | 6 +- src/theory/quantifiers/proof_checker.cpp | 2 +- .../quantifiers/quant_bound_inference.cpp | 3 +- .../quantifiers/quant_bound_inference.h | 2 +- .../quantifiers/quant_conflict_find.cpp | 2 +- src/theory/quantifiers/quant_conflict_find.h | 5 +- src/theory/quantifiers/quant_split.h | 2 +- src/theory/quantifiers/quantifiers_macros.cpp | 4 +- .../quantifiers/quantifiers_rewriter.cpp | 24 +- src/theory/quantifiers/quantifiers_rewriter.h | 4 +- src/theory/quantifiers/query_generator.h | 2 +- .../quantifiers/single_inv_partition.cpp | 6 +- src/theory/quantifiers/single_inv_partition.h | 2 +- src/theory/quantifiers/skolemize.cpp | 10 +- src/theory/quantifiers/skolemize.h | 7 +- src/theory/quantifiers/sygus/cegis.cpp | 6 +- src/theory/quantifiers/sygus/cegis.h | 6 +- .../sygus/cegis_core_connective.cpp | 16 +- .../quantifiers/sygus/cegis_core_connective.h | 14 +- .../sygus/enum_stream_substitution.cpp | 11 +- .../sygus/enum_stream_substitution.h | 6 +- .../quantifiers/sygus/example_infer.cpp | 6 +- src/theory/quantifiers/sygus/example_infer.h | 3 +- .../quantifiers/sygus/example_min_eval.cpp | 2 +- .../sygus/rcons_obligation_info.cpp | 20 +- .../quantifiers/sygus/rcons_obligation_info.h | 16 +- .../quantifiers/sygus/rcons_type_info.h | 2 +- src/theory/quantifiers/sygus/sygus_abduct.cpp | 2 +- .../quantifiers/sygus/sygus_enumerator.cpp | 4 +- .../quantifiers/sygus/sygus_enumerator.h | 4 +- .../sygus/sygus_enumerator_basic.h | 2 +- .../quantifiers/sygus/sygus_eval_unfold.cpp | 3 +- .../quantifiers/sygus/sygus_eval_unfold.h | 4 +- .../quantifiers/sygus/sygus_grammar_cons.cpp | 53 ++-- .../quantifiers/sygus/sygus_grammar_cons.h | 38 ++- .../quantifiers/sygus/sygus_interpol.cpp | 33 ++- src/theory/quantifiers/sygus/sygus_interpol.h | 9 +- .../quantifiers/sygus/sygus_invariance.cpp | 2 +- .../quantifiers/sygus/sygus_invariance.h | 2 +- .../quantifiers/sygus/sygus_process_conj.cpp | 97 +++---- .../quantifiers/sygus/sygus_process_conj.h | 28 +- .../quantifiers/sygus/sygus_reconstruct.cpp | 11 +- .../quantifiers/sygus/sygus_reconstruct.h | 22 +- .../quantifiers/sygus/sygus_repair_const.cpp | 14 +- .../quantifiers/sygus/sygus_repair_const.h | 2 +- .../quantifiers/sygus/sygus_unif_io.cpp | 5 +- src/theory/quantifiers/sygus/sygus_unif_io.h | 4 +- src/theory/quantifiers/sygus/sygus_unif_rl.h | 10 +- src/theory/quantifiers/sygus/synth_engine.h | 2 +- .../quantifiers/sygus/term_database_sygus.cpp | 9 +- .../quantifiers/sygus/term_database_sygus.h | 3 +- src/theory/quantifiers/sygus_inst.cpp | 47 ++-- src/theory/quantifiers/sygus_inst.h | 25 +- src/theory/quantifiers/sygus_sampler.cpp | 12 +- src/theory/quantifiers/term_database.cpp | 3 +- src/theory/quantifiers/term_database.h | 13 +- src/theory/quantifiers/term_enumeration.cpp | 3 +- src/theory/quantifiers/term_enumeration.h | 5 +- src/theory/quantifiers/term_pools.cpp | 2 +- src/theory/quantifiers/term_registry.h | 2 +- src/theory/quantifiers/term_util.cpp | 6 +- src/theory/quantifiers_engine.h | 4 +- src/theory/relevance_manager.cpp | 17 +- src/theory/relevance_manager.h | 15 +- src/theory/rep_set.cpp | 4 +- src/theory/rewriter.cpp | 2 +- src/theory/rewriter.h | 3 +- src/theory/sep/theory_sep.h | 4 +- src/theory/sets/cardinality_extension.h | 2 +- src/theory/sets/inference_manager.h | 2 +- src/theory/sets/singleton_op.cpp | 2 +- src/theory/sets/skolem_cache.h | 2 +- src/theory/sets/solver_state.h | 2 +- src/theory/sets/term_registry.h | 2 +- src/theory/sets/theory_sets_private.h | 4 +- src/theory/sets/theory_sets_rels.cpp | 59 +++-- src/theory/sets/theory_sets_rels.h | 69 ++--- src/theory/shared_terms_database.h | 7 +- src/theory/strings/arith_entail.cpp | 4 +- src/theory/strings/base_solver.h | 2 +- src/theory/strings/core_solver.cpp | 2 +- src/theory/strings/core_solver.h | 2 +- src/theory/strings/extf_solver.cpp | 2 +- src/theory/strings/extf_solver.h | 2 +- src/theory/strings/infer_proof_cons.h | 3 +- src/theory/strings/inference_manager.h | 4 +- src/theory/strings/regexp_operation.cpp | 6 +- src/theory/strings/regexp_operation.h | 2 +- src/theory/strings/regexp_solver.cpp | 4 +- src/theory/strings/regexp_solver.h | 10 +- src/theory/strings/skolem_cache.h | 2 +- src/theory/strings/strings_fmf.h | 2 +- src/theory/strings/term_registry.cpp | 3 +- src/theory/strings/term_registry.h | 8 +- src/theory/strings/theory_strings.cpp | 17 +- src/theory/strings/theory_strings.h | 16 +- src/theory/strings/theory_strings_utils.cpp | 4 +- src/theory/subs_minimize.cpp | 17 +- src/theory/substitutions.h | 67 +++-- src/theory/term_registration_visitor.h | 9 +- src/theory/theory.cpp | 5 +- src/theory/theory.h | 2 +- src/theory/theory_engine.cpp | 11 +- src/theory/theory_engine.h | 9 +- src/theory/theory_engine_proof_generator.h | 5 +- src/theory/theory_inference_manager.h | 2 +- src/theory/theory_model.cpp | 2 +- src/theory/theory_model.h | 4 +- src/theory/theory_model_builder.cpp | 12 +- src/theory/theory_model_builder.h | 11 +- src/theory/theory_preprocessor.h | 2 +- src/theory/theory_proof_step_buffer.cpp | 2 +- src/theory/trust_substitutions.h | 2 +- src/theory/type_set.cpp | 4 +- src/theory/type_set.h | 8 +- src/theory/uf/cardinality_extension.h | 4 +- src/theory/uf/eq_proof.cpp | 20 +- src/theory/uf/eq_proof.h | 13 +- src/theory/uf/equality_engine.h | 2 +- src/theory/uf/ho_extension.cpp | 2 +- src/theory/uf/ho_extension.h | 4 +- src/theory/uf/proof_equality_engine.h | 5 +- src/theory/uf/symmetry_breaker.cpp | 13 +- src/theory/uf/symmetry_breaker.h | 13 +- src/theory/uf/theory_uf.cpp | 2 +- test/unit/node/node_algorithm_black.cpp | 10 +- .../preprocessing/pass_bv_gauss_white.cpp | 34 +-- ...eory_quantifiers_bv_instantiator_white.cpp | 6 +- test/unit/theory/type_enumerator_white.cpp | 2 +- 323 files changed, 1448 insertions(+), 1574 deletions(-) diff --git a/src/api/cpp/cvc5.cpp b/src/api/cpp/cvc5.cpp index 18db5d5ab..066ea0082 100644 --- a/src/api/cpp/cvc5.cpp +++ b/src/api/cpp/cvc5.cpp @@ -4073,7 +4073,7 @@ void Grammar::addSygusConstructorVariables(DatatypeDecl& dt, bool Grammar::containsFreeVariables(const Term& rule) const { - std::unordered_set scope; + std::unordered_set scope; for (const Term& sygusVar : d_sygusVars) { @@ -4085,7 +4085,7 @@ bool Grammar::containsFreeVariables(const Term& rule) const scope.emplace(*ntsymbol.d_node); } - std::unordered_set fvs; + std::unordered_set fvs; return expr::getFreeVariablesScope(*rule.d_node, fvs, scope, false); } @@ -7117,7 +7117,7 @@ size_t hash::operator()(const cvc5::api::Op& t) const { if (t.isIndexedHelper()) { - return cvc5::NodeHashFunction()(*t.d_node); + return std::hash()(*t.d_node); } else { @@ -7133,12 +7133,12 @@ size_t std::hash::operator()( size_t std::hash::operator()(const cvc5::api::Sort& s) const { - return cvc5::TypeNodeHashFunction()(*s.d_type); + return std::hash()(*s.d_type); } size_t std::hash::operator()(const cvc5::api::Term& t) const { - return cvc5::NodeHashFunction()(*t.d_node); + return std::hash()(*t.d_node); } } // namespace std diff --git a/src/context/cdhashset.h b/src/context/cdhashset.h index 79c28769c..b7e3b8ed5 100644 --- a/src/context/cdhashset.h +++ b/src/context/cdhashset.h @@ -25,8 +25,9 @@ namespace cvc5 { namespace context { -template -class CDHashSet : protected CDInsertHashMap { +template > +class CDHashSet : protected CDInsertHashMap +{ typedef CDInsertHashMap super; // no copy or assignment @@ -152,7 +153,7 @@ public: return super::insertAtContextLevelZero(v, true); } -};/* class CDHashSet */ +}; /* class CDHashSet */ } // namespace context } // namespace cvc5 diff --git a/src/decision/assertion_list.cpp b/src/decision/assertion_list.cpp index 098378d22..28c285a8f 100644 --- a/src/decision/assertion_list.cpp +++ b/src/decision/assertion_list.cpp @@ -101,8 +101,7 @@ void AssertionList::notifyStatus(TNode n, DecisionStatus s) // no decision does not impact the decision order return; } - std::unordered_set::iterator it = - d_dlistSet.find(n); + std::unordered_set::iterator it = d_dlistSet.find(n); if (s == DecisionStatus::DECISION) { if (it == d_dlistSet.end()) diff --git a/src/decision/assertion_list.h b/src/decision/assertion_list.h index fdb4bb2d5..3e7a1fee8 100644 --- a/src/decision/assertion_list.h +++ b/src/decision/assertion_list.h @@ -97,7 +97,7 @@ class AssertionList /** The list of assertions */ std::vector d_dlist; /** The set of assertions for fast membership testing in the above vector */ - std::unordered_set d_dlistSet; + std::unordered_set d_dlistSet; /** The index of the next assertion to satify */ context::CDO d_dindex; }; diff --git a/src/decision/justification_heuristic.h b/src/decision/justification_heuristic.h index 870d0674c..8c713ab06 100644 --- a/src/decision/justification_heuristic.h +++ b/src/decision/justification_heuristic.h @@ -45,21 +45,17 @@ class JustificationHeuristic : public ITEDecisionStrategy { enum SearchResult {FOUND_SPLITTER, NO_SPLITTER, DONT_KNOW}; typedef std::vector > SkolemList; - typedef context::CDHashMap SkolemCache; + typedef context::CDHashMap SkolemCache; typedef std::vector ChildList; - typedef context:: - CDHashMap, NodeHashFunction> - ChildCache; - typedef context::CDHashMap SkolemMap; - typedef context::CDHashMap, - NodeHashFunction> + typedef context::CDHashMap> ChildCache; + typedef context::CDHashMap SkolemMap; + typedef context::CDHashMap> WeightCache; // being 'justified' is monotonic with respect to decisions - typedef context::CDHashSet JustifiedSet; + typedef context::CDHashSet JustifiedSet; JustifiedSet d_justified; - typedef context::CDHashMap ExploredThreshold; + typedef context::CDHashMap ExploredThreshold; ExploredThreshold d_exploredThreshold; context::CDO d_prvsIndex; context::CDO d_threshPrvsIndex; @@ -86,13 +82,13 @@ class JustificationHeuristic : public ITEDecisionStrategy { * splitter. Can happen when exploring assertion corresponding to a * term-ITE. */ - std::unordered_set d_visited; + std::unordered_set d_visited; /** * Set to track visited nodes in a dfs search done in computeSkolems * function */ - std::unordered_set d_visitedComputeSkolems; + std::unordered_set d_visitedComputeSkolems; /** current decision for the recursive call */ prop::SatLiteral d_curDecision; @@ -172,7 +168,7 @@ private: * For big and/or nodes, a cache to save starting index into children * for efficiently. */ - typedef context::CDHashMap StartIndexCache; + typedef context::CDHashMap StartIndexCache; StartIndexCache d_startIndexCache; int getStartIndex(TNode node); void saveStartIndex(TNode node, int val); diff --git a/src/expr/array_store_all.cpp b/src/expr/array_store_all.cpp index 848d86edd..d97fe1320 100644 --- a/src/expr/array_store_all.cpp +++ b/src/expr/array_store_all.cpp @@ -109,8 +109,8 @@ std::ostream& operator<<(std::ostream& out, const ArrayStoreAll& asa) { } size_t ArrayStoreAllHashFunction::operator()(const ArrayStoreAll& asa) const { - return TypeNodeHashFunction()(asa.getType()) - * NodeHashFunction()(asa.getValue()); + return std::hash()(asa.getType()) + * std::hash()(asa.getValue()); } } // namespace cvc5 diff --git a/src/expr/ascription_type.cpp b/src/expr/ascription_type.cpp index e0f1c3ec8..65a686036 100644 --- a/src/expr/ascription_type.cpp +++ b/src/expr/ascription_type.cpp @@ -47,7 +47,7 @@ bool AscriptionType::operator!=(const AscriptionType& other) const size_t AscriptionTypeHashFunction::operator()(const AscriptionType& at) const { - return TypeNodeHashFunction()(at.getType()); + return std::hash()(at.getType()); } std::ostream& operator<<(std::ostream& out, AscriptionType at) diff --git a/src/expr/bound_var_manager.h b/src/expr/bound_var_manager.h index 3330decff..b619a36e2 100644 --- a/src/expr/bound_var_manager.h +++ b/src/expr/bound_var_manager.h @@ -98,7 +98,7 @@ class BoundVarManager /** Whether we keep cache values */ bool d_keepCacheVals; /** The set of cache values we have used */ - std::unordered_set d_cacheVals; + std::unordered_set d_cacheVals; }; } // namespace cvc5 diff --git a/src/expr/buffered_proof_generator.h b/src/expr/buffered_proof_generator.h index 4ac0b9add..2e1ef6c53 100644 --- a/src/expr/buffered_proof_generator.h +++ b/src/expr/buffered_proof_generator.h @@ -33,8 +33,7 @@ class ProofStep; */ class BufferedProofGenerator : public ProofGenerator { - typedef context::CDHashMap, NodeHashFunction> - NodeProofStepMap; + typedef context::CDHashMap> NodeProofStepMap; public: BufferedProofGenerator(context::Context* c, ProofNodeManager* pnm); diff --git a/src/expr/dtype.cpp b/src/expr/dtype.cpp index c1893d3f4..9e09c06e6 100644 --- a/src/expr/dtype.cpp +++ b/src/expr/dtype.cpp @@ -192,7 +192,7 @@ bool DType::resolve(const std::map& resolutions, { // all datatype constructors should be sygus and have sygus operators whose // free variables are subsets of sygus bound var list. - std::unordered_set svs; + std::unordered_set svs; for (const Node& sv : d_sygusBvl) { svs.insert(sv); @@ -202,7 +202,7 @@ bool DType::resolve(const std::map& resolutions, Node sop = d_constructors[i]->getSygusOp(); Assert(!sop.isNull()) << "Sygus datatype contains a non-sygus constructor"; - std::unordered_set fvs; + std::unordered_set fvs; expr::getFreeVariables(sop, fvs); for (const Node& v : fvs) { @@ -625,10 +625,9 @@ Node DType::mkGroundTermInternal(TypeNode t, bool isValue) const return groundTerm; } -void DType::getAlienSubfieldTypes( - std::unordered_set& types, - std::map& processed, - bool isAlienPos) const +void DType::getAlienSubfieldTypes(std::unordered_set& types, + std::map& processed, + bool isAlienPos) const { std::map::iterator it = processed.find(d_self); if (it != processed.end()) @@ -708,7 +707,7 @@ bool DType::hasNestedRecursion() const Trace("datatypes-init") << "Compute simply recursive for " << getName() << std::endl; // get the alien subfield types of this datatype - std::unordered_set types; + std::unordered_set types; std::map processed; getAlienSubfieldTypes(types, processed, false); if (Trace.isOn("datatypes-init")) diff --git a/src/expr/dtype.h b/src/expr/dtype.h index 6fd334e02..584dc1615 100644 --- a/src/expr/dtype.h +++ b/src/expr/dtype.h @@ -542,10 +542,9 @@ class DType * @param isAlienPos Whether we are in an alien subfield type position. This * flag is true if we have traversed beneath a non-datatype type constructor. */ - void getAlienSubfieldTypes( - std::unordered_set& types, - std::map& processed, - bool isAlienPos) const; + void getAlienSubfieldTypes(std::unordered_set& types, + std::map& processed, + bool isAlienPos) const; /** name of this datatype */ std::string d_name; /** the type parameters of this datatype (if this is a parametric datatype) diff --git a/src/expr/emptybag.cpp b/src/expr/emptybag.cpp index d85aca30c..b8cb70e16 100644 --- a/src/expr/emptybag.cpp +++ b/src/expr/emptybag.cpp @@ -28,7 +28,7 @@ std::ostream& operator<<(std::ostream& out, const EmptyBag& asa) size_t EmptyBagHashFunction::operator()(const EmptyBag& es) const { - return TypeNodeHashFunction()(es.getType()); + return std::hash()(es.getType()); } /** diff --git a/src/expr/emptyset.cpp b/src/expr/emptyset.cpp index d0d1d4e78..0bd7ee213 100644 --- a/src/expr/emptyset.cpp +++ b/src/expr/emptyset.cpp @@ -29,7 +29,7 @@ std::ostream& operator<<(std::ostream& out, const EmptySet& asa) { } size_t EmptySetHashFunction::operator()(const EmptySet& es) const { - return TypeNodeHashFunction()(es.getType()); + return std::hash()(es.getType()); } /** diff --git a/src/expr/lazy_proof.h b/src/expr/lazy_proof.h index 6bec9ffb9..efcda94bd 100644 --- a/src/expr/lazy_proof.h +++ b/src/expr/lazy_proof.h @@ -92,8 +92,7 @@ class LazyCDProof : public CDProof bool hasGenerator(Node fact) const; protected: - typedef context::CDHashMap - NodeProofGeneratorMap; + typedef context::CDHashMap NodeProofGeneratorMap; /** Maps facts that can be proven to generators */ NodeProofGeneratorMap d_gens; /** The default proof generator */ diff --git a/src/expr/lazy_proof_chain.cpp b/src/expr/lazy_proof_chain.cpp index f5cf56983..3ce2212be 100644 --- a/src/expr/lazy_proof_chain.cpp +++ b/src/expr/lazy_proof_chain.cpp @@ -60,18 +60,15 @@ std::shared_ptr LazyCDProofChain::getProofFor(Node fact) << "LazyCDProofChain::getProofFor " << fact << "\n"; // which facts have had proofs retrieved for. This is maintained to avoid // cycles. It also saves the proof node of the fact - std::unordered_map, NodeHashFunction> - toConnect; + std::unordered_map> toConnect; // leaves of proof node links in the chain, i.e. assumptions, yet to be // expanded - std::unordered_map>, - NodeHashFunction> + std::unordered_map>> assumptionsToExpand; // invariant of the loop below, the first iteration notwithstanding: // visit = domain(assumptionsToExpand) \ domain(toConnect) std::vector visit{fact}; - std::unordered_map visited; + std::unordered_map visited; Node cur; do { diff --git a/src/expr/lazy_proof_chain.h b/src/expr/lazy_proof_chain.h index fa965f8bb..1abb3f84e 100644 --- a/src/expr/lazy_proof_chain.h +++ b/src/expr/lazy_proof_chain.h @@ -144,7 +144,7 @@ class LazyCDProofChain : public ProofGenerator /** A dummy context used by this class if none is provided */ context::Context d_context; /** Maps facts that can be proven to generators */ - context::CDHashMap d_gens; + context::CDHashMap d_gens; /** The default proof generator (if one exists) */ ProofGenerator* d_defGen; }; diff --git a/src/expr/node.cpp b/src/expr/node.cpp index e4acfb476..00a530227 100644 --- a/src/expr/node.cpp +++ b/src/expr/node.cpp @@ -110,3 +110,17 @@ template bool NodeTemplate::isConst() const; template bool NodeTemplate::isConst() const; } // namespace cvc5 + +namespace std { + +size_t hash::operator()(const cvc5::Node& node) const +{ + return node.getId(); +} + +size_t hash::operator()(const cvc5::TNode& node) const +{ + return node.getId(); +} + +} // namespace std diff --git a/src/expr/node.h b/src/expr/node.h index 5480b38ae..9258a3264 100644 --- a/src/expr/node.h +++ b/src/expr/node.h @@ -130,6 +130,25 @@ typedef NodeTemplate Node; */ typedef NodeTemplate TNode; +} // namespace cvc5 + +namespace std { + +template <> +struct hash +{ + size_t operator()(const cvc5::Node& node) const; +}; + +template <> +struct hash +{ + size_t operator()(const cvc5::TNode& node) const; +}; + +} // namespace std + +namespace cvc5 { namespace expr { class NodeValue; @@ -148,14 +167,6 @@ namespace kind { } // namespace metakind } // namespace kind -// for hash_maps, hash_sets.. -struct NodeHashFunction { - inline size_t operator()(Node node) const; -};/* struct NodeHashFunction */ -struct TNodeHashFunction { - inline size_t operator()(TNode node) const; -};/* struct TNodeHashFunction */ - /** * Encapsulation of an NodeValue pointer. The reference count is * maintained in the NodeValue if ref_count is true. @@ -226,82 +237,85 @@ public: * Cache-aware, recursive version of substitute() used by the public * member function with a similar signature. */ - Node substitute(TNode node, TNode replacement, - std::unordered_map& cache) const; - - /** - * Cache-aware, recursive version of substitute() used by the public - * member function with a similar signature. - */ - template - Node substitute(Iterator1 nodesBegin, Iterator1 nodesEnd, - Iterator2 replacementsBegin, Iterator2 replacementsEnd, - std::unordered_map& cache) const; - - /** - * Cache-aware, recursive version of substitute() used by the public - * member function with a similar signature. - */ - template - Node substitute(Iterator substitutionsBegin, Iterator substitutionsEnd, - std::unordered_map& cache) const; - - /** Default constructor, makes a null expression. */ - NodeTemplate() : d_nv(&expr::NodeValue::null()) { } - - /** - * Conversion between nodes that are reference-counted and those that are - * not. - * @param node the node to make copy of - */ - NodeTemplate(const NodeTemplate& node); - - /** - * Copy constructor. Note that GCC does NOT recognize an instantiation of - * the above template as a copy constructor and problems ensue. So we - * provide an explicit one here. - * @param node the node to make copy of - */ - NodeTemplate(const NodeTemplate& node); - - /** - * Assignment operator for nodes, copies the relevant information from node - * to this node. - * @param node the node to copy - * @return reference to this node - */ - NodeTemplate& operator=(const NodeTemplate& node); - - /** - * Assignment operator for nodes, copies the relevant information from node - * to this node. - * @param node the node to copy - * @return reference to this node - */ - NodeTemplate& operator=(const NodeTemplate& node); - - /** - * Destructor. If ref_count is true it will decrement the reference count - * and, if zero, collect the NodeValue. - */ - ~NodeTemplate(); - - /** - * Return the null node. - * @return the null node - */ - static NodeTemplate null() { - return s_null; - } - - /** - * Returns true if this expression is a null expression. - * @return true if null - */ - bool isNull() const { - assertTNodeNotExpired(); - return d_nv == &expr::NodeValue::null(); - } + Node substitute(TNode node, + TNode replacement, + std::unordered_map& cache) const; + + /** + * Cache-aware, recursive version of substitute() used by the public + * member function with a similar signature. + */ + template + Node substitute(Iterator1 nodesBegin, + Iterator1 nodesEnd, + Iterator2 replacementsBegin, + Iterator2 replacementsEnd, + std::unordered_map& cache) const; + + /** + * Cache-aware, recursive version of substitute() used by the public + * member function with a similar signature. + */ + template + Node substitute(Iterator substitutionsBegin, + Iterator substitutionsEnd, + std::unordered_map& cache) const; + + /** Default constructor, makes a null expression. */ + NodeTemplate() : d_nv(&expr::NodeValue::null()) {} + + /** + * Conversion between nodes that are reference-counted and those that are + * not. + * @param node the node to make copy of + */ + NodeTemplate(const NodeTemplate& node); + + /** + * Copy constructor. Note that GCC does NOT recognize an instantiation of + * the above template as a copy constructor and problems ensue. So we + * provide an explicit one here. + * @param node the node to make copy of + */ + NodeTemplate(const NodeTemplate& node); + + /** + * Assignment operator for nodes, copies the relevant information from node + * to this node. + * @param node the node to copy + * @return reference to this node + */ + NodeTemplate& operator=(const NodeTemplate& node); + + /** + * Assignment operator for nodes, copies the relevant information from node + * to this node. + * @param node the node to copy + * @return reference to this node + */ + NodeTemplate& operator=(const NodeTemplate& node); + + /** + * Destructor. If ref_count is true it will decrement the reference count + * and, if zero, collect the NodeValue. + */ + ~NodeTemplate(); + + /** + * Return the null node. + * @return the null node + */ + static NodeTemplate null() { return s_null; } + + /** + * Returns true if this expression is a null expression. + * @return true if null + */ + bool isNull() const + { + assertTNodeNotExpired(); + return d_nv == &expr::NodeValue::null(); + } /** * Structural comparison operator for expressions. @@ -500,8 +514,7 @@ public: /** * Simultaneous substitution of Nodes in cache. */ - Node substitute( - std::unordered_map& cache) const; + Node substitute(std::unordered_map& cache) const; /** * Returns the kind of this node. @@ -942,15 +955,8 @@ std::ostream& operator<<( namespace cvc5 { -inline size_t NodeHashFunction::operator()(Node node) const { - return node.getId(); -} -inline size_t TNodeHashFunction::operator()(TNode node) const { - return node.getId(); -} - using TNodePairHashFunction = - PairHashFunction; + PairHashFunction, std::hash>; template inline size_t NodeTemplate::getNumChildren() const { @@ -1253,14 +1259,16 @@ NodeTemplate::substitute(TNode node, TNode replacement) const { if (node == *this) { return replacement; } - std::unordered_map cache; + std::unordered_map cache; return substitute(node, replacement, cache); } template -Node -NodeTemplate::substitute(TNode node, TNode replacement, - std::unordered_map& cache) const { +Node NodeTemplate::substitute( + TNode node, + TNode replacement, + std::unordered_map& cache) const +{ Assert(node != *this); if (getNumChildren() == 0 || node == replacement) @@ -1269,7 +1277,8 @@ NodeTemplate::substitute(TNode node, TNode replacement, } // in cache? - typename std::unordered_map::const_iterator i = cache.find(*this); + typename std::unordered_map::const_iterator i = + cache.find(*this); if(i != cache.end()) { return (*i).second; } @@ -1309,21 +1318,23 @@ NodeTemplate::substitute(Iterator1 nodesBegin, Iterator1 nodesEnd, Iterator2 replacementsBegin, Iterator2 replacementsEnd) const { - std::unordered_map cache; + std::unordered_map cache; return substitute(nodesBegin, nodesEnd, replacementsBegin, replacementsEnd, cache); } template template -Node -NodeTemplate::substitute(Iterator1 nodesBegin, - Iterator1 nodesEnd, - Iterator2 replacementsBegin, - Iterator2 replacementsEnd, - std::unordered_map& cache) const { +Node NodeTemplate::substitute( + Iterator1 nodesBegin, + Iterator1 nodesEnd, + Iterator2 replacementsBegin, + Iterator2 replacementsEnd, + std::unordered_map& cache) const +{ // in cache? - typename std::unordered_map::const_iterator i = cache.find(*this); + typename std::unordered_map::const_iterator i = + cache.find(*this); if(i != cache.end()) { return (*i).second; } @@ -1366,13 +1377,13 @@ template inline Node NodeTemplate::substitute(Iterator substitutionsBegin, Iterator substitutionsEnd) const { - std::unordered_map cache; + std::unordered_map cache; return substitute(substitutionsBegin, substitutionsEnd, cache); } template inline Node NodeTemplate::substitute( - std::unordered_map& cache) const + std::unordered_map& cache) const { // Since no substitution is given (other than what may already be in the // cache), we pass dummy iterators to conform to the main substitute method, @@ -1382,12 +1393,14 @@ inline Node NodeTemplate::substitute( template template -Node -NodeTemplate::substitute(Iterator substitutionsBegin, - Iterator substitutionsEnd, - std::unordered_map& cache) const { +Node NodeTemplate::substitute( + Iterator substitutionsBegin, + Iterator substitutionsEnd, + std::unordered_map& cache) const +{ // in cache? - typename std::unordered_map::const_iterator i = cache.find(*this); + typename std::unordered_map::const_iterator i = + cache.find(*this); if(i != cache.end()) { return (*i).second; } diff --git a/src/expr/node_algorithm.cpp b/src/expr/node_algorithm.cpp index 0dc8858a2..19955443a 100644 --- a/src/expr/node_algorithm.cpp +++ b/src/expr/node_algorithm.cpp @@ -30,7 +30,7 @@ bool hasSubterm(TNode n, TNode t, bool strict) return true; } - std::unordered_set visited; + std::unordered_set visited; std::vector toProcess; toProcess.push_back(n); @@ -76,9 +76,9 @@ bool hasSubterm(TNode n, TNode t, bool strict) bool hasSubtermMulti(TNode n, TNode t) { - std::unordered_map visited; - std::unordered_map contains; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map contains; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(n); @@ -131,7 +131,7 @@ bool hasSubtermMulti(TNode n, TNode t) bool hasSubtermKind(Kind k, Node n) { - std::unordered_set visited; + std::unordered_set visited; std::vector visit; TNode cur; visit.push_back(n); @@ -162,7 +162,7 @@ bool hasSubtermKinds(const std::unordered_set& ks, { return false; } - std::unordered_set visited; + std::unordered_set visited; std::vector visit; TNode cur; visit.push_back(n); @@ -194,7 +194,7 @@ bool hasSubterm(TNode n, const std::vector& t, bool strict) return true; } - std::unordered_set visited; + std::unordered_set visited; std::vector toProcess; toProcess.push_back(n); @@ -283,7 +283,7 @@ bool hasBoundVar(TNode n) bool hasFreeVar(TNode n) { - std::unordered_set fvs; + std::unordered_set fvs; return getFreeVariables(n, fvs, false); } @@ -324,20 +324,18 @@ bool hasClosure(Node n) return n.getAttribute(HasClosureAttr()); } -bool getFreeVariables(TNode n, - std::unordered_set& fvs, - bool computeFv) +bool getFreeVariables(TNode n, std::unordered_set& fvs, bool computeFv) { - std::unordered_set scope; + std::unordered_set scope; return getFreeVariablesScope(n, fvs, scope, computeFv); } bool getFreeVariablesScope(TNode n, - std::unordered_set& fvs, - std::unordered_set& scope, + std::unordered_set& fvs, + std::unordered_set& scope, bool computeFv) { - std::unordered_set visited; + std::unordered_set visited; std::vector visit; TNode cur; visit.push_back(n); @@ -350,8 +348,7 @@ bool getFreeVariablesScope(TNode n, { continue; } - std::unordered_set::iterator itv = - visited.find(cur); + std::unordered_set::iterator itv = visited.find(cur); if (itv == visited.end()) { visited.insert(cur); @@ -404,9 +401,9 @@ bool getFreeVariablesScope(TNode n, return !fvs.empty(); } -bool getVariables(TNode n, std::unordered_set& vs) +bool getVariables(TNode n, std::unordered_set& vs) { - std::unordered_set visited; + std::unordered_set visited; std::vector visit; TNode cur; visit.push_back(n); @@ -414,8 +411,7 @@ bool getVariables(TNode n, std::unordered_set& vs) { cur = visit.back(); visit.pop_back(); - std::unordered_set::iterator itv = - visited.find(cur); + std::unordered_set::iterator itv = visited.find(cur); if (itv == visited.end()) { if (cur.isVar()) @@ -433,15 +429,15 @@ bool getVariables(TNode n, std::unordered_set& vs) return !vs.empty(); } -void getSymbols(TNode n, std::unordered_set& syms) +void getSymbols(TNode n, std::unordered_set& syms) { - std::unordered_set visited; + std::unordered_set visited; getSymbols(n, syms, visited); } void getSymbols(TNode n, - std::unordered_set& syms, - std::unordered_set& visited) + std::unordered_set& syms, + std::unordered_set& visited) { std::vector visit; TNode cur; @@ -469,9 +465,9 @@ void getSymbols(TNode n, void getKindSubterms(TNode n, Kind k, bool topLevel, - std::unordered_set& ts) + std::unordered_set& ts) { - std::unordered_set visited; + std::unordered_set visited; std::vector visit; TNode cur; visit.push_back(n); @@ -500,18 +496,15 @@ void getKindSubterms(TNode n, } while (!visit.empty()); } -void getOperatorsMap( - TNode n, - std::map>& ops) +void getOperatorsMap(TNode n, std::map>& ops) { - std::unordered_set visited; + std::unordered_set visited; getOperatorsMap(n, ops, visited); } -void getOperatorsMap( - TNode n, - std::map>& ops, - std::unordered_set& visited) +void getOperatorsMap(TNode n, + std::map>& ops, + std::unordered_set& visited) { // nodes that we still need to visit std::vector visit; @@ -565,8 +558,8 @@ Node substituteCaptureAvoiding(TNode n, std::vector& src, std::vector& dest) { - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode curr; visit.push_back(n); @@ -654,8 +647,7 @@ Node substituteCaptureAvoiding(TNode n, return visited[n]; } -void getComponentTypes( - TypeNode t, std::unordered_set& types) +void getComponentTypes(TypeNode t, std::unordered_set& types) { std::vector toProcess; toProcess.push_back(t); @@ -676,14 +668,12 @@ void getComponentTypes( } while (!toProcess.empty()); } -bool match(Node x, - Node y, - std::unordered_map& subs) +bool match(Node x, Node y, std::unordered_map& subs) { std::unordered_set, TNodePairHashFunction> visited; std::unordered_set, TNodePairHashFunction>::iterator it; - std::unordered_map::iterator subsIt; + std::unordered_map::iterator subsIt; std::vector> stack; stack.emplace_back(x, y); diff --git a/src/expr/node_algorithm.h b/src/expr/node_algorithm.h index 010724c80..b8576f787 100644 --- a/src/expr/node_algorithm.h +++ b/src/expr/node_algorithm.h @@ -103,7 +103,7 @@ bool hasClosure(Node n); * @return true iff this node contains a free variable. */ bool getFreeVariables(TNode n, - std::unordered_set& fvs, + std::unordered_set& fvs, bool computeFv = true); /** * Get the free variables in n, that is, the subterms of n of kind @@ -116,8 +116,8 @@ bool getFreeVariables(TNode n, * @return true iff this node contains a free variable. */ bool getFreeVariablesScope(TNode n, - std::unordered_set& fvs, - std::unordered_set& scope, + std::unordered_set& fvs, + std::unordered_set& scope, bool computeFv = true); /** @@ -126,7 +126,7 @@ bool getFreeVariablesScope(TNode n, * @param vs The set which free variables are added to * @return true iff this node contains a free variable. */ -bool getVariables(TNode n, std::unordered_set& vs); +bool getVariables(TNode n, std::unordered_set& vs); /** * For term n, this function collects the symbols that occur as a subterms @@ -134,7 +134,7 @@ bool getVariables(TNode n, std::unordered_set& vs); * @param n The node under investigation * @param syms The set which the symbols of n are added to */ -void getSymbols(TNode n, std::unordered_set& syms); +void getSymbols(TNode n, std::unordered_set& syms); /** * For term n, this function collects the symbols that occur as a subterms @@ -144,8 +144,8 @@ void getSymbols(TNode n, std::unordered_set& syms); * @param visited A cache to be used for visited nodes. */ void getSymbols(TNode n, - std::unordered_set& syms, - std::unordered_set& visited); + std::unordered_set& syms, + std::unordered_set& visited); /** * For term n, this function collects the subterms of n whose kind is k. @@ -157,7 +157,7 @@ void getSymbols(TNode n, void getKindSubterms(TNode n, Kind k, bool topLevel, - std::unordered_set& ts); + std::unordered_set& ts); /** * For term n, this function collects the operators that occur in n. @@ -165,9 +165,8 @@ void getKindSubterms(TNode n, * @param ops The map (from each type to operators of that type) which the * operators of n are added to */ -void getOperatorsMap( - TNode n, - std::map>& ops); +void getOperatorsMap(TNode n, + std::map>& ops); /** * For term n, this function collects the operators that occur in n. @@ -176,10 +175,9 @@ void getOperatorsMap( * operators of n are added to * @param visited A cache to be used for visited nodes. */ -void getOperatorsMap( - TNode n, - std::map>& ops, - std::unordered_set& visited); +void getOperatorsMap(TNode n, + std::map>& ops, + std::unordered_set& visited); /* * Substitution of Nodes in a capture avoiding way. @@ -208,8 +206,7 @@ Node substituteCaptureAvoiding(TNode n, * @param t The type node under investigation * @param types The set which component types are added to. */ -void getComponentTypes( - TypeNode t, std::unordered_set& types); +void getComponentTypes(TypeNode t, std::unordered_set& types); /** match * @@ -230,9 +227,7 @@ void getComponentTypes( * @param subs the mapping from free vars in `n1` to terms in `n2` * @return whether or not `n2` is an instance of `n1` */ -bool match(Node n1, - Node n2, - std::unordered_map& subs); +bool match(Node n1, Node n2, std::unordered_map& subs); } // namespace expr } // namespace cvc5 diff --git a/src/expr/node_traversal.h b/src/expr/node_traversal.h index 6489e19c8..75ae9c068 100644 --- a/src/expr/node_traversal.h +++ b/src/expr/node_traversal.h @@ -98,7 +98,7 @@ class NodeDfsIterator // Absent if we haven't visited it. // Set to `false` if we've already pre-visited it (enqueued its children). // Set to `true` if we've also already post-visited it. - std::unordered_map d_visited; + std::unordered_map d_visited; // The visit order that this iterator is using VisitOrder d_order; diff --git a/src/expr/proof.h b/src/expr/proof.h index 25ab1fd23..496815938 100644 --- a/src/expr/proof.h +++ b/src/expr/proof.h @@ -246,8 +246,7 @@ class CDProof : public ProofGenerator std::string identify() const override; protected: - typedef context::CDHashMap, NodeHashFunction> - NodeProofNodeMap; + typedef context::CDHashMap> NodeProofNodeMap; /** The proof manager, used for allocating new ProofNode objects */ ProofNodeManager* d_manager; /** A dummy context used by this class if none is provided */ diff --git a/src/expr/proof_node_algorithm.cpp b/src/expr/proof_node_algorithm.cpp index 957893cb3..4bb35b5dc 100644 --- a/src/expr/proof_node_algorithm.cpp +++ b/src/expr/proof_node_algorithm.cpp @@ -61,7 +61,7 @@ void getFreeAssumptionsMap( // after postvisiting SCOPE1: { y: 1 } // after postvisiting SCOPE2: {} // - std::unordered_map scopeDepth; + std::unordered_map scopeDepth; std::shared_ptr cur; visit.push_back(pn); do diff --git a/src/expr/proof_node_manager.cpp b/src/expr/proof_node_manager.cpp index d4a8b604f..c2c72f35d 100644 --- a/src/expr/proof_node_manager.cpp +++ b/src/expr/proof_node_manager.cpp @@ -87,19 +87,19 @@ std::shared_ptr ProofNodeManager::mkScope( } Trace("pnm-scope") << "ProofNodeManager::mkScope " << assumps << std::endl; // we first ensure the assumptions are flattened - std::unordered_set ac{assumps.begin(), assumps.end()}; + std::unordered_set ac{assumps.begin(), assumps.end()}; // map from the rewritten form of assumptions to the original. This is only // computed in the rare case when we need rewriting to match the // assumptions. An example of this is for Boolean constant equalities in // scoped proofs from the proof equality engine. - std::unordered_map acr; + std::unordered_map acr; // whether we have compute the map above bool computedAcr = false; // The free assumptions of the proof std::map>> famap; expr::getFreeAssumptionsMap(pf, famap); - std::unordered_set acu; + std::unordered_set acu; for (const std::pair>>& fa : famap) { @@ -153,8 +153,7 @@ std::shared_ptr ProofNodeManager::mkScope( } } Node ar = theory::Rewriter::rewrite(a); - std::unordered_map::iterator itr = - acr.find(ar); + std::unordered_map::iterator itr = acr.find(ar); if (itr != acr.end()) { aMatch = itr->second; diff --git a/src/expr/sequence.cpp b/src/expr/sequence.cpp index 9e68f6cd7..4202c70ec 100644 --- a/src/expr/sequence.cpp +++ b/src/expr/sequence.cpp @@ -374,7 +374,7 @@ size_t SequenceHashFunction::operator()(const Sequence& s) const const std::vector& vec = s.getVec(); for (const Node& n : vec) { - ret = fnv1a::fnv1a_64(ret, NodeHashFunction()(n)); + ret = fnv1a::fnv1a_64(ret, std::hash()(n)); } return ret; } diff --git a/src/expr/skolem_manager.cpp b/src/expr/skolem_manager.cpp index b59d01fdd..bb29f84ee 100644 --- a/src/expr/skolem_manager.cpp +++ b/src/expr/skolem_manager.cpp @@ -243,8 +243,8 @@ Node SkolemManager::getOriginalForm(Node n) << "SkolemManager::getOriginalForm " << n << std::endl; OriginalFormAttribute ofa; NodeManager* nm = NodeManager::currentNM(); - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/expr/tconv_seq_proof_generator.h b/src/expr/tconv_seq_proof_generator.h index ba8c438b2..bc067f60a 100644 --- a/src/expr/tconv_seq_proof_generator.h +++ b/src/expr/tconv_seq_proof_generator.h @@ -102,7 +102,7 @@ class TConvSeqProofGenerator : public ProofGenerator protected: using NodeIndexPairHashFunction = - PairHashFunction; + PairHashFunction>; typedef context:: CDHashMap, Node, NodeIndexPairHashFunction> NodeIndexNodeMap; diff --git a/src/expr/term_conversion_proof_generator.cpp b/src/expr/term_conversion_proof_generator.cpp index 3d68fd181..0e0ed3165 100644 --- a/src/expr/term_conversion_proof_generator.cpp +++ b/src/expr/term_conversion_proof_generator.cpp @@ -266,11 +266,11 @@ Node TConvProofGenerator::getProofForRewriting(Node t, // nodes. // the final rewritten form of terms - std::unordered_map visited; + std::unordered_map visited; // the rewritten form of terms we have processed so far - std::unordered_map rewritten; - std::unordered_map::iterator it; - std::unordered_map::iterator itr; + std::unordered_map rewritten; + std::unordered_map::iterator it; + std::unordered_map::iterator itr; std::map >::iterator itc; Trace("tconv-pf-gen-rewrite") << "TConvProofGenerator::getProofForRewriting: " << toStringDebug() diff --git a/src/expr/term_conversion_proof_generator.h b/src/expr/term_conversion_proof_generator.h index e546d23bd..70e606db4 100644 --- a/src/expr/term_conversion_proof_generator.h +++ b/src/expr/term_conversion_proof_generator.h @@ -200,7 +200,7 @@ class TConvProofGenerator : public ProofGenerator std::shared_ptr getProofForRewriting(Node n); protected: - typedef context::CDHashMap NodeNodeMap; + typedef context::CDHashMap NodeNodeMap; /** A dummy context used by this class if none is provided */ context::Context d_context; /** The (lazy) context dependent proof object. */ diff --git a/src/expr/type_node.cpp b/src/expr/type_node.cpp index bd435a392..b4f2f7efa 100644 --- a/src/expr/type_node.cpp +++ b/src/expr/type_node.cpp @@ -29,11 +29,13 @@ namespace cvc5 { TypeNode TypeNode::s_null( &expr::NodeValue::null() ); -TypeNode TypeNode::substitute(const TypeNode& type, - const TypeNode& replacement, - std::unordered_map& cache) const { +TypeNode TypeNode::substitute( + const TypeNode& type, + const TypeNode& replacement, + std::unordered_map& cache) const +{ // in cache? - std::unordered_map::const_iterator i = cache.find(*this); + std::unordered_map::const_iterator i = cache.find(*this); if(i != cache.end()) { return (*i).second; } @@ -683,3 +685,12 @@ TypeNode TypeNode::getBagElementType() const } } // namespace cvc5 + +namespace std { + +size_t hash::operator()(const cvc5::TypeNode& tn) const +{ + return tn.getId(); +} + +} // namespace std diff --git a/src/expr/type_node.h b/src/expr/type_node.h index 0ab1d0217..1840820dc 100644 --- a/src/expr/type_node.h +++ b/src/expr/type_node.h @@ -47,15 +47,6 @@ namespace expr { */ class TypeNode { -public: - - // for hash_maps, hash_sets.. - struct HashFunction { - size_t operator()(TypeNode node) const { - return (size_t) node.getId(); - } - };/* struct HashFunction */ - private: /** @@ -92,20 +83,22 @@ private: * Cache-aware, recursive version of substitute() used by the public * member function with a similar signature. */ - TypeNode substitute(const TypeNode& type, const TypeNode& replacement, - std::unordered_map& cache) const; + TypeNode substitute(const TypeNode& type, + const TypeNode& replacement, + std::unordered_map& cache) const; /** * Cache-aware, recursive version of substitute() used by the public * member function with a similar signature. */ template - TypeNode substitute(Iterator1 typesBegin, Iterator1 typesEnd, - Iterator2 replacementsBegin, Iterator2 replacementsEnd, - std::unordered_map& cache) const; - -public: + TypeNode substitute(Iterator1 typesBegin, + Iterator1 typesEnd, + Iterator2 replacementsBegin, + Iterator2 replacementsEnd, + std::unordered_map& cache) const; + public: /** Default constructor, makes a null expression. */ TypeNode() : d_nv(&expr::NodeValue::null()) { } @@ -735,10 +728,18 @@ inline std::ostream& operator<<(std::ostream& out, const TypeNode& n) { return out; } -typedef TypeNode::HashFunction TypeNodeHashFunction; - } // namespace cvc5 +namespace std { + +template <> +struct hash +{ + size_t operator()(const cvc5::TypeNode& tn) const; +}; + +} // namespace std + #include "expr/node_manager.h" namespace cvc5 { @@ -746,7 +747,7 @@ namespace cvc5 { inline TypeNode TypeNode::substitute(const TypeNode& type, const TypeNode& replacement) const { - std::unordered_map cache; + std::unordered_map cache; return substitute(type, replacement, cache); } @@ -756,19 +757,21 @@ TypeNode::substitute(Iterator1 typesBegin, Iterator1 typesEnd, Iterator2 replacementsBegin, Iterator2 replacementsEnd) const { - std::unordered_map cache; + std::unordered_map cache; return substitute(typesBegin, typesEnd, replacementsBegin, replacementsEnd, cache); } template -TypeNode TypeNode::substitute(Iterator1 typesBegin, - Iterator1 typesEnd, - Iterator2 replacementsBegin, - Iterator2 replacementsEnd, - std::unordered_map& cache) const { +TypeNode TypeNode::substitute( + Iterator1 typesBegin, + Iterator1 typesEnd, + Iterator2 replacementsBegin, + Iterator2 replacementsEnd, + std::unordered_map& cache) const +{ // in cache? - std::unordered_map::const_iterator i = cache.find(*this); + std::unordered_map::const_iterator i = cache.find(*this); if(i != cache.end()) { return (*i).second; } diff --git a/src/expr/uninterpreted_constant.cpp b/src/expr/uninterpreted_constant.cpp index 039a77eb3..ef354568d 100644 --- a/src/expr/uninterpreted_constant.cpp +++ b/src/expr/uninterpreted_constant.cpp @@ -90,7 +90,7 @@ std::ostream& operator<<(std::ostream& out, const UninterpretedConstant& uc) { size_t UninterpretedConstantHashFunction::operator()( const UninterpretedConstant& uc) const { - return TypeNodeHashFunction()(uc.getType()) + return std::hash()(uc.getType()) * IntegerHashFunction()(uc.getIndex()); } diff --git a/src/preprocessing/passes/ackermann.cpp b/src/preprocessing/passes/ackermann.cpp index 6b2f142fc..89029b5eb 100644 --- a/src/preprocessing/passes/ackermann.cpp +++ b/src/preprocessing/passes/ackermann.cpp @@ -205,7 +205,7 @@ size_t getBVSkolemSize(size_t capacity) * a sufficient bit-vector size. * Populate usVarsToBVVars so that it maps variables with uninterpreted sort to * the fresh skolem BV variables. variables */ -void collectUSortsToBV(const std::unordered_set& vars, +void collectUSortsToBV(const std::unordered_set& vars, const USortToBVSizeMap& usortCardinality, SubstitutionMap& usVarsToBVVars) { @@ -228,14 +228,13 @@ void collectUSortsToBV(const std::unordered_set& vars, /* This function returns the list of terms with uninterpreted sort in the * formula represented by assertions. */ -std::unordered_set getVarsWithUSorts( - AssertionPipeline* assertions) +std::unordered_set getVarsWithUSorts(AssertionPipeline* assertions) { - std::unordered_set res; + std::unordered_set res; for (const Node& assertion : assertions->ref()) { - std::unordered_set vars; + std::unordered_set vars; expr::getVariables(assertion, vars); for (const TNode& var : vars) @@ -261,8 +260,7 @@ void usortsToBitVectors(const LogicInfo& d_logic, USortToBVSizeMap& usortCardinality, SubstitutionMap& usVarsToBVVars) { - std::unordered_set toProcess = - getVarsWithUSorts(assertions); + std::unordered_set toProcess = getVarsWithUSorts(assertions); if (toProcess.size() > 0) { diff --git a/src/preprocessing/passes/ackermann.h b/src/preprocessing/passes/ackermann.h index b51c4b344..dc9375d5c 100644 --- a/src/preprocessing/passes/ackermann.h +++ b/src/preprocessing/passes/ackermann.h @@ -38,11 +38,9 @@ namespace cvc5 { namespace preprocessing { namespace passes { -using TNodeSet = std::unordered_set; -using FunctionToArgsMap = - std::unordered_map; -using USortToBVSizeMap = - std::unordered_map; +using TNodeSet = std::unordered_set; +using FunctionToArgsMap = std::unordered_map; +using USortToBVSizeMap = std::unordered_map; class Ackermann : public PreprocessingPass { diff --git a/src/preprocessing/passes/bool_to_bv.cpp b/src/preprocessing/passes/bool_to_bv.cpp index 7082f5553..a789a0d0b 100644 --- a/src/preprocessing/passes/bool_to_bv.cpp +++ b/src/preprocessing/passes/bool_to_bv.cpp @@ -144,7 +144,7 @@ Node BoolToBV::lowerNode(const TNode& node, bool allowIteIntroduction) { std::vector to_visit; to_visit.push_back(node); - std::unordered_set visited; + std::unordered_set visited; while (!to_visit.empty()) { @@ -309,7 +309,7 @@ Node BoolToBV::lowerIte(const TNode& node) { std::vector visit; visit.push_back(node); - std::unordered_set visited; + std::unordered_set visited; while (!visit.empty()) { diff --git a/src/preprocessing/passes/bool_to_bv.h b/src/preprocessing/passes/bool_to_bv.h index 210c4e5cd..0bef7c6b5 100644 --- a/src/preprocessing/passes/bool_to_bv.h +++ b/src/preprocessing/passes/bool_to_bv.h @@ -108,12 +108,12 @@ class BoolToBV : public PreprocessingPass Note: it only keeps mappings for ITEs of type bit-vector. Other ITEs will be in the d_lowerCache */ - std::unordered_map d_iteBVLowerCache; + std::unordered_map d_iteBVLowerCache; /** Keeps track of other lowered nodes -- will be cleared periodically in ITE mode */ - std::unordered_map d_lowerCache; + std::unordered_map d_lowerCache; /** Stores the bool-to-bv mode option */ options::BoolToBVMode d_boolToBVMode; diff --git a/src/preprocessing/passes/bv_gauss.cpp b/src/preprocessing/passes/bv_gauss.cpp index 557584490..f34ebd02e 100644 --- a/src/preprocessing/passes/bv_gauss.cpp +++ b/src/preprocessing/passes/bv_gauss.cpp @@ -79,8 +79,8 @@ unsigned BVGauss::getMinBwExpr(Node expr) { std::vector visit; /* Maps visited nodes to the determined minimum bit-width required. */ - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; visit.push_back(expr); while (!visit.empty()) @@ -421,20 +421,19 @@ BVGauss::Result BVGauss::gaussElim(Integer prime, * of the form 'unknown = mapped result' in applyInternal. */ BVGauss::Result BVGauss::gaussElimRewriteForUrem( - const std::vector& equations, - std::unordered_map& res) + const std::vector& equations, std::unordered_map& res) { Assert(res.empty()); Node prime; Integer iprime; - std::unordered_map, NodeHashFunction> vars; + std::unordered_map> vars; size_t neqs = equations.size(); std::vector rhs; std::vector> lhs = std::vector>(neqs, std::vector()); - res = std::unordered_map(); + res = std::unordered_map(); for (size_t i = 0; i < neqs; ++i) { @@ -473,7 +472,7 @@ BVGauss::Result BVGauss::gaussElimRewriteForUrem( iprime = get_bv_const_value(prime); } - std::unordered_map tmp; + std::unordered_map tmp; std::vector stack; stack.push_back(urem[0]); while (!stack.empty()) @@ -699,7 +698,7 @@ PreprocessingPassResult BVGauss::applyInternal( AssertionPipeline* assertionsToPreprocess) { std::vector assertions(assertionsToPreprocess->ref()); - std::unordered_map, NodeHashFunction> equations; + std::unordered_map> equations; while (!assertions.empty()) { @@ -738,14 +737,14 @@ PreprocessingPassResult BVGauss::applyInternal( } } - std::unordered_map subst; + std::unordered_map subst; NodeManager* nm = NodeManager::currentNM(); for (const auto& eq : equations) { if (eq.second.size() <= 1) { continue; } - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret = gaussElimRewriteForUrem(eq.second, res); Trace("bv-gauss-elim") << "result: " << (ret == BVGauss::Result::INVALID diff --git a/src/preprocessing/passes/bv_gauss.h b/src/preprocessing/passes/bv_gauss.h index a71f4ce3f..c7cec2cc0 100644 --- a/src/preprocessing/passes/bv_gauss.h +++ b/src/preprocessing/passes/bv_gauss.h @@ -96,9 +96,8 @@ class BVGauss : public PreprocessingPass std::vector& rhs, std::vector>& lhs); - static Result gaussElimRewriteForUrem( - const std::vector& equations, - std::unordered_map& res); + static Result gaussElimRewriteForUrem(const std::vector& equations, + std::unordered_map& res); static unsigned getMinBwExpr(Node expr); }; diff --git a/src/preprocessing/passes/bv_intro_pow2.cpp b/src/preprocessing/passes/bv_intro_pow2.cpp index 829655121..45df7478c 100644 --- a/src/preprocessing/passes/bv_intro_pow2.cpp +++ b/src/preprocessing/passes/bv_intro_pow2.cpp @@ -30,7 +30,7 @@ namespace cvc5 { namespace preprocessing { namespace passes { -using NodeMap = std::unordered_map; +using NodeMap = std::unordered_map; using namespace cvc5::theory; namespace { @@ -87,7 +87,7 @@ BvIntroPow2::BvIntroPow2(PreprocessingPassContext* preprocContext) PreprocessingPassResult BvIntroPow2::applyInternal( AssertionPipeline* assertionsToPreprocess) { - std::unordered_map cache; + std::unordered_map cache; for (unsigned i = 0, size = assertionsToPreprocess->size(); i < size; ++i) { Node cur = (*assertionsToPreprocess)[i]; diff --git a/src/preprocessing/passes/bv_to_bool.h b/src/preprocessing/passes/bv_to_bool.h index 6ae33ef02..d34f2f77f 100644 --- a/src/preprocessing/passes/bv_to_bool.h +++ b/src/preprocessing/passes/bv_to_bool.h @@ -26,7 +26,7 @@ namespace cvc5 { namespace preprocessing { namespace passes { -typedef std::unordered_map NodeNodeMap; +typedef std::unordered_map NodeNodeMap; class BVToBool : public PreprocessingPass { diff --git a/src/preprocessing/passes/bv_to_int.h b/src/preprocessing/passes/bv_to_int.h index b8fa00e95..d09f9e738 100644 --- a/src/preprocessing/passes/bv_to_int.h +++ b/src/preprocessing/passes/bv_to_int.h @@ -78,7 +78,7 @@ namespace cvc5 { namespace preprocessing { namespace passes { -using CDNodeMap = context::CDHashMap; +using CDNodeMap = context::CDHashMap; class BVToInt : public PreprocessingPass { @@ -272,7 +272,7 @@ class BVToInt : public PreprocessingPass * A set of constraints of the form 0 <= x < 2^k * These are added for every new integer variable that we introduce. */ - context::CDHashSet d_rangeAssertions; + context::CDHashSet d_rangeAssertions; /** * Useful constants diff --git a/src/preprocessing/passes/foreign_theory_rewrite.h b/src/preprocessing/passes/foreign_theory_rewrite.h index 87299074a..4940f326c 100644 --- a/src/preprocessing/passes/foreign_theory_rewrite.h +++ b/src/preprocessing/passes/foreign_theory_rewrite.h @@ -28,7 +28,7 @@ namespace cvc5 { namespace preprocessing { namespace passes { -using CDNodeMap = context::CDHashMap; +using CDNodeMap = context::CDHashMap; class ForeignTheoryRewrite : public PreprocessingPass { diff --git a/src/preprocessing/passes/global_negate.cpp b/src/preprocessing/passes/global_negate.cpp index b09870c11..e990f8868 100644 --- a/src/preprocessing/passes/global_negate.cpp +++ b/src/preprocessing/passes/global_negate.cpp @@ -37,7 +37,7 @@ Node GlobalNegate::simplify(const std::vector& assertions, // collect free variables in all assertions std::vector free_vars; std::vector visit; - std::unordered_set visited; + std::unordered_set visited; for (const Node& as : assertions) { Trace("cegqi-gn") << " " << as << std::endl; diff --git a/src/preprocessing/passes/ho_elim.cpp b/src/preprocessing/passes/ho_elim.cpp index 48ec7860d..27dcf651b 100644 --- a/src/preprocessing/passes/ho_elim.cpp +++ b/src/preprocessing/passes/ho_elim.cpp @@ -39,7 +39,7 @@ Node HoElim::eliminateLambdaComplete(Node n, std::map& newLambda) { NodeManager* nm = NodeManager::currentNM(); SkolemManager* sm = nm->getSkolemManager(); - std::unordered_map::iterator it; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(n); @@ -57,7 +57,7 @@ Node HoElim::eliminateLambdaComplete(Node n, std::map& newLambda) // must also get free variables in lambda std::vector lvars; std::vector ftypes; - std::unordered_set fvs; + std::unordered_set fvs; expr::getFreeVariables(cur, fvs); std::vector nvars; std::vector vars; @@ -155,7 +155,7 @@ Node HoElim::eliminateHo(Node n) Trace("ho-elim-assert") << "Ho-elim assertion: " << n << std::endl; NodeManager* nm = NodeManager::currentNM(); SkolemManager* sm = nm->getSkolemManager(); - std::unordered_map::iterator it; + std::unordered_map::iterator it; std::map preReplace; std::map::iterator itr; std::vector visit; @@ -258,7 +258,7 @@ Node HoElim::eliminateHo(Node n) << std::endl; if (typeChanged) { - std::unordered_map::iterator ito = + std::unordered_map::iterator ito = d_visited_op.find(op); if (ito == d_visited_op.end()) { diff --git a/src/preprocessing/passes/ho_elim.h b/src/preprocessing/passes/ho_elim.h index a2574ff39..8b8dc08c2 100644 --- a/src/preprocessing/passes/ho_elim.h +++ b/src/preprocessing/passes/ho_elim.h @@ -117,14 +117,14 @@ class HoElim : public PreprocessingPass * Stores the set of nodes we have current visited and their results * in steps [1] and [2] of this pass. */ - std::unordered_map d_visited; + std::unordered_map d_visited; /** * Stores the mapping from functions f to their corresponding function H(f) * in the encoding for step [2] of this pass. */ - std::unordered_map d_visited_op; + std::unordered_map d_visited_op; /** The set of all function types encountered in assertions. */ - std::unordered_set d_funTypes; + std::unordered_set d_funTypes; /** * Get ho apply uf, this returns App_{@_{T1 x T2 ... x Tn -> T}} diff --git a/src/preprocessing/passes/int_to_bv.cpp b/src/preprocessing/passes/int_to_bv.cpp index 21ec77d0c..2f9fd28e6 100644 --- a/src/preprocessing/passes/int_to_bv.cpp +++ b/src/preprocessing/passes/int_to_bv.cpp @@ -38,7 +38,7 @@ namespace passes { using namespace std; using namespace cvc5::theory; -using NodeMap = std::unordered_map; +using NodeMap = std::unordered_map; namespace { diff --git a/src/preprocessing/passes/miplib_trick.cpp b/src/preprocessing/passes/miplib_trick.cpp index e9819072d..fe515ed59 100644 --- a/src/preprocessing/passes/miplib_trick.cpp +++ b/src/preprocessing/passes/miplib_trick.cpp @@ -207,7 +207,7 @@ PreprocessingPassResult MipLibTrick::applyInternal( Node zero = nm->mkConst(Rational(0)), one = nm->mkConst(Rational(1)); Node trueNode = nm->mkConst(true); - unordered_map intVars; + unordered_map intVars; for (TNode v0 : d_boolVars) { if (propagator->isAssigned(v0)) diff --git a/src/preprocessing/passes/nl_ext_purify.cpp b/src/preprocessing/passes/nl_ext_purify.cpp index bb32e7ba2..afd21fb7a 100644 --- a/src/preprocessing/passes/nl_ext_purify.cpp +++ b/src/preprocessing/passes/nl_ext_purify.cpp @@ -116,8 +116,8 @@ NlExtPurify::NlExtPurify(PreprocessingPassContext* preprocContext) PreprocessingPassResult NlExtPurify::applyInternal( AssertionPipeline* assertionsToPreprocess) { - unordered_map cache; - unordered_map bcache; + unordered_map cache; + unordered_map bcache; std::vector var_eq; unsigned size = assertionsToPreprocess->size(); for (unsigned i = 0; i < size; ++i) diff --git a/src/preprocessing/passes/nl_ext_purify.h b/src/preprocessing/passes/nl_ext_purify.h index 211373e35..ab5a6ac7f 100644 --- a/src/preprocessing/passes/nl_ext_purify.h +++ b/src/preprocessing/passes/nl_ext_purify.h @@ -31,7 +31,7 @@ namespace cvc5 { namespace preprocessing { namespace passes { -using NodeMap = std::unordered_map; +using NodeMap = std::unordered_map; class NlExtPurify : public PreprocessingPass { diff --git a/src/preprocessing/passes/non_clausal_simp.cpp b/src/preprocessing/passes/non_clausal_simp.cpp index d68c30a11..d88e901d7 100644 --- a/src/preprocessing/passes/non_clausal_simp.cpp +++ b/src/preprocessing/passes/non_clausal_simp.cpp @@ -294,7 +294,7 @@ PreprocessingPassResult NonClausalSimp::applyInternal( << "Resize non-clausal learned literals to " << j << std::endl; learned_literals.resize(j); - std::unordered_set s; + std::unordered_set s; for (size_t i = 0, size = assertionsToPreprocess->size(); i < size; ++i) { Node assertion = (*assertionsToPreprocess)[i]; diff --git a/src/preprocessing/passes/pseudo_boolean_processor.h b/src/preprocessing/passes/pseudo_boolean_processor.h index cf68bc8fb..74ee67fa4 100644 --- a/src/preprocessing/passes/pseudo_boolean_processor.h +++ b/src/preprocessing/passes/pseudo_boolean_processor.h @@ -90,12 +90,11 @@ class PseudoBooleanProcessor : public PreprocessingPass static Node mkGeqOne(Node v); // x -> - typedef context::CDHashMap, NodeHashFunction> - CDNode2PairMap; + typedef context::CDHashMap> CDNode2PairMap; CDNode2PairMap d_pbBounds; theory::SubstitutionMap d_subCache; - typedef std::unordered_set NodeSet; + typedef std::unordered_set NodeSet; NodeSet d_learningCache; context::CDO d_pbs; diff --git a/src/preprocessing/passes/real_to_int.h b/src/preprocessing/passes/real_to_int.h index d26547372..4fcc6e254 100644 --- a/src/preprocessing/passes/real_to_int.h +++ b/src/preprocessing/passes/real_to_int.h @@ -32,7 +32,7 @@ namespace passes { class RealToInt : public PreprocessingPass { - using NodeMap = context::CDHashMap; + using NodeMap = context::CDHashMap; public: RealToInt(PreprocessingPassContext* preprocContext); diff --git a/src/preprocessing/passes/sygus_inference.cpp b/src/preprocessing/passes/sygus_inference.cpp index b15d5a377..33a2e38d9 100644 --- a/src/preprocessing/passes/sygus_inference.cpp +++ b/src/preprocessing/passes/sygus_inference.cpp @@ -93,7 +93,7 @@ bool SygusInference::solveSygus(const std::vector& assertions, std::vector free_functions; std::vector visit; - std::unordered_set visited; + std::unordered_set visited; // add top-level conjuncts to eassertions std::vector assertions_proc = assertions; diff --git a/src/preprocessing/passes/synth_rew_rules.cpp b/src/preprocessing/passes/synth_rew_rules.cpp index e521ceffa..81d5cae84 100644 --- a/src/preprocessing/passes/synth_rew_rules.cpp +++ b/src/preprocessing/passes/synth_rew_rules.cpp @@ -54,8 +54,8 @@ PreprocessingPassResult SynthRewRulesPass::applyInternal( NodeManager* nm = NodeManager::currentNM(); // initialize the candidate rewrite - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; // Get all usable terms from the input. A term is usable if it does not // contain a quantified subterm diff --git a/src/preprocessing/passes/theory_rewrite_eq.cpp b/src/preprocessing/passes/theory_rewrite_eq.cpp index 862585790..44aedc754 100644 --- a/src/preprocessing/passes/theory_rewrite_eq.cpp +++ b/src/preprocessing/passes/theory_rewrite_eq.cpp @@ -49,8 +49,8 @@ theory::TrustNode TheoryRewriteEq::rewriteAssertion(TNode n) { NodeManager* nm = NodeManager::currentNM(); TheoryEngine* te = d_preprocContext->getTheoryEngine(); - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/preprocessing/passes/unconstrained_simplifier.h b/src/preprocessing/passes/unconstrained_simplifier.h index 2128f9681..861a89b7e 100644 --- a/src/preprocessing/passes/unconstrained_simplifier.h +++ b/src/preprocessing/passes/unconstrained_simplifier.h @@ -49,9 +49,9 @@ class UnconstrainedSimplifier : public PreprocessingPass /** number of expressions eliminated due to unconstrained simplification */ IntStat d_numUnconstrainedElim; - using TNodeCountMap = std::unordered_map; - using TNodeMap = std::unordered_map; - using TNodeSet = std::unordered_set; + using TNodeCountMap = std::unordered_map; + using TNodeMap = std::unordered_map; + using TNodeSet = std::unordered_set; TNodeCountMap d_visited; TNodeMap d_visitedOnce; diff --git a/src/preprocessing/preprocessing_pass_context.cpp b/src/preprocessing/preprocessing_pass_context.cpp index 9e8a4efc8..eaccce1a9 100644 --- a/src/preprocessing/preprocessing_pass_context.cpp +++ b/src/preprocessing/preprocessing_pass_context.cpp @@ -55,8 +55,8 @@ void PreprocessingPassContext::spendResource(Resource r) void PreprocessingPassContext::recordSymbolsInAssertions( const std::vector& assertions) { - std::unordered_set visited; - std::unordered_set syms; + std::unordered_set visited; + std::unordered_set syms; for (TNode cn : assertions) { expr::getSymbols(cn, syms, visited); diff --git a/src/preprocessing/preprocessing_pass_context.h b/src/preprocessing/preprocessing_pass_context.h index a14fafb47..722c82f6b 100644 --- a/src/preprocessing/preprocessing_pass_context.h +++ b/src/preprocessing/preprocessing_pass_context.h @@ -57,10 +57,7 @@ class PreprocessingPassContext return d_circuitPropagator; } - context::CDHashSet& getSymsInAssertions() - { - return d_symsInAssertions; - } + context::CDHashSet& getSymsInAssertions() { return d_symsInAssertions; } void spendResource(Resource r); @@ -107,7 +104,7 @@ class PreprocessingPassContext * The (user-context-dependent) set of symbols that occur in at least one * assertion in the current user context. */ - context::CDHashSet d_symsInAssertions; + context::CDHashSet d_symsInAssertions; }; // class PreprocessingPassContext diff --git a/src/preprocessing/util/ite_utilities.cpp b/src/preprocessing/util/ite_utilities.cpp index 833fa59b9..3e1b3659a 100644 --- a/src/preprocessing/util/ite_utilities.cpp +++ b/src/preprocessing/util/ite_utilities.cpp @@ -1264,7 +1264,7 @@ bool ITESimplifier::leavesAreConst(TNode e, theory::TheoryId tid) return true; } - unordered_map::iterator it; + unordered_map::iterator it; it = d_leavesConstCache.find(e); if (it != d_leavesConstCache.end()) { @@ -1358,7 +1358,7 @@ Node ITESimplifier::simpConstants(TNode simpContext, Node ITESimplifier::getSimpVar(TypeNode t) { - std::unordered_map::iterator it; + std::unordered_map::iterator it; it = d_simpVars.find(t); if (it != d_simpVars.end()) { @@ -1424,7 +1424,7 @@ Node ITESimplifier::createSimpContext(TNode c, Node& iteNode, Node& simpVar) d_simpContextCache[c] = result; return result; } -typedef std::unordered_set NodeSet; +typedef std::unordered_set NodeSet; void countReachable_(Node x, Kind k, NodeSet& visited, uint32_t& reached) { if (visited.find(x) != visited.end()) diff --git a/src/preprocessing/util/ite_utilities.h b/src/preprocessing/util/ite_utilities.h index 95eaf8a84..3ab655767 100644 --- a/src/preprocessing/util/ite_utilities.h +++ b/src/preprocessing/util/ite_utilities.h @@ -61,7 +61,7 @@ class ContainsTermITEVisitor size_t cache_size() const { return d_cache.size(); } private: - typedef std::unordered_map NodeBoolMap; + typedef std::unordered_map NodeBoolMap; NodeBoolMap d_cache; }; @@ -121,7 +121,7 @@ class IncomingArcCounter void clear(); private: - typedef std::unordered_map NodeCountMap; + typedef std::unordered_map NodeCountMap; NodeCountMap d_reachCount; bool d_skipVariables; @@ -154,7 +154,7 @@ class TermITEHeightCounter size_t cache_size() const; private: - typedef std::unordered_map NodeCountMap; + typedef std::unordered_map NodeCountMap; NodeCountMap d_termITEHeight; }; /* class TermITEHeightCounter */ @@ -181,7 +181,7 @@ class ITECompressor AssertionPipeline* d_assertions; IncomingArcCounter d_incoming; - typedef std::unordered_map NodeMap; + typedef std::unordered_map NodeMap; NodeMap d_compressed; void reset(); @@ -232,8 +232,7 @@ class ITESimplifier // constant // or termITE(cnd, ConstantIte, ConstantIte) typedef std::vector NodeVec; - typedef std::unordered_map - ConstantLeavesMap; + typedef std::unordered_map ConstantLeavesMap; ConstantLeavesMap d_constantLeaves; // d_constantLeaves satisfies the following invariants: @@ -269,7 +268,7 @@ class ITESimplifier typedef std::pair NodePair; using NodePairHashFunction = - PairHashFunction; + PairHashFunction, std::hash>; typedef std::unordered_map NodePairMap; NodePairMap d_constantIteEqualsConstantCache; NodePairMap d_replaceOverCache; @@ -277,16 +276,16 @@ class ITESimplifier Node replaceOver(Node n, Node replaceWith, Node simpVar); Node replaceOverTermIte(Node term, Node simpAtom, Node simpVar); - std::unordered_map d_leavesConstCache; + std::unordered_map d_leavesConstCache; bool leavesAreConst(TNode e, theory::TheoryId tid); bool leavesAreConst(TNode e); NodePairMap d_simpConstCache; Node simpConstants(TNode simpContext, TNode iteNode, TNode simpVar); - std::unordered_map d_simpVars; + std::unordered_map d_simpVars; Node getSimpVar(TypeNode t); - typedef std::unordered_map NodeMap; + typedef std::unordered_map NodeMap; NodeMap d_simpContextCache; Node createSimpContext(TNode c, Node& iteNode, Node& simpVar); @@ -335,7 +334,7 @@ class ITECareSimplifier Node d_true; Node d_false; - typedef std::unordered_map TNodeMap; + typedef std::unordered_map TNodeMap; class CareSetPtr; class CareSetPtrVal diff --git a/src/printer/let_binding.cpp b/src/printer/let_binding.cpp index 16fc4703c..a807b9d83 100644 --- a/src/printer/let_binding.cpp +++ b/src/printer/let_binding.cpp @@ -82,8 +82,8 @@ Node LetBinding::convert(Node n, const std::string& prefix, bool letTop) const return n; } NodeManager* nm = NodeManager::currentNM(); - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/printer/let_binding.h b/src/printer/let_binding.h index abdf5985d..b67ceb129 100644 --- a/src/printer/let_binding.h +++ b/src/printer/let_binding.h @@ -87,7 +87,7 @@ namespace cvc5 { class LetBinding { using NodeList = context::CDList; - using NodeIdMap = context::CDHashMap; + using NodeIdMap = context::CDHashMap; public: LetBinding(uint32_t thresh = 2); diff --git a/src/proof/cnf_proof.h b/src/proof/cnf_proof.h index 50ce78eb8..8e8f2bc91 100644 --- a/src/proof/cnf_proof.h +++ b/src/proof/cnf_proof.h @@ -32,14 +32,14 @@ namespace prop { class CnfProof; -typedef std::unordered_map NodeToNode; +typedef std::unordered_map NodeToNode; typedef std::unordered_set ClauseIdSet; typedef context::CDHashMap ClauseIdToNode; typedef std::pair NodePair; typedef std::set NodePairSet; -typedef std::unordered_set NodeSet; +typedef std::unordered_set NodeSet; class CnfProof { protected: diff --git a/src/proof/proof_manager.h b/src/proof/proof_manager.h index f0bc20fea..8d1bbc70c 100644 --- a/src/proof/proof_manager.h +++ b/src/proof/proof_manager.h @@ -54,8 +54,8 @@ namespace prop { } // namespace prop typedef std::unordered_map IdToSatClause; -typedef context::CDHashSet CDNodeSet; -typedef context::CDHashMap, NodeHashFunction> CDNodeToNodes; +typedef context::CDHashSet CDNodeSet; +typedef context::CDHashMap> CDNodeToNodes; typedef std::unordered_set IdHashSet; class ProofManager { diff --git a/src/prop/cnf_stream.h b/src/prop/cnf_stream.h index 2d0b83c33..9901fb18b 100644 --- a/src/prop/cnf_stream.h +++ b/src/prop/cnf_stream.h @@ -75,8 +75,7 @@ class CnfStream { LiteralToNodeMap; /** Cache of what literals have been registered to a node. */ - typedef context::CDInsertHashMap - NodeToLiteralMap; + typedef context::CDInsertHashMap NodeToLiteralMap; /** * Constructs a CnfStream that performs equisatisfiable CNF transformations @@ -223,7 +222,7 @@ class CnfStream { context::CDList d_booleanVariables; /** Formulas that we translated that we are notifying */ - context::CDHashSet d_notifyFormulas; + context::CDHashSet d_notifyFormulas; /** Map from nodes to literals */ NodeToLiteralMap d_nodeToLiteralMap; diff --git a/src/prop/sat_proof_manager.cpp b/src/prop/sat_proof_manager.cpp index 5fdc0eb79..60a4c9704 100644 --- a/src/prop/sat_proof_manager.cpp +++ b/src/prop/sat_proof_manager.cpp @@ -330,8 +330,8 @@ void SatProofManager::processRedundantLit( !negated); } -void SatProofManager::explainLit( - SatLiteral lit, std::unordered_set& premises) +void SatProofManager::explainLit(SatLiteral lit, + std::unordered_set& premises) { Trace("sat-proof") << push << "SatProofManager::explainLit: Lit: " << lit; Node litNode = getClauseNode(lit); @@ -393,7 +393,7 @@ void SatProofManager::explainLit( { continue; } - std::unordered_set childPremises; + std::unordered_set childPremises; explainLit(~currLit, childPremises); // save to resolution chain premises / arguments Assert(d_cnfStream->getNodeCache().find(currLit) @@ -462,7 +462,7 @@ void SatProofManager::finalizeProof(Node inConflictNode, Trace("sat-proof-debug2") << push << "SatProofManager::finalizeProof: saved proofs in chain:\n"; std::map> links = d_resChains.getLinks(); - std::unordered_set skip; + std::unordered_set skip; for (const std::pair>& link : links) { if (skip.count(link.first)) @@ -546,12 +546,12 @@ void SatProofManager::finalizeProof(Node inConflictNode, // we call explainLit on each ~l_i while accumulating the children and // arguments for the resolution step to conclude false. std::vector children{inConflictNode}, args; - std::unordered_set premises; + std::unordered_set premises; for (unsigned i = 0, size = inConflict.size(); i < size; ++i) { Assert(d_cnfStream->getNodeCache().find(inConflict[i]) != d_cnfStream->getNodeCache().end()); - std::unordered_set childPremises; + std::unordered_set childPremises; explainLit(~inConflict[i], childPremises); Node negatedLitNode = d_cnfStream->getNodeCache()[~inConflict[i]]; // save to resolution chain premises / arguments @@ -659,7 +659,7 @@ void SatProofManager::finalizeProof(Node inConflictNode, // mark another iteration for the loop, as some resolution link may be // connected because of the new justifications expanded = true; - std::unordered_set childPremises; + std::unordered_set childPremises; explainLit(it->second, childPremises); // add the premises used in the justification. We know they will have // been as expanded as possible diff --git a/src/prop/sat_proof_manager.h b/src/prop/sat_proof_manager.h index 8f2923981..a53f66cec 100644 --- a/src/prop/sat_proof_manager.h +++ b/src/prop/sat_proof_manager.h @@ -493,8 +493,7 @@ class SatProofManager * have been used as premises of resolution steps while explaining * propagations */ - void explainLit(prop::SatLiteral lit, - std::unordered_set& premises); + void explainLit(prop::SatLiteral lit, std::unordered_set& premises); /** Build refutation proof starting from conflict clause * @@ -568,7 +567,7 @@ class SatProofManager /** All clauses added to the SAT solver, kept in a context-dependent manner. */ - context::CDHashSet d_assumptions; + context::CDHashSet d_assumptions; /** * A placeholder that may be used to store the literal with the final diff --git a/src/prop/skolem_def_manager.cpp b/src/prop/skolem_def_manager.cpp index 873a748ae..5b51d730c 100644 --- a/src/prop/skolem_def_manager.cpp +++ b/src/prop/skolem_def_manager.cpp @@ -52,7 +52,7 @@ void SkolemDefManager::notifyAsserted(TNode literal, std::vector& activatedSkolems, bool useDefs) { - std::unordered_set skolems; + std::unordered_set skolems; getSkolems(literal, skolems); for (const Node& k : skolems) { @@ -90,8 +90,8 @@ typedef expr::Attribute HasSkolemComputedAttr; bool SkolemDefManager::hasSkolems(TNode n) const { - std::unordered_set visited; - std::unordered_set::iterator it; + std::unordered_set visited; + std::unordered_set::iterator it; std::vector visit; TNode cur; visit.push_back(n); @@ -145,11 +145,11 @@ bool SkolemDefManager::hasSkolems(TNode n) const return n.getAttribute(HasSkolemAttr()); } -void SkolemDefManager::getSkolems( - TNode n, std::unordered_set& skolems) const +void SkolemDefManager::getSkolems(TNode n, + std::unordered_set& skolems) const { - std::unordered_set visited; - std::unordered_set::iterator it; + std::unordered_set visited; + std::unordered_set::iterator it; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/prop/skolem_def_manager.h b/src/prop/skolem_def_manager.h index 475f40c85..d3b59f895 100644 --- a/src/prop/skolem_def_manager.h +++ b/src/prop/skolem_def_manager.h @@ -41,8 +41,8 @@ namespace prop { */ class SkolemDefManager { - using NodeNodeMap = context::CDInsertHashMap; - using NodeSet = context::CDHashSet; + using NodeNodeMap = context::CDInsertHashMap; + using NodeSet = context::CDHashSet; public: SkolemDefManager(context::Context* context, @@ -81,8 +81,7 @@ class SkolemDefManager * @param n The node to traverse * @param skolems The set where the skolems are added */ - void getSkolems(TNode n, - std::unordered_set& skolems) const; + void getSkolems(TNode n, std::unordered_set& skolems) const; /** Does n have skolems having definitions managed by this class? */ bool hasSkolems(TNode n) const; diff --git a/src/prop/theory_proxy.cpp b/src/prop/theory_proxy.cpp index 090b44b90..b764695cc 100644 --- a/src/prop/theory_proxy.cpp +++ b/src/prop/theory_proxy.cpp @@ -217,7 +217,7 @@ void TheoryProxy::getSkolems(TNode node, std::vector& skAsserts, std::vector& sks) { - std::unordered_set skolems; + std::unordered_set skolems; d_skdm->getSkolems(node, skolems); for (const Node& k : skolems) { diff --git a/src/prop/theory_proxy.h b/src/prop/theory_proxy.h index bc834d205..afd99ae83 100644 --- a/src/prop/theory_proxy.h +++ b/src/prop/theory_proxy.h @@ -155,7 +155,7 @@ class TheoryProxy : public Registrar * Set of all lemmas that have been "shared" in the portfolio---i.e., * all imported and exported lemmas. */ - std::unordered_set d_shared; + std::unordered_set d_shared; /** The theory preprocessor */ theory::TheoryPreprocessor d_tpp; diff --git a/src/smt/abstract_values.h b/src/smt/abstract_values.h index 1c9069ed0..32cff9378 100644 --- a/src/smt/abstract_values.h +++ b/src/smt/abstract_values.h @@ -34,7 +34,8 @@ namespace smt { */ class AbstractValues { - typedef std::unordered_map NodeToNodeHashMap; + typedef std::unordered_map NodeToNodeHashMap; + public: AbstractValues(NodeManager* nm); ~AbstractValues(); diff --git a/src/smt/check_models.cpp b/src/smt/check_models.cpp index 3d5429635..0bc7ce99b 100644 --- a/src/smt/check_models.cpp +++ b/src/smt/check_models.cpp @@ -53,7 +53,7 @@ void CheckModels::checkModel(Model* m, theory::SubstitutionMap& sm = d_env.getTopLevelSubstitutions().get(); Trace("check-model") << "checkModel: Check assertions..." << std::endl; - std::unordered_map cache; + std::unordered_map cache; // the list of assertions that did not rewrite to true std::vector noCheckList; // Now go through all our user assertions checking if they're satisfied. diff --git a/src/smt/expand_definitions.cpp b/src/smt/expand_definitions.cpp index 349736d15..91287e5f9 100644 --- a/src/smt/expand_definitions.cpp +++ b/src/smt/expand_definitions.cpp @@ -42,17 +42,16 @@ ExpandDefs::ExpandDefs(Env& env, SmtEngineStatistics& stats) ExpandDefs::~ExpandDefs() {} -Node ExpandDefs::expandDefinitions( - TNode n, std::unordered_map& cache) +Node ExpandDefs::expandDefinitions(TNode n, + std::unordered_map& cache) { TrustNode trn = expandDefinitions(n, cache, nullptr); return trn.isNull() ? Node(n) : trn.getNode(); } -TrustNode ExpandDefs::expandDefinitions( - TNode n, - std::unordered_map& cache, - TConvProofGenerator* tpg) +TrustNode ExpandDefs::expandDefinitions(TNode n, + std::unordered_map& cache, + TConvProofGenerator* tpg) { const TNode orig = n; std::stack> worklist; @@ -87,8 +86,7 @@ TrustNode ExpandDefs::expandDefinitions( } // maybe it's in the cache - std::unordered_map::iterator cacheHit = - cache.find(n); + std::unordered_map::iterator cacheHit = cache.find(n); if (cacheHit != cache.end()) { TNode ret = (*cacheHit).second; diff --git a/src/smt/expand_definitions.h b/src/smt/expand_definitions.h index d4e591c31..801622e27 100644 --- a/src/smt/expand_definitions.h +++ b/src/smt/expand_definitions.h @@ -51,8 +51,7 @@ class ExpandDefs * @param cache Cache of previous results * @return The expanded term. */ - Node expandDefinitions( - TNode n, std::unordered_map& cache); + Node expandDefinitions(TNode n, std::unordered_map& cache); /** * Set proof node manager, which signals this class to enable proofs using the @@ -65,10 +64,9 @@ class ExpandDefs * Helper function for above, called to specify if we want proof production * based on the optional argument tpg. */ - theory::TrustNode expandDefinitions( - TNode n, - std::unordered_map& cache, - TConvProofGenerator* tpg); + theory::TrustNode expandDefinitions(TNode n, + std::unordered_map& cache, + TConvProofGenerator* tpg); /** Reference to the environment. */ Env& d_env; /** Reference to the SMT stats */ diff --git a/src/smt/model_blocker.cpp b/src/smt/model_blocker.cpp index 04613f848..cbc388331 100644 --- a/src/smt/model_blocker.cpp +++ b/src/smt/model_blocker.cpp @@ -72,9 +72,9 @@ Node ModelBlocker::getModelBlocker(const std::vector& assertions, } Node formula = asserts.size() > 1 ? nm->mkNode(AND, asserts) : asserts[0]; - std::unordered_map visited; - std::unordered_map implicant; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map implicant; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(formula); @@ -235,7 +235,7 @@ Node ModelBlocker::getModelBlocker(const std::vector& assertions, { Trace("model-blocker") << "no specific terms to block recognized" << std::endl; - std::unordered_set symbols; + std::unordered_set symbols; for (Node n : tlAsserts) { expr::getSymbols(n, symbols); @@ -253,7 +253,7 @@ Node ModelBlocker::getModelBlocker(const std::vector& assertions, // otherwise, block all terms that were specified in get-value else { - std::unordered_set terms; + std::unordered_set terms; for (Node n : nodesToBlock) { Node v = m->getValue(n); diff --git a/src/smt/model_core_builder.cpp b/src/smt/model_core_builder.cpp index 5b6df3c1a..0395a32fd 100644 --- a/src/smt/model_core_builder.cpp +++ b/src/smt/model_core_builder.cpp @@ -41,7 +41,7 @@ bool ModelCoreBuilder::setModelCore(const std::vector& assertions, std::vector vars; std::vector subs; Trace("model-core") << "Assignments: " << std::endl; - std::unordered_set visited; + std::unordered_set visited; std::vector visit; TNode cur; visit.push_back(formula); diff --git a/src/smt/preprocess_proof_generator.cpp b/src/smt/preprocess_proof_generator.cpp index ea5d28a23..3ae03e58f 100644 --- a/src/smt/preprocess_proof_generator.cpp +++ b/src/smt/preprocess_proof_generator.cpp @@ -126,7 +126,7 @@ std::shared_ptr PreprocessProofGenerator::getProofFor(Node f) << ") input " << f << std::endl; Node curr = f; std::vector transChildren; - std::unordered_set processed; + std::unordered_set processed; bool success; // we connect the proof of f to its source via the map d_src until we // discover that its source is a preprocessing lemma (a lemma stored in d_src) diff --git a/src/smt/preprocess_proof_generator.h b/src/smt/preprocess_proof_generator.h index d1373a9d3..140a7c91a 100644 --- a/src/smt/preprocess_proof_generator.h +++ b/src/smt/preprocess_proof_generator.h @@ -55,8 +55,7 @@ namespace smt { */ class PreprocessProofGenerator : public ProofGenerator { - typedef context::CDHashMap - NodeTrustNodeMap; + typedef context::CDHashMap NodeTrustNodeMap; public: /** diff --git a/src/smt/preprocessor.cpp b/src/smt/preprocessor.cpp index a222568d3..7406b922e 100644 --- a/src/smt/preprocessor.cpp +++ b/src/smt/preprocessor.cpp @@ -112,12 +112,12 @@ void Preprocessor::cleanup() { d_processor.cleanup(); } Node Preprocessor::expandDefinitions(const Node& n) { - std::unordered_map cache; + std::unordered_map cache; return expandDefinitions(n, cache); } -Node Preprocessor::expandDefinitions( - const Node& node, std::unordered_map& cache) +Node Preprocessor::expandDefinitions(const Node& node, + std::unordered_map& cache) { Trace("smt") << "SMT expandDefinitions(" << node << ")" << endl; // Substitute out any abstract values in node. diff --git a/src/smt/preprocessor.h b/src/smt/preprocessor.h index 4c60a2898..3a1f9f080 100644 --- a/src/smt/preprocessor.h +++ b/src/smt/preprocessor.h @@ -89,8 +89,7 @@ class Preprocessor */ Node expandDefinitions(const Node& n); /** Same as above, with a cache of previous results. */ - Node expandDefinitions( - const Node& n, std::unordered_map& cache); + Node expandDefinitions(const Node& n, std::unordered_map& cache); /** * Set proof node manager. Enables proofs in this preprocessor. */ diff --git a/src/smt/process_assertions.h b/src/smt/process_assertions.h index 3cdf8a463..80219eb3c 100644 --- a/src/smt/process_assertions.h +++ b/src/smt/process_assertions.h @@ -57,7 +57,7 @@ class ProcessAssertions { /** The types for the recursive function definitions */ typedef context::CDList NodeList; - typedef std::unordered_map NodeToBoolHashMap; + typedef std::unordered_map NodeToBoolHashMap; public: ProcessAssertions(SmtEngine& smt, diff --git a/src/smt/proof_post_processor.cpp b/src/smt/proof_post_processor.cpp index b36b00bd5..618cdebac 100644 --- a/src/smt/proof_post_processor.cpp +++ b/src/smt/proof_post_processor.cpp @@ -166,7 +166,7 @@ Node ProofPostprocessCallback::eliminateCrowdingLits( // get crowding lits and the position of the last clause that includes // them. The factoring step must be added after the last inclusion and before // its elimination. - std::unordered_set crowding; + std::unordered_set crowding; std::vector> lastInclusion; // positions of eliminators of crowding literals, which are the positions of // the clauses that eliminate crowding literals *after* their last inclusion @@ -752,7 +752,7 @@ Node ProofPostprocessCallback::expandMacros(PfRule id, // We build it rather than taking conclusionLits because the order may be // different std::vector factoredLits; - std::unordered_set clauseSet; + std::unordered_set clauseSet; for (size_t i = 0, size = chainConclusionLits.size(); i < size; ++i) { if (clauseSet.count(chainConclusionLits[i])) diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index 780ed78ce..67273f854 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -1330,7 +1330,7 @@ std::vector SmtEngine::getExpandedAssertions() std::vector easserts = getAssertions(); // must expand definitions std::vector eassertsProc; - std::unordered_map cache; + std::unordered_map cache; for (const Node& e : easserts) { Node eae = d_pp->expandDefinitions(e, cache); diff --git a/src/smt/smt_engine.h b/src/smt/smt_engine.h index 22316b872..924e3c974 100644 --- a/src/smt/smt_engine.h +++ b/src/smt/smt_engine.h @@ -37,7 +37,6 @@ template class NodeTemplate; typedef NodeTemplate Node; typedef NodeTemplate TNode; class TypeNode; -struct NodeHashFunction; class Env; class NodeManager; diff --git a/src/smt/sygus_solver.cpp b/src/smt/sygus_solver.cpp index 317bb2646..37d752230 100644 --- a/src/smt/sygus_solver.cpp +++ b/src/smt/sygus_solver.cpp @@ -285,7 +285,7 @@ void SygusSolver::checkSynthSolution(Assertions& as) } Trace("check-synth-sol") << "Got solution map:\n"; // the set of synthesis conjectures in our assertions - std::unordered_set conjs; + std::unordered_set conjs; // For each of the above conjectures, the functions-to-synthesis and their // solutions. This is used as a substitution below. std::map> fvarMap; @@ -317,7 +317,7 @@ void SygusSolver::checkSynthSolution(Assertions& as) // auxiliary assertions std::vector auxAssertions; // expand definitions cache - std::unordered_map cache; + std::unordered_map cache; for (Node assertion : *alist) { Notice() << "SygusSolver::checkSynthSolution(): checking assertion " diff --git a/src/smt/term_formula_removal.cpp b/src/smt/term_formula_removal.cpp index 823511b02..34ef53194 100644 --- a/src/smt/term_formula_removal.cpp +++ b/src/smt/term_formula_removal.cpp @@ -516,7 +516,7 @@ Node RemoveTermFormulas::runCurrent(std::pair& curr, Node RemoveTermFormulas::getSkolemForNode(Node k) const { - context::CDInsertHashMap::const_iterator itk = + context::CDInsertHashMap::const_iterator itk = d_skolem_cache.find(k); if (itk != d_skolem_cache.end()) { diff --git a/src/smt/term_formula_removal.h b/src/smt/term_formula_removal.h index 1eeed5543..6a3a1c019 100644 --- a/src/smt/term_formula_removal.h +++ b/src/smt/term_formula_removal.h @@ -127,7 +127,7 @@ class RemoveTermFormulas { typedef context::CDInsertHashMap< std::pair, Node, - PairHashFunction > + PairHashFunction>> TermFormulaCache; /** term formula removal cache * @@ -155,7 +155,7 @@ class RemoveTermFormulas { * d_skolem_cache[ite( G, a, b )] = k, and * d_tfCache[] = d_tfCache[] = k. */ - context::CDInsertHashMap d_skolem_cache; + context::CDInsertHashMap d_skolem_cache; /** gets the skolem for node * diff --git a/src/smt/witness_form.cpp b/src/smt/witness_form.cpp index c7e3d3280..8e998b9cf 100644 --- a/src/smt/witness_form.cpp +++ b/src/smt/witness_form.cpp @@ -66,7 +66,7 @@ Node WitnessFormGenerator::convertToWitnessForm(Node t) // trivial case return tw; } - std::unordered_set::iterator it; + std::unordered_set::iterator it; std::vector visit; TNode cur; TNode curw; @@ -123,8 +123,7 @@ bool WitnessFormGenerator::requiresWitnessFormIntro(Node t) const return !tr.isConst() || !tr.getConst(); } -const std::unordered_set& -WitnessFormGenerator::getWitnessFormEqs() const +const std::unordered_set& WitnessFormGenerator::getWitnessFormEqs() const { return d_eqs; } diff --git a/src/smt/witness_form.h b/src/smt/witness_form.h index be1c4e534..980cbcadb 100644 --- a/src/smt/witness_form.h +++ b/src/smt/witness_form.h @@ -72,7 +72,7 @@ class WitnessFormGenerator : public ProofGenerator * where k is a skolem, containing all rewrite steps used in calls to * getProofFor during the entire lifetime of this generator. */ - const std::unordered_set& getWitnessFormEqs() const; + const std::unordered_set& getWitnessFormEqs() const; private: /** @@ -88,9 +88,9 @@ class WitnessFormGenerator : public ProofGenerator /** The term conversion proof generator */ TConvProofGenerator d_tcpg; /** The nodes we have already added rewrite steps for in d_tcpg */ - std::unordered_set d_visited; + std::unordered_set d_visited; /** The set of equalities added as proof steps */ - std::unordered_set d_eqs; + std::unordered_set d_eqs; /** Lazy proof storing witness intro steps */ LazyCDProof d_wintroPf; /** CDProof for justifying purification existentials */ diff --git a/src/smt_util/nary_builder.h b/src/smt_util/nary_builder.h index b1a5ef2d8..7af0f95a0 100644 --- a/src/smt_util/nary_builder.h +++ b/src/smt_util/nary_builder.h @@ -49,7 +49,7 @@ private: Node case_assoccomm(TNode n); Node case_other(TNode n); - typedef std::unordered_map NodeMap; + typedef std::unordered_map NodeMap; NodeMap d_cache; };/* class RePairAssocCommutativeOperators */ diff --git a/src/theory/arith/arith_ite_utils.h b/src/theory/arith/arith_ite_utils.h index 4d181b39f..ed7f54182 100644 --- a/src/theory/arith/arith_ite_utils.h +++ b/src/theory/arith/arith_ite_utils.h @@ -48,7 +48,7 @@ class ArithIteUtils { SubstitutionMap* d_subs; TheoryModel* d_model; - typedef std::unordered_map NodeMap; + typedef std::unordered_map NodeMap; // cache for reduce vars NodeMap d_reduceVar; // if reduceVars[n].isNull(), treat reduceVars[n] == n @@ -58,13 +58,13 @@ class ArithIteUtils { NodeMap d_reduceGcd; - typedef std::unordered_map NodeIntegerMap; + typedef std::unordered_map NodeIntegerMap; NodeIntegerMap d_gcds; Integer d_one; context::CDO d_subcount; - typedef context::CDInsertHashMap CDNodeMap; + typedef context::CDInsertHashMap CDNodeMap; CDNodeMap d_skolems; typedef std::map > ImpMap; diff --git a/src/theory/arith/arith_preprocess.cpp b/src/theory/arith/arith_preprocess.cpp index d5533de24..6ab399348 100644 --- a/src/theory/arith/arith_preprocess.cpp +++ b/src/theory/arith/arith_preprocess.cpp @@ -39,8 +39,7 @@ TrustNode ArithPreprocess::eliminate(TNode n, bool ArithPreprocess::reduceAssertion(TNode atom) { - context::CDHashMap::const_iterator it = - d_reduced.find(atom); + context::CDHashMap::const_iterator it = d_reduced.find(atom); if (it != d_reduced.end()) { // already computed @@ -70,8 +69,7 @@ bool ArithPreprocess::reduceAssertion(TNode atom) bool ArithPreprocess::isReduced(TNode atom) const { - context::CDHashMap::const_iterator it = - d_reduced.find(atom); + context::CDHashMap::const_iterator it = d_reduced.find(atom); if (it == d_reduced.end()) { return false; diff --git a/src/theory/arith/arith_preprocess.h b/src/theory/arith/arith_preprocess.h index 63b4515e7..a537c33c7 100644 --- a/src/theory/arith/arith_preprocess.h +++ b/src/theory/arith/arith_preprocess.h @@ -83,7 +83,7 @@ class ArithPreprocess /** The operator elimination utility */ OperatorElim& d_opElim; /** The set of assertions that were reduced */ - context::CDHashMap d_reduced; + context::CDHashMap d_reduced; }; } // namespace arith diff --git a/src/theory/arith/arith_static_learner.h b/src/theory/arith/arith_static_learner.h index 7ff674b25..7c6bfc47b 100644 --- a/src/theory/arith/arith_static_learner.h +++ b/src/theory/arith/arith_static_learner.h @@ -39,9 +39,9 @@ private: /** * Map from a node to it's minimum and maximum. */ - typedef context::CDHashMap CDNodeToMinMaxMap; - CDNodeToMinMaxMap d_minMap; - CDNodeToMinMaxMap d_maxMap; + typedef context::CDHashMap CDNodeToMinMaxMap; + CDNodeToMinMaxMap d_minMap; + CDNodeToMinMaxMap d_maxMap; public: ArithStaticLearner(context::Context* userContext); diff --git a/src/theory/arith/arith_utilities.cpp b/src/theory/arith/arith_utilities.cpp index 81968fc13..75edc49f5 100644 --- a/src/theory/arith/arith_utilities.cpp +++ b/src/theory/arith/arith_utilities.cpp @@ -207,8 +207,8 @@ Node arithSubstitute(Node n, std::vector& vars, std::vector& subs) { Assert(vars.size() == subs.size()); NodeManager* nm = NodeManager::currentNM(); - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector::iterator itv; std::vector visit; TNode cur; diff --git a/src/theory/arith/arith_utilities.h b/src/theory/arith/arith_utilities.h index 0c6378bc2..6617fccb0 100644 --- a/src/theory/arith/arith_utilities.h +++ b/src/theory/arith/arith_utilities.h @@ -34,12 +34,12 @@ namespace theory { namespace arith { //Sets of Nodes -typedef std::unordered_set NodeSet; -typedef std::unordered_set TNodeSet; -typedef context::CDHashSet CDNodeSet; +typedef std::unordered_set NodeSet; +typedef std::unordered_set TNodeSet; +typedef context::CDHashSet CDNodeSet; //Maps from Nodes -> ArithVars, and vice versa -typedef std::unordered_map NodeToArithVarMap; +typedef std::unordered_map NodeToArithVarMap; typedef DenseMap ArithVarToNodeMap; inline Node mkRationalNode(const Rational& q){ diff --git a/src/theory/arith/congruence_manager.h b/src/theory/arith/congruence_manager.h index 6032adcc8..e45b7bf29 100644 --- a/src/theory/arith/congruence_manager.h +++ b/src/theory/arith/congruence_manager.h @@ -101,7 +101,7 @@ private: * This is node is potentially both the propagation or * Rewriter::rewrite(propagation). */ - typedef context::CDHashMap ExplainMap; + typedef context::CDHashMap ExplainMap; ExplainMap d_explanationMap; ConstraintDatabase& d_constraintDatabase; diff --git a/src/theory/arith/constraint.h b/src/theory/arith/constraint.h index ecd5b10fb..0d3c96f89 100644 --- a/src/theory/arith/constraint.h +++ b/src/theory/arith/constraint.h @@ -156,7 +156,7 @@ enum ConstraintType {LowerBound, Equality, UpperBound, Disequality}; typedef context::CDList CDConstraintList; -typedef std::unordered_map NodetoConstraintMap; +typedef std::unordered_map NodetoConstraintMap; typedef size_t ConstraintRuleID; static const ConstraintRuleID ConstraintRuleIdSentinel = std::numeric_limits::max(); diff --git a/src/theory/arith/dio_solver.cpp b/src/theory/arith/dio_solver.cpp index 1cd092abc..19bd2f2bf 100644 --- a/src/theory/arith/dio_solver.cpp +++ b/src/theory/arith/dio_solver.cpp @@ -294,7 +294,7 @@ bool DioSolver::queueEmpty() const{ } Node DioSolver::columnGcdIsOne() const{ - std::unordered_map gcdMap; + std::unordered_map gcdMap; std::deque::const_iterator iter, end; for(iter = d_currentF.begin(), end = d_currentF.end(); iter != end; ++iter){ diff --git a/src/theory/arith/dio_solver.h b/src/theory/arith/dio_solver.h index 0fac563bb..8f2411036 100644 --- a/src/theory/arith/dio_solver.h +++ b/src/theory/arith/dio_solver.h @@ -68,7 +68,8 @@ private: * We maintain a map from the variables associated with proofs to an input constraint. * These variables can then be used in polynomial manipulations. */ - typedef std::unordered_map NodeToInputConstraintIndexMap; + typedef std::unordered_map + NodeToInputConstraintIndexMap; NodeToInputConstraintIndexMap d_varToInputConstraintMap; Node proofVariableToReason(const Variable& v) const{ diff --git a/src/theory/arith/inference_manager.h b/src/theory/arith/inference_manager.h index 287b89851..7e103797e 100644 --- a/src/theory/arith/inference_manager.h +++ b/src/theory/arith/inference_manager.h @@ -43,7 +43,7 @@ class TheoryArith; */ class InferenceManager : public InferenceManagerBuffered { - using NodeSet = context::CDHashSet; + using NodeSet = context::CDHashSet; public: InferenceManager(TheoryArith& ta, ArithState& astate, ProofNodeManager* pnm); diff --git a/src/theory/arith/nl/ext/ext_state.h b/src/theory/arith/nl/ext/ext_state.h index b2279344d..b0a4fd859 100644 --- a/src/theory/arith/nl/ext/ext_state.h +++ b/src/theory/arith/nl/ext/ext_state.h @@ -86,7 +86,7 @@ struct ExtState // ( x*y, x*z, y ) for each pair of monomials ( x*y, x*z ) with common factors std::map > d_mono_diff; /** the set of monomials we should apply tangent planes to */ - std::unordered_set d_tplane_refine; + std::unordered_set d_tplane_refine; }; } // namespace nl diff --git a/src/theory/arith/nl/ext/monomial_check.cpp b/src/theory/arith/nl/ext/monomial_check.cpp index 6df35c71d..404916453 100644 --- a/src/theory/arith/nl/ext/monomial_check.cpp +++ b/src/theory/arith/nl/ext/monomial_check.cpp @@ -238,7 +238,7 @@ void MonomialCheck::checkMagnitude(unsigned c) Trace("nl-ext-comp") << "Compute redundancies for " << lemmas.size() << " lemmas." << std::endl; // naive - std::unordered_set r_lemmas; + std::unordered_set r_lemmas; for (std::map > >::iterator itb = cmp_infers.begin(); itb != cmp_infers.end(); diff --git a/src/theory/arith/nl/ext/split_zero_check.h b/src/theory/arith/nl/ext/split_zero_check.h index b42c7932d..c50737d51 100644 --- a/src/theory/arith/nl/ext/split_zero_check.h +++ b/src/theory/arith/nl/ext/split_zero_check.h @@ -40,7 +40,7 @@ class SplitZeroCheck void check(); private: - using NodeSet = context::CDHashSet; + using NodeSet = context::CDHashSet; /** Basic data that is shared with other checks */ ExtState* d_data; diff --git a/src/theory/arith/nl/iand_solver.h b/src/theory/arith/nl/iand_solver.h index 676390478..c80edbeb3 100644 --- a/src/theory/arith/nl/iand_solver.h +++ b/src/theory/arith/nl/iand_solver.h @@ -39,7 +39,7 @@ class NlModel; */ class IAndSolver { - typedef context::CDHashSet NodeSet; + typedef context::CDHashSet NodeSet; public: IAndSolver(InferenceManager& im, ArithState& state, NlModel& model); diff --git a/src/theory/arith/nl/icp/icp_solver.cpp b/src/theory/arith/nl/icp/icp_solver.cpp index 6e96cfe7b..9cd74883b 100644 --- a/src/theory/arith/nl/icp/icp_solver.cpp +++ b/src/theory/arith/nl/icp/icp_solver.cpp @@ -67,7 +67,7 @@ inline std::ostream& operator<<(std::ostream& os, const IAWrapper& iaw) std::vector ICPSolver::collectVariables(const Node& n) const { - std::unordered_set tmp; + std::unordered_set tmp; expr::getVariables(n, tmp); std::vector res; for (const auto& t : tmp) @@ -93,7 +93,7 @@ std::vector ICPSolver::constructCandidates(const Node& n) auto poly = std::get<0>(comp); std::vector result; - std::unordered_set vars; + std::unordered_set vars; expr::getVariables(n, vars); for (const auto& v : vars) { diff --git a/src/theory/arith/nl/nl_model.cpp b/src/theory/arith/nl/nl_model.cpp index 9b1246f67..ed4a5318f 100644 --- a/src/theory/arith/nl/nl_model.cpp +++ b/src/theory/arith/nl/nl_model.cpp @@ -242,7 +242,7 @@ bool NlModel::checkModel(const std::vector& assertions, // all remaining variables are constrained to their exact model values Trace("nl-ext-cm-debug") << " set exact bounds for remaining variables..." << std::endl; - std::unordered_set visited; + std::unordered_set visited; std::vector visit; TNode cur; for (const Node& a : assertions) @@ -479,10 +479,10 @@ bool NlModel::solveEqualitySimple(Node eq, NodeManager* nm = NodeManager::currentNM(); // the list of variables that occur as a monomial in msum, and whose value // is so far unconstrained in the model. - std::unordered_set unc_vars; + std::unordered_set unc_vars; // the list of variables that occur as a factor in a monomial, and whose // value is so far unconstrained in the model. - std::unordered_set unc_vars_factor; + std::unordered_set unc_vars_factor; for (std::pair& m : msum) { Node v = m.first; @@ -797,7 +797,7 @@ bool NlModel::simpleCheckModelLit(Node lit) Trace("nl-ext-cms-debug") << "* Try univariate quadratic analysis..." << std::endl; std::vector vs_invalid; - std::unordered_set vs; + std::unordered_set vs; std::map v_a; std::map v_b; // get coefficients... diff --git a/src/theory/arith/nl/nl_model.h b/src/theory/arith/nl/nl_model.h index 600dbd02c..acf5ee7f5 100644 --- a/src/theory/arith/nl/nl_model.h +++ b/src/theory/arith/nl/nl_model.h @@ -322,7 +322,7 @@ class NlModel * These literals are exempt from check-model, since they are satisfied by * definition of our model construction. */ - std::unordered_map d_check_model_solved; + std::unordered_map d_check_model_solved; /** did we use an approximation on this call to last-call effort? */ bool d_used_approx; }; /* class NlModel */ diff --git a/src/theory/arith/nl/nonlinear_extension.cpp b/src/theory/arith/nl/nonlinear_extension.cpp index a3b32c6e9..8221e18d5 100644 --- a/src/theory/arith/nl/nonlinear_extension.cpp +++ b/src/theory/arith/nl/nonlinear_extension.cpp @@ -123,7 +123,7 @@ void NonlinearExtension::getAssertions(std::vector& assertions) BoundInference bounds; - std::unordered_set init_assertions; + std::unordered_set init_assertions; for (Theory::assertions_iterator it = d_containing.facts_begin(); it != d_containing.facts_end(); diff --git a/src/theory/arith/nl/nonlinear_extension.h b/src/theory/arith/nl/nonlinear_extension.h index e39f97402..4e029be7c 100644 --- a/src/theory/arith/nl/nonlinear_extension.h +++ b/src/theory/arith/nl/nonlinear_extension.h @@ -80,7 +80,7 @@ class NlLemma; */ class NonlinearExtension { - typedef context::CDHashSet NodeSet; + typedef context::CDHashSet NodeSet; public: NonlinearExtension(TheoryArith& containing, diff --git a/src/theory/arith/nl/transcendental/transcendental_solver.cpp b/src/theory/arith/nl/transcendental/transcendental_solver.cpp index 62d101686..0d5e5ad04 100644 --- a/src/theory/arith/nl/transcendental/transcendental_solver.cpp +++ b/src/theory/arith/nl/transcendental/transcendental_solver.cpp @@ -291,8 +291,7 @@ bool TranscendentalSolver::checkTfTangentPlanesFun(Node tf, unsigned d) // compute the concavity int region = -1; - std::unordered_map::iterator itr = - d_tstate.d_tf_region.find(tf); + std::unordered_map::iterator itr = d_tstate.d_tf_region.find(tf); if (itr != d_tstate.d_tf_region.end()) { region = itr->second; diff --git a/src/theory/arith/nl/transcendental/transcendental_state.h b/src/theory/arith/nl/transcendental/transcendental_state.h index f98986fad..74f005294 100644 --- a/src/theory/arith/nl/transcendental/transcendental_state.h +++ b/src/theory/arith/nl/transcendental/transcendental_state.h @@ -201,7 +201,7 @@ struct TranscendentalState * arguments that contain transcendental functions. */ std::map d_trMaster; - std::map> d_trSlaves; + std::map> d_trSlaves; /** concavity region for transcendental functions * @@ -223,7 +223,7 @@ struct TranscendentalState * of transcendental functions whose arguments have model * values that reside in valid regions. */ - std::unordered_map d_tf_region; + std::unordered_map d_tf_region; /** * Maps representives of a congruence class to the members of that class. * @@ -253,9 +253,7 @@ struct TranscendentalState * each transcendental function application. We store this set for each * Taylor degree. */ - std::unordered_map>, - NodeHashFunction> + std::unordered_map>> d_secant_points; /** PI diff --git a/src/theory/arith/theory_arith_private.cpp b/src/theory/arith/theory_arith_private.cpp index ce8e2393b..508362158 100644 --- a/src/theory/arith/theory_arith_private.cpp +++ b/src/theory/arith/theory_arith_private.cpp @@ -3975,7 +3975,7 @@ void TheoryArithPrivate::collectModelValues(const std::set& termSet, // Delta lasts at least the duration of the function call const Rational& delta = d_partialModel.getDelta(); - std::unordered_set shared = d_containing.currentlySharedTerms(); + std::unordered_set shared = d_containing.currentlySharedTerms(); // TODO: // This is not very good for user push/pop.... @@ -4446,7 +4446,7 @@ bool TheoryArithPrivate::tryToPropagate(RowIndex ridx, bool rowUp, ArithVar v, b Node flattenImplication(Node imp){ NodeBuilder nb(kind::OR); - std::unordered_set included; + std::unordered_set included; Node left = imp[0]; Node right = imp[1]; diff --git a/src/theory/arith/theory_arith_private.h b/src/theory/arith/theory_arith_private.h index e23451167..e029e3c41 100644 --- a/src/theory/arith/theory_arith_private.h +++ b/src/theory/arith/theory_arith_private.h @@ -193,8 +193,8 @@ private: * A superset of all of the assertions that currently are not the literal for * their constraint do not match constraint literals. Not just the witnesses. */ - context::CDInsertHashMap d_assertionsThatDoNotMatchTheirLiterals; - + context::CDInsertHashMap + d_assertionsThatDoNotMatchTheirLiterals; /** Returns true if x is of type Integer. */ inline bool isInteger(ArithVar x) const { @@ -267,8 +267,7 @@ private: /** * Contains all nodes that have been preregistered */ - context::CDHashSet d_preregisteredNodes; - + context::CDHashSet d_preregisteredNodes; /** * Manages information about the assignment and upper and lower bounds on diff --git a/src/theory/arrays/array_info.h b/src/theory/arrays/array_info.h index 15f27eb96..42c6e7387 100644 --- a/src/theory/arrays/array_info.h +++ b/src/theory/arrays/array_info.h @@ -86,8 +86,7 @@ public: } };/* class Info */ - -typedef std::unordered_map CNodeInfoMap; +typedef std::unordered_map CNodeInfoMap; /** * Class keeping track of the following information for canonical diff --git a/src/theory/arrays/theory_arrays.cpp b/src/theory/arrays/theory_arrays.cpp index e887feccb..9b5676d65 100644 --- a/src/theory/arrays/theory_arrays.cpp +++ b/src/theory/arrays/theory_arrays.cpp @@ -551,7 +551,7 @@ void TheoryArrays::weakEquivMakeRepIndex(TNode node) { } void TheoryArrays::weakEquivAddSecondary(TNode index, TNode arrayFrom, TNode arrayTo, TNode reason) { - std::unordered_set marked; + std::unordered_set marked; vector index_trail; vector::iterator it, iend; Node equivalence_trail = reason; @@ -1043,7 +1043,8 @@ bool TheoryArrays::collectModelValues(TheoryModel* m, std::vector arrays; eq::EqClassesIterator eqcs_i = eq::EqClassesIterator(d_equalityEngine); - for (; !eqcs_i.isFinished(); ++eqcs_i) { + for (; !eqcs_i.isFinished(); ++eqcs_i) + { Node eqc = (*eqcs_i); if (!eqc.getType().isArray()) { @@ -1051,9 +1052,11 @@ bool TheoryArrays::collectModelValues(TheoryModel* m, continue; } eq::EqClassIterator eqc_i = eq::EqClassIterator(eqc, d_equalityEngine); - for (; !eqc_i.isFinished(); ++eqc_i) { + for (; !eqc_i.isFinished(); ++eqc_i) + { Node n = *eqc_i; - // If this EC is an array type and it contains something other than STORE nodes, we have to compute a representative explicitly + // If this EC is an array type and it contains something other than STORE + // nodes, we have to compute a representative explicitly if (termSet.find(n) != termSet.end()) { if (n.getKind() != kind::STORE) @@ -1068,10 +1071,13 @@ bool TheoryArrays::collectModelValues(TheoryModel* m, // Build a list of all the relevant reads, indexed by the store representative std::map > selects; set::iterator set_it = termSet.begin(), set_it_end = termSet.end(); - for (; set_it != set_it_end; ++set_it) { + for (; set_it != set_it_end; ++set_it) + { Node n = *set_it; - // If this term is a select, record that the EC rep of its store parameter is being read from using this term - if (n.getKind() == kind::SELECT) { + // If this term is a select, record that the EC rep of its store parameter + // is being read from using this term + if (n.getKind() == kind::SELECT) + { selects[d_equalityEngine->getRepresentative(n[0])].push_back(n); } } @@ -1081,71 +1087,82 @@ bool TheoryArrays::collectModelValues(TheoryModel* m, TypeSet defaultValuesSet; // Compute all default values already in use - //if (fullModel) { - for (size_t i=0; igetRepresentative(arrays[i]); - d_mayEqualEqualityEngine.addTerm(nrep); // add the term in case it isn't there already - TNode mayRep = d_mayEqualEqualityEngine.getRepresentative(nrep); - it = d_defValues.find(mayRep); - if (it != d_defValues.end()) { - defaultValuesSet.add(nrep.getType().getArrayConstituentType(), (*it).second); - } + // if (fullModel) { + for (size_t i = 0; i < arrays.size(); ++i) + { + TNode nrep = d_equalityEngine->getRepresentative(arrays[i]); + d_mayEqualEqualityEngine.addTerm( + nrep); // add the term in case it isn't there already + TNode mayRep = d_mayEqualEqualityEngine.getRepresentative(nrep); + it = d_defValues.find(mayRep); + if (it != d_defValues.end()) + { + defaultValuesSet.add(nrep.getType().getArrayConstituentType(), + (*it).second); } + } //} - // Loop through all array equivalence classes that need a representative computed - for (size_t i = 0; i < arrays.size(); ++i) + // Loop through all array equivalence classes that need a representative + // computed + for (size_t i = 0; i < arrays.size(); ++i) + { + TNode n = arrays[i]; + TNode nrep = d_equalityEngine->getRepresentative(n); + + // if (fullModel) { + // Compute default value for this array - there is one default value for + // every mayEqual equivalence class + TNode mayRep = d_mayEqualEqualityEngine.getRepresentative(nrep); + it = d_defValues.find(mayRep); + // If this mayEqual EC doesn't have a default value associated, get the next + // available default value for the associated array element type + if (it == d_defValues.end()) { - TNode n = arrays[i]; - TNode nrep = d_equalityEngine->getRepresentative(n); - - // if (fullModel) { - // Compute default value for this array - there is one default value for - // every mayEqual equivalence class - TNode mayRep = d_mayEqualEqualityEngine.getRepresentative(nrep); - it = d_defValues.find(mayRep); - // If this mayEqual EC doesn't have a default value associated, get the next available default value for the associated array element type - if (it == d_defValues.end()) { - TypeNode valueType = nrep.getType().getArrayConstituentType(); - rep = defaultValuesSet.nextTypeEnum(valueType); - if (rep.isNull()) { - Assert(defaultValuesSet.getSet(valueType)->begin() - != defaultValuesSet.getSet(valueType)->end()); - rep = *(defaultValuesSet.getSet(valueType)->begin()); - } - Trace("arrays-models") << "New default value = " << rep << endl; - d_defValues[mayRep] = rep; - } - else { - rep = (*it).second; + TypeNode valueType = nrep.getType().getArrayConstituentType(); + rep = defaultValuesSet.nextTypeEnum(valueType); + if (rep.isNull()) + { + Assert(defaultValuesSet.getSet(valueType)->begin() + != defaultValuesSet.getSet(valueType)->end()); + rep = *(defaultValuesSet.getSet(valueType)->begin()); } + Trace("arrays-models") << "New default value = " << rep << endl; + d_defValues[mayRep] = rep; + } + else + { + rep = (*it).second; + } - // Build the STORE_ALL term with the default value - rep = nm->mkConst(ArrayStoreAll(nrep.getType(), rep)); - /* + // Build the STORE_ALL term with the default value + rep = nm->mkConst(ArrayStoreAll(nrep.getType(), rep)); + /* + } + else { + std::unordered_map::iterator it = d_skolemCache.find(n); + if (it == d_skolemCache.end()) { + rep = nm->mkSkolem("array_collect_model_var", n.getType(), "base model + variable for array collectModelInfo"); d_skolemCache[n] = rep; } else { - std::unordered_map::iterator it = d_skolemCache.find(n); - if (it == d_skolemCache.end()) { - rep = nm->mkSkolem("array_collect_model_var", n.getType(), "base model variable for array collectModelInfo"); - d_skolemCache[n] = rep; - } - else { - rep = (*it).second; - } + rep = (*it).second; } + } */ // For each read, require that the rep stores the right value vector& reads = selects[nrep]; - for (unsigned j = 0; j < reads.size(); ++j) { + for (unsigned j = 0; j < reads.size(); ++j) + { rep = nm->mkNode(kind::STORE, rep, reads[j][1], reads[j]); } if (!m->assertEquality(n, rep, true)) { return false; } - if (!n.isConst()) { + if (!n.isConst()) + { m->assertSkeleton(rep); } } @@ -1181,7 +1198,7 @@ Node TheoryArrays::getSkolem(TNode ref) // the call to SkolemCache::getExtIndexSkolem should be deterministic, but use // cache anyways for now Node skolem; - std::unordered_map::iterator it = d_skolemCache.find(ref); + std::unordered_map::iterator it = d_skolemCache.find(ref); if (it == d_skolemCache.end()) { Assert(ref.getKind() == kind::NOT && ref[0].getKind() == kind::EQUAL); // make the skolem using the skolem cache utility diff --git a/src/theory/arrays/theory_arrays.h b/src/theory/arrays/theory_arrays.h index f9813cd3f..c85b382e4 100644 --- a/src/theory/arrays/theory_arrays.h +++ b/src/theory/arrays/theory_arrays.h @@ -215,7 +215,7 @@ class TheoryArrays : public Theory { void explain(TNode literal, Node& exp); /** For debugging only- checks invariants about when things are preregistered*/ - context::CDHashSet d_isPreRegistered; + context::CDHashSet d_isPreRegistered; /** Helper for preRegisterTerm, also used internally */ void preRegisterTermInternal(TNode n); @@ -374,7 +374,7 @@ class TheoryArrays : public Theory { context::CDQueue d_RowQueue; context::CDHashSet d_RowAlreadyAdded; - typedef context::CDHashSet CDNodeSet; + typedef context::CDHashSet CDNodeSet; CDNodeSet d_sharedArrays; CDNodeSet d_sharedOther; @@ -384,7 +384,7 @@ class TheoryArrays : public Theory { // When a new read term is created, we check the index to see if we know the model value. If so, we add it to d_constReads (and d_constReadsList) // If not, we push it onto d_reads and figure out where it goes at computeCareGraph time. // d_constReadsList is used as a backup in case we can't compute the model at computeCareGraph time. - typedef std::unordered_map CNodeNListMap; + typedef std::unordered_map CNodeNListMap; CNodeNListMap d_constReads; context::CDList d_reads; context::CDList d_constReadsList; @@ -410,7 +410,7 @@ class TheoryArrays : public Theory { };/* class ContextPopper */ ContextPopper d_contextPopper; - std::unordered_map d_skolemCache; + std::unordered_map d_skolemCache; context::CDO d_skolemIndex; std::vector d_skolemAssertions; @@ -420,11 +420,11 @@ class TheoryArrays : public Theory { // List of nodes that need permanent references in this context context::CDList d_permRef; context::CDList d_modelConstraints; - context::CDHashSet d_lemmasSaved; + context::CDHashSet d_lemmasSaved; std::vector d_lemmas; // Default values for each mayEqual equivalence class - typedef context::CDHashMap DefValMap; + typedef context::CDHashMap DefValMap; DefValMap d_defValues; typedef std::unordered_map, CTNodeList*, TNodePairHashFunction> ReadBucketMap; diff --git a/src/theory/arrays/theory_arrays_rewriter.cpp b/src/theory/arrays/theory_arrays_rewriter.cpp index 6269cb5dd..8ad7a5f95 100644 --- a/src/theory/arrays/theory_arrays_rewriter.cpp +++ b/src/theory/arrays/theory_arrays_rewriter.cpp @@ -177,9 +177,9 @@ Node TheoryArraysRewriter::normalizeConstant(TNode node, Cardinality indexCard) // Bad case: have to recompute value counts and/or possibly switch out // default value store = n; - std::unordered_set indexSet; - std::unordered_map elementsMap; - std::unordered_map::iterator it; + std::unordered_set indexSet; + std::unordered_map elementsMap; + std::unordered_map::iterator it; uint32_t count; uint32_t max = 0; TNode maxValue; diff --git a/src/theory/arrays/union_find.cpp b/src/theory/arrays/union_find.cpp index 19ae573d8..5abc752d6 100644 --- a/src/theory/arrays/union_find.cpp +++ b/src/theory/arrays/union_find.cpp @@ -45,9 +45,9 @@ void UnionFind::notify() { // The following declarations allow us to put functions in the .cpp file // instead of the header, since we know which instantiations are needed. -template void UnionFind::notify(); +template void UnionFind>::notify(); -template void UnionFind::notify(); +template void UnionFind>::notify(); } // namespace arrays } // namespace theory diff --git a/src/theory/atom_requests.h b/src/theory/atom_requests.h index 0d2bf0bb4..63d66f200 100644 --- a/src/theory/atom_requests.h +++ b/src/theory/atom_requests.h @@ -105,7 +105,7 @@ private: /** We index the requests in this vector, it's a list */ context::CDList d_requests; - typedef context::CDHashMap trigger_to_list_map; + typedef context::CDHashMap trigger_to_list_map; /** Map from triggers, to the list of elements they trigger */ trigger_to_list_map d_triggerToRequestMap; diff --git a/src/theory/bags/inference_manager.h b/src/theory/bags/inference_manager.h index a74515d37..5ce05baba 100644 --- a/src/theory/bags/inference_manager.h +++ b/src/theory/bags/inference_manager.h @@ -35,7 +35,7 @@ class SolverState; */ class InferenceManager : public InferenceManagerBuffered { - typedef context::CDHashSet NodeSet; + typedef context::CDHashSet NodeSet; public: InferenceManager(Theory& t, SolverState& s, ProofNodeManager* pnm); diff --git a/src/theory/bags/make_bag_op.cpp b/src/theory/bags/make_bag_op.cpp index ed3d4cf26..c03b21236 100644 --- a/src/theory/bags/make_bag_op.cpp +++ b/src/theory/bags/make_bag_op.cpp @@ -28,7 +28,7 @@ std::ostream& operator<<(std::ostream& out, const MakeBagOp& op) size_t MakeBagOpHashFunction::operator()(const MakeBagOp& op) const { - return TypeNodeHashFunction()(op.getType()); + return std::hash()(op.getType()); } MakeBagOp::MakeBagOp(const TypeNode& elementType) diff --git a/src/theory/bags/term_registry.h b/src/theory/bags/term_registry.h index 6255f3b00..2b0218fdf 100644 --- a/src/theory/bags/term_registry.h +++ b/src/theory/bags/term_registry.h @@ -36,7 +36,7 @@ class SolverState; */ class TermRegistry { - typedef context::CDHashMap NodeMap; + typedef context::CDHashMap NodeMap; public: TermRegistry(SolverState& state, InferenceManager& im); diff --git a/src/theory/booleans/circuit_propagator.h b/src/theory/booleans/circuit_propagator.h index 443be0ec7..1d4f6e9ee 100644 --- a/src/theory/booleans/circuit_propagator.h +++ b/src/theory/booleans/circuit_propagator.h @@ -63,8 +63,7 @@ class CircuitPropagator ASSIGNED_TO_FALSE, }; - typedef std::unordered_map, NodeHashFunction> - BackEdgesMap; + typedef std::unordered_map> BackEdgesMap; /** * Construct a new CircuitPropagator. @@ -172,8 +171,7 @@ class CircuitPropagator /** * Assignment status of each node. */ - typedef context::CDHashMap - AssignmentMap; + typedef context::CDHashMap AssignmentMap; /** * Assign Node in circuit with the value and add it to the queue; note @@ -245,7 +243,7 @@ class CircuitPropagator /** Nodes that have been attached already (computed forward edges for) */ // All the nodes we've visited so far - context::CDHashSet d_seen; + context::CDHashSet d_seen; AssignmentMap d_state; diff --git a/src/theory/booleans/proof_checker.cpp b/src/theory/booleans/proof_checker.cpp index 8b2967fe6..2d2155f44 100644 --- a/src/theory/booleans/proof_checker.cpp +++ b/src/theory/booleans/proof_checker.cpp @@ -140,7 +140,7 @@ Node BoolProofRuleChecker::checkInternal(PfRule id, return Node::null(); } // remove duplicates while keeping the order of children - std::unordered_set clauseSet; + std::unordered_set clauseSet; std::vector disjuncts; unsigned size = children[0].getNumChildren(); for (unsigned i = 0; i < size; ++i) @@ -166,7 +166,7 @@ Node BoolProofRuleChecker::checkInternal(PfRule id, { Assert(children.size() == 1); Assert(args.size() == 1); - std::unordered_set clauseSet1, clauseSet2; + std::unordered_set clauseSet1, clauseSet2; if (children[0].getKind() == kind::OR) { clauseSet1.insert(children[0].begin(), children[0].end()); @@ -201,7 +201,7 @@ Node BoolProofRuleChecker::checkInternal(PfRule id, Node falseNode = nm->mkConst(false); std::vector clauseNodes; // literals to be removed from the virtual lhs clause of the resolution - std::unordered_map lhsElim; + std::unordered_map lhsElim; for (std::size_t i = 0, argsSize = args.size(); i < argsSize; i = i + 2) { // whether pivot should occur as is or negated depends on the polarity of @@ -320,7 +320,7 @@ Node BoolProofRuleChecker::checkInternal(PfRule id, for (std::size_t i = 0, childrenSize = children.size(); i < childrenSize; ++i) { - std::unordered_set elim; + std::unordered_set elim; // literals to be removed from "first" clause if (i < childrenSize - 1) { @@ -387,8 +387,8 @@ Node BoolProofRuleChecker::checkInternal(PfRule id, } Trace("bool-pfcheck") << "clause: " << clauseNodes << "\n"; // check that set representation is the same as of the given conclusion - std::unordered_set clauseComputed{ - clauseNodes.begin(), clauseNodes.end()}; + std::unordered_set clauseComputed{clauseNodes.begin(), + clauseNodes.end()}; Trace("bool-pfcheck") << "clauseSet: " << clauseComputed << "\n" << pop; if (clauseComputed.empty()) { @@ -415,8 +415,7 @@ Node BoolProofRuleChecker::checkInternal(PfRule id, { return Node::null(); } - std::unordered_set clauseGiven{args[0].begin(), - args[0].end()}; + std::unordered_set clauseGiven{args[0].begin(), args[0].end()}; return clauseComputed == clauseGiven ? args[0] : Node::null(); } if (id == PfRule::SPLIT) diff --git a/src/theory/booleans/theory_bool_rewriter.cpp b/src/theory/booleans/theory_bool_rewriter.cpp index 0d7431a8e..44d337c28 100644 --- a/src/theory/booleans/theory_bool_rewriter.cpp +++ b/src/theory/booleans/theory_bool_rewriter.cpp @@ -45,7 +45,7 @@ RewriteResponse TheoryBoolRewriter::postRewrite(TNode node) { */ RewriteResponse flattenNode(TNode n, TNode trivialNode, TNode skipNode) { - typedef std::unordered_set node_set; + typedef std::unordered_set node_set; node_set visited; visited.insert(skipNode); diff --git a/src/theory/builtin/theory_builtin_rewriter.cpp b/src/theory/builtin/theory_builtin_rewriter.cpp index e22f5f20f..68d6e1ad1 100644 --- a/src/theory/builtin/theory_builtin_rewriter.cpp +++ b/src/theory/builtin/theory_builtin_rewriter.cpp @@ -144,9 +144,13 @@ TypeNode TheoryBuiltinRewriter::getArrayTypeForFunctionType(TypeNode ftn) return ret; } -Node TheoryBuiltinRewriter::getLambdaForArrayRepresentationRec( TNode a, TNode bvl, unsigned bvlIndex, - std::unordered_map< TNode, Node, TNodeHashFunction >& visited ){ - std::unordered_map< TNode, Node, TNodeHashFunction >::iterator it = visited.find( a ); +Node TheoryBuiltinRewriter::getLambdaForArrayRepresentationRec( + TNode a, + TNode bvl, + unsigned bvlIndex, + std::unordered_map& visited) +{ + std::unordered_map::iterator it = visited.find(a); if( it==visited.end() ){ Node ret; if( bvlIndex visited; + std::unordered_map visited; Trace("builtin-rewrite-debug") << "Get lambda for : " << a << ", with variables " << bvl << std::endl; Node body = getLambdaForArrayRepresentationRec( a, bvl, 0, visited ); if( !body.isNull() ){ diff --git a/src/theory/builtin/theory_builtin_rewriter.h b/src/theory/builtin/theory_builtin_rewriter.h index 7d5cde3c2..f528ed43c 100644 --- a/src/theory/builtin/theory_builtin_rewriter.h +++ b/src/theory/builtin/theory_builtin_rewriter.h @@ -40,8 +40,11 @@ class TheoryBuiltinRewriter : public TheoryRewriter // conversions between lambdas and arrays private: /** recursive helper for getLambdaForArrayRepresentation */ - static Node getLambdaForArrayRepresentationRec( TNode a, TNode bvl, unsigned bvlIndex, - std::unordered_map< TNode, Node, TNodeHashFunction >& visited ); + static Node getLambdaForArrayRepresentationRec( + TNode a, + TNode bvl, + unsigned bvlIndex, + std::unordered_map& visited); /** recursive helper for getArrayRepresentationForLambda */ static Node getArrayRepresentationForLambdaRec(TNode n, TypeNode retType); diff --git a/src/theory/bv/abstraction.h b/src/theory/bv/abstraction.h index 67a04bfea..7eea90cdc 100644 --- a/src/theory/bv/abstraction.h +++ b/src/theory/bv/abstraction.h @@ -32,17 +32,16 @@ namespace bv { typedef std::vector ArgsVec; class AbstractionModule { - using NodeVecMap = - std::unordered_map, NodeHashFunction>; - using NodeTNodeMap = std::unordered_map; - using TNodeTNodeMap = std::unordered_map; - using NodeNodeMap = std::unordered_map; - using TNodeNodeMap = std::unordered_map; - using TNodeSet = std::unordered_set; + using NodeVecMap = std::unordered_map>; + using NodeTNodeMap = std::unordered_map; + using TNodeTNodeMap = std::unordered_map; + using NodeNodeMap = std::unordered_map; + using TNodeNodeMap = std::unordered_map; + using TNodeSet = std::unordered_set; using IntNodeMap = std::unordered_map; using IndexMap = std::unordered_map; using SkolemMap = std::unordered_map >; - using SignatureMap = std::unordered_map; + using SignatureMap = std::unordered_map; struct Statistics { SizeStat d_numFunctionsAbstracted; @@ -77,15 +76,15 @@ class AbstractionModule { }; class ArgsTable { - std::unordered_map d_data; + std::unordered_map d_data; bool hasEntry(TNode signature) const; public: - typedef std::unordered_map::iterator iterator; - ArgsTable() {} - void addEntry(TNode signature, const ArgsVec& args); - ArgsTableEntry& getEntry(TNode signature); - iterator begin() { return d_data.begin(); } - iterator end() { return d_data.end(); } + typedef std::unordered_map::iterator iterator; + ArgsTable() {} + void addEntry(TNode signature, const ArgsVec& args); + ArgsTableEntry& getEntry(TNode signature); + iterator begin() { return d_data.begin(); } + iterator end() { return d_data.end(); } }; /** diff --git a/src/theory/bv/bitblast/aig_bitblaster.h b/src/theory/bv/bitblast/aig_bitblaster.h index a7dfb00e5..39ecbc12c 100644 --- a/src/theory/bv/bitblast/aig_bitblaster.h +++ b/src/theory/bv/bitblast/aig_bitblaster.h @@ -56,8 +56,8 @@ class AigBitblaster : public TBitblaster static Abc_Ntk_t* currentAigNtk(); private: - typedef std::unordered_map TNodeAigMap; - typedef std::unordered_map NodeAigMap; + typedef std::unordered_map TNodeAigMap; + typedef std::unordered_map NodeAigMap; static thread_local Abc_Ntk_t* s_abcAigNetwork; std::unique_ptr d_nullContext; diff --git a/src/theory/bv/bitblast/bitblaster.h b/src/theory/bv/bitblast/bitblaster.h index 2a7931aa0..a669e4a86 100644 --- a/src/theory/bv/bitblast/bitblaster.h +++ b/src/theory/bv/bitblast/bitblaster.h @@ -38,8 +38,8 @@ namespace cvc5 { namespace theory { namespace bv { -typedef std::unordered_set NodeSet; -typedef std::unordered_set TNodeSet; +typedef std::unordered_set NodeSet; +typedef std::unordered_set TNodeSet; /** * The Bitblaster that manages the mapping between Nodes @@ -52,9 +52,9 @@ class TBitblaster { protected: typedef std::vector Bits; - typedef std::unordered_map TermDefMap; - typedef std::unordered_set TNodeSet; - typedef std::unordered_map ModelCache; + typedef std::unordered_map TermDefMap; + typedef std::unordered_set TNodeSet; + typedef std::unordered_map ModelCache; typedef void (*TermBBStrategy)(TNode, Bits&, TBitblaster*); typedef T (*AtomBBStrategy)(TNode, TBitblaster*); diff --git a/src/theory/bv/bitblast/eager_bitblaster.h b/src/theory/bv/bitblast/eager_bitblaster.h index 765f3051e..9e5ace9d8 100644 --- a/src/theory/bv/bitblast/eager_bitblaster.h +++ b/src/theory/bv/bitblast/eager_bitblaster.h @@ -56,7 +56,7 @@ class EagerBitblaster : public TBitblaster private: context::Context* d_context; - typedef std::unordered_set TNodeSet; + typedef std::unordered_set TNodeSet; std::unique_ptr d_satSolver; std::unique_ptr d_bitblastingRegistrar; diff --git a/src/theory/bv/bitblast/proof_bitblaster.cpp b/src/theory/bv/bitblast/proof_bitblaster.cpp index 09448da8a..4d6501673 100644 --- a/src/theory/bv/bitblast/proof_bitblaster.cpp +++ b/src/theory/bv/bitblast/proof_bitblaster.cpp @@ -81,7 +81,7 @@ void BBProof::bbAtom(TNode node) { std::vector visit; visit.push_back(node); - std::unordered_set visited; + std::unordered_set visited; bool fproofs = options::proofGranularityMode() != options::ProofGranularityMode::OFF; diff --git a/src/theory/bv/bitblast/proof_bitblaster.h b/src/theory/bv/bitblast/proof_bitblaster.h index 6cd4960fb..ef23c05c0 100644 --- a/src/theory/bv/bitblast/proof_bitblaster.h +++ b/src/theory/bv/bitblast/proof_bitblaster.h @@ -60,7 +60,7 @@ class BBProof /** The associated term conversion proof generator. */ TConvProofGenerator* d_tcpg; /** Map bit-vector nodes to bit-blasted nodes. */ - std::unordered_map d_bbMap; + std::unordered_map d_bbMap; }; } // namespace bv diff --git a/src/theory/bv/bitblast/simple_bitblaster.h b/src/theory/bv/bitblast/simple_bitblaster.h index 04a35bc4f..ebbb2891f 100644 --- a/src/theory/bv/bitblast/simple_bitblaster.h +++ b/src/theory/bv/bitblast/simple_bitblaster.h @@ -68,7 +68,7 @@ class BBSimple : public TBitblaster /** Caches variables for which we already created bits. */ TNodeSet d_variables; /** Stores bit-blasted atoms. */ - std::unordered_map d_bbAtoms; + std::unordered_map d_bbAtoms; /** Theory state. */ TheoryState* d_state; }; diff --git a/src/theory/bv/bv_eager_solver.h b/src/theory/bv/bv_eager_solver.h index 4b6c4fc5b..ab51ea844 100644 --- a/src/theory/bv/bv_eager_solver.h +++ b/src/theory/bv/bv_eager_solver.h @@ -45,8 +45,8 @@ class EagerBitblastSolver { bool collectModelInfo(theory::TheoryModel* m, bool fullModel); private: - context::CDHashSet d_assertionSet; - context::CDHashSet d_assumptionSet; + context::CDHashSet d_assertionSet; + context::CDHashSet d_assumptionSet; context::Context* d_context; /** Bitblasters */ diff --git a/src/theory/bv/bv_inequality_graph.h b/src/theory/bv/bv_inequality_graph.h index 0fa96e619..32b6dbd7a 100644 --- a/src/theory/bv/bv_inequality_graph.h +++ b/src/theory/bv/bv_inequality_graph.h @@ -99,17 +99,18 @@ class InequalityGraph : public context::ContextNotifyObj{ return (*(d_model->find(left))).second.value < (*(d_model->find(right))).second.value; } - }; + }; - typedef std::unordered_map ReasonToIdMap; - typedef std::unordered_map TermNodeToIdMap; + typedef std::unordered_map ReasonToIdMap; + typedef std::unordered_map TermNodeToIdMap; typedef std::vector Edges; typedef std::unordered_set TermIdSet; - typedef std::priority_queue, QueueComparator> BFSQueue; - typedef std::unordered_set TNodeSet; - typedef std::unordered_set NodeSet; + typedef std::priority_queue, QueueComparator> + BFSQueue; + typedef std::unordered_set TNodeSet; + typedef std::unordered_set NodeSet; std::vector d_ineqNodes; std::vector< Edges > d_ineqEdges; @@ -206,7 +207,7 @@ class InequalityGraph : public context::ContextNotifyObj{ /*** The currently asserted disequalities */ context::CDQueue d_disequalities; - typedef context::CDHashSet CDNodeSet; + typedef context::CDHashSet CDNodeSet; CDNodeSet d_disequalitiesAlreadySplit; Node makeDiseqSplitLemma(TNode diseq); /** Backtracking mechanisms **/ diff --git a/src/theory/bv/bv_quick_check.h b/src/theory/bv/bv_quick_check.h index f22f298ac..d1411d784 100644 --- a/src/theory/bv/bv_quick_check.h +++ b/src/theory/bv/bv_quick_check.h @@ -100,8 +100,7 @@ class BVQuickCheck bool collectModelValues(theory::TheoryModel* model, const std::set& termSet); - typedef std::unordered_set::const_iterator - vars_iterator; + typedef std::unordered_set::const_iterator vars_iterator; vars_iterator beginVars(); vars_iterator endVars(); diff --git a/src/theory/bv/bv_solver_bitblast.cpp b/src/theory/bv/bv_solver_bitblast.cpp index a9d46f068..ecf2bafb6 100644 --- a/src/theory/bv/bv_solver_bitblast.cpp +++ b/src/theory/bv/bv_solver_bitblast.cpp @@ -261,7 +261,7 @@ Node BVSolverBitblast::getValue(TNode node) nb << cur.getOperator(); } - std::unordered_map::iterator iit; + std::unordered_map::iterator iit; for (const TNode& child : cur) { iit = d_modelCache.find(child); diff --git a/src/theory/bv/bv_solver_bitblast.h b/src/theory/bv/bv_solver_bitblast.h index 384017f5f..36c06209a 100644 --- a/src/theory/bv/bv_solver_bitblast.h +++ b/src/theory/bv/bv_solver_bitblast.h @@ -87,7 +87,7 @@ class BVSolverBitblast : public BVSolver * Is cleared at the beginning of a getValue() call if the * `d_invalidateModelCache` flag is set to true. */ - std::unordered_map d_modelCache; + std::unordered_map d_modelCache; /** Bit-blaster used to bit-blast atoms/terms. */ std::unique_ptr d_bitblaster; @@ -123,8 +123,7 @@ class BVSolverBitblast : public BVSolver BVProofRuleChecker d_bvProofChecker; /** Stores the SatLiteral for a given fact. */ - context::CDHashMap - d_factLiteralCache; + context::CDHashMap d_factLiteralCache; /** Reverse map of `d_factLiteralCache`. */ context::CDHashMap diff --git a/src/theory/bv/bv_solver_lazy.h b/src/theory/bv/bv_solver_lazy.h index 57b3e0a08..9b3a2f1fa 100644 --- a/src/theory/bv/bv_solver_lazy.h +++ b/src/theory/bv/bv_solver_lazy.h @@ -49,8 +49,8 @@ class BVSolverLazy : public BVSolver context::Context* d_context; /** Context dependent set of atoms we already propagated */ - context::CDHashSet d_alreadyPropagatedSet; - context::CDHashSet d_sharedTermsSet; + context::CDHashSet d_alreadyPropagatedSet; + context::CDHashSet d_sharedTermsSet; std::vector> d_subtheories; std::unordered_map> @@ -122,11 +122,11 @@ class BVSolverLazy : public BVSolver void check(Theory::Effort e); void spendResource(Resource r); - typedef std::unordered_set TNodeSet; - typedef std::unordered_set NodeSet; + typedef std::unordered_set TNodeSet; + typedef std::unordered_set NodeSet; NodeSet d_staticLearnCache; - typedef std::unordered_map NodeToNode; + typedef std::unordered_map NodeToNode; context::CDO d_lemmasAdded; @@ -149,7 +149,7 @@ class BVSolverLazy : public BVSolver * Keeps a map from nodes to the subtheory that propagated it so that we can * explain it properly. */ - typedef context::CDHashMap PropagatedMap; + typedef context::CDHashMap PropagatedMap; PropagatedMap d_propagatedBy; std::unique_ptr d_eagerSolver; diff --git a/src/theory/bv/bv_solver_simple.cpp b/src/theory/bv/bv_solver_simple.cpp index 52f5d52ac..3faad29a9 100644 --- a/src/theory/bv/bv_solver_simple.cpp +++ b/src/theory/bv/bv_solver_simple.cpp @@ -38,10 +38,10 @@ bool isBVAtom(TNode n) } /* Traverse Boolean nodes and collect BV atoms. */ -void collectBVAtoms(TNode n, std::unordered_set& atoms) +void collectBVAtoms(TNode n, std::unordered_set& atoms) { std::vector visit; - std::unordered_set visited; + std::unordered_set visited; visit.push_back(n); @@ -138,7 +138,7 @@ bool BVSolverSimple::preNotifyFact( d_im.trustedLemma(tlem, InferenceId::BV_SIMPLE_LEMMA); } - std::unordered_set bv_atoms; + std::unordered_set bv_atoms; collectBVAtoms(n, bv_atoms); for (const Node& nn : bv_atoms) { diff --git a/src/theory/bv/bv_subtheory_algebraic.cpp b/src/theory/bv/bv_subtheory_algebraic.cpp index 90276f8b1..3a9e460fe 100644 --- a/src/theory/bv/bv_subtheory_algebraic.cpp +++ b/src/theory/bv/bv_subtheory_algebraic.cpp @@ -47,7 +47,7 @@ namespace { void collectVariables(TNode node, utils::NodeSet& vars) { std::vector stack; - std::unordered_set visited; + std::unordered_set visited; stack.push_back(node); while (!stack.empty()) diff --git a/src/theory/bv/bv_subtheory_algebraic.h b/src/theory/bv/bv_subtheory_algebraic.h index 670adafa3..b93ff235f 100644 --- a/src/theory/bv/bv_subtheory_algebraic.h +++ b/src/theory/bv/bv_subtheory_algebraic.h @@ -58,10 +58,8 @@ class SubstitutionEx } }; - typedef std::unordered_map - Substitutions; - typedef std::unordered_map - SubstitutionsCache; + typedef std::unordered_map Substitutions; + typedef std::unordered_map SubstitutionsCache; Substitutions d_substitutions; SubstitutionsCache d_cache; @@ -103,9 +101,9 @@ struct WorklistElement WorklistElement() : node(), id(-1) {} }; -typedef std::unordered_map NodeNodeMap; -typedef std::unordered_map NodeIdMap; -typedef std::unordered_set TNodeSet; +typedef std::unordered_map NodeNodeMap; +typedef std::unordered_map NodeIdMap; +typedef std::unordered_set TNodeSet; class ExtractSkolemizer { @@ -124,7 +122,7 @@ class ExtractSkolemizer ExtractList() : base(1), extracts() {} void addExtract(Extract& e); }; - typedef std::unordered_map VarExtractMap; + typedef std::unordered_map VarExtractMap; context::Context d_emptyContext; VarExtractMap d_varToExtract; theory::SubstitutionMap* d_modelMap; diff --git a/src/theory/bv/bv_subtheory_bitblast.h b/src/theory/bv/bv_subtheory_bitblast.h index 903a5136e..439bd33ed 100644 --- a/src/theory/bv/bv_subtheory_bitblast.h +++ b/src/theory/bv/bv_subtheory_bitblast.h @@ -49,7 +49,7 @@ class BitblastSolver : public SubtheorySolver context::CDQueue d_bitblastQueue; Statistics d_statistics; - typedef std::unordered_map NodeMap; + typedef std::unordered_map NodeMap; NodeMap d_modelCache; context::CDO d_validModelCache; diff --git a/src/theory/bv/bv_subtheory_core.h b/src/theory/bv/bv_subtheory_core.h index 52d9e739a..0dfcfdde4 100644 --- a/src/theory/bv/bv_subtheory_core.h +++ b/src/theory/bv/bv_subtheory_core.h @@ -50,10 +50,9 @@ class CoreSolverExtTheoryCallback : public ExtTheoryCallback * Bitvector equality solver */ class CoreSolver : public SubtheorySolver { - typedef std::unordered_map ModelValue; - typedef std::unordered_map TNodeBoolMap; - typedef std::unordered_set TNodeSet; - + typedef std::unordered_map ModelValue; + typedef std::unordered_map TNodeBoolMap; + typedef std::unordered_set TNodeSet; struct Statistics { IntStat d_numCallstoCheck; @@ -103,7 +102,7 @@ class CoreSolver : public SubtheorySolver { std::unique_ptr d_extTheory; /** To make sure we keep the explanations */ - context::CDHashSet d_reasons; + context::CDHashSet d_reasons; ModelValue d_modelValues; void buildModel(); bool assertFactToEqualityEngine(TNode fact, TNode reason); @@ -113,8 +112,8 @@ class CoreSolver : public SubtheorySolver { /** Whether we need a last call effort check */ bool d_needsLastCallCheck; /** For extended functions */ - context::CDHashSet d_extf_range_infer; - context::CDHashSet d_extf_collapse_infer; + context::CDHashSet d_extf_range_infer; + context::CDHashSet d_extf_collapse_infer; /** do extended function inferences * diff --git a/src/theory/bv/bv_subtheory_inequality.h b/src/theory/bv/bv_subtheory_inequality.h index 65eee95e1..f8a7bf113 100644 --- a/src/theory/bv/bv_subtheory_inequality.h +++ b/src/theory/bv/bv_subtheory_inequality.h @@ -51,11 +51,11 @@ class InequalitySolver : public SubtheorySolver Statistics(); }; - context::CDHashSet d_assertionSet; + context::CDHashSet d_assertionSet; InequalityGraph d_inequalityGraph; - context::CDHashMap d_explanations; + context::CDHashMap d_explanations; context::CDO d_isComplete; - typedef std::unordered_set NodeSet; + typedef std::unordered_set NodeSet; NodeSet d_ineqTerms; bool isInequalityOnly(TNode node); bool addInequality(TNode a, TNode b, bool strict, TNode fact); diff --git a/src/theory/bv/int_blaster.h b/src/theory/bv/int_blaster.h index 7fb463721..f8717e045 100644 --- a/src/theory/bv/int_blaster.h +++ b/src/theory/bv/int_blaster.h @@ -87,7 +87,7 @@ namespace cvc5 { **/ class IntBlaster { - using CDNodeMap = context::CDHashMap; + using CDNodeMap = context::CDHashMap; public: /** @@ -319,13 +319,13 @@ class IntBlaster * Range constraints of the form 0 <= x < 2^k * These are added for every new integer variable that we introduce. */ - context::CDHashSet d_rangeAssertions; + context::CDHashSet d_rangeAssertions; /** * A set of "bitwise" equalities over integers for BITVECTOR_AND * used in for options::SolveBVAsIntMode::BITWISE */ - context::CDHashSet d_bitwiseAssertions; + context::CDHashSet d_bitwiseAssertions; /** Useful constants */ Node d_zero; diff --git a/src/theory/bv/theory_bv_rewrite_rules_normalization.h b/src/theory/bv/theory_bv_rewrite_rules_normalization.h index 63d618da2..4a2d2943d 100644 --- a/src/theory/bv/theory_bv_rewrite_rules_normalization.h +++ b/src/theory/bv/theory_bv_rewrite_rules_normalization.h @@ -1047,7 +1047,10 @@ struct Count { {} }; -inline static void insert(std::unordered_map& map, TNode node, bool neg) { +inline static void insert(std::unordered_map& map, + TNode node, + bool neg) +{ if(map.find(node) == map.end()) { Count c = neg? Count(0,1) : Count(1, 0); map[node] = c; @@ -1073,7 +1076,7 @@ inline Node RewriteRule::apply(TNode node) NodeManager *nm = NodeManager::currentNM(); // this will remove duplicates - std::unordered_map subterms; + std::unordered_map subterms; unsigned size = utils::getSize(node); BitVector constant = BitVector::mkOnes(size); for (unsigned i = 0; i < node.getNumChildren(); ++i) @@ -1110,8 +1113,7 @@ inline Node RewriteRule::apply(TNode node) children.push_back(utils::mkConst(constant)); } - std::unordered_map::const_iterator it = - subterms.begin(); + std::unordered_map::const_iterator it = subterms.begin(); for (; it != subterms.end(); ++it) { @@ -1163,7 +1165,7 @@ Node RewriteRule::apply(TNode node) { Debug("bv-rewrite") << "RewriteRule(" << node << ")" << std::endl; std::vector processingStack; processingStack.push_back(node); - std::unordered_set processed; + std::unordered_set processed; std::vector children; Kind kind = node.getKind(); @@ -1200,7 +1202,7 @@ inline Node RewriteRule::apply(TNode node) NodeManager *nm = NodeManager::currentNM(); // this will remove duplicates - std::unordered_map subterms; + std::unordered_map subterms; unsigned size = utils::getSize(node); BitVector constant(size, (unsigned)0); @@ -1238,8 +1240,7 @@ inline Node RewriteRule::apply(TNode node) children.push_back(utils::mkConst(constant)); } - std::unordered_map::const_iterator it = - subterms.begin(); + std::unordered_map::const_iterator it = subterms.begin(); for (; it != subterms.end(); ++it) { @@ -1283,7 +1284,7 @@ inline Node RewriteRule::apply(TNode node) << std::endl; NodeManager *nm = NodeManager::currentNM(); - std::unordered_map subterms; + std::unordered_map subterms; unsigned size = utils::getSize(node); BitVector constant; bool const_set = false; @@ -1321,8 +1322,7 @@ inline Node RewriteRule::apply(TNode node) std::vector children; - std::unordered_map::const_iterator it = - subterms.begin(); + std::unordered_map::const_iterator it = subterms.begin(); unsigned true_count = 0; bool seen_false = false; for (; it != subterms.end(); ++it) diff --git a/src/theory/bv/theory_bv_utils.cpp b/src/theory/bv/theory_bv_utils.cpp index eb2fd6527..1549df639 100644 --- a/src/theory/bv/theory_bv_utils.cpp +++ b/src/theory/bv/theory_bv_utils.cpp @@ -140,7 +140,7 @@ static bool isCoreEqTerm(bool iseq, TNode term, TNodeBoolMap& cache) TNode t = term.getKind() == kind::NOT ? term[0] : term; std::vector stack; - std::unordered_map visited; + std::unordered_map visited; stack.push_back(t); while (!stack.empty()) diff --git a/src/theory/bv/theory_bv_utils.h b/src/theory/bv/theory_bv_utils.h index 4844c1a93..8e916e975 100644 --- a/src/theory/bv/theory_bv_utils.h +++ b/src/theory/bv/theory_bv_utils.h @@ -28,13 +28,13 @@ namespace cvc5 { namespace theory { namespace bv { -typedef std::unordered_set NodeSet; -typedef std::unordered_set TNodeSet; +typedef std::unordered_set NodeSet; +typedef std::unordered_set TNodeSet; namespace utils { -typedef std::unordered_map TNodeBoolMap; -typedef std::unordered_set NodeSet; +typedef std::unordered_map TNodeBoolMap; +typedef std::unordered_set NodeSet; /* Get the bit-width of given node. */ unsigned getSize(TNode node); diff --git a/src/theory/datatypes/infer_proof_cons.h b/src/theory/datatypes/infer_proof_cons.h index 9e6b6d339..f8e7eea09 100644 --- a/src/theory/datatypes/infer_proof_cons.h +++ b/src/theory/datatypes/infer_proof_cons.h @@ -42,9 +42,8 @@ namespace datatypes { */ class InferProofCons : public ProofGenerator { - typedef context:: - CDHashMap, NodeHashFunction> - NodeDatatypesInferenceMap; + typedef context::CDHashMap> + NodeDatatypesInferenceMap; public: InferProofCons(context::Context* c, ProofNodeManager* pnm); diff --git a/src/theory/datatypes/sygus_datatype_utils.cpp b/src/theory/datatypes/sygus_datatype_utils.cpp index 4b0c17bee..7e5099d55 100644 --- a/src/theory/datatypes/sygus_datatype_utils.cpp +++ b/src/theory/datatypes/sygus_datatype_utils.cpp @@ -60,7 +60,7 @@ Node applySygusArgs(const DType& dt, TNode val; if (!op.hasAttribute(SygusVarFreeAttribute())) { - std::unordered_set fvs; + std::unordered_set fvs; if (expr::getFreeVariables(op, fvs)) { if (fvs.size() == 1) @@ -294,8 +294,8 @@ typedef expr::Attribute Node sygusToBuiltin(Node n, bool isExternal) { - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode cur; unsigned index; @@ -410,8 +410,8 @@ Node sygusToBuiltinEval(Node n, const std::vector& args) std::vector eargs; bool svarsInit = false; std::vector svars; - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode cur; unsigned index; @@ -521,8 +521,7 @@ Node builtinVarToSygus(Node v) return Node::null(); } -void getFreeSymbolsSygusType(TypeNode sdt, - std::unordered_set& syms) +void getFreeSymbolsSygusType(TypeNode sdt, std::unordered_set& syms) { // datatype types we need to process std::vector typeToProcess; diff --git a/src/theory/datatypes/sygus_datatype_utils.h b/src/theory/datatypes/sygus_datatype_utils.h index 63e8a057a..6f3791a4d 100644 --- a/src/theory/datatypes/sygus_datatype_utils.h +++ b/src/theory/datatypes/sygus_datatype_utils.h @@ -197,8 +197,7 @@ Node sygusToBuiltinEval(Node n, const std::vector& args); * We have that { a, b, c, e } are added to syms. Notice that expr::getSymbols * excludes variables whose kind is BOUND_VARIABLE. */ -void getFreeSymbolsSygusType(TypeNode sdt, - std::unordered_set& syms); +void getFreeSymbolsSygusType(TypeNode sdt, std::unordered_set& syms); /** Substitute and generalize a sygus datatype type * diff --git a/src/theory/datatypes/sygus_extension.cpp b/src/theory/datatypes/sygus_extension.cpp index d4dbdf82d..45d996b55 100644 --- a/src/theory/datatypes/sygus_extension.cpp +++ b/src/theory/datatypes/sygus_extension.cpp @@ -156,8 +156,7 @@ void SygusExtension::registerTerm(Node n) bool success = false; if( n.getKind()==kind::APPLY_SELECTOR_TOTAL ){ registerTerm(n[0]); - std::unordered_map::iterator it = - d_term_to_anchor.find(n[0]); + std::unordered_map::iterator it = d_term_to_anchor.find(n[0]); if( it!=d_term_to_anchor.end() ) { d_term_to_anchor[n] = it->second; unsigned sel_weight = @@ -333,7 +332,7 @@ void SygusExtension::assertTesterInternal(int tindex, TNode n, Node exp) } // add the above symmetry breaking predicates to lemmas - std::unordered_map cache; + std::unordered_map cache; Node rlv = getRelevancyCondition(n); for (std::pair& sbl : sbLemmas) { @@ -450,8 +449,8 @@ Node SygusExtension::eliminateTraversalPredicates(Node n) { NodeManager* nm = NodeManager::currentNM(); SkolemManager* sm = nm->getSkolemManager(); - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::map::iterator ittb; std::vector visit; TNode cur; @@ -948,8 +947,7 @@ void SygusExtension::registerSearchTerm(TypeNode tn, bool topLevel) { //register this term - std::unordered_map::iterator ita = - d_term_to_anchor.find(n); + std::unordered_map::iterator ita = d_term_to_anchor.find(n); Assert(ita != d_term_to_anchor.end()); Node a = ita->second; Assert(!a.isNull()); @@ -1050,12 +1048,9 @@ Node SygusExtension::registerSearchValue(Node a, registerSymBreakLemmaForValue(a, nv, dbzet, Node::null(), var_count); return Node::null(); }else{ - std::unordered_map& scasv = - sca.d_search_val[tn]; - std::unordered_map& scasvs = - sca.d_search_val_sz[tn]; - std::unordered_map::iterator itsv = - scasv.find(bvr); + std::unordered_map& scasv = sca.d_search_val[tn]; + std::unordered_map& scasvs = sca.d_search_val_sz[tn]; + std::unordered_map::iterator itsv = scasv.find(bvr); Node bad_val_bvr; bool by_examples = false; if (itsv == scasv.end()) @@ -1264,7 +1259,7 @@ void SygusExtension::addSymBreakLemmasFor(TypeNode tn, Trace("sygus-sb-debug2") << "add lemmas up to size " << max_sz << ", which is (search_size) " << csz << " - (depth) " << d << std::endl; - std::unordered_map cache; + std::unordered_map cache; for (std::pair>& sbls : its->second) { if (sbls.first <= max_sz) @@ -1443,8 +1438,7 @@ void SygusExtension::notifySearchSize(TNode m, uint64_t s, Node exp) unsigned SygusExtension::getSearchSizeFor( Node n ) { Trace("sygus-sb-debug2") << "get search size for term : " << n << std::endl; - std::unordered_map::iterator ita = - d_term_to_anchor.find(n); + std::unordered_map::iterator ita = d_term_to_anchor.find(n); Assert(ita != d_term_to_anchor.end()); return getSearchSizeForAnchor( ita->second ); } @@ -1497,7 +1491,7 @@ void SygusExtension::incrementCurrentSearchSize(TNode m) && !s.second.empty())) { Node rlv = getRelevancyCondition(t); - std::unordered_map cache; + std::unordered_map cache; for (const Node& lem : s.second) { Node slem = lem.substitute(x, t, cache); diff --git a/src/theory/datatypes/sygus_extension.h b/src/theory/datatypes/sygus_extension.h index 25f56b334..3c7607eaf 100644 --- a/src/theory/datatypes/sygus_extension.h +++ b/src/theory/datatypes/sygus_extension.h @@ -64,10 +64,10 @@ class InferenceManager; */ class SygusExtension { - typedef context::CDHashMap< Node, int, NodeHashFunction > IntMap; - typedef context::CDHashMap< Node, Node, NodeHashFunction > NodeMap; - typedef context::CDHashMap< Node, bool, NodeHashFunction > BoolMap; - typedef context::CDHashSet NodeSet; + typedef context::CDHashMap IntMap; + typedef context::CDHashMap NodeMap; + typedef context::CDHashMap BoolMap; + typedef context::CDHashSet NodeSet; public: SygusExtension(TheoryState& s, @@ -149,7 +149,7 @@ class SygusExtension * Map from terms (selector chains) to their anchors. The anchor of a * selector chain S1( ... Sn( x ) ... ) is x. */ - std::unordered_map d_term_to_anchor; + std::unordered_map d_term_to_anchor; /** * Map from anchors to the conjecture they are associated with. */ @@ -161,7 +161,7 @@ class SygusExtension * where weight is the selector weight of Si * (see SygusTermDatabase::getSelectorWeight). */ - std::unordered_map d_term_to_depth; + std::unordered_map d_term_to_depth; /** * Map from terms (selector chains) to whether they are the topmost term * of their type. For example, if: @@ -172,7 +172,7 @@ class SygusExtension * Then, x, S1( x ), and S4( S3( S2( S1( x ) ) ) ) are top-level terms, * whereas S2( S1( x ) ) and S3( S2( S1( x ) ) ) are not. */ - std::unordered_map d_is_top_level; + std::unordered_map d_is_top_level; /** * Returns true if the selector chain n is top-level based on the above * definition, when tn is the type of n. @@ -198,13 +198,11 @@ private: * term. The range of this map can be updated if we later encounter a sygus * term that also rewrites to the builtin value but has a smaller term size. */ - std::map> - d_search_val; + std::map> d_search_val; /** the size of terms in the range of d_search val. */ - std::map> - d_search_val_sz; + std::map> d_search_val_sz; /** For each term, whether this cache has processed that term */ - std::unordered_set d_search_val_proc; + std::unordered_set d_search_val_proc; }; /** An instance of the above cache, for each anchor */ std::map< Node, SearchCache > d_cache; @@ -513,7 +511,7 @@ private: * This should be user context-dependent if sygus is updated to work in * incremental mode. */ - std::unordered_map d_simple_proc; + std::unordered_map d_simple_proc; //------------------------end static symmetry breaking /** Get the canonical free variable for type tn */ diff --git a/src/theory/datatypes/theory_datatypes.h b/src/theory/datatypes/theory_datatypes.h index 1ae122f5e..951aea804 100644 --- a/src/theory/datatypes/theory_datatypes.h +++ b/src/theory/datatypes/theory_datatypes.h @@ -42,9 +42,9 @@ class TheoryDatatypes : public Theory { private: typedef context::CDList NodeList; /** maps nodes to an index in a vector */ - typedef context::CDHashMap NodeUIntMap; - typedef context::CDHashMap BoolMap; - typedef context::CDHashMap NodeMap; + typedef context::CDHashMap NodeUIntMap; + typedef context::CDHashMap BoolMap; + typedef context::CDHashMap NodeMap; private: //notification class for equality engine diff --git a/src/theory/datatypes/theory_datatypes_type_rules.cpp b/src/theory/datatypes/theory_datatypes_type_rules.cpp index c9bfd98df..df644e9b2 100644 --- a/src/theory/datatypes/theory_datatypes_type_rules.cpp +++ b/src/theory/datatypes/theory_datatypes_type_rules.cpp @@ -420,7 +420,7 @@ TypeNode MatchTypeRule::computeType(NodeManager* nodeManager, if (check) { Kind nck = nc.getKind(); - std::unordered_set bvs; + std::unordered_set bvs; if (nck == kind::MATCH_BIND_CASE) { for (const Node& v : nc[0]) diff --git a/src/theory/eager_proof_generator.h b/src/theory/eager_proof_generator.h index 3a9ddd9d6..1606fbb50 100644 --- a/src/theory/eager_proof_generator.h +++ b/src/theory/eager_proof_generator.h @@ -87,8 +87,7 @@ namespace theory { */ class EagerProofGenerator : public ProofGenerator { - typedef context::CDHashMap, NodeHashFunction> - NodeProofNodeMap; + typedef context::CDHashMap> NodeProofNodeMap; public: EagerProofGenerator(ProofNodeManager* pnm, diff --git a/src/theory/evaluator.cpp b/src/theory/evaluator.cpp index 90ab5c4f0..c0a3a2a2f 100644 --- a/src/theory/evaluator.cpp +++ b/src/theory/evaluator.cpp @@ -132,21 +132,20 @@ Node Evaluator::eval(TNode n, const std::vector& vals, bool useRewriter) const { - std::unordered_map visited; + std::unordered_map visited; return eval(n, args, vals, visited, useRewriter); } -Node Evaluator::eval( - TNode n, - const std::vector& args, - const std::vector& vals, - const std::unordered_map& visited, - bool useRewriter) const +Node Evaluator::eval(TNode n, + const std::vector& args, + const std::vector& vals, + const std::unordered_map& visited, + bool useRewriter) const { Trace("evaluator") << "Evaluating " << n << " under substitution " << args << " " << vals << " with visited size = " << visited.size() << std::endl; - std::unordered_map evalAsNode; - std::unordered_map results; + std::unordered_map evalAsNode; + std::unordered_map results; // add visited to results for (const std::pair& p : visited) { @@ -155,8 +154,7 @@ Node Evaluator::eval( if (results[p.first].d_tag == EvalResult::INVALID) { // could not evaluate, use the evalAsNode map - std::unordered_map::iterator itn = - evalAsNode.find(p.second); + std::unordered_map::iterator itn = evalAsNode.find(p.second); Assert(itn != evalAsNode.end()); Node val = itn->second; if (useRewriter) @@ -172,8 +170,7 @@ Node Evaluator::eval( if (ret.isNull() && useRewriter) { // should be stored in the evaluation-as-node map - std::unordered_map::iterator itn = - evalAsNode.find(n); + std::unordered_map::iterator itn = evalAsNode.find(n); Assert(itn != evalAsNode.end()); ret = Rewriter::rewrite(itn->second); } @@ -190,13 +187,13 @@ EvalResult Evaluator::evalInternal( TNode n, const std::vector& args, const std::vector& vals, - std::unordered_map& evalAsNode, - std::unordered_map& results, + std::unordered_map& evalAsNode, + std::unordered_map& results, bool useRewriter) const { std::vector queue; queue.emplace_back(n); - std::unordered_map::iterator itr; + std::unordered_map::iterator itr; while (queue.size() != 0) { @@ -361,8 +358,8 @@ EvalResult Evaluator::evalInternal( // since the evaluation of op[1] is under a new substitution and thus // should not be cached. We could alternatively copy evalAsNode to // evalAsNodeC but favor avoiding this copy for performance reasons. - std::unordered_map evalAsNodeC; - std::unordered_map resultsC; + std::unordered_map evalAsNodeC; + std::unordered_map resultsC; results[currNode] = evalInternal(op[1], lambdaArgs, lambdaVals, @@ -885,10 +882,9 @@ EvalResult Evaluator::evalInternal( return results[n]; } -Node Evaluator::reconstruct( - TNode n, - std::unordered_map& eresults, - std::unordered_map& evalAsNode) const +Node Evaluator::reconstruct(TNode n, + std::unordered_map& eresults, + std::unordered_map& evalAsNode) const { if (n.getNumChildren() == 0) { @@ -896,8 +892,8 @@ Node Evaluator::reconstruct( } Trace("evaluator") << "Evaluator: reconstruct " << n << std::endl; NodeManager* nm = NodeManager::currentNM(); - std::unordered_map::iterator itr; - std::unordered_map::iterator itn; + std::unordered_map::iterator itr; + std::unordered_map::iterator itn; std::vector echildren; if (n.getMetaKind() == kind::metakind::PARAMETERIZED) { diff --git a/src/theory/evaluator.h b/src/theory/evaluator.h index 211b3060d..42cc34749 100644 --- a/src/theory/evaluator.h +++ b/src/theory/evaluator.h @@ -117,7 +117,7 @@ class Evaluator Node eval(TNode n, const std::vector& args, const std::vector& vals, - const std::unordered_map& visited, + const std::unordered_map& visited, bool useRewriter = true) const; private: @@ -137,13 +137,12 @@ class Evaluator * `args` to `vals` and rewriting. Notice that this map contains an entry * for n in the case that it cannot be evaluated. */ - EvalResult evalInternal( - TNode n, - const std::vector& args, - const std::vector& vals, - std::unordered_map& evalAsNode, - std::unordered_map& results, - bool useRewriter) const; + EvalResult evalInternal(TNode n, + const std::vector& args, + const std::vector& vals, + std::unordered_map& evalAsNode, + std::unordered_map& results, + bool useRewriter) const; /** reconstruct * * This function reconstructs the result of evaluating n using a combination @@ -153,10 +152,9 @@ class Evaluator * above method for some args and vals. This method ensures that the return * value is equivalent to the rewritten form of n * { args -> vals }. */ - Node reconstruct( - TNode n, - std::unordered_map& eresults, - std::unordered_map& evalAsNode) const; + Node reconstruct(TNode n, + std::unordered_map& eresults, + std::unordered_map& evalAsNode) const; }; } // namespace theory diff --git a/src/theory/ext_theory.h b/src/theory/ext_theory.h index 425c6fe6c..f5e08e2f5 100644 --- a/src/theory/ext_theory.h +++ b/src/theory/ext_theory.h @@ -164,10 +164,9 @@ class ExtTheoryCallback */ class ExtTheory { - using NodeBoolMap = context::CDHashMap; - using NodeExtReducedIdMap = - context::CDHashMap; - using NodeSet = context::CDHashSet; + using NodeBoolMap = context::CDHashMap; + using NodeExtReducedIdMap = context::CDHashMap; + using NodeSet = context::CDHashSet; public: /** constructor diff --git a/src/theory/fp/fp_converter.h b/src/theory/fp/fp_converter.h index 1db635cda..f1b7c8a83 100644 --- a/src/theory/fp/fp_converter.h +++ b/src/theory/fp/fp_converter.h @@ -323,11 +323,11 @@ class FpConverter typedef symfpuSymbolic::traits::ubv ubv; typedef symfpuSymbolic::traits::sbv sbv; - typedef context::CDHashMap fpMap; - typedef context::CDHashMap rmMap; - typedef context::CDHashMap boolMap; - typedef context::CDHashMap ubvMap; - typedef context::CDHashMap sbvMap; + typedef context::CDHashMap fpMap; + typedef context::CDHashMap rmMap; + typedef context::CDHashMap boolMap; + typedef context::CDHashMap ubvMap; + typedef context::CDHashMap sbvMap; fpMap d_fpMap; rmMap d_rmMap; diff --git a/src/theory/fp/fp_expand_defs.h b/src/theory/fp/fp_expand_defs.h index 674d79331..a9edc8b02 100644 --- a/src/theory/fp/fp_expand_defs.h +++ b/src/theory/fp/fp_expand_defs.h @@ -33,11 +33,10 @@ class FpExpandDefs { using PairTypeNodeHashFunction = PairHashFunction; + std::hash, + std::hash>; /** Uninterpreted functions for undefined cases of non-total operators. */ - using ComparisonUFMap = - context::CDHashMap; + using ComparisonUFMap = context::CDHashMap; /** Uninterpreted functions for lazy handling of conversions. */ using ConversionUFMap = context:: CDHashMap, Node, PairTypeNodeHashFunction>; diff --git a/src/theory/fp/theory_fp.cpp b/src/theory/fp/theory_fp.cpp index 01dace411..21f2975a8 100644 --- a/src/theory/fp/theory_fp.cpp +++ b/src/theory/fp/theory_fp.cpp @@ -804,7 +804,7 @@ bool TheoryFp::collectModelValues(TheoryModel* m, } } - std::unordered_set visited; + std::unordered_set visited; std::stack working; std::set relevantVariables; for (std::set::const_iterator i(relevantTerms.begin()); diff --git a/src/theory/fp/theory_fp.h b/src/theory/fp/theory_fp.h index 8cf4c4cc5..a41bf342c 100644 --- a/src/theory/fp/theory_fp.h +++ b/src/theory/fp/theory_fp.h @@ -92,9 +92,8 @@ class TheoryFp : public Theory TrustNode explain(TNode n) override; protected: - using ConversionAbstractionMap = - context::CDHashMap; - using AbstractionMap = context::CDHashMap; + using ConversionAbstractionMap = context::CDHashMap; + using AbstractionMap = context::CDHashMap; /** Equality engine. */ class NotifyClass : public eq::EqualityEngineNotify { @@ -121,7 +120,7 @@ class TheoryFp : public Theory void registerTerm(TNode node); bool isRegistered(TNode node); - context::CDHashSet d_registeredTerms; + context::CDHashSet d_registeredTerms; /** The word-blaster. Translates FP -> BV. */ std::unique_ptr d_conv; diff --git a/src/theory/quantifiers/bv_inverter.cpp b/src/theory/quantifiers/bv_inverter.cpp index 2bde66fe7..86444b8cf 100644 --- a/src/theory/quantifiers/bv_inverter.cpp +++ b/src/theory/quantifiers/bv_inverter.cpp @@ -114,12 +114,11 @@ static bool isInvertible(Kind k, unsigned index) || k == BITVECTOR_SHL; } -Node BvInverter::getPathToPv( - Node lit, - Node pv, - Node sv, - std::vector& path, - std::unordered_set& visited) +Node BvInverter::getPathToPv(Node lit, + Node pv, + Node sv, + std::vector& path, + std::unordered_set& visited) { if (visited.find(lit) == visited.end()) { @@ -169,7 +168,7 @@ Node BvInverter::getPathToPv(Node lit, std::vector& path, bool projectNl) { - std::unordered_set visited; + std::unordered_set visited; Node slit = getPathToPv(lit, pv, sv, path, visited); // if we are able to find a (invertible) path to pv if (!slit.isNull() && !pvs.isNull()) diff --git a/src/theory/quantifiers/bv_inverter.h b/src/theory/quantifiers/bv_inverter.h index bf6c31b1b..e840b53de 100644 --- a/src/theory/quantifiers/bv_inverter.h +++ b/src/theory/quantifiers/bv_inverter.h @@ -104,7 +104,7 @@ class BvInverter Node pv, Node sv, std::vector& path, - std::unordered_set& visited); + std::unordered_set& visited); /** Helper function for getInv. * diff --git a/src/theory/quantifiers/candidate_rewrite_database.cpp b/src/theory/quantifiers/candidate_rewrite_database.cpp index dfc5efff7..789a723b9 100644 --- a/src/theory/quantifiers/candidate_rewrite_database.cpp +++ b/src/theory/quantifiers/candidate_rewrite_database.cpp @@ -83,8 +83,7 @@ Node CandidateRewriteDatabase::addTerm(Node sol, bool& rew_print) { // have we added this term before? - std::unordered_map::iterator itac = - d_add_term_cache.find(sol); + std::unordered_map::iterator itac = d_add_term_cache.find(sol); if (itac != d_add_term_cache.end()) { return itac->second; diff --git a/src/theory/quantifiers/candidate_rewrite_database.h b/src/theory/quantifiers/candidate_rewrite_database.h index 1a2add6eb..309aaf4b7 100644 --- a/src/theory/quantifiers/candidate_rewrite_database.h +++ b/src/theory/quantifiers/candidate_rewrite_database.h @@ -124,7 +124,7 @@ class CandidateRewriteDatabase : public ExprMiner /** candidate rewrite filter */ CandidateRewriteFilter d_crewrite_filter; /** the cache for results of addTerm */ - std::unordered_map d_add_term_cache; + std::unordered_map d_add_term_cache; }; } // namespace quantifiers diff --git a/src/theory/quantifiers/candidate_rewrite_filter.cpp b/src/theory/quantifiers/candidate_rewrite_filter.cpp index a57b74c78..d5f06b6e9 100644 --- a/src/theory/quantifiers/candidate_rewrite_filter.cpp +++ b/src/theory/quantifiers/candidate_rewrite_filter.cpp @@ -227,8 +227,7 @@ bool CandidateRewriteFilter::notify(Node s, Assert(!s.isNull()); n = d_drewrite->toExternal(n); Assert(!n.isNull()); - std::map >::iterator it = - d_pairs.find(n); + std::map >::iterator it = d_pairs.find(n); if (Trace.isOn("crf-match")) { Trace("crf-match") << " " << s << " matches " << n diff --git a/src/theory/quantifiers/candidate_rewrite_filter.h b/src/theory/quantifiers/candidate_rewrite_filter.h index 7d2d9088c..4995dc7c2 100644 --- a/src/theory/quantifiers/candidate_rewrite_filter.h +++ b/src/theory/quantifiers/candidate_rewrite_filter.h @@ -115,7 +115,7 @@ class CandidateRewriteFilter * Stores all relevant pairs returned by this sampler (see registerTerm). In * detail, if (t,s) is a relevant pair, then t in d_pairs[s]. */ - std::map > d_pairs; + std::map > d_pairs; /** * For each (builtin) type, a match trie storing all terms in the domain of * d_pairs. diff --git a/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp index c76243a46..ec15b926f 100644 --- a/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_bv_instantiator.cpp @@ -270,8 +270,8 @@ bool BvInstantiator::processAssertions(CegInstantiator* ci, Node pv, CegInstEffort effort) { - std::unordered_map, NodeHashFunction>::iterator - iti = d_var_to_inst_id.find(pv); + std::unordered_map>::iterator iti = + d_var_to_inst_id.find(pv); if (iti == d_var_to_inst_id.end()) { // no bounds @@ -317,7 +317,7 @@ bool BvInstantiator::processAssertions(CegInstantiator* ci, // get the slack value introduced for the asserted literal Node curr_slack_val; - std::unordered_map::iterator itms = + std::unordered_map::iterator itms = d_alit_to_model_slack.find(alit); if (itms != d_alit_to_model_slack.end()) { @@ -382,12 +382,12 @@ Node BvInstantiator::rewriteAssertionForSolvePv(CegInstantiator* ci, Node lit) { // result of rewriting the visited term - std::stack > visited; - visited.push(std::unordered_map()); + std::stack> visited; + visited.push(std::unordered_map()); // whether the visited term contains pv - std::unordered_map visited_contains_pv; - std::unordered_map::iterator it; - std::unordered_map curr_subs; + std::unordered_map visited_contains_pv; + std::unordered_map::iterator it; + std::unordered_map curr_subs; std::stack > visit; TNode cur; visit.push(std::stack()); @@ -400,8 +400,7 @@ Node BvInstantiator::rewriteAssertionForSolvePv(CegInstantiator* ci, if (it == visited.top().end()) { - std::unordered_map::iterator itc = - curr_subs.find(cur); + std::unordered_map::iterator itc = curr_subs.find(cur); if (itc != curr_subs.end()) { visited.top()[cur] = itc->second; @@ -422,7 +421,7 @@ Node BvInstantiator::rewriteAssertionForSolvePv(CegInstantiator* ci, // of this witness expression since we are // now in the context { cur[0][0] -> bv }, // hence we push a context here - visited.push(std::unordered_map()); + visited.push(std::unordered_map()); visit.push(std::stack()); } visited.top()[cur] = Node::null(); @@ -507,7 +506,7 @@ Node BvInstantiator::rewriteAssertionForSolvePv(CegInstantiator* ci, if (Trace.isOn("cegqi-bv-nl")) { std::vector trace_visit; - std::unordered_set trace_visited; + std::unordered_set trace_visited; trace_visit.push_back(result); do @@ -535,7 +534,7 @@ Node BvInstantiator::rewriteTermForSolvePv( Node pv, Node n, std::vector& children, - std::unordered_map& contains_pv) + std::unordered_map& contains_pv) { NodeManager* nm = NodeManager::currentNM(); @@ -648,7 +647,7 @@ void BvInstantiatorPreprocess::registerCounterexampleLemma( Trace("cegqi-bv-pp") << "-----remove extracts..." << std::endl; // map from terms to bitvector extracts applied to that term std::map > extract_map; - std::unordered_set visited; + std::unordered_set visited; Trace("cegqi-bv-pp-debug2") << "Register ce lemma " << lem << std::endl; collectExtracts(lem, extract_map, visited); for (std::pair >& es : extract_map) @@ -728,8 +727,8 @@ void BvInstantiatorPreprocess::registerCounterexampleLemma( void BvInstantiatorPreprocess::collectExtracts( Node lem, - std::map >& extract_map, - std::unordered_set& visited) + std::map>& extract_map, + std::unordered_set& visited) { std::vector visit; TNode cur; diff --git a/src/theory/quantifiers/cegqi/ceg_bv_instantiator.h b/src/theory/quantifiers/cegqi/ceg_bv_instantiator.h index a1774de1c..cbc73dc2c 100644 --- a/src/theory/quantifiers/cegqi/ceg_bv_instantiator.h +++ b/src/theory/quantifiers/cegqi/ceg_bv_instantiator.h @@ -108,16 +108,15 @@ class BvInstantiator : public Instantiator /** identifier counter, used to allocate ids to each solve form */ unsigned d_inst_id_counter; /** map from variables to list of solved form ids */ - std::unordered_map, NodeHashFunction> - d_var_to_inst_id; + std::unordered_map> d_var_to_inst_id; /** for each solved form id, the term for instantiation */ std::unordered_map d_inst_id_to_term; /** for each solved form id, the corresponding asserted literal */ std::unordered_map d_inst_id_to_alit; /** map from variable to current id we are processing */ - std::unordered_map d_var_to_curr_inst_id; + std::unordered_map d_var_to_curr_inst_id; /** the amount of slack we added for asserted literals */ - std::unordered_map d_alit_to_model_slack; + std::unordered_map d_alit_to_model_slack; //--------------------------------end solved forms /** rewrite assertion for solve pv * @@ -137,11 +136,10 @@ class BvInstantiator : public Instantiator * where we guarantee that all subterms of terms in children * appear in the domain of contains_pv. */ - Node rewriteTermForSolvePv( - Node pv, - Node n, - std::vector& children, - std::unordered_map& contains_pv); + Node rewriteTermForSolvePv(Node pv, + Node n, + std::vector& children, + std::unordered_map& contains_pv); /** process literal, called from processAssertion * * lit is the literal to solve for pv that has been rewritten according to @@ -204,8 +202,8 @@ class BvInstantiatorPreprocess : public InstantiatorPreprocess * visited is the terms we've already visited. */ void collectExtracts(Node lem, - std::map >& extract_map, - std::unordered_set& visited); + std::map>& extract_map, + std::unordered_set& visited); }; } // namespace quantifiers diff --git a/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp b/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp index 768ae73a6..5040125ba 100644 --- a/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp +++ b/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.cpp @@ -59,10 +59,9 @@ Node getPvCoeff(TNode pv, TNode n) return coeff; } -Node normalizePvMult( - TNode pv, - const std::vector& children, - std::unordered_map& contains_pv) +Node normalizePvMult(TNode pv, + const std::vector& children, + std::unordered_map& contains_pv) { bool neg, neg_coeff = false; bool found_pv = false; @@ -139,10 +138,9 @@ Node normalizePvMult( #ifdef CVC5_ASSERTIONS namespace { -bool isLinearPlus( - TNode n, - TNode pv, - std::unordered_map& contains_pv) +bool isLinearPlus(TNode n, + TNode pv, + std::unordered_map& contains_pv) { Node coeff; Assert(n.getAttribute(BvLinearAttribute())); @@ -163,10 +161,9 @@ bool isLinearPlus( } // namespace #endif -Node normalizePvPlus( - Node pv, - const std::vector& children, - std::unordered_map& contains_pv) +Node normalizePvPlus(Node pv, + const std::vector& children, + std::unordered_map& contains_pv) { NodeManager* nm; NodeBuilder nb_c(BITVECTOR_PLUS); @@ -252,10 +249,9 @@ Node normalizePvPlus( return result; } -Node normalizePvEqual( - Node pv, - const std::vector& children, - std::unordered_map& contains_pv) +Node normalizePvEqual(Node pv, + const std::vector& children, + std::unordered_map& contains_pv) { Assert(children.size() == 2); diff --git a/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.h b/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.h index 15b13433a..6be22805d 100644 --- a/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.h +++ b/src/theory/quantifiers/cegqi/ceg_bv_instantiator_utils.h @@ -61,10 +61,9 @@ Node getPvCoeff(TNode pv, TNode n); * a null node otherwise. If pv does not occur in children it returns a * multiplication over children. */ -Node normalizePvMult( - TNode pv, - const std::vector& children, - std::unordered_map& contains_pv); +Node normalizePvMult(TNode pv, + const std::vector& children, + std::unordered_map& contains_pv); /** * Normalizes the children of a BITVECTOR_PLUS w.r.t. pv. contains_pv marks @@ -81,10 +80,9 @@ Node normalizePvMult( * a null node otherwise. If pv does not occur in children it returns an * addition over children. */ -Node normalizePvPlus( - Node pv, - const std::vector& children, - std::unordered_map& contains_pv); +Node normalizePvPlus(Node pv, + const std::vector& children, + std::unordered_map& contains_pv); /** * Linearize an equality w.r.t. pv such that pv only occurs once. contains_pv @@ -97,10 +95,9 @@ Node normalizePvPlus( * * pv * (-a - 1) = c - b. */ -Node normalizePvEqual( - Node pv, - const std::vector& children, - std::unordered_map& contains_pv); +Node normalizePvEqual(Node pv, + const std::vector& children, + std::unordered_map& contains_pv); } // namespace utils } // namespace quantifiers diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp index 8a3b22a1f..0d85b8946 100644 --- a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp @@ -274,7 +274,7 @@ CegHandledStatus CegInstantiator::isCbqiKind(Kind k) CegHandledStatus CegInstantiator::isCbqiTerm(Node n) { CegHandledStatus ret = CEG_HANDLED; - std::unordered_set visited; + std::unordered_set visited; std::vector visit; TNode cur; visit.push_back(n); @@ -846,7 +846,7 @@ bool CegInstantiator::constructInstantiation(SolvedForm& sf, } Trace("cegqi-inst-debug") << "[3] try based on assertions." << std::endl; d_curr_iphase[pv] = CEG_INST_PHASE_ASSERTION; - std::unordered_set lits; + std::unordered_set lits; for (unsigned r = 0; r < 2; r++) { TheoryId tid = r == 0 ? Theory::theoryOf(pvtn) : THEORY_UF; @@ -1104,8 +1104,7 @@ bool CegInstantiator::isEligibleForInstantiation(Node n) const bool CegInstantiator::canApplyBasicSubstitution( Node n, std::vector< Node >& non_basic ){ Assert(d_prog_var.find(n) != d_prog_var.end()); if( !non_basic.empty() ){ - for (std::unordered_set::iterator it = - d_prog_var[n].begin(); + for (std::unordered_set::iterator it = d_prog_var[n].begin(); it != d_prog_var[n].end(); ++it) { @@ -1439,7 +1438,7 @@ Node CegInstantiator::getModelValue( Node n ) { Node CegInstantiator::getBoundVariable(TypeNode tn) { unsigned index = 0; - std::unordered_map::iterator itb = + std::unordered_map::iterator itb = d_bound_var_index.find(tn); if (itb != d_bound_var_index.end()) { @@ -1529,9 +1528,9 @@ void CegInstantiator::registerCounterexampleLemma(Node lem, } // register variables that were introduced during TheoryEngine preprocessing - std::unordered_set ceSyms; + std::unordered_set ceSyms; expr::getSymbols(lem, ceSyms); - std::unordered_set qSyms; + std::unordered_set qSyms; expr::getSymbols(d_quant, qSyms); // all variables that are in counterexample lemma but not in quantified // formula diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.h b/src/theory/quantifiers/cegqi/ceg_instantiator.h index 0279a72ca..2c228777d 100644 --- a/src/theory/quantifiers/cegqi/ceg_instantiator.h +++ b/src/theory/quantifiers/cegqi/ceg_instantiator.h @@ -359,14 +359,11 @@ class CegInstantiator { /** cache from nodes to the set of variables it contains * (from the quantified formula we are instantiating). */ - std::unordered_map, - NodeHashFunction> - d_prog_var; + std::unordered_map> d_prog_var; /** cache of the set of terms that we have established are * ineligible for instantiation. */ - std::unordered_set d_inelig; + std::unordered_set d_inelig; /** ensures n is in d_prog_var and d_inelig. */ void computeProgVars(Node n); //-------------------------------end globally cached @@ -379,7 +376,7 @@ class CegInstantiator { /** map from types to representatives of that type */ std::map > d_curr_type_eqc; /** solved asserts */ - std::unordered_set d_solved_asserts; + std::unordered_set d_solved_asserts; /** process assertions * This is called once at the beginning of check to * set up all necessary information for constructing instantiations, @@ -389,16 +386,14 @@ class CegInstantiator { /** cache bound variables for type returned * by getBoundVariable(...). */ - std::unordered_map, TypeNodeHashFunction> - d_bound_var; + std::unordered_map> d_bound_var; /** current index of bound variables for type. * The next call to getBoundVariable(...) for * type tn returns the d_bound_var_index[tn]^th * element of d_bound_var[tn], or a fresh variable * if not in bounds. */ - std::unordered_map - d_bound_var_index; + std::unordered_map d_bound_var_index; //-------------------------------end cached per round //-------------------------------data per theory @@ -434,7 +429,7 @@ class CegInstantiator { */ std::vector d_vars; /** set form of d_vars */ - std::unordered_set d_vars_set; + std::unordered_set d_vars_set; /** index of variables reported in instantiation */ std::vector d_var_order_index; /** number of input variables diff --git a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h index 5547409de..882f69b85 100644 --- a/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h +++ b/src/theory/quantifiers/cegqi/inst_strategy_cegqi.h @@ -65,8 +65,8 @@ class InstRewriterCegqi : public InstantiationRewriter */ class InstStrategyCegqi : public QuantifiersModule { - typedef context::CDHashSet NodeSet; - typedef context::CDHashMap< Node, int, NodeHashFunction> NodeIntMap; + typedef context::CDHashSet NodeSet; + typedef context::CDHashMap NodeIntMap; public: InstStrategyCegqi(QuantifiersState& qs, diff --git a/src/theory/quantifiers/cegqi/nested_qe.cpp b/src/theory/quantifiers/cegqi/nested_qe.cpp index 6ae5cf546..a20c37043 100644 --- a/src/theory/quantifiers/cegqi/nested_qe.cpp +++ b/src/theory/quantifiers/cegqi/nested_qe.cpp @@ -55,8 +55,7 @@ bool NestedQe::hasProcessed(Node q) const return d_qnqe.find(q) != d_qnqe.end(); } -bool NestedQe::getNestedQuantification( - Node q, std::unordered_set& nqs) +bool NestedQe::getNestedQuantification(Node q, std::unordered_set& nqs) { expr::getKindSubterms(q[1], kind::FORALL, true, nqs); return !nqs.empty(); @@ -64,7 +63,7 @@ bool NestedQe::getNestedQuantification( bool NestedQe::hasNestedQuantification(Node q) { - std::unordered_set nqs; + std::unordered_set nqs; return getNestedQuantification(q, nqs); } @@ -79,7 +78,7 @@ Node NestedQe::doNestedQe(Node q, bool keepTopLevel) inputExists = true; } Assert(q.getKind() == kind::FORALL); - std::unordered_set nqs; + std::unordered_set nqs; if (!getNestedQuantification(q, nqs)) { Trace("cegqi-nested-qe-debug") diff --git a/src/theory/quantifiers/cegqi/nested_qe.h b/src/theory/quantifiers/cegqi/nested_qe.h index 020d15d3a..f6e15d4c6 100644 --- a/src/theory/quantifiers/cegqi/nested_qe.h +++ b/src/theory/quantifiers/cegqi/nested_qe.h @@ -30,7 +30,7 @@ namespace quantifiers { class NestedQe { - using NodeNodeMap = context::CDHashMap; + using NodeNodeMap = context::CDHashMap; public: NestedQe(context::UserContext* u); @@ -53,8 +53,7 @@ class NestedQe * Get nested quantification. Returns true if q has nested quantifiers. * Adds each nested quantifier in the body of q to nqs. */ - static bool getNestedQuantification( - Node q, std::unordered_set& nqs); + static bool getNestedQuantification(Node q, std::unordered_set& nqs); /** * Does quantified formula q have nested quantification? */ diff --git a/src/theory/quantifiers/conjecture_generator.h b/src/theory/quantifiers/conjecture_generator.h index e8b5e260a..ef60792a6 100644 --- a/src/theory/quantifiers/conjecture_generator.h +++ b/src/theory/quantifiers/conjecture_generator.h @@ -239,10 +239,10 @@ class ConjectureGenerator : public QuantifiersModule friend class SubsEqcIndex; friend class TermGenerator; friend class TermGenEnv; - typedef context::CDHashMap< Node, Node, NodeHashFunction > NodeMap; - typedef context::CDHashMap< Node, bool, NodeHashFunction > BoolMap; -//this class maintains a congruence closure for *universal* facts -private: + typedef context::CDHashMap NodeMap; + typedef context::CDHashMap BoolMap; + // this class maintains a congruence closure for *universal* facts + private: //notification class for equality engine class NotifyClass : public eq::EqualityEngineNotify { ConjectureGenerator& d_sg; diff --git a/src/theory/quantifiers/ematching/ho_trigger.cpp b/src/theory/quantifiers/ematching/ho_trigger.cpp index 95fae09e8..73a894081 100644 --- a/src/theory/quantifiers/ematching/ho_trigger.cpp +++ b/src/theory/quantifiers/ematching/ho_trigger.cpp @@ -90,10 +90,10 @@ void HigherOrderTrigger::collectHoVarApplyTerms( void HigherOrderTrigger::collectHoVarApplyTerms( Node q, std::vector& ns, std::map >& apps) { - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; // whether the visited node is a child of a HO_APPLY chain - std::unordered_map withinApply; + std::unordered_map withinApply; std::vector visit; TNode cur; for (unsigned i = 0, size = ns.size(); i < size; i++) diff --git a/src/theory/quantifiers/ematching/ho_trigger.h b/src/theory/quantifiers/ematching/ho_trigger.h index 64f03e7fa..78b2e6c84 100644 --- a/src/theory/quantifiers/ematching/ho_trigger.h +++ b/src/theory/quantifiers/ematching/ho_trigger.h @@ -145,7 +145,7 @@ class HigherOrderTrigger : public Trigger std::map > d_ho_var_bvs; std::map d_ho_var_bvl; /** the set of types of ho variables */ - std::unordered_set d_ho_var_types; + std::unordered_set d_ho_var_types; /** add higher-order type predicate lemmas * * Adds lemmas of the form P( f ), where P is the predicate diff --git a/src/theory/quantifiers/ematching/pattern_term_selector.cpp b/src/theory/quantifiers/ematching/pattern_term_selector.cpp index 4ff77bdbf..d5af43242 100644 --- a/src/theory/quantifiers/ematching/pattern_term_selector.cpp +++ b/src/theory/quantifiers/ematching/pattern_term_selector.cpp @@ -472,10 +472,10 @@ int PatternTermSelector::isInstanceOf(Node n1, { Assert(n1 != n2); int status = 0; - std::unordered_set subs_vars; + std::unordered_set subs_vars; std::unordered_set< std::pair, - PairHashFunction > + PairHashFunction, std::hash>> visited; std::vector > visit; std::pair cur; diff --git a/src/theory/quantifiers/ematching/trigger.cpp b/src/theory/quantifiers/ematching/trigger.cpp index c63e2c830..3a78819ea 100644 --- a/src/theory/quantifiers/ematching/trigger.cpp +++ b/src/theory/quantifiers/ematching/trigger.cpp @@ -163,8 +163,8 @@ Node Trigger::ensureGroundTermPreprocessed(Valuation& val, std::vector& gts) { NodeManager* nm = NodeManager::currentNM(); - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/theory/quantifiers/equality_query.cpp b/src/theory/quantifiers/equality_query.cpp index 0a6ac6a78..f87ec6435 100644 --- a/src/theory/quantifiers/equality_query.cpp +++ b/src/theory/quantifiers/equality_query.cpp @@ -115,7 +115,7 @@ Node EqualityQuery::getInternalRepresentative(Node a, Node q, size_t index) return Node::null(); } // now, make sure that no other member of the class is an instance - std::unordered_map cache; + std::unordered_map cache; r_best = getInstance(r_best, eqc, cache); // store that this representative was chosen at this point if (d_rep_score.find(r_best) == d_rep_score.end()) @@ -142,10 +142,9 @@ Node EqualityQuery::getInternalRepresentative(Node a, Node q, size_t index) //helper functions -Node EqualityQuery::getInstance( - Node n, - const std::vector& eqc, - std::unordered_map& cache) +Node EqualityQuery::getInstance(Node n, + const std::vector& eqc, + std::unordered_map& cache) { if(cache.find(n) != cache.end()) { return cache[n]; diff --git a/src/theory/quantifiers/equality_query.h b/src/theory/quantifiers/equality_query.h index 4809cc6c2..f39ff86e3 100644 --- a/src/theory/quantifiers/equality_query.h +++ b/src/theory/quantifiers/equality_query.h @@ -84,7 +84,9 @@ class EqualityQuery : public QuantifiersUtil /** processInferences : will merge equivalence classes in master equality engine, if possible */ bool processInferences( Theory::Effort e ); /** node contains */ - Node getInstance( Node n, const std::vector< Node >& eqc, std::unordered_map& cache ); + Node getInstance(Node n, + const std::vector& eqc, + std::unordered_map& cache); /** get score */ int32_t getRepScore(Node n, Node f, size_t index, TypeNode v_tn); }; /* EqualityQuery */ diff --git a/src/theory/quantifiers/extended_rewrite.cpp b/src/theory/quantifiers/extended_rewrite.cpp index a8159bef9..e73323e48 100644 --- a/src/theory/quantifiers/extended_rewrite.cpp +++ b/src/theory/quantifiers/extended_rewrite.cpp @@ -783,7 +783,7 @@ Node ExtendedRewriter::extendedRewriteBcp( // the processing terms std::vector clauses; // the terms we have propagated information to - std::unordered_set prop_clauses; + std::unordered_set prop_clauses; // the assignment std::map assign; std::vector avars; @@ -1531,8 +1531,8 @@ Node ExtendedRewriter::partialSubstitute(Node n, const std::map& assign, const std::map& rkinds) { - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::map::const_iterator ita; std::vector visit; TNode cur; diff --git a/src/theory/quantifiers/fmf/bounded_integers.h b/src/theory/quantifiers/fmf/bounded_integers.h index 8e3b9f607..d37e71b72 100644 --- a/src/theory/quantifiers/fmf/bounded_integers.h +++ b/src/theory/quantifiers/fmf/bounded_integers.h @@ -47,9 +47,9 @@ namespace quantifiers { class BoundedIntegers : public QuantifiersModule { - typedef context::CDHashMap NodeBoolMap; - typedef context::CDHashMap NodeIntMap; - typedef context::CDHashMap NodeNodeMap; + typedef context::CDHashMap NodeBoolMap; + typedef context::CDHashMap NodeIntMap; + typedef context::CDHashMap NodeNodeMap; typedef context::CDHashMap IntBoolMap; private: //for determining bounds diff --git a/src/theory/quantifiers/fmf/full_model_check.cpp b/src/theory/quantifiers/fmf/full_model_check.cpp index fd91a94ab..808db7aec 100644 --- a/src/theory/quantifiers/fmf/full_model_check.cpp +++ b/src/theory/quantifiers/fmf/full_model_check.cpp @@ -42,7 +42,7 @@ struct ModelBasisArgSort { std::vector< Node > d_terms; // number of arguments that are model-basis terms - std::unordered_map d_mba_count; + std::unordered_map d_mba_count; bool operator() (int i,int j) { return (d_mba_count[d_terms[i]] < d_mba_count[d_terms[j]]); } diff --git a/src/theory/quantifiers/fmf/full_model_check.h b/src/theory/quantifiers/fmf/full_model_check.h index fdaf18e81..e33d1db6d 100644 --- a/src/theory/quantifiers/fmf/full_model_check.h +++ b/src/theory/quantifiers/fmf/full_model_check.h @@ -96,7 +96,7 @@ protected: std::map d_quant_cond; /** A set of quantified formulas that cannot be handled by model-based * quantifier instantiation */ - std::unordered_set d_unhandledQuant; + std::unordered_set d_unhandledQuant; std::map< TypeNode, Node > d_array_cond; std::map< Node, Node > d_array_term_cond; std::map< Node, std::vector< int > > d_star_insts; diff --git a/src/theory/quantifiers/fun_def_evaluator.cpp b/src/theory/quantifiers/fun_def_evaluator.cpp index a249cf2a8..beb2a33cd 100644 --- a/src/theory/quantifiers/fun_def_evaluator.cpp +++ b/src/theory/quantifiers/fun_def_evaluator.cpp @@ -55,10 +55,10 @@ Node FunDefEvaluator::evaluate(Node n) const Assert(Rewriter::rewrite(n) == n); Trace("fd-eval") << "FunDefEvaluator: evaluate " << n << std::endl; NodeManager* nm = NodeManager::currentNM(); - std::unordered_map funDefCount; - std::unordered_map::iterator itCount; - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map funDefCount; + std::unordered_map::iterator itCount; + std::unordered_map visited; + std::unordered_map::iterator it; std::map::const_iterator itf; std::vector visit; TNode cur; diff --git a/src/theory/quantifiers/instantiate.h b/src/theory/quantifiers/instantiate.h index 42bff316a..9b410dd08 100644 --- a/src/theory/quantifiers/instantiate.h +++ b/src/theory/quantifiers/instantiate.h @@ -100,8 +100,8 @@ class InstLemmaList */ class Instantiate : public QuantifiersUtil { - using NodeInstListMap = context:: - CDHashMap, NodeHashFunction>; + using NodeInstListMap = + context::CDHashMap>; public: Instantiate(QuantifiersState& qs, @@ -352,7 +352,7 @@ class Instantiate : public QuantifiersUtil * The list of quantified formulas for which the domain of d_c_inst_match_trie * is valid. */ - context::CDHashSet d_c_inst_match_trie_dom; + context::CDHashSet d_c_inst_match_trie_dom; /** * A CDProof storing instantiation steps. */ diff --git a/src/theory/quantifiers/proof_checker.cpp b/src/theory/quantifiers/proof_checker.cpp index b2a807197..fae160aa8 100644 --- a/src/theory/quantifiers/proof_checker.cpp +++ b/src/theory/quantifiers/proof_checker.cpp @@ -50,7 +50,7 @@ Node QuantifiersProofRuleChecker::checkInternal( { return Node::null(); } - std::unordered_map subs; + std::unordered_map subs; if (!expr::match(exists[1], p, subs)) { return Node::null(); diff --git a/src/theory/quantifiers/quant_bound_inference.cpp b/src/theory/quantifiers/quant_bound_inference.cpp index 1fbf53761..a78f66c51 100644 --- a/src/theory/quantifiers/quant_bound_inference.cpp +++ b/src/theory/quantifiers/quant_bound_inference.cpp @@ -34,8 +34,7 @@ void QuantifiersBoundInference::finishInit(BoundedIntegers* b) { d_bint = b; } bool QuantifiersBoundInference::mayComplete(TypeNode tn) { - std::unordered_map::iterator it = - d_may_complete.find(tn); + std::unordered_map::iterator it = d_may_complete.find(tn); if (it == d_may_complete.end()) { // cache diff --git a/src/theory/quantifiers/quant_bound_inference.h b/src/theory/quantifiers/quant_bound_inference.h index 0bcb5937a..55e7b0766 100644 --- a/src/theory/quantifiers/quant_bound_inference.h +++ b/src/theory/quantifiers/quant_bound_inference.h @@ -116,7 +116,7 @@ class QuantifiersBoundInference /** Whether finite model finding is enabled */ bool d_isFmf; /** may complete */ - std::unordered_map d_may_complete; + std::unordered_map d_may_complete; /** The bounded integers module, which may help infer bounds */ BoundedIntegers* d_bint; }; diff --git a/src/theory/quantifiers/quant_conflict_find.cpp b/src/theory/quantifiers/quant_conflict_find.cpp index cff9fde0b..8c4d68631 100644 --- a/src/theory/quantifiers/quant_conflict_find.cpp +++ b/src/theory/quantifiers/quant_conflict_find.cpp @@ -2309,7 +2309,7 @@ std::ostream& operator<<(std::ostream& os, const QuantConflictFind::Effort& e) { bool QuantConflictFind::isPropagatingInstance(Node n) const { - std::unordered_set visited; + std::unordered_set visited; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/theory/quantifiers/quant_conflict_find.h b/src/theory/quantifiers/quant_conflict_find.h index 5a36452fe..de521cd07 100644 --- a/src/theory/quantifiers/quant_conflict_find.h +++ b/src/theory/quantifiers/quant_conflict_find.h @@ -193,8 +193,9 @@ class QuantConflictFind : public QuantifiersModule { friend class MatchGen; friend class QuantInfo; - typedef context::CDHashMap NodeBoolMap; -private: + typedef context::CDHashMap NodeBoolMap; + + private: context::CDO< bool > d_conflict; std::map< Kind, Node > d_zero; //for storing nodes created during t-constraint solving (prevents memory leaks) diff --git a/src/theory/quantifiers/quant_split.h b/src/theory/quantifiers/quant_split.h index 06b9c59f5..18aeec773 100644 --- a/src/theory/quantifiers/quant_split.h +++ b/src/theory/quantifiers/quant_split.h @@ -47,7 +47,7 @@ namespace quantifiers { * one variable per quantified formula at a time. */ class QuantDSplit : public QuantifiersModule { - typedef context::CDHashSet NodeSet; + typedef context::CDHashSet NodeSet; public: QuantDSplit(QuantifiersState& qs, diff --git a/src/theory/quantifiers/quantifiers_macros.cpp b/src/theory/quantifiers/quantifiers_macros.cpp index 43a404ff9..e53b1ed13 100644 --- a/src/theory/quantifiers/quantifiers_macros.cpp +++ b/src/theory/quantifiers/quantifiers_macros.cpp @@ -107,8 +107,8 @@ Node QuantifiersMacros::solve(Node lit, bool reqGround) bool QuantifiersMacros::containsBadOp(Node n, Node op, bool reqGround) { - std::unordered_set visited; - std::unordered_set::iterator it; + std::unordered_set visited; + std::unordered_set::iterator it; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/theory/quantifiers/quantifiers_rewriter.cpp b/src/theory/quantifiers/quantifiers_rewriter.cpp index 3df5aa65f..48106b858 100644 --- a/src/theory/quantifiers/quantifiers_rewriter.cpp +++ b/src/theory/quantifiers/quantifiers_rewriter.cpp @@ -1061,7 +1061,7 @@ bool QuantifiersRewriter::getVarElimIneq(Node body, { // compute variables in itm->first, these are not eligible for // elimination - std::unordered_set fvs; + std::unordered_set fvs; expr::getFreeVariables(m.first, fvs); for (const Node& v : fvs) { @@ -1113,8 +1113,7 @@ bool QuantifiersRewriter::getVarElimIneq(Node body, } // traverse the body, invalidate variables if they occur in places other than // the bounds they occur in - std::unordered_map, TNodeHashFunction> - evisited; + std::unordered_map> evisited; std::vector evisit; std::vector evisit_pol; TNode ecur; @@ -1242,13 +1241,12 @@ Node QuantifiersRewriter::computeVarElimination( Node body, std::vector< Node >& return body; } -Node QuantifiersRewriter::computePrenex( - Node q, - Node body, - std::unordered_set& args, - std::unordered_set& nargs, - bool pol, - bool prenexAgg) +Node QuantifiersRewriter::computePrenex(Node q, + Node body, + std::unordered_set& args, + std::unordered_set& nargs, + bool pol, + bool prenexAgg) { NodeManager* nm = NodeManager::currentNM(); Kind k = body.getKind(); @@ -1382,8 +1380,8 @@ Node QuantifiersRewriter::computePrenexAgg(Node n, } else { - std::unordered_set argsSet; - std::unordered_set nargsSet; + std::unordered_set argsSet; + std::unordered_set nargsSet; Node q; Node nn = computePrenex(q, n, argsSet, nargsSet, true, true); Assert(n != nn || argsSet.empty()); @@ -1893,7 +1891,7 @@ Node QuantifiersRewriter::computeOperation(Node f, } else { - std::unordered_set argsSet, nargsSet; + std::unordered_set argsSet, nargsSet; n = computePrenex(f, n, argsSet, nargsSet, true, false); Assert(nargsSet.empty()); args.insert(args.end(), argsSet.begin(), argsSet.end()); diff --git a/src/theory/quantifiers/quantifiers_rewriter.h b/src/theory/quantifiers/quantifiers_rewriter.h index c2f60c7f9..cfc4eca2e 100644 --- a/src/theory/quantifiers/quantifiers_rewriter.h +++ b/src/theory/quantifiers/quantifiers_rewriter.h @@ -247,8 +247,8 @@ class QuantifiersRewriter : public TheoryRewriter */ static Node computePrenex(Node q, Node body, - std::unordered_set& args, - std::unordered_set& nargs, + std::unordered_set& args, + std::unordered_set& nargs, bool pol, bool prenexAgg); /** diff --git a/src/theory/quantifiers/query_generator.h b/src/theory/quantifiers/query_generator.h index 6955245f7..90b30a016 100644 --- a/src/theory/quantifiers/query_generator.h +++ b/src/theory/quantifiers/query_generator.h @@ -70,7 +70,7 @@ class QueryGenerator : public ExprMiner private: /** cache of all terms registered to this generator */ - std::unordered_set d_terms; + std::unordered_set d_terms; /** the threshold used by this module for maximum number of sat points */ unsigned d_deqThresh; /** diff --git a/src/theory/quantifiers/single_inv_partition.cpp b/src/theory/quantifiers/single_inv_partition.cpp index cc11d884c..05492b5b7 100644 --- a/src/theory/quantifiers/single_inv_partition.cpp +++ b/src/theory/quantifiers/single_inv_partition.cpp @@ -285,7 +285,7 @@ bool SingleInvocationPartition::init(std::vector& funcs, Trace("si-prt-debug") << "...normalized invocations to " << cr << std::endl; // now must check if it has other bound variables - std::unordered_set fvs; + std::unordered_set fvs; expr::getFreeVariables(cr, fvs); // bound variables must be contained in the single invocation variables for (const Node& bv : fvs) @@ -316,7 +316,7 @@ bool SingleInvocationPartition::init(std::vector& funcs, Trace("si-prt") << "...not single invocation." << std::endl; singleInvocation = false; // rename bound variables with maximal overlap with si_vars - std::unordered_set fvs; + std::unordered_set fvs; expr::getFreeVariables(cr, fvs); std::vector termsNs; std::vector subsNs; @@ -349,7 +349,7 @@ bool SingleInvocationPartition::init(std::vector& funcs, Trace("si-prt") << ".....got si=" << singleInvocation << ", result : " << cr << std::endl; d_conjuncts[2].push_back(cr); - std::unordered_set fvs; + std::unordered_set fvs; expr::getFreeVariables(cr, fvs); d_all_vars.insert(fvs.begin(), fvs.end()); if (singleInvocation) diff --git a/src/theory/quantifiers/single_inv_partition.h b/src/theory/quantifiers/single_inv_partition.h index 90b8fb3ea..7f8cfc326 100644 --- a/src/theory/quantifiers/single_inv_partition.h +++ b/src/theory/quantifiers/single_inv_partition.h @@ -202,7 +202,7 @@ class SingleInvocationPartition std::vector d_si_vars; /** every free variable of conjuncts[2] */ - std::unordered_set d_all_vars; + std::unordered_set d_all_vars; /** map from functions to first-order variables that anti-skolemized them */ std::map d_func_fo_var; /** map from first-order variables to the function it anti-skolemized */ diff --git a/src/theory/quantifiers/skolemize.cpp b/src/theory/quantifiers/skolemize.cpp index 90e780c44..c9234db2c 100644 --- a/src/theory/quantifiers/skolemize.cpp +++ b/src/theory/quantifiers/skolemize.cpp @@ -102,7 +102,7 @@ TrustNode Skolemize::process(Node q) bool Skolemize::getSkolemConstants(Node q, std::vector& skolems) { - std::unordered_map, NodeHashFunction>::iterator it = + std::unordered_map>::iterator it = d_skolem_constants.find(q); if (it != d_skolem_constants.end()) { @@ -114,7 +114,7 @@ bool Skolemize::getSkolemConstants(Node q, std::vector& skolems) Node Skolemize::getSkolemConstant(Node q, unsigned i) { - std::unordered_map, NodeHashFunction>::iterator it = + std::unordered_map>::iterator it = d_skolem_constants.find(q); if (it != d_skolem_constants.end()) { @@ -326,8 +326,7 @@ Node Skolemize::mkSkolemizedBody(Node f, Node Skolemize::getSkolemizedBody(Node f) { Assert(f.getKind() == FORALL); - std::unordered_map::iterator it = - d_skolem_body.find(f); + std::unordered_map::iterator it = d_skolem_body.find(f); if (it == d_skolem_body.end()) { std::vector fvTypes; @@ -381,8 +380,7 @@ bool Skolemize::isInductionTerm(Node n) void Skolemize::getSkolemTermVectors( std::map >& sks) const { - std::unordered_map, NodeHashFunction>::const_iterator - itk; + std::unordered_map>::const_iterator itk; for (const auto& p : d_skolemized) { Node q = p.first; diff --git a/src/theory/quantifiers/skolemize.h b/src/theory/quantifiers/skolemize.h index 412f7a069..2a09913a9 100644 --- a/src/theory/quantifiers/skolemize.h +++ b/src/theory/quantifiers/skolemize.h @@ -65,7 +65,7 @@ class TermRegistry; */ class Skolemize { - typedef context::CDHashMap NodeNodeMap; + typedef context::CDHashMap NodeNodeMap; public: Skolemize(QuantifiersState& qs, TermRegistry& tr, ProofNodeManager* pnm); @@ -146,10 +146,9 @@ class Skolemize /** quantified formulas that have been skolemized */ NodeNodeMap d_skolemized; /** map from quantified formulas to the list of skolem constants */ - std::unordered_map, NodeHashFunction> - d_skolem_constants; + std::unordered_map> d_skolem_constants; /** map from quantified formulas to their skolemized body */ - std::unordered_map d_skolem_body; + std::unordered_map d_skolem_body; /** Pointer to the proof node manager */ ProofNodeManager* d_pnm; /** Eager proof generator for skolemization lemmas */ diff --git a/src/theory/quantifiers/sygus/cegis.cpp b/src/theory/quantifiers/sygus/cegis.cpp index 6b1369363..a0cebda8e 100644 --- a/src/theory/quantifiers/sygus/cegis.cpp +++ b/src/theory/quantifiers/sygus/cegis.cpp @@ -508,7 +508,7 @@ bool Cegis::getRefinementEvalLemmas(const std::vector& vs, for (unsigned r = 0; r < 2; r++) { - std::unordered_set& rlemmas = + std::unordered_set& rlemmas = r == 0 ? d_refinement_lemma_unit : d_refinement_lemma_conj; for (const Node& lem : rlemmas) { @@ -585,7 +585,7 @@ bool Cegis::checkRefinementEvalLemmas(const std::vector& vs, // Maybe we already evaluated some terms in refinement lemmas. // In particular, the example eval cache for f may have some evaluations // cached, which we add to evalVisited and pass to the evaluator below. - std::unordered_map evalVisited; + std::unordered_map evalVisited; ExampleInfer* ei = d_parent->getExampleInfer(); for (unsigned i = 0, vsize = vs.size(); i < vsize; i++) { @@ -611,7 +611,7 @@ bool Cegis::checkRefinementEvalLemmas(const std::vector& vs, Evaluator* eval = d_tds->getEvaluator(); for (unsigned r = 0; r < 2; r++) { - std::unordered_set& rlemmas = + std::unordered_set& rlemmas = r == 0 ? d_refinement_lemma_unit : d_refinement_lemma_conj; for (const Node& lem : rlemmas) { diff --git a/src/theory/quantifiers/sygus/cegis.h b/src/theory/quantifiers/sygus/cegis.h index db2c44ca9..b9f593b69 100644 --- a/src/theory/quantifiers/sygus/cegis.h +++ b/src/theory/quantifiers/sygus/cegis.h @@ -107,14 +107,14 @@ class Cegis : public SygusModule /** refinement lemmas */ std::vector d_refinement_lemmas; /** (processed) conjunctions of refinement lemmas that are not unit */ - std::unordered_set d_refinement_lemma_conj; + std::unordered_set d_refinement_lemma_conj; /** (processed) conjunctions of refinement lemmas that are unit */ - std::unordered_set d_refinement_lemma_unit; + std::unordered_set d_refinement_lemma_unit; /** substitution entailed by d_refinement_lemma_unit */ std::vector d_rl_eval_hds; std::vector d_rl_vals; /** all variables appearing in refinement lemmas */ - std::unordered_set d_refinement_lemma_vars; + std::unordered_set d_refinement_lemma_vars; /** adds lem as a refinement lemma */ void addRefinementLemma(Node lem); diff --git a/src/theory/quantifiers/sygus/cegis_core_connective.cpp b/src/theory/quantifiers/sygus/cegis_core_connective.cpp index f94bc2ab2..9953c5d05 100644 --- a/src/theory/quantifiers/sygus/cegis_core_connective.cpp +++ b/src/theory/quantifiers/sygus/cegis_core_connective.cpp @@ -330,7 +330,7 @@ bool CegisCoreConnective::constructSolution( { // check refinement points Node etsrn = d == 0 ? etsr : etsr.negate(); - std::unordered_set visited; + std::unordered_set visited; std::vector pt; Node rid = cfilter.getRefinementPt(this, etsrn, visited, pt); if (!rid.isNull()) @@ -447,7 +447,7 @@ void CegisCoreConnective::Component::addFalseCore(Node id, Node CegisCoreConnective::Component::getRefinementPt( CegisCoreConnective* p, Node n, - std::unordered_set& visited, + std::unordered_set& visited, std::vector& ss) { std::vector ctx; @@ -608,7 +608,7 @@ void CegisCoreConnective::getModel(SmtEngine& smt, bool CegisCoreConnective::getUnsatCore( SmtEngine& smt, - const std::unordered_set& queryAsserts, + const std::unordered_set& queryAsserts, std::vector& uasserts) const { UnsatCore uc = smt.getUnsatCore(); @@ -656,10 +656,10 @@ Node CegisCoreConnective::evaluate(Node n, } return nm->mkConst(!expRes); } - std::unordered_map& ec = d_eval_cache[n]; + std::unordered_map& ec = d_eval_cache[n]; if (!id.isNull()) { - std::unordered_map::iterator it = ec.find(id); + std::unordered_map::iterator it = ec.find(id); if (it != ec.end()) { return it->second; @@ -691,7 +691,7 @@ Node CegisCoreConnective::constructSolutionFromPool(Component& ccheck, ? d_true : (asserts.size() == 1 ? asserts[0] : nm->mkNode(AND, asserts)); std::vector mvs; - std::unordered_set visited; + std::unordered_set visited; bool addSuccess = true; // Ensure that the current conjunction evaluates to false on all refinement // points. We get refinement points until we have exhausted. @@ -759,7 +759,7 @@ Node CegisCoreConnective::constructSolutionFromPool(Component& ccheck, // "Let U be a subset of D such that S ^ U ^ ~B is unsat." // and uasserts is set to U. std::vector uasserts; - std::unordered_set queryAsserts; + std::unordered_set queryAsserts; queryAsserts.insert(ccheck.getFormula()); queryAsserts.insert(d_sc); bool hasQuery = getUnsatCore(*checkSol, queryAsserts, uasserts); @@ -796,7 +796,7 @@ Node CegisCoreConnective::constructSolutionFromPool(Component& ccheck, // "Let W be a subset of D such that S ^ W is unsat." // and uasserts is set to W. uasserts.clear(); - std::unordered_set queryAsserts2; + std::unordered_set queryAsserts2; queryAsserts2.insert(d_sc); getUnsatCore(*checkSc, queryAsserts2, uasserts); falseCore = true; diff --git a/src/theory/quantifiers/sygus/cegis_core_connective.h b/src/theory/quantifiers/sygus/cegis_core_connective.h index d8f6fb203..baff98de3 100644 --- a/src/theory/quantifiers/sygus/cegis_core_connective.h +++ b/src/theory/quantifiers/sygus/cegis_core_connective.h @@ -260,7 +260,7 @@ class CegisCoreConnective : public Cegis */ Node getRefinementPt(CegisCoreConnective* p, Node n, - std::unordered_set& visited, + std::unordered_set& visited, std::vector& ss); /** Get term pool, i.e. pool(A)/pool(B) in the algorithms above */ void getTermPool(std::vector& passerts) const; @@ -349,10 +349,9 @@ class CegisCoreConnective : public Cegis * If one of the formulas in queryAsserts was in the unsat core, then this * method returns true. Otherwise, this method returns false. */ - bool getUnsatCore( - SmtEngine& smt, - const std::unordered_set& queryAsserts, - std::vector& uasserts) const; + bool getUnsatCore(SmtEngine& smt, + const std::unordered_set& queryAsserts, + std::vector& uasserts) const; /** * Return the result of checking satisfiability of formula n. * If n was satisfiable, then we store the model for d_vars in mvs. @@ -367,10 +366,7 @@ class CegisCoreConnective : public Cegis */ Node evaluate(Node n, Node id, const std::vector& mvs); /** A cache of the above function */ - std::unordered_map, - NodeHashFunction> - d_eval_cache; + std::unordered_map> d_eval_cache; /** The evaluator utility used for the above function */ Evaluator d_eval; //-----------------------------------end for evaluation diff --git a/src/theory/quantifiers/sygus/enum_stream_substitution.cpp b/src/theory/quantifiers/sygus/enum_stream_substitution.cpp index 02d9f3185..3ae34d82c 100644 --- a/src/theory/quantifiers/sygus/enum_stream_substitution.cpp +++ b/src/theory/quantifiers/sygus/enum_stream_substitution.cpp @@ -74,12 +74,12 @@ void EnumStreamPermutation::reset(Node value) } // collect variables occurring in value std::vector vars; - std::unordered_set visited; + std::unordered_set visited; collectVars(value, vars, visited); // partition permutation variables d_curr_ind = 0; Trace("synth-stream-concrete") << " ..permutting vars :"; - std::unordered_set seen_vars; + std::unordered_set seen_vars; for (const Node& v_cons : vars) { Assert(cons_var.find(v_cons) != cons_var.end()); @@ -231,10 +231,9 @@ unsigned EnumStreamPermutation::getVarClassSize(unsigned id) const return it->second.size(); } -void EnumStreamPermutation::collectVars( - Node n, - std::vector& vars, - std::unordered_set& visited) +void EnumStreamPermutation::collectVars(Node n, + std::vector& vars, + std::unordered_set& visited) { if (visited.find(n) != visited.end()) { diff --git a/src/theory/quantifiers/sygus/enum_stream_substitution.h b/src/theory/quantifiers/sygus/enum_stream_substitution.h index 3e849e9a7..ea028991b 100644 --- a/src/theory/quantifiers/sygus/enum_stream_substitution.h +++ b/src/theory/quantifiers/sygus/enum_stream_substitution.h @@ -82,11 +82,11 @@ class EnumStreamPermutation /** value to which we are generating permutations */ Node d_value; /** generated permutations (modulo rewriting) */ - std::unordered_set d_perm_values; + std::unordered_set d_perm_values; /** retrieves variables occurring in value */ void collectVars(Node n, std::vector& vars, - std::unordered_set& visited); + std::unordered_set& visited); /** Utility for stepwise application of Heap's algorithm for permutation * * see https://en.wikipedia.org/wiki/Heap%27s_algorithm @@ -229,7 +229,7 @@ class EnumStreamSubstitution */ Node d_last; /** generated combinations */ - std::unordered_set d_comb_values; + std::unordered_set d_comb_values; /** permutation utility */ EnumStreamPermutation d_stream_permutations; /** Utility for stepwise generation of ordered subsets of size k from n diff --git a/src/theory/quantifiers/sygus/example_infer.cpp b/src/theory/quantifiers/sygus/example_infer.cpp index 12818685e..d701fe6d9 100644 --- a/src/theory/quantifiers/sygus/example_infer.cpp +++ b/src/theory/quantifiers/sygus/example_infer.cpp @@ -41,8 +41,7 @@ bool ExampleInfer::initialize(Node n, const std::vector& candidates) d_examplesOut[v].clear(); d_examplesTerm[v].clear(); } - std::map, std::unordered_set> - visited; + std::map, std::unordered_set> visited; // n is negated conjecture if (!collectExamples(n, visited, true, false)) { @@ -86,8 +85,7 @@ bool ExampleInfer::initialize(Node n, const std::vector& candidates) bool ExampleInfer::collectExamples( Node n, - std::map, std::unordered_set>& - visited, + std::map, std::unordered_set>& visited, bool hasPol, bool pol) { diff --git a/src/theory/quantifiers/sygus/example_infer.h b/src/theory/quantifiers/sygus/example_infer.h index 921e52c3c..d34e32b0e 100644 --- a/src/theory/quantifiers/sygus/example_infer.h +++ b/src/theory/quantifiers/sygus/example_infer.h @@ -107,8 +107,7 @@ class ExampleInfer */ bool collectExamples( Node n, - std::map, - std::unordered_set>& visited, + std::map, std::unordered_set>& visited, bool hasPol, bool pol); /** Pointer to the sygus term database */ diff --git a/src/theory/quantifiers/sygus/example_min_eval.cpp b/src/theory/quantifiers/sygus/example_min_eval.cpp index 43740708b..8d303b90c 100644 --- a/src/theory/quantifiers/sygus/example_min_eval.cpp +++ b/src/theory/quantifiers/sygus/example_min_eval.cpp @@ -32,7 +32,7 @@ ExampleMinEval::ExampleMinEval(Node n, d_vars.insert(d_vars.end(), vars.begin(), vars.end()); // compute its free variables - std::unordered_set fvs; + std::unordered_set fvs; expr::getFreeVariables(n, fvs); for (size_t i = 0, vsize = vars.size(); i < vsize; i++) { diff --git a/src/theory/quantifiers/sygus/rcons_obligation_info.cpp b/src/theory/quantifiers/sygus/rcons_obligation_info.cpp index 8a8fcf64b..19725e08b 100644 --- a/src/theory/quantifiers/sygus/rcons_obligation_info.cpp +++ b/src/theory/quantifiers/sygus/rcons_obligation_info.cpp @@ -28,8 +28,7 @@ RConsObligationInfo::RConsObligationInfo(Node builtin) : d_builtins({builtin}) { } -const std::unordered_set& -RConsObligationInfo::getBuiltins() const +const std::unordered_set& RConsObligationInfo::getBuiltins() const { return d_builtins; } @@ -44,8 +43,8 @@ void RConsObligationInfo::addBuiltin(Node builtin) d_builtins.emplace(builtin); } -const std::unordered_set& -RConsObligationInfo::getCandidateSolutions() const +const std::unordered_set& RConsObligationInfo::getCandidateSolutions() + const { return d_candSols; } @@ -55,8 +54,7 @@ void RConsObligationInfo::addCandidateSolutionToWatchSet(Node candSol) d_watchSet.emplace(candSol); } -const std::unordered_set& -RConsObligationInfo::getWatchSet() const +const std::unordered_set& RConsObligationInfo::getWatchSet() const { return d_watchSet; } @@ -66,8 +64,7 @@ std::string RConsObligationInfo::obToString(Node k, { std::stringstream ss; ss << "(["; - std::unordered_set::const_iterator it = - obInfo.getBuiltins().cbegin(); + std::unordered_set::const_iterator it = obInfo.getBuiltins().cbegin(); ss << *it; ++it; while (it != obInfo.getBuiltins().cend()) @@ -81,10 +78,9 @@ std::string RConsObligationInfo::obToString(Node k, void RConsObligationInfo::printCandSols( const Node& root, - const std::unordered_map& - obInfo) + const std::unordered_map& obInfo) { - std::unordered_set visited; + std::unordered_set visited; std::vector stack; stack.push_back(root); @@ -103,7 +99,7 @@ void RConsObligationInfo::printCandSols( for (const Node& j : obInfo.at(k).getCandidateSolutions()) { Trace("sygus-rcons") << datatypes::utils::sygusToBuiltin(j) << " "; - std::unordered_set subObs; + std::unordered_set subObs; expr::getVariables(j, subObs); for (const TNode& l : subObs) { diff --git a/src/theory/quantifiers/sygus/rcons_obligation_info.h b/src/theory/quantifiers/sygus/rcons_obligation_info.h index f1a48d561..2fd23c5fa 100644 --- a/src/theory/quantifiers/sygus/rcons_obligation_info.h +++ b/src/theory/quantifiers/sygus/rcons_obligation_info.h @@ -57,7 +57,7 @@ class RConsObligationInfo /** * @return equivalent builtin terms to reconstruct for this class' obligation */ - const std::unordered_set& getBuiltins() const; + const std::unordered_set& getBuiltins() const; /** * Add candidate solution to the set of candidate solutions for the @@ -70,8 +70,7 @@ class RConsObligationInfo /** * @return set of candidate solutions for this class' obligation */ - const std::unordered_set& getCandidateSolutions() - const; + const std::unordered_set& getCandidateSolutions() const; /** * Add candidate solution to the set of candidate solutions waiting for the @@ -85,7 +84,7 @@ class RConsObligationInfo * @return set of candidate solutions waiting for this class' obligation * to be solved */ - const std::unordered_set& getWatchSet() const; + const std::unordered_set& getWatchSet() const; /** * Return a string representation of an obligation. @@ -120,8 +119,7 @@ class RConsObligationInfo */ static void printCandSols( const Node& root, - const std::unordered_map& - obInfo); + const std::unordered_map& obInfo); private: /** Equivalent builtin terms for this class' obligation. @@ -129,7 +127,7 @@ class RConsObligationInfo * To solve the obligation, one of these builtin terms must be reconstructed * in the specified grammar (sygus datatype type) of the obligation. */ - std::unordered_set d_builtins; + std::unordered_set d_builtins; /** A set of candidate solutions to this class' obligation. * * Each candidate solution is a sygus datatype term containing skolem subterms @@ -143,7 +141,7 @@ class RConsObligationInfo * where c_z1 and c_z2 are skolems. Notice that `d_candSols` may contain a * pure term that solves the obligation ((c_+ c_x c_y) in this example). */ - std::unordered_set d_candSols; + std::unordered_set d_candSols; /** A set of candidate solutions waiting for this class' obligation to * be solved. * @@ -151,7 +149,7 @@ class RConsObligationInfo * the watch-set of c_z2. Similarly, (c_+ c_z1 c_z2) and (c_+ c_z1 c_y) are in * the watch-set of c_z1. */ - std::unordered_set d_watchSet; + std::unordered_set d_watchSet; }; } // namespace quantifiers diff --git a/src/theory/quantifiers/sygus/rcons_type_info.h b/src/theory/quantifiers/sygus/rcons_type_info.h index d1d38c3f3..89c6444a5 100644 --- a/src/theory/quantifiers/sygus/rcons_type_info.h +++ b/src/theory/quantifiers/sygus/rcons_type_info.h @@ -93,7 +93,7 @@ class RConsTypeInfo * possible to have multiple obligations to reconstruct the same builtin term * from different sygus datatype types. */ - std::unordered_map d_ob; + std::unordered_map d_ob; }; } // namespace quantifiers diff --git a/src/theory/quantifiers/sygus/sygus_abduct.cpp b/src/theory/quantifiers/sygus/sygus_abduct.cpp index 78cb0dbb1..fc7e7a1b9 100644 --- a/src/theory/quantifiers/sygus/sygus_abduct.cpp +++ b/src/theory/quantifiers/sygus/sygus_abduct.cpp @@ -46,7 +46,7 @@ Node SygusAbduct::mkAbductionConjecture(const std::string& name, { NodeManager* nm = NodeManager::currentNM(); SkolemManager* sm = nm->getSkolemManager(); - std::unordered_set symset; + std::unordered_set symset; for (size_t i = 0, size = asserts.size(); i < size; i++) { expr::getSymbols(asserts[i], symset); diff --git a/src/theory/quantifiers/sygus/sygus_enumerator.cpp b/src/theory/quantifiers/sygus/sygus_enumerator.cpp index 83a4276ab..0cf92b373 100644 --- a/src/theory/quantifiers/sygus/sygus_enumerator.cpp +++ b/src/theory/quantifiers/sygus/sygus_enumerator.cpp @@ -1084,8 +1084,8 @@ Node SygusEnumerator::TermEnumMaster::convertShape( Node n, std::map& vcounter) { NodeManager* nm = NodeManager::currentNM(); - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/theory/quantifiers/sygus/sygus_enumerator.h b/src/theory/quantifiers/sygus/sygus_enumerator.h index c7efae3bb..355108957 100644 --- a/src/theory/quantifiers/sygus/sygus_enumerator.h +++ b/src/theory/quantifiers/sygus/sygus_enumerator.h @@ -204,7 +204,7 @@ class SygusEnumerator : public EnumValGenerator /** the list of sygus terms we have enumerated */ std::vector d_terms; /** the set of builtin terms corresponding to the above list */ - std::unordered_set d_bterms; + std::unordered_set d_bterms; /** * The index of first term whose size is greater than or equal to that size, * if it exists. @@ -501,7 +501,7 @@ class SygusEnumerator : public EnumValGenerator * lemma that entails ~is-C( d_enum ) was registered to * TermDbSygus::registerSymBreakLemma. */ - std::unordered_set d_sbExcTlCons; + std::unordered_set d_sbExcTlCons; //-------------------------------- end externally specified symmetry breaking }; diff --git a/src/theory/quantifiers/sygus/sygus_enumerator_basic.h b/src/theory/quantifiers/sygus/sygus_enumerator_basic.h index 434118af0..bae6f6327 100644 --- a/src/theory/quantifiers/sygus/sygus_enumerator_basic.h +++ b/src/theory/quantifiers/sygus/sygus_enumerator_basic.h @@ -61,7 +61,7 @@ class EnumValGeneratorBasic : public EnumValGenerator /** the current term */ Node d_currTerm; /** cache of (enumerated) builtin values we have enumerated so far */ - std::unordered_set d_cache; + std::unordered_set d_cache; }; } // namespace quantifiers diff --git a/src/theory/quantifiers/sygus/sygus_eval_unfold.cpp b/src/theory/quantifiers/sygus/sygus_eval_unfold.cpp index aff145322..0ef1e7f17 100644 --- a/src/theory/quantifiers/sygus/sygus_eval_unfold.cpp +++ b/src/theory/quantifiers/sygus/sygus_eval_unfold.cpp @@ -76,8 +76,7 @@ void SygusEvalUnfold::registerModelValue(Node a, std::vector& vals, std::vector& exps) { - std::map >::iterator its = - d_subterms.find(a); + std::map >::iterator its = d_subterms.find(a); if (its == d_subterms.end()) { return; diff --git a/src/theory/quantifiers/sygus/sygus_eval_unfold.h b/src/theory/quantifiers/sygus/sygus_eval_unfold.h index c9a0b0ba5..bb181996a 100644 --- a/src/theory/quantifiers/sygus/sygus_eval_unfold.h +++ b/src/theory/quantifiers/sygus/sygus_eval_unfold.h @@ -132,7 +132,7 @@ class SygusEvalUnfold /** sygus term database associated with this utility */ TermDbSygus* d_tds; /** the set of evaluation terms we have already processed */ - std::unordered_set d_eval_processed; + std::unordered_set d_eval_processed; /** map from evaluation heads to evaluation function applications */ std::map > d_evals; /** @@ -150,7 +150,7 @@ class SygusEvalUnfold * This maps anchor terms to the set of shared selector chains with * them as an anchor, for example x may map to { x, x.1, x.2, x.1.1 }. */ - std::map > d_subterms; + std::map > d_subterms; }; } // namespace quantifiers diff --git a/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp b/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp index a532e6cad..263b36abf 100644 --- a/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp +++ b/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp @@ -58,11 +58,10 @@ bool CegGrammarConstructor::hasSyntaxRestrictions(Node q) } void CegGrammarConstructor::collectTerms( - Node n, - std::map>& consts) + Node n, std::map>& consts) { - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::stack visit; TNode cur; visit.push(n); @@ -100,13 +99,13 @@ Node CegGrammarConstructor::process(Node q, // now, construct the grammar Trace("cegqi") << "SynthConjecture : convert to deep embedding..." << std::endl; - std::map> extra_cons; + std::map> extra_cons; if( options::sygusAddConstGrammar() ){ Trace("cegqi") << "SynthConjecture : collect constants..." << std::endl; collectTerms( q[1], extra_cons ); } - std::map> exc_cons; - std::map> inc_cons; + std::map> exc_cons; + std::map> inc_cons; NodeManager* nm = NodeManager::currentNM(); @@ -148,7 +147,7 @@ Node CegGrammarConstructor::process(Node q, // check which arguments are irrelevant std::unordered_set arg_irrelevant; d_parent->getProcess()->getIrrelevantArgs(sf, arg_irrelevant); - std::unordered_set term_irlv; + std::unordered_set term_irlv; // convert to term for (const unsigned& arg : arg_irrelevant) { @@ -279,8 +278,8 @@ Node CegGrammarConstructor::process(Node q, Node CegGrammarConstructor::convertToEmbedding(Node n) { NodeManager* nm = NodeManager::currentNM(); - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::stack visit; TNode cur; visit.push(n); @@ -552,12 +551,10 @@ void CegGrammarConstructor::mkSygusDefaultGrammar( TypeNode range, Node bvl, const std::string& fun, - std::map>& extra_cons, - std::map>& - exclude_cons, - const std::map>& - include_cons, - std::unordered_set& term_irrelevant, + std::map>& extra_cons, + std::map>& exclude_cons, + const std::map>& include_cons, + std::unordered_set& term_irrelevant, std::vector& sdts, std::set& unres) { @@ -601,8 +598,7 @@ void CegGrammarConstructor::mkSygusDefaultGrammar( // create placeholders for collected types std::vector unres_types; std::map type_to_unres; - std::map>::const_iterator - itc; + std::map>::const_iterator itc; // maps types to the index of its "any term" grammar construction std::map> typeToGAnyTerm; options::SygusGrammarConsMode sgcm = options::sygusGrammarConsMode(); @@ -726,12 +722,11 @@ void CegGrammarConstructor::mkSygusDefaultGrammar( } else { - std::map>::iterator - itec = extra_cons.find(types[i]); + std::map>::iterator itec = + extra_cons.find(types[i]); if (itec != extra_cons.end()) { - for (std::unordered_set::iterator set_it = - itec->second.begin(); + for (std::unordered_set::iterator set_it = itec->second.begin(); set_it != itec->second.end(); ++set_it) { @@ -1493,16 +1488,14 @@ TypeNode CegGrammarConstructor::mkSygusDefaultType( TypeNode range, Node bvl, const std::string& fun, - std::map>& extra_cons, - std::map>& - exclude_cons, - std::map>& - include_cons, - std::unordered_set& term_irrelevant) + std::map>& extra_cons, + std::map>& exclude_cons, + std::map>& include_cons, + std::unordered_set& term_irrelevant) { Trace("sygus-grammar-def") << "*** Make sygus default type " << range << ", make datatypes..." << std::endl; - for (std::map>::iterator - it = extra_cons.begin(); + for (std::map>::iterator it = + extra_cons.begin(); it != extra_cons.end(); ++it) { diff --git a/src/theory/quantifiers/sygus/sygus_grammar_cons.h b/src/theory/quantifiers/sygus/sygus_grammar_cons.h index 8745f7d61..a743bed2f 100644 --- a/src/theory/quantifiers/sygus/sygus_grammar_cons.h +++ b/src/theory/quantifiers/sygus/sygus_grammar_cons.h @@ -111,12 +111,10 @@ public: TypeNode range, Node bvl, const std::string& fun, - std::map>& extra_cons, - std::map>& - exclude_cons, - std::map>& - include_cons, - std::unordered_set& term_irrelevant); + std::map>& extra_cons, + std::map>& exclude_cons, + std::map>& include_cons, + std::unordered_set& term_irrelevant); /** * Make the default sygus datatype type corresponding to builtin type range. @@ -125,10 +123,10 @@ public: Node bvl, const std::string& fun) { - std::map> extra_cons; - std::map> exclude_cons; - std::map> include_cons; - std::unordered_set term_irrelevant; + std::map> extra_cons; + std::map> exclude_cons; + std::map> include_cons; + std::unordered_set term_irrelevant; return mkSygusDefaultType(range, bvl, fun, @@ -183,9 +181,8 @@ public: /** is the syntax restricted? */ bool d_is_syntax_restricted; /** collect terms */ - void collectTerms( - Node n, - std::map>& consts); + void collectTerms(Node n, + std::map>& consts); //---------------- grammar construction /** A class for generating sygus datatypes */ class SygusDatatypeGenerator @@ -211,12 +208,12 @@ public: /** Should we include constructor with operator op? */ bool shouldInclude(Node op) const; /** The constructors that should be excluded. */ - std::unordered_set d_exclude_cons; + std::unordered_set d_exclude_cons; /** * If this set is non-empty, then only include variables and constructors * from it. */ - std::unordered_set d_include_cons; + std::unordered_set d_include_cons; /** The sygus datatype we are generating. */ SygusDatatype d_sdt; }; @@ -236,13 +233,10 @@ public: TypeNode range, Node bvl, const std::string& fun, - std::map>& - extra_cons, - std::map>& - exclude_cons, - const std::map>& - include_cons, - std::unordered_set& term_irrelevant, + std::map>& extra_cons, + std::map>& exclude_cons, + const std::map>& include_cons, + std::unordered_set& term_irrelevant, std::vector& sdts, std::set& unres); diff --git a/src/theory/quantifiers/sygus/sygus_interpol.cpp b/src/theory/quantifiers/sygus/sygus_interpol.cpp index 3c8320d8c..426ad07ef 100644 --- a/src/theory/quantifiers/sygus/sygus_interpol.cpp +++ b/src/theory/quantifiers/sygus/sygus_interpol.cpp @@ -38,8 +38,8 @@ void SygusInterpol::collectSymbols(const std::vector& axioms, const Node& conj) { Trace("sygus-interpol-debug") << "Collect symbols..." << std::endl; - std::unordered_set symSetAxioms; - std::unordered_set symSetConj; + std::unordered_set symSetAxioms; + std::unordered_set symSetConj; for (size_t i = 0, size = axioms.size(); i < size; i++) { expr::getSymbols(axioms[i], symSetAxioms); @@ -96,7 +96,7 @@ void SygusInterpol::createVariables(bool needsShared) void SygusInterpol::getIncludeCons( const std::vector& axioms, const Node& conj, - std::map>& result) + std::map>& result) { NodeManager* nm = NodeManager::currentNM(); Assert(options::produceInterpols() != options::ProduceInterpols::NONE); @@ -116,38 +116,35 @@ void SygusInterpol::getIncludeCons( else if (options::produceInterpols() == options::ProduceInterpols::SHARED) { // Get operators from axioms - std::map> - include_cons_axioms; + std::map> include_cons_axioms; Node tmpAssumptions = (axioms.size() == 1 ? axioms[0] : nm->mkNode(kind::AND, axioms)); expr::getOperatorsMap(tmpAssumptions, include_cons_axioms); // Get operators from conj - std::map> - include_cons_conj; + std::map> include_cons_conj; expr::getOperatorsMap(conj, include_cons_conj); // Compute intersection - for (std::map>::iterator it = + for (std::map>::iterator it = include_cons_axioms.begin(); it != include_cons_axioms.end(); it++) { TypeNode tn = it->first; - std::unordered_set axiomsOps = it->second; - std::map>::iterator - concIter = include_cons_conj.find(tn); + std::unordered_set axiomsOps = it->second; + std::map>::iterator concIter = + include_cons_conj.find(tn); if (concIter != include_cons_conj.end()) { - std::unordered_set conjOps = concIter->second; + std::unordered_set conjOps = concIter->second; for (const Node& n : axiomsOps) { if (conjOps.find(n) != conjOps.end()) { if (result.find(tn) == result.end()) { - result[tn] = std::unordered_set(); + result[tn] = std::unordered_set(); } result[tn].insert(n); } @@ -184,11 +181,11 @@ TypeNode SygusInterpol::setSynthGrammar(const TypeNode& itpGType, else { // set default grammar - std::map> extra_cons; - std::map> exclude_cons; - std::map> include_cons; + std::map> extra_cons; + std::map> exclude_cons; + std::map> include_cons; getIncludeCons(axioms, conj, include_cons); - std::unordered_set terms_irrelevant; + std::unordered_set terms_irrelevant; itpGTypeS = CegGrammarConstructor::mkSygusDefaultType( NodeManager::currentNM()->booleanType(), d_ibvlShared, diff --git a/src/theory/quantifiers/sygus/sygus_interpol.h b/src/theory/quantifiers/sygus/sygus_interpol.h index c96f23e00..07f5ed4ad 100644 --- a/src/theory/quantifiers/sygus/sygus_interpol.h +++ b/src/theory/quantifiers/sygus/sygus_interpol.h @@ -122,10 +122,9 @@ class SygusInterpol * @param conj input argument * @param result the return value */ - void getIncludeCons( - const std::vector& axioms, - const Node& conj, - std::map>& result); + void getIncludeCons(const std::vector& axioms, + const Node& conj, + std::map>& result); /** * Set up the grammar for the interpol-to-synthesis. @@ -180,7 +179,7 @@ class SygusInterpol /** * unordered set for shared symbols between axioms and conjecture. */ - std::unordered_set d_symSetShared; + std::unordered_set d_symSetShared; /** * free variables created from d_syms. */ diff --git a/src/theory/quantifiers/sygus/sygus_invariance.cpp b/src/theory/quantifiers/sygus/sygus_invariance.cpp index 966d341c1..78f5c49e6 100644 --- a/src/theory/quantifiers/sygus/sygus_invariance.cpp +++ b/src/theory/quantifiers/sygus/sygus_invariance.cpp @@ -57,7 +57,7 @@ Node EvalSygusInvarianceTest::doEvaluateWithUnfolding(TermDbSygus* tds, Node n) bool EvalSygusInvarianceTest::invariant(TermDbSygus* tds, Node nvn, Node x) { TNode tnvn = nvn; - std::unordered_map cache; + std::unordered_map cache; for (const Node& c : d_terms) { Node conj_subs = c.substitute(d_var, tnvn, cache); diff --git a/src/theory/quantifiers/sygus/sygus_invariance.h b/src/theory/quantifiers/sygus/sygus_invariance.h index 0fc610580..ca5f057b1 100644 --- a/src/theory/quantifiers/sygus/sygus_invariance.h +++ b/src/theory/quantifiers/sygus/sygus_invariance.h @@ -138,7 +138,7 @@ class EvalSygusInvarianceTest : public SygusInvarianceTest */ bool d_is_conjunctive; /** cache of n -> the simplified form of eval( n ) */ - std::unordered_map d_visited; + std::unordered_map d_visited; }; /** EquivSygusInvarianceTest diff --git a/src/theory/quantifiers/sygus/sygus_process_conj.cpp b/src/theory/quantifiers/sygus/sygus_process_conj.cpp index 3f802c954..f5cadc607 100644 --- a/src/theory/quantifiers/sygus/sygus_process_conj.cpp +++ b/src/theory/quantifiers/sygus/sygus_process_conj.cpp @@ -36,8 +36,7 @@ void SynthConjectureProcessFun::init(Node f) Assert(f.getType().isFunction()); // initialize the arguments - std::unordered_map - type_to_init_deq_id; + std::unordered_map type_to_init_deq_id; std::vector argTypes = f.getType().getArgTypes(); for (unsigned j = 0; j < argTypes.size(); j++) { @@ -77,8 +76,7 @@ bool SynthConjectureProcessFun::isArgVar(Node n, unsigned& arg_index) { if (n.isVar()) { - std::unordered_map::iterator ita = - d_arg_var_num.find(n); + std::unordered_map::iterator ita = d_arg_var_num.find(n); if (ita != d_arg_var_num.end()) { arg_index = ita->second; @@ -90,13 +88,11 @@ bool SynthConjectureProcessFun::isArgVar(Node n, unsigned& arg_index) Node SynthConjectureProcessFun::inferDefinition( Node n, - std::unordered_map& term_to_arg_carry, - std::unordered_map, - NodeHashFunction>& free_vars) + std::unordered_map& term_to_arg_carry, + std::unordered_map>& free_vars) { - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::stack visit; TNode cur; visit.push(n); @@ -115,7 +111,7 @@ Node SynthConjectureProcessFun::inferDefinition( else { // if it is term used by another argument, use it - std::unordered_map::iterator itt = + std::unordered_map::iterator itt = term_to_arg_carry.find(cur); if (itt != term_to_arg_carry.end()) { @@ -185,7 +181,7 @@ unsigned SynthConjectureProcessFun::assignRelevantDef( } unsigned rid = args[id]; // for merging previously equivalent definitions - std::unordered_map prev_defs; + std::unordered_map prev_defs; for (unsigned j = 0; j < args.size(); j++) { unsigned i = args[j]; @@ -199,8 +195,7 @@ unsigned SynthConjectureProcessFun::assignRelevantDef( else { Node t = d_arg_props[i].d_template; - std::unordered_map::iterator itt = - prev_defs.find(t); + std::unordered_map::iterator itt = prev_defs.find(t); if (itt != prev_defs.end()) { // merge previously equivalent definitions @@ -254,10 +249,8 @@ void SynthConjectureProcessFun::processTerms( std::vector& ns, std::vector& ks, Node nf, - std::unordered_set& synth_fv, - std::unordered_map, - NodeHashFunction>& free_vars) + std::unordered_set& synth_fv, + std::unordered_map>& free_vars) { Assert(ns.size() == ks.size()); Trace("sygus-process-arg-deps") << "Process " << ns.size() @@ -266,14 +259,14 @@ void SynthConjectureProcessFun::processTerms( // get the relevant variables // relevant variables are those that appear in the body of the conjunction - std::unordered_set rlv_vars; + std::unordered_set rlv_vars; Assert(free_vars.find(nf) != free_vars.end()); rlv_vars = free_vars[nf]; // get the single occurrence variables // single occurrence variables are those that appear in only one position, // as an argument to the function-to-synthesize. - std::unordered_map single_occ_variables; + std::unordered_map single_occ_variables; for (unsigned index = 0; index < ns.size(); index++) { Node n = ns[index]; @@ -282,7 +275,7 @@ void SynthConjectureProcessFun::processTerms( Node nn = n[i]; if (nn.isVar()) { - std::unordered_map::iterator its = + std::unordered_map::iterator its = single_occ_variables.find(nn); if (its == single_occ_variables.end()) { @@ -296,12 +289,10 @@ void SynthConjectureProcessFun::processTerms( } else { - std::unordered_map, - NodeHashFunction>::iterator itf = free_vars.find(nn); + std::unordered_map>::iterator itf = + free_vars.find(nn); Assert(itf != free_vars.end()); - for (std::unordered_set::iterator itfv = - itf->second.begin(); + for (std::unordered_set::iterator itfv = itf->second.begin(); itfv != itf->second.end(); ++itfv) { @@ -327,10 +318,9 @@ void SynthConjectureProcessFun::processTerms( std::unordered_map n_arg_map; // terms to the argument that is carrying it. // the arguments in the range of this map must be marked as relevant. - std::unordered_map term_to_arg_carry; + std::unordered_map term_to_arg_carry; // map of terms to (unprocessed) arguments where it occurs - std::unordered_map, NodeHashFunction> - term_to_args; + std::unordered_map> term_to_args; // initialize for (unsigned a = 0; a < n.getNumChildren(); a++) @@ -408,8 +398,8 @@ void SynthConjectureProcessFun::processTerms( // list of all arguments std::vector arg_list; // now look at the terms for unprocessed arguments - for (std::unordered_map, NodeHashFunction>:: - iterator it = term_to_args.begin(); + for (std::unordered_map>::iterator it = + term_to_args.begin(); it != term_to_args.end(); ++it) { @@ -454,8 +444,8 @@ void SynthConjectureProcessFun::processTerms( { infer_def_t = Node::null(); // see if we can infer a definition - for (std::unordered_map, NodeHashFunction>:: - iterator it = term_to_args.begin(); + for (std::unordered_map>::iterator it = + term_to_args.begin(); it != term_to_args.end(); ++it) { @@ -483,8 +473,8 @@ void SynthConjectureProcessFun::processTerms( while (arg_list_counter < arg_list.size() && !success) { Node curr = arg_list[arg_list_counter]; - std::unordered_map, NodeHashFunction>:: - iterator it = term_to_args.find(curr); + std::unordered_map>::iterator it = + term_to_args.find(curr); if (it != term_to_args.end()) { Trace("sygus-process-arg-deps") << " *** Decide relevant " << curr @@ -548,7 +538,7 @@ Node SynthConjectureProcess::postSimplify(Node q) // get the base on the conjecture Node base = q[1]; - std::unordered_set synth_fv; + std::unordered_set synth_fv; if (base.getKind() == NOT && base[0].getKind() == FORALL) { for (unsigned j = 0, size = base[0][0].getNumChildren(); j < size; j++) @@ -617,8 +607,9 @@ bool SynthConjectureProcess::getIrrelevantArgs( return false; } -void SynthConjectureProcess::processConjunct( - Node n, Node f, std::unordered_set& synth_fv) +void SynthConjectureProcess::processConjunct(Node n, + Node f, + std::unordered_set& synth_fv) { Trace("sygus-process-arg-deps") << "Process conjunct: " << std::endl; Trace("sygus-process-arg-deps") << " " << n << " for synth fun " << f @@ -626,24 +617,20 @@ void SynthConjectureProcess::processConjunct( // first, flatten the conjunct // make a copy of free variables since we may add new ones - std::unordered_set synth_fv_n = synth_fv; - std::unordered_map defs; + std::unordered_set synth_fv_n = synth_fv; + std::unordered_map defs; Node nf = flatten(n, f, synth_fv_n, defs); Trace("sygus-process-arg-deps") << "Flattened to: " << std::endl; Trace("sygus-process-arg-deps") << " " << nf << std::endl; // get free variables in nf - std::unordered_map, - NodeHashFunction> - free_vars; + std::unordered_map> free_vars; getFreeVariables(nf, synth_fv_n, free_vars); // get free variables in each application std::vector ns; std::vector ks; - for (std::unordered_map::iterator it = - defs.begin(); + for (std::unordered_map::iterator it = defs.begin(); it != defs.end(); ++it) { @@ -666,11 +653,11 @@ void SynthConjectureProcess::processConjunct( Node SynthConjectureProcess::SynthConjectureProcess::flatten( Node n, Node f, - std::unordered_set& synth_fv, - std::unordered_map& defs) + std::unordered_set& synth_fv, + std::unordered_map& defs) { - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::stack visit; Node cur; visit.push(n); @@ -730,15 +717,13 @@ Node SynthConjectureProcess::SynthConjectureProcess::flatten( void SynthConjectureProcess::getFreeVariables( Node n, - std::unordered_set& synth_fv, - std::unordered_map, - NodeHashFunction>& free_vars) + std::unordered_set& synth_fv, + std::unordered_map>& free_vars) { // first must compute free variables in each subterm of n, // as well as contains_synth_fun - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::stack visit; Node cur; visit.push(n); diff --git a/src/theory/quantifiers/sygus/sygus_process_conj.h b/src/theory/quantifiers/sygus/sygus_process_conj.h index 3a2c6eb4d..d751e4c9c 100644 --- a/src/theory/quantifiers/sygus/sygus_process_conj.h +++ b/src/theory/quantifiers/sygus/sygus_process_conj.h @@ -144,10 +144,8 @@ struct SynthConjectureProcessFun std::vector& ns, std::vector& ks, Node nf, - std::unordered_set& synth_fv, - std::unordered_map, - NodeHashFunction>& free_vars); + std::unordered_set& synth_fv, + std::unordered_map>& free_vars); /** is the i^th argument of the function-to-synthesize of this class relevant? */ bool isArgRelevant(unsigned i); @@ -169,7 +167,7 @@ struct SynthConjectureProcessFun /** map from d_arg_vars to the argument # * they represent. */ - std::unordered_map d_arg_var_num; + std::unordered_map d_arg_var_num; /** check match * This function returns true iff we can infer: * cn * { x -> n_arg_map[d_arg_var_num[x]] | x in d_arg_vars } = n @@ -217,10 +215,8 @@ struct SynthConjectureProcessFun */ Node inferDefinition( Node n, - std::unordered_map& term_to_arg_carry, - std::unordered_map, - NodeHashFunction>& free_vars); + std::unordered_map& term_to_arg_carry, + std::unordered_map>& free_vars); /** Assign relevant definition * * If def is non-null, @@ -322,9 +318,7 @@ class SynthConjectureProcess * is the set of (inner) universal variables in the synthesis * conjecture. */ - void processConjunct(Node n, - Node f, - std::unordered_set& synth_fv); + void processConjunct(Node n, Node f, std::unordered_set& synth_fv); /** flatten * * Flattens all applications of f in term n. @@ -337,18 +331,16 @@ class SynthConjectureProcess */ Node flatten(Node n, Node f, - std::unordered_set& synth_fv, - std::unordered_map& defs); + std::unordered_set& synth_fv, + std::unordered_map& defs); /** get free variables * Constructs a map of all free variables that occur in n * from synth_fv and stores them in the map free_vars. */ void getFreeVariables( Node n, - std::unordered_set& synth_fv, - std::unordered_map, - NodeHashFunction>& free_vars); + std::unordered_set& synth_fv, + std::unordered_map>& free_vars); /** for each synth-fun, information that is specific to this conjecture */ std::map d_sf_info; diff --git a/src/theory/quantifiers/sygus/sygus_reconstruct.cpp b/src/theory/quantifiers/sygus/sygus_reconstruct.cpp index 1321ad879..719bb448b 100644 --- a/src/theory/quantifiers/sygus/sygus_reconstruct.cpp +++ b/src/theory/quantifiers/sygus/sygus_reconstruct.cpp @@ -70,7 +70,7 @@ Node SygusReconstruct::reconstructSolution(Node sol, // the set of unique (up to rewriting) patterns/shapes in the grammar used by // matching - std::unordered_map, TypeNodeHashFunction> pool; + std::unordered_map> pool; uint64_t count = 0; @@ -209,7 +209,7 @@ TypeObligationSetMap SygusReconstruct::matchNewObs(Node k, Node sz) // obligations generated by match. Note that we might have already seen (and // even solved) those obligations, hence the name "candidate obligations" - std::unordered_map candObs; + std::unordered_map candObs; // the builtin terms corresponding to sygus variables in the grammar are bound // variables. However, we want the `match` method to treat them as ground // terms. So, we add redundant substitutions @@ -444,10 +444,10 @@ void SygusReconstruct::removeSolvedObs(TypeObligationSetMap& unsolvedObs) Node SygusReconstruct::mkGround(Node n) const { // get the set of bound variables in n - std::unordered_set vars; + std::unordered_set vars; expr::getVariables(n, vars); - std::unordered_map subs; + std::unordered_map subs; // generate a ground value for each one of those variables for (const TNode& var : vars) @@ -492,8 +492,7 @@ void SygusReconstruct::clear() } void SygusReconstruct::printPool( - const std::unordered_map, TypeNodeHashFunction>& - pool) const + const std::unordered_map>& pool) const { Trace("sygus-rcons") << "\nPool:\n["; diff --git a/src/theory/quantifiers/sygus/sygus_reconstruct.h b/src/theory/quantifiers/sygus/sygus_reconstruct.h index 334b95e71..e3c214bde 100644 --- a/src/theory/quantifiers/sygus/sygus_reconstruct.h +++ b/src/theory/quantifiers/sygus/sygus_reconstruct.h @@ -28,9 +28,8 @@ namespace cvc5 { namespace theory { namespace quantifiers { -using ObligationSet = std::unordered_set; -using TypeObligationSetMap = - std::unordered_map; +using ObligationSet = std::unordered_set; +using TypeObligationSetMap = std::unordered_map; /** SygusReconstruct * @@ -288,9 +287,8 @@ class SygusReconstruct : public expr::NotifyMatch * * @param pool a pool of patterns/shapes to print */ - void printPool(const std::unordered_map, - TypeNodeHashFunction>& pool) const; + void printPool( + const std::unordered_map>& pool) const; /** pointer to the sygus term database */ TermDbSygus* d_tds; @@ -298,20 +296,20 @@ class SygusReconstruct : public expr::NotifyMatch SygusStatistics& d_stats; /** a map from an obligation to its reconstruction info */ - std::unordered_map d_obInfo; + std::unordered_map d_obInfo; /** a map from a sygus datatype type to its reconstruction info */ - std::unordered_map d_stnInfo; + std::unordered_map d_stnInfo; /** a map from an obligation to its sygus solution (if it exists) */ - std::unordered_map d_sol; + std::unordered_map d_sol; /** a map from a candidate solution to its sub-obligations */ - std::unordered_map, NodeHashFunction> d_subObs; + std::unordered_map> d_subObs; /** a map from a candidate solution to its parent obligation */ - std::unordered_map d_parentOb; + std::unordered_map d_parentOb; /** a cache of sygus variables treated as ground terms by matching */ - std::unordered_map d_sygusVars; + std::unordered_map d_sygusVars; /** A trie for filtering out redundant terms from the paterns pool */ expr::MatchTrie d_poolTrie; diff --git a/src/theory/quantifiers/sygus/sygus_repair_const.cpp b/src/theory/quantifiers/sygus/sygus_repair_const.cpp index 62f362e2b..d45a96d3b 100644 --- a/src/theory/quantifiers/sygus/sygus_repair_const.cpp +++ b/src/theory/quantifiers/sygus/sygus_repair_const.cpp @@ -286,7 +286,7 @@ bool SygusRepairConst::repairSolution(Node sygusBody, bool SygusRepairConst::mustRepair(Node n) { - std::unordered_set visited; + std::unordered_set visited; std::vector visit; TNode cur; visit.push_back(n); @@ -365,8 +365,8 @@ Node SygusRepairConst::getSkeleton(Node n, } NodeManager* nm = NodeManager::currentNM(); // get the most general candidate skeleton of n - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(n); @@ -464,8 +464,8 @@ Node SygusRepairConst::getFoQuery(Node body, // now, we must replace all terms of the form eval( z_i, t1...tn ) with // a fresh first-order variable w_i, where z_i is a variable introduced in // the skeleton inference step (z_i is a variable in sk_vars). - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(body); @@ -577,8 +577,8 @@ bool SygusRepairConst::getFitToLogicExcludeVar(LogicInfo& logic, // should have at least one restriction Assert(restrictLA); - std::unordered_set visited; - std::unordered_set::iterator it; + std::unordered_set visited; + std::unordered_set::iterator it; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/theory/quantifiers/sygus/sygus_repair_const.h b/src/theory/quantifiers/sygus/sygus_repair_const.h index 1a2159b10..f0452a59c 100644 --- a/src/theory/quantifiers/sygus/sygus_repair_const.h +++ b/src/theory/quantifiers/sygus/sygus_repair_const.h @@ -123,7 +123,7 @@ class SygusRepairConst /** reverse map of d_sk_to_fo */ std::map d_fo_to_sk; /** a cache of satisfiability queries of the form [***] above we have tried */ - std::unordered_set d_queries; + std::unordered_set d_queries; /** * Register information for sygus type tn, tprocessed stores the set of * already registered types. diff --git a/src/theory/quantifiers/sygus/sygus_unif_io.cpp b/src/theory/quantifiers/sygus/sygus_unif_io.cpp index 7f816a97f..4cf0e6bb4 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_io.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif_io.cpp @@ -1128,9 +1128,8 @@ Node SygusUnifIo::constructSol( if (ret_dt.isNull() && !retValMod) { bool firstTime = true; - std::unordered_set intersection; - std::map>::iterator - pit; + std::unordered_set intersection; + std::map>::iterator pit; for (size_t i = 0, nvals = x.d_vals.size(); i < nvals; i++) { if (x.d_vals[i].getConst()) diff --git a/src/theory/quantifiers/sygus/sygus_unif_io.h b/src/theory/quantifiers/sygus/sygus_unif_io.h index ef6732cd6..fd918c996 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_io.h +++ b/src/theory/quantifiers/sygus/sygus_unif_io.h @@ -311,9 +311,7 @@ class SygusUnifIo : public SygusUnif * A -> ite( A, B, C ) | ... * where terms of type B and C can both act as solutions. */ - std::map>> - d_psolutions; + std::map>> d_psolutions; /** * This flag is set to true if the solution construction was * non-deterministic with respect to failure/success. diff --git a/src/theory/quantifiers/sygus/sygus_unif_rl.h b/src/theory/quantifiers/sygus/sygus_unif_rl.h index 356c908dc..a5c7af161 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_rl.h +++ b/src/theory/quantifiers/sygus/sygus_unif_rl.h @@ -30,10 +30,10 @@ namespace quantifiers { using BoolNodePair = std::pair; using BoolNodePairHashFunction = - PairHashFunction; + PairHashFunction>; using BoolNodePairMap = std::unordered_map; -using NodePairMap = std::unordered_map; +using NodePairMap = std::unordered_map; using NodePair = std::pair; class SynthConjecture; @@ -120,7 +120,7 @@ class SygusUnifRl : public SygusUnif /** Whether we are additionally using information gain heuristics */ bool d_useCondPoolIGain; /* Functions-to-synthesize (a.k.a. candidates) with unification strategies */ - std::unordered_set d_unif_candidates; + std::unordered_set d_unif_candidates; /** construct sol */ Node constructSol(Node f, Node e, @@ -248,7 +248,7 @@ class SygusUnifRl : public SygusUnif /** gathered evaluation point heads */ std::vector d_hds; /** all enumerated model values for conditions */ - std::unordered_set d_cond_mvs; + std::unordered_set d_cond_mvs; /** get condition enumerator */ Node getConditionEnumerator() const { return d_cond_enum; } /** set conditions */ @@ -262,7 +262,7 @@ class SygusUnifRl : public SygusUnif Node d_false; /** Accumulates solutions built when considering all enumerated condition * values (which may generate repeated solutions) */ - std::unordered_set d_sols; + std::unordered_set d_sols; /** * Conditional enumerator variables corresponding to the condition values in * d_conds. These are used for generating separation lemmas during diff --git a/src/theory/quantifiers/sygus/synth_engine.h b/src/theory/quantifiers/sygus/synth_engine.h index ec4ade86b..df73c4821 100644 --- a/src/theory/quantifiers/sygus/synth_engine.h +++ b/src/theory/quantifiers/sygus/synth_engine.h @@ -31,7 +31,7 @@ namespace quantifiers { class SynthEngine : public QuantifiersModule { - typedef context::CDHashMap NodeBoolMap; + typedef context::CDHashMap NodeBoolMap; public: SynthEngine(QuantifiersState& qs, diff --git a/src/theory/quantifiers/sygus/term_database_sygus.cpp b/src/theory/quantifiers/sygus/term_database_sygus.cpp index b18a7c796..826563401 100644 --- a/src/theory/quantifiers/sygus/term_database_sygus.cpp +++ b/src/theory/quantifiers/sygus/term_database_sygus.cpp @@ -1018,11 +1018,10 @@ Node TermDbSygus::evaluateBuiltin(TypeNode tn, return rewriteNode(res); } -Node TermDbSygus::evaluateWithUnfolding( - Node n, std::unordered_map& visited) +Node TermDbSygus::evaluateWithUnfolding(Node n, + std::unordered_map& visited) { - std::unordered_map::iterator it = - visited.find(n); + std::unordered_map::iterator it = visited.find(n); if( it==visited.end() ){ Node ret = n; while (ret.getKind() == DT_SYGUS_EVAL @@ -1068,7 +1067,7 @@ Node TermDbSygus::evaluateWithUnfolding( Node TermDbSygus::evaluateWithUnfolding(Node n) { - std::unordered_map visited; + std::unordered_map visited; return evaluateWithUnfolding(n, visited); } diff --git a/src/theory/quantifiers/sygus/term_database_sygus.h b/src/theory/quantifiers/sygus/term_database_sygus.h index c8a422a0e..e0a812069 100644 --- a/src/theory/quantifiers/sygus/term_database_sygus.h +++ b/src/theory/quantifiers/sygus/term_database_sygus.h @@ -285,8 +285,7 @@ class TermDbSygus { */ Node evaluateWithUnfolding(Node n); /** same as above, but with a cache of visited nodes */ - Node evaluateWithUnfolding( - Node n, std::unordered_map& visited); + Node evaluateWithUnfolding(Node n, std::unordered_map& visited); /** is evaluation point? * * Returns true if n is of the form eval( x, c1...cn ) for some variable x diff --git a/src/theory/quantifiers/sygus_inst.cpp b/src/theory/quantifiers/sygus_inst.cpp index 1c6256c24..286d5f42b 100644 --- a/src/theory/quantifiers/sygus_inst.cpp +++ b/src/theory/quantifiers/sygus_inst.cpp @@ -47,8 +47,8 @@ namespace { */ void getMaxGroundTerms(TNode n, TypeNode tn, - std::unordered_set& terms, - std::unordered_set& cache, + std::unordered_set& terms, + std::unordered_set& cache, bool skip_quant = false) { if (options::sygusInstTermSel() != options::SygusInstTermSelMode::MAX @@ -100,12 +100,11 @@ void getMaxGroundTerms(TNode n, * term was already found in a subterm. * @param skip_quant: Do not traverse quantified formulas (skip quantifiers). */ -void getMinGroundTerms( - TNode n, - TypeNode tn, - std::unordered_set& terms, - std::unordered_map, TNodeHashFunction>& cache, - bool skip_quant = false) +void getMinGroundTerms(TNode n, + TypeNode tn, + std::unordered_set& terms, + std::unordered_map>& cache, + bool skip_quant = false) { if (options::sygusInstTermSel() != options::SygusInstTermSelMode::MIN && options::sygusInstTermSel() != options::SygusInstTermSelMode::BOTH) @@ -169,9 +168,8 @@ void getMinGroundTerms( * @param extra_cons: A map of TypeNode to constants, which are added in * addition to the default grammar. */ -void addSpecialValues( - const TypeNode& tn, - std::map>& extra_cons) +void addSpecialValues(const TypeNode& tn, + std::map>& extra_cons) { if (tn.isBitVector()) { @@ -331,19 +329,16 @@ void SygusInst::registerQuantifier(Node q) Trace("sygus-inst") << "Register " << q << std::endl; - std::map> extra_cons; - std::map> exclude_cons; - std::map> include_cons; - std::unordered_set term_irrelevant; + std::map> extra_cons; + std::map> exclude_cons; + std::map> include_cons; + std::unordered_set term_irrelevant; /* Collect relevant local ground terms for each variable type. */ if (options::sygusInstScope() == options::SygusInstScope::IN || options::sygusInstScope() == options::SygusInstScope::BOTH) { - std::unordered_map, - TypeNodeHashFunction> - relevant_terms; + std::unordered_map> relevant_terms; for (const Node& var : q[0]) { TypeNode tn = var.getType(); @@ -351,10 +346,9 @@ void SygusInst::registerQuantifier(Node q) /* Collect relevant ground terms for type tn. */ if (relevant_terms.find(tn) == relevant_terms.end()) { - std::unordered_set terms; - std::unordered_set cache_max; - std::unordered_map, TNodeHashFunction> - cache_min; + std::unordered_set terms; + std::unordered_set cache_max; + std::unordered_map> cache_min; getMinGroundTerms(q, tn, terms, cache_min); getMaxGroundTerms(q, tn, terms, cache_max); @@ -383,10 +377,9 @@ void SygusInst::registerQuantifier(Node q) /* Collect relevant ground terms for type tn. */ if (d_global_terms.find(tn) == d_global_terms.end()) { - std::unordered_set terms; - std::unordered_set cache_max; - std::unordered_map, TNodeHashFunction> - cache_min; + std::unordered_set terms; + std::unordered_set cache_max; + std::unordered_map> cache_min; for (const Node& a : d_notified_assertions) { diff --git a/src/theory/quantifiers/sygus_inst.h b/src/theory/quantifiers/sygus_inst.h index 05c62d883..80c7e809f 100644 --- a/src/theory/quantifiers/sygus_inst.h +++ b/src/theory/quantifiers/sygus_inst.h @@ -110,40 +110,35 @@ class SygusInst : public QuantifiersModule bool sendEvalUnfoldLemmas(const std::vector& lemmas); /* Maps quantifiers to a vector of instantiation constants. */ - std::unordered_map, NodeHashFunction> - d_inst_constants; + std::unordered_map> d_inst_constants; /* Maps quantifiers to a vector of DT_SYGUS_EVAL terms. */ - std::unordered_map, NodeHashFunction> d_var_eval; + std::unordered_map> d_var_eval; /* Maps quantified formulas to registered counterexample literals. */ - std::unordered_map d_ce_lits; + std::unordered_map d_ce_lits; /* Decision strategies registered for quantified formulas. */ - std::unordered_map, NodeHashFunction> - d_dstrat; + std::unordered_map> d_dstrat; /* Currently active quantifiers. */ - std::unordered_set d_active_quant; + std::unordered_set d_active_quant; /* Currently inactive quantifiers. */ - std::unordered_set d_inactive_quant; + std::unordered_set d_inactive_quant; /* Registered counterexample lemma cache. */ - std::unordered_map d_ce_lemmas; + std::unordered_map d_ce_lemmas; /* Indicates whether a counterexample lemma was added for a quantified * formula in the current context. */ - context::CDHashSet d_ce_lemma_added; + context::CDHashSet d_ce_lemma_added; /* Set of global ground terms in assertions (outside of quantifiers). */ - context::CDHashMap, - TypeNodeHashFunction> - d_global_terms; + context::CDHashMap> d_global_terms; /* Assertions sent by ppNotifyAssertions. */ - context::CDHashSet d_notified_assertions; + context::CDHashSet d_notified_assertions; }; } // namespace quantifiers diff --git a/src/theory/quantifiers/sygus_sampler.cpp b/src/theory/quantifiers/sygus_sampler.cpp index d4720ea7c..36602d3ae 100644 --- a/src/theory/quantifiers/sygus_sampler.cpp +++ b/src/theory/quantifiers/sygus_sampler.cpp @@ -323,8 +323,8 @@ bool SygusSampler::isContiguous(Node n) void SygusSampler::computeFreeVariables(Node n, std::vector& fvs) { - std::unordered_set visited; - std::unordered_set::iterator it; + std::unordered_set visited; + std::unordered_set::iterator it; std::vector visit; TNode cur; visit.push_back(n); @@ -359,8 +359,8 @@ bool SygusSampler::checkVariables(Node n, bool checkOrder, bool checkLinear) // compute free variables in n for each type std::map > fvs; - std::unordered_set visited; - std::unordered_set::iterator it; + std::unordered_set visited; + std::unordered_set::iterator it; std::vector visit; TNode cur; visit.push_back(n); @@ -411,8 +411,8 @@ bool SygusSampler::containsFreeVariables(Node a, Node b, bool strict) computeFreeVariables(a, fvs); std::vector fv_found; - std::unordered_set visited; - std::unordered_set::iterator it; + std::unordered_set visited; + std::unordered_set::iterator it; std::vector visit; TNode cur; visit.push_back(b); diff --git a/src/theory/quantifiers/term_database.cpp b/src/theory/quantifiers/term_database.cpp index 56a486022..bedab16f1 100644 --- a/src/theory/quantifiers/term_database.cpp +++ b/src/theory/quantifiers/term_database.cpp @@ -152,8 +152,7 @@ Node TermDb::getOrMakeTypeGroundTerm(TypeNode tn, bool reqVar) Node TermDb::getOrMakeTypeFreshVariable(TypeNode tn) { - std::unordered_map::iterator it = - d_type_fv.find(tn); + std::unordered_map::iterator it = d_type_fv.find(tn); if (it == d_type_fv.end()) { SkolemManager* sm = NodeManager::currentNM()->getSkolemManager(); diff --git a/src/theory/quantifiers/term_database.h b/src/theory/quantifiers/term_database.h index a8551a581..01465c7ca 100644 --- a/src/theory/quantifiers/term_database.h +++ b/src/theory/quantifiers/term_database.h @@ -65,13 +65,12 @@ class DbList * lazily for performance reasons. */ class TermDb : public QuantifiersUtil { - using NodeBoolMap = context::CDHashMap; + using NodeBoolMap = context::CDHashMap; using NodeList = context::CDList; - using NodeSet = context::CDHashSet; - using TypeNodeDbListMap = context:: - CDHashMap, TypeNodeHashFunction>; - using NodeDbListMap = - context::CDHashMap, NodeHashFunction>; + using NodeSet = context::CDHashSet; + using TypeNodeDbListMap = + context::CDHashMap>; + using NodeDbListMap = context::CDHashMap>; public: TermDb(QuantifiersState& qs, @@ -316,7 +315,7 @@ class TermDb : public QuantifiersUtil { Node d_true; Node d_false; /** map from type nodes to a fresh variable we introduced */ - std::unordered_map d_type_fv; + std::unordered_map d_type_fv; /** inactive map */ NodeBoolMap d_inactive_map; /** count of the number of non-redundant ground terms per operator */ diff --git a/src/theory/quantifiers/term_enumeration.cpp b/src/theory/quantifiers/term_enumeration.cpp index ffade62fb..d6b0d8154 100644 --- a/src/theory/quantifiers/term_enumeration.cpp +++ b/src/theory/quantifiers/term_enumeration.cpp @@ -29,8 +29,7 @@ Node TermEnumeration::getEnumerateTerm(TypeNode tn, unsigned index) { Trace("term-db-enum") << "Get enumerate term " << tn << " " << index << std::endl; - std::unordered_map::iterator it = - d_typ_enum_map.find(tn); + std::unordered_map::iterator it = d_typ_enum_map.find(tn); size_t teIndex; if (it == d_typ_enum_map.end()) { diff --git a/src/theory/quantifiers/term_enumeration.h b/src/theory/quantifiers/term_enumeration.h index 50abef744..f23640e07 100644 --- a/src/theory/quantifiers/term_enumeration.h +++ b/src/theory/quantifiers/term_enumeration.h @@ -62,10 +62,9 @@ class TermEnumeration */ QuantifiersBoundInference* d_qbi; /** ground terms enumerated for types */ - std::unordered_map, TypeNodeHashFunction> - d_enum_terms; + std::unordered_map> d_enum_terms; /** map from type to the index of its type enumerator in d_typ_enum. */ - std::unordered_map d_typ_enum_map; + std::unordered_map d_typ_enum_map; /** type enumerators */ std::vector d_typ_enum; }; diff --git a/src/theory/quantifiers/term_pools.cpp b/src/theory/quantifiers/term_pools.cpp index aa0fbd06d..883161f1a 100644 --- a/src/theory/quantifiers/term_pools.cpp +++ b/src/theory/quantifiers/term_pools.cpp @@ -98,7 +98,7 @@ void TermPools::getTermsForPool(Node p, std::vector& terms) // if we have yet to compute terms on this round if (dom.d_currTerms.empty()) { - std::unordered_set reps; + std::unordered_set reps; // eliminate modulo equality for (const Node& t : dom.d_terms) { diff --git a/src/theory/quantifiers/term_registry.h b/src/theory/quantifiers/term_registry.h index cf2ba7a47..c3e4fcf4c 100644 --- a/src/theory/quantifiers/term_registry.h +++ b/src/theory/quantifiers/term_registry.h @@ -39,7 +39,7 @@ class FirstOrderModel; */ class TermRegistry { - using NodeSet = context::CDHashSet; + using NodeSet = context::CDHashSet; public: TermRegistry(QuantifiersState& qs, diff --git a/src/theory/quantifiers/term_util.cpp b/src/theory/quantifiers/term_util.cpp index 9db3dd020..b771db986 100644 --- a/src/theory/quantifiers/term_util.cpp +++ b/src/theory/quantifiers/term_util.cpp @@ -123,7 +123,7 @@ Node TermUtil::getRemoveQuantifiers( Node n ) { //quantified simplify Node TermUtil::getQuantSimplify( Node n ) { - std::unordered_set fvs; + std::unordered_set fvs; expr::getFreeVariables(n, fvs); if (fvs.empty()) { @@ -156,8 +156,8 @@ void TermUtil::computeVarContainsInternal(Node n, Kind k, std::vector& vars) { - std::unordered_set visited; - std::unordered_set::iterator it; + std::unordered_set visited; + std::unordered_set::iterator it; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/theory/quantifiers_engine.h b/src/theory/quantifiers_engine.h index 631f7bec1..fc29ab8e8 100644 --- a/src/theory/quantifiers_engine.h +++ b/src/theory/quantifiers_engine.h @@ -54,8 +54,8 @@ class TermRegistry; // TODO: organize this more/review this, github issue #1163 class QuantifiersEngine { friend class ::cvc5::TheoryEngine; - typedef context::CDHashMap< Node, bool, NodeHashFunction > BoolMap; - typedef context::CDHashSet NodeSet; + typedef context::CDHashMap BoolMap; + typedef context::CDHashSet NodeSet; public: QuantifiersEngine(quantifiers::QuantifiersState& qstate, diff --git a/src/theory/relevance_manager.cpp b/src/theory/relevance_manager.cpp index 68ec573c3..9746f4a22 100644 --- a/src/theory/relevance_manager.cpp +++ b/src/theory/relevance_manager.cpp @@ -92,7 +92,7 @@ void RelevanceManager::computeRelevance() d_computed = true; d_rset.clear(); Trace("rel-manager") << "RelevanceManager::computeRelevance..." << std::endl; - std::unordered_map cache; + std::unordered_map cache; for (const Node& node: d_input) { TNode n = node; @@ -123,7 +123,7 @@ bool RelevanceManager::isBooleanConnective(TNode cur) bool RelevanceManager::updateJustifyLastChild( TNode cur, std::vector& childrenJustify, - std::unordered_map& cache) + std::unordered_map& cache) { // This method is run when we are informed that child index of cur // has justify status lastChildJustify. We return true if we would like to @@ -226,13 +226,12 @@ bool RelevanceManager::updateJustifyLastChild( return false; } -int RelevanceManager::justify( - TNode n, std::unordered_map& cache) +int RelevanceManager::justify(TNode n, std::unordered_map& cache) { // the vector of values of children - std::unordered_map, TNodeHashFunction> childJustify; - std::unordered_map::iterator it; - std::unordered_map, TNodeHashFunction>::iterator itc; + std::unordered_map> childJustify; + std::unordered_map::iterator it; + std::unordered_map>::iterator itc; std::vector visit; TNode cur; visit.push_back(n); @@ -315,8 +314,8 @@ bool RelevanceManager::isRelevant(Node lit) return d_rset.find(lit) != d_rset.end(); } -const std::unordered_set& -RelevanceManager::getRelevantAssertions(bool& success) +const std::unordered_set& RelevanceManager::getRelevantAssertions( + bool& success) { if (!d_computed) { diff --git a/src/theory/relevance_manager.h b/src/theory/relevance_manager.h index dc717157b..6c69861fd 100644 --- a/src/theory/relevance_manager.h +++ b/src/theory/relevance_manager.h @@ -104,8 +104,7 @@ class RelevanceManager * * The value of this return is only valid if success was not updated to false. */ - const std::unordered_set& getRelevantAssertions( - bool& success); + const std::unordered_set& getRelevantAssertions(bool& success); private: /** @@ -124,8 +123,7 @@ class RelevanceManager * This method returns 1 if we justified n to be true, -1 means * justified n to be false, 0 means n could not be justified. */ - int justify(TNode n, - std::unordered_map& cache); + int justify(TNode n, std::unordered_map& cache); /** Is the top symbol of cur a Boolean connective? */ bool isBooleanConnective(TNode cur); /** @@ -140,16 +138,15 @@ class RelevanceManager * @return True if we wish to visit the next child. If this is the case, then * the justify value of the current child is added to childrenJustify. */ - bool updateJustifyLastChild( - TNode cur, - std::vector& childrenJustify, - std::unordered_map& cache); + bool updateJustifyLastChild(TNode cur, + std::vector& childrenJustify, + std::unordered_map& cache); /** The valuation object, used to query current value of theory literals */ Valuation d_val; /** The input assertions */ NodeList d_input; /** The current relevant selection. */ - std::unordered_set d_rset; + std::unordered_set d_rset; /** Have we computed the relevant selection this round? */ bool d_computed; /** diff --git a/src/theory/rep_set.cpp b/src/theory/rep_set.cpp index f44b269cf..d0eee1886 100644 --- a/src/theory/rep_set.cpp +++ b/src/theory/rep_set.cpp @@ -69,7 +69,7 @@ const std::vector* RepSet::getTypeRepsOrNull(TypeNode tn) const namespace { -bool containsStoreAll(Node n, std::unordered_set& cache) +bool containsStoreAll(Node n, std::unordered_set& cache) { if( std::find( cache.begin(), cache.end(), n )==cache.end() ){ cache.insert(n); @@ -91,7 +91,7 @@ bool containsStoreAll(Node n, std::unordered_set& cache) void RepSet::add( TypeNode tn, Node n ){ //for now, do not add array constants FIXME if( tn.isArray() ){ - std::unordered_set cache; + std::unordered_set cache; if( containsStoreAll( n, cache ) ){ return; } diff --git a/src/theory/rewriter.cpp b/src/theory/rewriter.cpp index 2b2604593..1094d5920 100644 --- a/src/theory/rewriter.cpp +++ b/src/theory/rewriter.cpp @@ -199,7 +199,7 @@ Node Rewriter::rewriteTo(theory::TheoryId theoryId, if (d_rewriteStack == nullptr) { - d_rewriteStack.reset(new std::unordered_set()); + d_rewriteStack.reset(new std::unordered_set()); } #endif diff --git a/src/theory/rewriter.h b/src/theory/rewriter.h index b3ea3b542..1fc685992 100644 --- a/src/theory/rewriter.h +++ b/src/theory/rewriter.h @@ -228,8 +228,7 @@ class Rewriter { /** The proof generator */ std::unique_ptr d_tpg; #ifdef CVC5_ASSERTIONS - std::unique_ptr> d_rewriteStack = - nullptr; + std::unique_ptr> d_rewriteStack = nullptr; #endif /* CVC5_ASSERTIONS */ };/* class Rewriter */ diff --git a/src/theory/sep/theory_sep.h b/src/theory/sep/theory_sep.h index 3b8ec8b6b..b028f0686 100644 --- a/src/theory/sep/theory_sep.h +++ b/src/theory/sep/theory_sep.h @@ -39,8 +39,8 @@ namespace sep { class TheorySep : public Theory { typedef context::CDList NodeList; - typedef context::CDHashSet NodeSet; - typedef context::CDHashMap NodeNodeMap; + typedef context::CDHashSet NodeSet; + typedef context::CDHashMap NodeNodeMap; ///////////////////////////////////////////////////////////////////////////// // MISC diff --git a/src/theory/sets/cardinality_extension.h b/src/theory/sets/cardinality_extension.h index cd4ba5de0..ce2f29bd5 100644 --- a/src/theory/sets/cardinality_extension.h +++ b/src/theory/sets/cardinality_extension.h @@ -62,7 +62,7 @@ namespace sets { */ class CardinalityExtension { - typedef context::CDHashSet NodeSet; + typedef context::CDHashSet NodeSet; public: /** diff --git a/src/theory/sets/inference_manager.h b/src/theory/sets/inference_manager.h index bcb38ff5c..7a64b10c7 100644 --- a/src/theory/sets/inference_manager.h +++ b/src/theory/sets/inference_manager.h @@ -36,7 +36,7 @@ class TheorySetsPrivate; */ class InferenceManager : public InferenceManagerBuffered { - typedef context::CDHashSet NodeSet; + typedef context::CDHashSet NodeSet; public: InferenceManager(Theory& t, SolverState& s, ProofNodeManager* pnm); diff --git a/src/theory/sets/singleton_op.cpp b/src/theory/sets/singleton_op.cpp index 993457fe8..06d144f72 100644 --- a/src/theory/sets/singleton_op.cpp +++ b/src/theory/sets/singleton_op.cpp @@ -28,7 +28,7 @@ std::ostream& operator<<(std::ostream& out, const SingletonOp& op) size_t SingletonOpHashFunction::operator()(const SingletonOp& op) const { - return TypeNodeHashFunction()(op.getType()); + return std::hash()(op.getType()); } SingletonOp::SingletonOp(const TypeNode& elementType) diff --git a/src/theory/sets/skolem_cache.h b/src/theory/sets/skolem_cache.h index a41886f9d..62547a66e 100644 --- a/src/theory/sets/skolem_cache.h +++ b/src/theory/sets/skolem_cache.h @@ -74,7 +74,7 @@ class SkolemCache /** map from node pairs and identifiers to skolems */ std::map > > d_skolemCache; /** the set of all skolems we have generated */ - std::unordered_set d_allSkolems; + std::unordered_set d_allSkolems; }; } // namespace sets diff --git a/src/theory/sets/solver_state.h b/src/theory/sets/solver_state.h index 94e06971c..63039eddd 100644 --- a/src/theory/sets/solver_state.h +++ b/src/theory/sets/solver_state.h @@ -43,7 +43,7 @@ class TheorySetsPrivate; */ class SolverState : public TheoryState { - typedef context::CDHashMap NodeIntMap; + typedef context::CDHashMap NodeIntMap; public: SolverState(context::Context* c, diff --git a/src/theory/sets/term_registry.h b/src/theory/sets/term_registry.h index f98f204e0..87f25341e 100644 --- a/src/theory/sets/term_registry.h +++ b/src/theory/sets/term_registry.h @@ -37,7 +37,7 @@ namespace sets { */ class TermRegistry { - typedef context::CDHashMap NodeMap; + typedef context::CDHashMap NodeMap; public: TermRegistry(SolverState& state, diff --git a/src/theory/sets/theory_sets_private.h b/src/theory/sets/theory_sets_private.h index 952bfd83b..3b5ee2390 100644 --- a/src/theory/sets/theory_sets_private.h +++ b/src/theory/sets/theory_sets_private.h @@ -38,8 +38,8 @@ namespace sets { class TheorySets; class TheorySetsPrivate { - typedef context::CDHashMap< Node, bool, NodeHashFunction> NodeBoolMap; - typedef context::CDHashSet NodeSet; + typedef context::CDHashMap NodeBoolMap; + typedef context::CDHashSet NodeSet; public: void eqNotifyNewClass(TNode t); diff --git a/src/theory/sets/theory_sets_rels.cpp b/src/theory/sets/theory_sets_rels.cpp index 0e14a6c34..74dfc01ba 100644 --- a/src/theory/sets/theory_sets_rels.cpp +++ b/src/theory/sets/theory_sets_rels.cpp @@ -28,9 +28,10 @@ namespace sets { typedef std::map< Node, std::vector< Node > >::iterator MEM_IT; typedef std::map< kind::Kind_t, std::vector< Node > >::iterator KIND_TERM_IT; -typedef std::map< Node, std::unordered_set< Node, NodeHashFunction > >::iterator TC_GRAPH_IT; +typedef std::map >::iterator TC_GRAPH_IT; typedef std::map< Node, std::map< kind::Kind_t, std::vector< Node > > >::iterator TERM_IT; -typedef std::map< Node, std::map< Node, std::unordered_set< Node, NodeHashFunction > > >::iterator TC_IT; +typedef std::map > >::iterator + TC_IT; TheorySetsRels::TheorySetsRels(SolverState& s, InferenceManager& im, @@ -281,7 +282,7 @@ void TheorySetsRels::check(Theory::Effort level) NodeManager* nm = NodeManager::currentNM(); Node join_image_rel = join_image_term[0]; - std::unordered_set< Node, NodeHashFunction > hasChecked; + std::unordered_set hasChecked; Node join_image_rel_rep = getRepresentative( join_image_rel ); std::vector< Node >::iterator mem_rep_it = (*rel_mem_it).second.begin(); MEM_IT rel_mem_exp_it = d_rReps_memberReps_exp_cache.find( join_image_rel_rep ); @@ -544,14 +545,14 @@ void TheorySetsRels::check(Theory::Effort level) if( tc_graph_it != (tc_it->second).end() ) { (tc_graph_it->second).insert( mem_rep_snd ); } else { - std::unordered_set< Node, NodeHashFunction > sets; + std::unordered_set sets; sets.insert( mem_rep_snd ); (tc_it->second)[mem_rep_fst] = sets; } } else { std::map< Node, Node > exp_map; - std::unordered_set< Node, NodeHashFunction > sets; - std::map< Node, std::unordered_set > element_map; + std::unordered_set sets; + std::map > element_map; sets.insert( mem_rep_snd ); element_map[mem_rep_fst] = sets; d_tcr_tcGraph[tc_rel] = element_map; @@ -609,7 +610,7 @@ void TheorySetsRels::check(Theory::Effort level) TC_IT tc_it = d_rRep_tcGraph.find( getRepresentative(tc_rel[0]) ); if( tc_it != d_rRep_tcGraph.end() ) { bool isReachable = false; - std::unordered_set seen; + std::unordered_set seen; isTCReachable( getRepresentative( RelsUtils::nthElementOfTuple(mem_rep, 0) ), getRepresentative( RelsUtils::nthElementOfTuple(mem_rep, 1) ), seen, tc_it->second, isReachable ); return isReachable; @@ -617,8 +618,13 @@ void TheorySetsRels::check(Theory::Effort level) return false; } - void TheorySetsRels::isTCReachable( Node start, Node dest, std::unordered_set& hasSeen, - std::map< Node, std::unordered_set< Node, NodeHashFunction > >& tc_graph, bool& isReachable ) { + void TheorySetsRels::isTCReachable( + Node start, + Node dest, + std::unordered_set& hasSeen, + std::map >& tc_graph, + bool& isReachable) + { if(hasSeen.find(start) == hasSeen.end()) { hasSeen.insert(start); } @@ -630,7 +636,7 @@ void TheorySetsRels::check(Theory::Effort level) isReachable = true; return; } else { - std::unordered_set< Node, NodeHashFunction >::iterator set_it = pair_set_it->second.begin(); + std::unordered_set::iterator set_it = pair_set_it->second.begin(); while( set_it != pair_set_it->second.end() ) { // need to check if *set_it has been looked already @@ -645,7 +651,7 @@ void TheorySetsRels::check(Theory::Effort level) void TheorySetsRels::buildTCGraphForRel( Node tc_rel ) { std::map< Node, Node > rel_tc_graph_exps; - std::map< Node, std::unordered_set > rel_tc_graph; + std::map > rel_tc_graph; Node rel_rep = getRepresentative( tc_rel[0] ); Node tc_rel_rep = getRepresentative( tc_rel ); @@ -656,10 +662,11 @@ void TheorySetsRels::check(Theory::Effort level) Node fst_element_rep = getRepresentative( RelsUtils::nthElementOfTuple( members[i], 0 )); Node snd_element_rep = getRepresentative( RelsUtils::nthElementOfTuple( members[i], 1 )); Node tuple_rep = RelsUtils::constructPair( rel_rep, fst_element_rep, snd_element_rep ); - std::map< Node, std::unordered_set >::iterator rel_tc_graph_it = rel_tc_graph.find( fst_element_rep ); + std::map >::iterator rel_tc_graph_it = + rel_tc_graph.find(fst_element_rep); if( rel_tc_graph_it == rel_tc_graph.end() ) { - std::unordered_set< Node, NodeHashFunction > snd_elements; + std::unordered_set snd_elements; snd_elements.insert( snd_element_rep ); rel_tc_graph[fst_element_rep] = snd_elements; rel_tc_graph_exps[tuple_rep] = exps[i]; @@ -676,19 +683,23 @@ void TheorySetsRels::check(Theory::Effort level) } } - void TheorySetsRels::doTCInference( std::map< Node, std::unordered_set > rel_tc_graph, std::map< Node, Node > rel_tc_graph_exps, Node tc_rel ) { + void TheorySetsRels::doTCInference( + std::map > rel_tc_graph, + std::map rel_tc_graph_exps, + Node tc_rel) + { Trace("rels-debug") << "[Theory::Rels] ****** doTCInference !" << std::endl; for (TC_GRAPH_IT tc_graph_it = rel_tc_graph.begin(); tc_graph_it != rel_tc_graph.end(); ++tc_graph_it) { - for (std::unordered_set::iterator - snd_elements_it = tc_graph_it->second.begin(); + for (std::unordered_set::iterator snd_elements_it = + tc_graph_it->second.begin(); snd_elements_it != tc_graph_it->second.end(); ++snd_elements_it) { std::vector< Node > reasons; - std::unordered_set seen; + std::unordered_set seen; Node tuple = RelsUtils::constructPair( tc_rel, getRepresentative( tc_graph_it->first ), getRepresentative( *snd_elements_it) ); Assert(rel_tc_graph_exps.find(tuple) != rel_tc_graph_exps.end()); Node exp = rel_tc_graph_exps.find( tuple )->second; @@ -701,8 +712,15 @@ void TheorySetsRels::check(Theory::Effort level) Trace("rels-debug") << "[Theory::Rels] ****** Done with doTCInference !" << std::endl; } - void TheorySetsRels::doTCInference(Node tc_rel, std::vector< Node > reasons, std::map< Node, std::unordered_set< Node, NodeHashFunction > >& tc_graph, - std::map< Node, Node >& rel_tc_graph_exps, Node start_node_rep, Node cur_node_rep, std::unordered_set< Node, NodeHashFunction >& seen ) { + void TheorySetsRels::doTCInference( + Node tc_rel, + std::vector reasons, + std::map >& tc_graph, + std::map& rel_tc_graph_exps, + Node start_node_rep, + Node cur_node_rep, + std::unordered_set& seen) + { NodeManager* nm = NodeManager::currentNM(); Node tc_mem = RelsUtils::constructPair( tc_rel, RelsUtils::nthElementOfTuple((reasons.front())[0], 0), RelsUtils::nthElementOfTuple((reasons.back())[0], 1) ); std::vector< Node > all_reasons( reasons ); @@ -737,8 +755,7 @@ void TheorySetsRels::check(Theory::Effort level) seen.insert( cur_node_rep ); TC_GRAPH_IT cur_set = tc_graph.find( cur_node_rep ); if( cur_set != tc_graph.end() ) { - for (std::unordered_set::iterator set_it = - cur_set->second.begin(); + for (std::unordered_set::iterator set_it = cur_set->second.begin(); set_it != cur_set->second.end(); ++set_it) { diff --git a/src/theory/sets/theory_sets_rels.h b/src/theory/sets/theory_sets_rels.h index 2ca8696b0..c30322d07 100644 --- a/src/theory/sets/theory_sets_rels.h +++ b/src/theory/sets/theory_sets_rels.h @@ -61,27 +61,27 @@ public: */ class TheorySetsRels { typedef context::CDList NodeList; - typedef context::CDHashSet< Node, NodeHashFunction > NodeSet; - typedef context::CDHashMap< Node, Node, NodeHashFunction > NodeMap; + typedef context::CDHashSet NodeSet; + typedef context::CDHashMap NodeMap; -public: - TheorySetsRels(SolverState& s, - InferenceManager& im, - SkolemCache& skc, - TermRegistry& treg); - - ~TheorySetsRels(); - /** - * Invoke the check method with effort level e. At a high level, this class - * will make calls to TheorySetsPrivate::processInference to assert facts, - * lemmas, and conflicts. If this class makes no such call, then the current - * set of assertions is satisfiable with respect to relations. - */ - void check(Theory::Effort e); - /** Is kind k a kind that belongs to the relation theory? */ - static bool isRelationKind(Kind k); - -private: + public: + TheorySetsRels(SolverState& s, + InferenceManager& im, + SkolemCache& skc, + TermRegistry& treg); + + ~TheorySetsRels(); + /** + * Invoke the check method with effort level e. At a high level, this class + * will make calls to TheorySetsPrivate::processInference to assert facts, + * lemmas, and conflicts. If this class makes no such call, then the current + * set of assertions is satisfiable with respect to relations. + */ + void check(Theory::Effort e); + /** Is kind k a kind that belongs to the relation theory? */ + static bool isRelationKind(Kind k); + + private: /** True and false constant nodes */ Node d_trueNode; Node d_falseNode; @@ -98,13 +98,12 @@ private: std::vector d_pending; NodeSet d_shared_terms; - - std::unordered_set< Node, NodeHashFunction > d_rel_nodes; + std::unordered_set d_rel_nodes; std::map< Node, std::vector > d_tuple_reps; std::map< Node, TupleTrie > d_membership_trie; /** Symbolic tuple variables that has been reduced to concrete ones */ - std::unordered_set< Node, NodeHashFunction > d_symbolic_tuples; + std::unordered_set d_symbolic_tuples; /** Mapping between relation and its member representatives */ std::map< Node, std::vector< Node > > d_rReps_memberReps_cache; @@ -116,8 +115,8 @@ private: std::map< Node, std::map > > d_terms_cache; /** Mapping between transitive closure relation TC(r) and its TC graph constructed based on the members of r*/ - std::map< Node, std::map< Node, std::unordered_set > > d_rRep_tcGraph; - std::map< Node, std::map< Node, std::unordered_set > > d_tcr_tcGraph; + std::map > > d_rRep_tcGraph; + std::map > > d_tcr_tcGraph; std::map< Node, std::map< Node, Node > > d_tcr_tcGraph_exps; private: @@ -154,9 +153,16 @@ private: void applyTCRule( Node mem, Node rel, Node rel_rep, Node exp); void buildTCGraphForRel( Node tc_rel ); void doTCInference(); - void doTCInference( std::map< Node, std::unordered_set > rel_tc_graph, std::map< Node, Node > rel_tc_graph_exps, Node tc_rel ); - void doTCInference(Node tc_rel, std::vector< Node > reasons, std::map< Node, std::unordered_set< Node, NodeHashFunction > >& tc_graph, - std::map< Node, Node >& rel_tc_graph_exps, Node start_node_rep, Node cur_node_rep, std::unordered_set< Node, NodeHashFunction >& seen ); + void doTCInference(std::map > rel_tc_graph, + std::map rel_tc_graph_exps, + Node tc_rel); + void doTCInference(Node tc_rel, + std::vector reasons, + std::map >& tc_graph, + std::map& rel_tc_graph_exps, + Node start_node_rep, + Node cur_node_rep, + std::unordered_set& seen); void composeMembersForRels( Node ); void computeMembersForBinOpRel( Node ); @@ -165,8 +171,11 @@ private: void computeMembersForJoinImageTerm( Node ); bool isTCReachable( Node mem_rep, Node tc_rel ); - void isTCReachable( Node start, Node dest, std::unordered_set& hasSeen, - std::map< Node, std::unordered_set< Node, NodeHashFunction > >& tc_graph, bool& isReachable ); + void isTCReachable(Node start, + Node dest, + std::unordered_set& hasSeen, + std::map >& tc_graph, + bool& isReachable); /** Helper functions */ bool hasTerm( Node a ); diff --git a/src/theory/shared_terms_database.h b/src/theory/shared_terms_database.h index 655c2aa88..40f6080e5 100644 --- a/src/theory/shared_terms_database.h +++ b/src/theory/shared_terms_database.h @@ -47,7 +47,7 @@ class SharedTermsDatabase : public context::ContextNotifyObj { IntStat d_statSharedTerms; // Needs to be a map from Nodes as after a backtrack they might not exist - typedef std::unordered_map SharedTermsMap; + typedef std::unordered_map SharedTermsMap; /** A map from atoms to a list of shared terms */ SharedTermsMap d_atomsToTerms; @@ -66,12 +66,11 @@ class SharedTermsDatabase : public context::ContextNotifyObj { SharedTermsTheoriesMap d_termsToTheories; /** Map from term to theories that have already been notified about the shared term */ - typedef context::CDHashMap - AlreadyNotifiedMap; + typedef context::CDHashMap AlreadyNotifiedMap; AlreadyNotifiedMap d_alreadyNotifiedMap; /** The registered equalities for propagation */ - typedef context::CDHashSet RegisteredEqualitiesSet; + typedef context::CDHashSet RegisteredEqualitiesSet; RegisteredEqualitiesSet d_registeredEqualities; private: diff --git a/src/theory/strings/arith_entail.cpp b/src/theory/strings/arith_entail.cpp index 9c9adf99e..4c3b2f17e 100644 --- a/src/theory/strings/arith_entail.cpp +++ b/src/theory/strings/arith_entail.cpp @@ -131,7 +131,7 @@ bool ArithEntail::checkApprox(Node ar) // c.isNull() means c = 1 bool isOverApprox = !c.isNull() && c.getConst().sgn() == -1; std::vector& approx = mApprox[v]; - std::unordered_set visited; + std::unordered_set visited; std::vector toProcess; toProcess.push_back(v); do @@ -561,7 +561,7 @@ bool ArithEntail::checkWithEqAssumption(Node assumption, Node a, bool strict) << ", strict=" << strict << std::endl; // Find candidates variables to compute substitutions for - std::unordered_set candVars; + std::unordered_set candVars; std::vector toVisit = {assumption}; while (!toVisit.empty()) { diff --git a/src/theory/strings/base_solver.h b/src/theory/strings/base_solver.h index 41cb3e608..6c423e3b8 100644 --- a/src/theory/strings/base_solver.h +++ b/src/theory/strings/base_solver.h @@ -39,7 +39,7 @@ namespace strings { */ class BaseSolver { - using NodeSet = context::CDHashSet; + using NodeSet = context::CDHashSet; public: BaseSolver(SolverState& s, InferenceManager& im); diff --git a/src/theory/strings/core_solver.cpp b/src/theory/strings/core_solver.cpp index ed220c1eb..a6e4ce698 100644 --- a/src/theory/strings/core_solver.cpp +++ b/src/theory/strings/core_solver.cpp @@ -1078,7 +1078,7 @@ void CoreSolver::processNEqc(Node eqc, // the possible inferences std::vector pinfer; // compute normal forms that are effectively unique - std::unordered_map nfCache; + std::unordered_map nfCache; std::vector nfIndices; bool hasConstIndex = false; for (size_t i = 0, nnforms = normal_forms.size(); i < nnforms; i++) diff --git a/src/theory/strings/core_solver.h b/src/theory/strings/core_solver.h index 143155f55..4e8a0a96b 100644 --- a/src/theory/strings/core_solver.h +++ b/src/theory/strings/core_solver.h @@ -79,7 +79,7 @@ class CoreInferInfo class CoreSolver { friend class InferenceManager; - using NodeIntMap = context::CDHashMap; + using NodeIntMap = context::CDHashMap; public: CoreSolver(SolverState& s, diff --git a/src/theory/strings/extf_solver.cpp b/src/theory/strings/extf_solver.cpp index e00668997..a1de5e295 100644 --- a/src/theory/strings/extf_solver.cpp +++ b/src/theory/strings/extf_solver.cpp @@ -251,7 +251,7 @@ void ExtfSolver::checkExtfEval(int effort) bool has_nreduce = false; std::vector terms = d_extt.getActive(); // the set of terms we have done extf inferences for - std::unordered_set inferProcessed; + std::unordered_set inferProcessed; for (const Node& n : terms) { // Setup information about n, including if it is equal to a constant. diff --git a/src/theory/strings/extf_solver.h b/src/theory/strings/extf_solver.h index bfcf244d7..82b4f61ee 100644 --- a/src/theory/strings/extf_solver.h +++ b/src/theory/strings/extf_solver.h @@ -81,7 +81,7 @@ class ExtfInfoTmp */ class ExtfSolver { - typedef context::CDHashSet NodeSet; + typedef context::CDHashSet NodeSet; public: ExtfSolver(SolverState& s, diff --git a/src/theory/strings/infer_proof_cons.h b/src/theory/strings/infer_proof_cons.h index 6b2c4dfc4..af905cbad 100644 --- a/src/theory/strings/infer_proof_cons.h +++ b/src/theory/strings/infer_proof_cons.h @@ -45,8 +45,7 @@ namespace strings { */ class InferProofCons : public ProofGenerator { - typedef context::CDHashMap, NodeHashFunction> - NodeInferInfoMap; + typedef context::CDHashMap> NodeInferInfoMap; public: InferProofCons(context::Context* c, diff --git a/src/theory/strings/inference_manager.h b/src/theory/strings/inference_manager.h index b18c64319..cf9c64bb1 100644 --- a/src/theory/strings/inference_manager.h +++ b/src/theory/strings/inference_manager.h @@ -72,8 +72,8 @@ namespace strings { */ class InferenceManager : public InferenceManagerBuffered { - typedef context::CDHashSet NodeSet; - typedef context::CDHashMap NodeNodeMap; + typedef context::CDHashSet NodeSet; + typedef context::CDHashMap NodeNodeMap; friend class InferInfo; public: diff --git a/src/theory/strings/regexp_operation.cpp b/src/theory/strings/regexp_operation.cpp index ace2756c1..bf4c20f85 100644 --- a/src/theory/strings/regexp_operation.cpp +++ b/src/theory/strings/regexp_operation.cpp @@ -63,7 +63,7 @@ bool RegExpOpr::checkConstRegExp( Node r ) { RegExpConstType RegExpOpr::getRegExpConstType(Node r) { Assert(r.getType().isRegExp()); - std::unordered_map::iterator it; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(r); @@ -1345,8 +1345,8 @@ Node RegExpOpr::intersectInternal( Node r1, Node r2, std::map< PairNodes, Node > Node RegExpOpr::removeIntersection(Node r) { Assert(checkConstRegExp(r)); NodeManager* nm = NodeManager::currentNM(); - std::unordered_map visited; - std::unordered_map::iterator it; + std::unordered_map visited; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(r); diff --git a/src/theory/strings/regexp_operation.h b/src/theory/strings/regexp_operation.h index d0ed07308..a20e9a0a9 100644 --- a/src/theory/strings/regexp_operation.h +++ b/src/theory/strings/regexp_operation.h @@ -78,7 +78,7 @@ class RegExpOpr { std::map d_dv_cache; std::map > d_deriv_cache; /** cache mapping regular expressions to whether they contain constants */ - std::unordered_map d_constCache; + std::unordered_map d_constCache; std::map, std::set > > d_fset_cache; std::map d_inter_cache; std::map > d_split_cache; diff --git a/src/theory/strings/regexp_solver.cpp b/src/theory/strings/regexp_solver.cpp index 38fc6fc8f..167ce9570 100644 --- a/src/theory/strings/regexp_solver.cpp +++ b/src/theory/strings/regexp_solver.cpp @@ -137,7 +137,7 @@ void RegExpSolver::check(const std::map >& mems) NodeManager* nm = NodeManager::currentNM(); // representatives of strings that are the LHS of positive memberships that // we unfolded - std::unordered_set repUnfold; + std::unordered_set repUnfold; // check positive (e=0), then negative (e=1) memberships for (unsigned e = 0; e < 2; e++) { @@ -329,7 +329,7 @@ void RegExpSolver::check(const std::map >& mems) bool RegExpSolver::checkEqcInclusion(std::vector& mems) { - std::unordered_set remove; + std::unordered_set remove; for (const Node& m1 : mems) { diff --git a/src/theory/strings/regexp_solver.h b/src/theory/strings/regexp_solver.h index bf148a071..98e2449c5 100644 --- a/src/theory/strings/regexp_solver.h +++ b/src/theory/strings/regexp_solver.h @@ -38,11 +38,11 @@ namespace strings { class RegExpSolver { typedef context::CDList NodeList; - typedef context::CDHashMap NodeBoolMap; - typedef context::CDHashMap NodeIntMap; - typedef context::CDHashMap NodeUIntMap; - typedef context::CDHashMap NodeNodeMap; - typedef context::CDHashSet NodeSet; + typedef context::CDHashMap NodeBoolMap; + typedef context::CDHashMap NodeIntMap; + typedef context::CDHashMap NodeUIntMap; + typedef context::CDHashMap NodeNodeMap; + typedef context::CDHashSet NodeSet; public: RegExpSolver(SolverState& s, diff --git a/src/theory/strings/skolem_cache.h b/src/theory/strings/skolem_cache.h index b3ffa784f..126ee313d 100644 --- a/src/theory/strings/skolem_cache.h +++ b/src/theory/strings/skolem_cache.h @@ -207,7 +207,7 @@ class SkolemCache /** map from node pairs and identifiers to skolems */ std::map > > d_skolemCache; /** the set of all skolems we have generated */ - std::unordered_set d_allSkolems; + std::unordered_set d_allSkolems; }; } // namespace strings diff --git a/src/theory/strings/strings_fmf.h b/src/theory/strings/strings_fmf.h index ba9f0f4e1..39ba6168a 100644 --- a/src/theory/strings/strings_fmf.h +++ b/src/theory/strings/strings_fmf.h @@ -37,7 +37,7 @@ namespace strings { */ class StringsFmf { - typedef context::CDHashSet NodeSet; + typedef context::CDHashSet NodeSet; public: StringsFmf(context::Context* c, diff --git a/src/theory/strings/term_registry.cpp b/src/theory/strings/term_registry.cpp index 4460e1ff3..d7a0a0554 100644 --- a/src/theory/strings/term_registry.cpp +++ b/src/theory/strings/term_registry.cpp @@ -437,8 +437,7 @@ const context::CDList& TermRegistry::getFunctionTerms() const return d_functionsTerms; } -const context::CDHashSet& TermRegistry::getInputVars() - const +const context::CDHashSet& TermRegistry::getInputVars() const { return d_inputVars; } diff --git a/src/theory/strings/term_registry.h b/src/theory/strings/term_registry.h index f0543c282..7c399759b 100644 --- a/src/theory/strings/term_registry.h +++ b/src/theory/strings/term_registry.h @@ -46,9 +46,9 @@ class InferenceManager; */ class TermRegistry { - typedef context::CDHashSet NodeSet; - typedef context::CDHashSet TypeNodeSet; - typedef context::CDHashMap NodeNodeMap; + typedef context::CDHashSet NodeSet; + typedef context::CDHashSet> TypeNodeSet; + typedef context::CDHashMap NodeNodeMap; public: TermRegistry(SolverState& s, @@ -147,7 +147,7 @@ class TermRegistry * Get the "input variables", corresponding to the set of leaf nodes of * string-like type that have been preregistered as terms to this object. */ - const context::CDHashSet& getInputVars() const; + const context::CDHashSet& getInputVars() const; /** Returns true if any str.code terms have been preregistered */ bool hasStringCode() const; //---------------------------- end queries diff --git a/src/theory/strings/theory_strings.cpp b/src/theory/strings/theory_strings.cpp index 02c0c3130..06a39ec64 100644 --- a/src/theory/strings/theory_strings.cpp +++ b/src/theory/strings/theory_strings.cpp @@ -210,7 +210,7 @@ bool TheoryStrings::collectModelValues(TheoryModel* m, Trace("strings-debug-model") << d_esolver.debugPrintModel() << std::endl; } Trace("strings-model") << "TheoryStrings::collectModelValues" << std::endl; - std::map > repSet; + std::map > repSet; // Generate model // get the relevant string equivalence classes for (const Node& s : termSet) @@ -222,9 +222,7 @@ bool TheoryStrings::collectModelValues(TheoryModel* m, repSet[tn].insert(r); } } - for (const std::pair >& rst : - repSet) + for (const std::pair >& rst : repSet) { // get partition of strings of equal lengths, per type std::map > > colT; @@ -241,12 +239,11 @@ bool TheoryStrings::collectModelValues(TheoryModel* m, return true; } -bool TheoryStrings::collectModelInfoType( - TypeNode tn, - const std::unordered_set& repSet, - std::vector >& col, - std::vector& lts, - TheoryModel* m) +bool TheoryStrings::collectModelInfoType(TypeNode tn, + const std::unordered_set& repSet, + std::vector >& col, + std::vector& lts, + TheoryModel* m) { NodeManager* nm = NodeManager::currentNM(); std::map< Node, Node > processed; diff --git a/src/theory/strings/theory_strings.h b/src/theory/strings/theory_strings.h index 01111880d..a671129d4 100644 --- a/src/theory/strings/theory_strings.h +++ b/src/theory/strings/theory_strings.h @@ -60,8 +60,9 @@ namespace strings { */ class TheoryStrings : public Theory { friend class InferenceManager; - typedef context::CDHashSet NodeSet; - typedef context::CDHashSet TypeNodeSet; + typedef context::CDHashSet NodeSet; + typedef context::CDHashSet> TypeNodeSet; + public: TheoryStrings(context::Context* c, context::UserContext* u, @@ -195,12 +196,11 @@ class TheoryStrings : public Theory { * * Returns false if a conflict is discovered while doing this assignment. */ - bool collectModelInfoType( - TypeNode tn, - const std::unordered_set& repSet, - std::vector >& col, - std::vector& lts, - TheoryModel* m); + bool collectModelInfoType(TypeNode tn, + const std::unordered_set& repSet, + std::vector>& col, + std::vector& lts, + TheoryModel* m); /** assert pending fact * diff --git a/src/theory/strings/theory_strings_utils.cpp b/src/theory/strings/theory_strings_utils.cpp index c3c444fc7..5a4a25e88 100644 --- a/src/theory/strings/theory_strings_utils.cpp +++ b/src/theory/strings/theory_strings_utils.cpp @@ -70,8 +70,8 @@ void flattenOp(Kind k, Node n, std::vector& conj) return; } // otherwise, traverse - std::unordered_set visited; - std::unordered_set::iterator it; + std::unordered_set visited; + std::unordered_set::iterator it; std::vector visit; TNode cur; visit.push_back(n); diff --git a/src/theory/subs_minimize.cpp b/src/theory/subs_minimize.cpp index b58ffad33..e2a81f54a 100644 --- a/src/theory/subs_minimize.cpp +++ b/src/theory/subs_minimize.cpp @@ -73,9 +73,9 @@ bool SubstitutionMinimize::findWithImplied(Node t, std::vector tconj; getConjuncts(t, tconj); // map from conjuncts to their free symbols - std::map > tcFv; + std::map > tcFv; - std::unordered_set reqSet; + std::unordered_set reqSet; std::vector reqSubs; std::map reqVarToIndex; for (const Node& v : reqVars) @@ -104,8 +104,7 @@ bool SubstitutionMinimize::findWithImplied(Node t, for (const Node& tc : tconj) { // ensure we've computed its free symbols - std::map >::iterator - itf = tcFv.find(tc); + std::map >::iterator itf = tcFv.find(tc); if (itf == tcFv.end()) { expr::getSymbols(tc, tcFv[tc]); @@ -181,8 +180,8 @@ bool SubstitutionMinimize::findInternal(Node n, Trace("subs-min") << "--- Compute values for subterms..." << std::endl; // the value of each subterm in n under the substitution - std::unordered_map value; - std::unordered_map::iterator it; + std::unordered_map value; + std::unordered_map::iterator it; std::vector visit; TNode cur; visit.push_back(n); @@ -262,12 +261,12 @@ bool SubstitutionMinimize::findInternal(Node n, } Trace("subs-min") << "--- Compute relevant variables..." << std::endl; - std::unordered_set rlvFv; + std::unordered_set rlvFv; // only variables that occur in assertions are relevant visit.push_back(n); - std::unordered_set visited; - std::unordered_set::iterator itv; + std::unordered_set visited; + std::unordered_set::iterator itv; do { cur = visit.back(); diff --git a/src/theory/substitutions.h b/src/theory/substitutions.h index e1d75d957..08936e3b6 100644 --- a/src/theory/substitutions.h +++ b/src/theory/substitutions.h @@ -40,18 +40,16 @@ namespace theory { * * This map is context-dependent. */ -class SubstitutionMap { - -public: - - typedef context::CDHashMap NodeMap; +class SubstitutionMap +{ + public: + typedef context::CDHashMap NodeMap; typedef NodeMap::iterator iterator; typedef NodeMap::const_iterator const_iterator; -private: - - typedef std::unordered_map NodeCache; + private: + typedef std::unordered_map NodeCache; /** A dummy context used by this class if none is provided */ context::Context d_context; @@ -68,18 +66,21 @@ private: Node internalSubstitute(TNode t, NodeCache& cache); /** Helper class to invalidate cache on user pop */ - class CacheInvalidator : public context::ContextNotifyObj { + class CacheInvalidator : public context::ContextNotifyObj + { bool& d_cacheInvalidated; - protected: - void contextNotifyPop() override { d_cacheInvalidated = true; } - public: - CacheInvalidator(context::Context* context, bool& cacheInvalidated) : - context::ContextNotifyObj(context), - d_cacheInvalidated(cacheInvalidated) { + protected: + void contextNotifyPop() override { d_cacheInvalidated = true; } + + public: + CacheInvalidator(context::Context* context, bool& cacheInvalidated) + : context::ContextNotifyObj(context), + d_cacheInvalidated(cacheInvalidated) + { } - };/* class SubstitutionMap::CacheInvalidator */ + }; /* class SubstitutionMap::CacheInvalidator */ /** * This object is notified on user pop and marks the SubstitutionMap's @@ -103,7 +104,8 @@ private: /** * Returns true iff x is in the substitution map */ - bool hasSubstitution(TNode x) const { + bool hasSubstitution(TNode x) const + { return d_substitutions.find(x) != d_substitutions.end(); } @@ -115,8 +117,10 @@ private: * is mainly intended for constructing assertions about what has * already been put in the map. */ - TNode getSubstitution(TNode x) const { - AssertArgument(hasSubstitution(x), x, "element not in this substitution map"); + TNode getSubstitution(TNode x) const + { + AssertArgument( + hasSubstitution(x), x, "element not in this substitution map"); return (*d_substitutions.find(x)).second; } @@ -128,29 +132,20 @@ private: /** * Apply the substitutions to the node. */ - Node apply(TNode t, bool doRewrite = false) const { + Node apply(TNode t, bool doRewrite = false) const + { return const_cast(this)->apply(t, doRewrite); } - iterator begin() { - return d_substitutions.begin(); - } + iterator begin() { return d_substitutions.begin(); } - iterator end() { - return d_substitutions.end(); - } + iterator end() { return d_substitutions.end(); } - const_iterator begin() const { - return d_substitutions.begin(); - } + const_iterator begin() const { return d_substitutions.begin(); } - const_iterator end() const { - return d_substitutions.end(); - } + const_iterator end() const { return d_substitutions.end(); } - bool empty() const { - return d_substitutions.empty(); - } + bool empty() const { return d_substitutions.empty(); } /** * Print to the output stream @@ -158,7 +153,7 @@ private: void print(std::ostream& out) const; void debugPrint() const; -};/* class SubstitutionMap */ +}; /* class SubstitutionMap */ inline std::ostream& operator << (std::ostream& out, const SubstitutionMap& subst) { subst.print(out); diff --git a/src/theory/term_registration_visitor.h b/src/theory/term_registration_visitor.h index 04200ed70..86ab160d8 100644 --- a/src/theory/term_registration_visitor.h +++ b/src/theory/term_registration_visitor.h @@ -43,8 +43,7 @@ class PreRegisterVisitor { /** The engine */ TheoryEngine* d_engine; - typedef context::CDHashMap - TNodeToTheorySetMap; + typedef context::CDHashMap TNodeToTheorySetMap; /** * Map from terms to the theories that have already had this term pre-registered. @@ -129,10 +128,8 @@ class PreRegisterVisitor { * been visited already, we need to visit it again, since we need to associate it with both atoms. */ class SharedTermsVisitor { - using TNodeVisitedMap = - std::unordered_map; - using TNodeToTheorySetMap = - context::CDHashMap; + using TNodeVisitedMap = std::unordered_map; + using TNodeToTheorySetMap = context::CDHashMap; /** * String representation of the visited map, for debugging purposes. */ diff --git a/src/theory/theory.cpp b/src/theory/theory.cpp index 5d2128c54..d6ad4cd41 100644 --- a/src/theory/theory.cpp +++ b/src/theory/theory.cpp @@ -341,8 +341,9 @@ bool Theory::isLegalElimination(TNode x, TNode val) return tm->isLegalElimination(x, val); } -std::unordered_set Theory::currentlySharedTerms() const{ - std::unordered_set currentlyShared; +std::unordered_set Theory::currentlySharedTerms() const +{ + std::unordered_set currentlyShared; for (shared_terms_iterator i = shared_terms_begin(), i_end = shared_terms_end(); i != i_end; ++i) { currentlyShared.insert (*i); diff --git a/src/theory/theory.h b/src/theory/theory.h index 9cf663a4f..8f69d4cb2 100644 --- a/src/theory/theory.h +++ b/src/theory/theory.h @@ -828,7 +828,7 @@ class Theory { * This is a utility function for constructing a copy of the currently shared terms * in a queriable form. As this is */ - std::unordered_set currentlySharedTerms() const; + std::unordered_set currentlySharedTerms() const; /** * This allows the theory to be queried for whether a literal, lit, is diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp index 1acaca34f..abbca451a 100644 --- a/src/theory/theory_engine.cpp +++ b/src/theory/theory_engine.cpp @@ -1119,8 +1119,8 @@ theory::EqualityStatus TheoryEngine::getEqualityStatus(TNode a, TNode b) { return d_sharedSolver->getEqualityStatus(a, b); } -const std::unordered_set& -TheoryEngine::getRelevantAssertions(bool& success) +const std::unordered_set& TheoryEngine::getRelevantAssertions( + bool& success) { // if we are not in SAT mode, or there is no relevance manager, we fail if (!d_inSatMode || d_relManager == nullptr) @@ -1203,10 +1203,9 @@ TrustNode TheoryEngine::getExplanation(TNode node) struct AtomsCollect { std::vector d_atoms; - std::unordered_set d_visited; - -public: + std::unordered_set d_visited; + public: typedef void return_type; bool alreadyVisited(TNode current, TNode parent) { @@ -1508,7 +1507,7 @@ theory::TrustNode TheoryEngine::getExplanation( // vector of trust nodes to explain at the end std::vector> texplains; // cache of nodes we have already explained by some theory - std::unordered_map cache; + std::unordered_map cache; while (i < explanationVector.size()) { // Get the current literal to explain diff --git a/src/theory/theory_engine.h b/src/theory/theory_engine.h index 4c097a262..6887959ed 100644 --- a/src/theory/theory_engine.h +++ b/src/theory/theory_engine.h @@ -68,10 +68,10 @@ struct NodeTheoryPair { };/* struct NodeTheoryPair */ struct NodeTheoryPairHashFunction { - NodeHashFunction hashFunction; + std::hash hashFunction; // Hash doesn't take into account the timestamp size_t operator()(const NodeTheoryPair& pair) const { - uint64_t hash = fnv1a::fnv1a_64(NodeHashFunction()(pair.d_node)); + uint64_t hash = fnv1a::fnv1a_64(std::hash()(pair.d_node)); return static_cast(fnv1a::fnv1a_64(pair.d_theory, hash)); } };/* struct NodeTheoryPairHashFunction */ @@ -162,7 +162,7 @@ class TheoryEngine { * An empty set of relevant assertions, which is returned as a dummy value for * getRelevantAssertions when relevance is disabled. */ - std::unordered_set d_emptyRelevantSet; + std::unordered_set d_emptyRelevantSet; /** are we in eager model building mode? (see setEagerModelBuilding). */ bool d_eager_model_building; @@ -637,8 +637,7 @@ class TheoryEngine { * relevance manager failed to compute relevant assertions due to an internal * error. */ - const std::unordered_set& getRelevantAssertions( - bool& success); + const std::unordered_set& getRelevantAssertions(bool& success); /** * Forwards an entailment check according to the given theoryOfMode. diff --git a/src/theory/theory_engine_proof_generator.h b/src/theory/theory_engine_proof_generator.h index 167216226..48969aa21 100644 --- a/src/theory/theory_engine_proof_generator.h +++ b/src/theory/theory_engine_proof_generator.h @@ -38,9 +38,8 @@ namespace cvc5 { */ class TheoryEngineProofGenerator : public ProofGenerator { - typedef context:: - CDHashMap, NodeHashFunction> - NodeLazyCDProofMap; + typedef context::CDHashMap> + NodeLazyCDProofMap; public: TheoryEngineProofGenerator(ProofNodeManager* pnm, context::UserContext* u); diff --git a/src/theory/theory_inference_manager.h b/src/theory/theory_inference_manager.h index a785af186..2cb7d9d30 100644 --- a/src/theory/theory_inference_manager.h +++ b/src/theory/theory_inference_manager.h @@ -68,7 +68,7 @@ class ProofEqEngine; */ class TheoryInferenceManager { - typedef context::CDHashSet NodeSet; + typedef context::CDHashSet NodeSet; public: /** diff --git a/src/theory/theory_model.cpp b/src/theory/theory_model.cpp index a95546cf5..dd1e0b883 100644 --- a/src/theory/theory_model.cpp +++ b/src/theory/theory_model.cpp @@ -184,7 +184,7 @@ Cardinality TheoryModel::getCardinality(TypeNode tn) const Node TheoryModel::getModelValue(TNode n) const { - std::unordered_map::iterator it = d_modelCache.find(n); + std::unordered_map::iterator it = d_modelCache.find(n); if (it != d_modelCache.end()) { return (*it).second; } diff --git a/src/theory/theory_model.h b/src/theory/theory_model.h index ab66e8fe7..951a62cae 100644 --- a/src/theory/theory_model.h +++ b/src/theory/theory_model.h @@ -398,7 +398,7 @@ class TheoryModel /** are we using model cores? */ bool d_using_model_core; /** symbols that are in the model core */ - std::unordered_set d_model_core; + std::unordered_set d_model_core; /** Get model value function. * * This function is a helper function for getValue. @@ -414,7 +414,7 @@ class TheoryModel virtual void addTermInternal(TNode n); private: /** cache for getModelValue */ - mutable std::unordered_map d_modelCache; + mutable std::unordered_map d_modelCache; //---------------------------- separation logic /** the value of the heap */ diff --git a/src/theory/theory_model_builder.cpp b/src/theory/theory_model_builder.cpp index 2103c3997..0a038845c 100644 --- a/src/theory/theory_model_builder.cpp +++ b/src/theory/theory_model_builder.cpp @@ -340,7 +340,7 @@ bool TheoryEngineModelBuilder::isExcludedUSortValue( void TheoryEngineModelBuilder::addToTypeList( TypeNode tn, std::vector& type_list, - std::unordered_set& visiting) + std::unordered_set& visiting) { if (std::find(type_list.begin(), type_list.end(), tn) == type_list.end()) { @@ -427,11 +427,11 @@ bool TheoryEngineModelBuilder::buildModel(TheoryModel* tm) // the set of equivalence classes that are "assignable", i.e. those that have // an assignable expression in them (see isAssignable), and have not already // been assigned a constant. - std::unordered_set assignableEqc; + std::unordered_set assignableEqc; // The set of equivalence classes that are "evaluable", i.e. those that have // an expression in them that is not assignable, and have not already been // assigned a constant. - std::unordered_set evaluableEqc; + std::unordered_set evaluableEqc; // Assigner objects for relevant equivalence classes that require special // ways of assigning values, e.g. those that take into account assignment // exclusion sets. @@ -449,7 +449,7 @@ bool TheoryEngineModelBuilder::buildModel(TheoryModel* tm) // should we compute assigner objects? bool computeAssigners = tm->hasAssignmentExclusionSets(); // the set of exclusion sets we have processed - std::unordered_set processedExcSet; + std::unordered_set processedExcSet; for (; !eqcs_i.isFinished(); ++eqcs_i) { Node eqc = *eqcs_i; @@ -591,13 +591,13 @@ bool TheoryEngineModelBuilder::buildModel(TheoryModel* tm) { assertedReps[eqc] = rep; typeRepSet.add(eqct.getBaseType(), eqc); - std::unordered_set visiting; + std::unordered_set visiting; addToTypeList(eqct.getBaseType(), type_list, visiting); } else { typeNoRepSet.add(eqct, eqc); - std::unordered_set visiting; + std::unordered_set visiting; addToTypeList(eqct, type_list, visiting); } diff --git a/src/theory/theory_model_builder.h b/src/theory/theory_model_builder.h index af3f30fb0..195ba9e0f 100644 --- a/src/theory/theory_model_builder.h +++ b/src/theory/theory_model_builder.h @@ -44,8 +44,8 @@ namespace theory { */ class TheoryEngineModelBuilder { - typedef std::unordered_map NodeMap; - typedef std::unordered_set NodeSet; + typedef std::unordered_map NodeMap; + typedef std::unordered_set NodeSet; public: TheoryEngineModelBuilder(); @@ -164,10 +164,9 @@ class TheoryEngineModelBuilder * For example, if tn is (Array Int Bool) and type_list is empty, * then we append ( Int, Bool, (Array Int Bool) ) to type_list. */ - void addToTypeList( - TypeNode tn, - std::vector& type_list, - std::unordered_set& visiting); + void addToTypeList(TypeNode tn, + std::vector& type_list, + std::unordered_set& visiting); /** assign function f based on the model m. * This construction is based on "table form". For example: * (f 0 1) = 1 diff --git a/src/theory/theory_preprocessor.h b/src/theory/theory_preprocessor.h index 79b5dbe01..58dd763e0 100644 --- a/src/theory/theory_preprocessor.h +++ b/src/theory/theory_preprocessor.h @@ -72,7 +72,7 @@ namespace theory { */ class TheoryPreprocessor { - typedef context::CDHashMap NodeMap; + typedef context::CDHashMap NodeMap; public: /** Constructs a theory preprocessor */ diff --git a/src/theory/theory_proof_step_buffer.cpp b/src/theory/theory_proof_step_buffer.cpp index 70f35afb8..667c8d114 100644 --- a/src/theory/theory_proof_step_buffer.cpp +++ b/src/theory/theory_proof_step_buffer.cpp @@ -186,7 +186,7 @@ Node TheoryProofStepBuffer::factorReorderElimDoubleNeg(Node n) } children.clear(); // remove duplicates while keeping the order of children - std::unordered_set clauseSet; + std::unordered_set clauseSet; unsigned size = n.getNumChildren(); for (unsigned i = 0; i < size; ++i) { diff --git a/src/theory/trust_substitutions.h b/src/theory/trust_substitutions.h index b7b526205..136992fbe 100644 --- a/src/theory/trust_substitutions.h +++ b/src/theory/trust_substitutions.h @@ -38,7 +38,7 @@ namespace theory { */ class TrustSubstitutionMap : public ProofGenerator { - using NodeUIntMap = context::CDHashMap; + using NodeUIntMap = context::CDHashMap; public: TrustSubstitutionMap(context::Context* c, diff --git a/src/theory/type_set.cpp b/src/theory/type_set.cpp index 00a3d77fd..12bb2bae6 100644 --- a/src/theory/type_set.cpp +++ b/src/theory/type_set.cpp @@ -113,14 +113,14 @@ Node TypeSet::nextTypeEnum(TypeNode t, bool useBaseType) // this is necessary for parametric types whose values are constructed from // other types to ensure that we do not enumerate subterms of other // previously enumerated values - std::unordered_set visited; + std::unordered_set visited; addSubTerms(n, visited); ++(*te); return n; } void TypeSet::addSubTerms(TNode n, - std::unordered_set& visited, + std::unordered_set& visited, bool topLevel) { if (visited.find(n) == visited.end()) diff --git a/src/theory/type_set.h b/src/theory/type_set.h index 229ec2001..fb4859602 100644 --- a/src/theory/type_set.h +++ b/src/theory/type_set.h @@ -33,10 +33,8 @@ namespace theory { class TypeSet { public: - typedef std::unordered_map*, TypeNodeHashFunction> - TypeSetMap; - typedef std::unordered_map - TypeToTypeEnumMap; + typedef std::unordered_map*> TypeSetMap; + typedef std::unordered_map TypeToTypeEnumMap; typedef TypeSetMap::iterator iterator; typedef TypeSetMap::const_iterator const_iterator; @@ -81,7 +79,7 @@ class TypeSet * (very low expression depth). */ void addSubTerms(TNode n, - std::unordered_set& visited, + std::unordered_set& visited, bool topLevel = true); }; /* class TypeSet */ diff --git a/src/theory/uf/cardinality_extension.h b/src/theory/uf/cardinality_extension.h index 70db9257f..1809a30bd 100644 --- a/src/theory/uf/cardinality_extension.h +++ b/src/theory/uf/cardinality_extension.h @@ -39,8 +39,8 @@ class TheoryUF; class CardinalityExtension { protected: - typedef context::CDHashMap NodeBoolMap; - typedef context::CDHashMap NodeIntMap; + typedef context::CDHashMap NodeBoolMap; + typedef context::CDHashMap NodeIntMap; public: /** diff --git a/src/theory/uf/eq_proof.cpp b/src/theory/uf/eq_proof.cpp index 8e5e0f659..c63f8b51d 100644 --- a/src/theory/uf/eq_proof.cpp +++ b/src/theory/uf/eq_proof.cpp @@ -106,7 +106,7 @@ bool EqProof::expandTransitivityForDisequalities( Node conclusion, std::vector& premises, CDProof* p, - std::unordered_set& assumptions) const + std::unordered_set& assumptions) const { Trace("eqproof-conv") << "EqProof::expandTransitivityForDisequalities: check if need " @@ -684,8 +684,8 @@ void EqProof::reduceNestedCongruence( Node conclusion, std::vector>& transitivityMatrix, CDProof* p, - std::unordered_map& visited, - std::unordered_set& assumptions, + std::unordered_map& visited, + std::unordered_set& assumptions, bool isNary) const { Trace("eqproof-conv") << "EqProof::reduceNestedCongruence: building for " << i @@ -785,8 +785,8 @@ void EqProof::reduceNestedCongruence( Node EqProof::addToProof(CDProof* p) const { - std::unordered_map cache; - std::unordered_set assumptions; + std::unordered_map cache; + std::unordered_set assumptions; Node conclusion = addToProof(p, cache, assumptions); Trace("eqproof-conv") << "EqProof::addToProof: root of proof: " << conclusion << "\n"; @@ -840,13 +840,11 @@ Node EqProof::addToProof(CDProof* p) const return newConclusion; } -Node EqProof::addToProof( - CDProof* p, - std::unordered_map& visited, - std::unordered_set& assumptions) const +Node EqProof::addToProof(CDProof* p, + std::unordered_map& visited, + std::unordered_set& assumptions) const { - std::unordered_map::const_iterator it = - visited.find(d_node); + std::unordered_map::const_iterator it = visited.find(d_node); if (it != visited.end()) { Trace("eqproof-conv") << "EqProof::addToProof: already processed " << d_node diff --git a/src/theory/uf/eq_proof.h b/src/theory/uf/eq_proof.h index c938c8d9d..3179da592 100644 --- a/src/theory/uf/eq_proof.h +++ b/src/theory/uf/eq_proof.h @@ -88,10 +88,9 @@ class EqProof * equalities) * @return the node that is the conclusion of the proof as added to p. */ - Node addToProof( - CDProof* p, - std::unordered_map& visited, - std::unordered_set& assumptions) const; + Node addToProof(CDProof* p, + std::unordered_map& visited, + std::unordered_set& assumptions) const; /** Removes all reflexivity steps, i.e. (= t t), from premises. */ void cleanReflPremises(std::vector& premises) const; @@ -173,7 +172,7 @@ class EqProof Node conclusion, std::vector& premises, CDProof* p, - std::unordered_set& assumptions) const; + std::unordered_set& assumptions) const; /** Expand coarse-grained transitivity steps for theory disequalities * @@ -347,8 +346,8 @@ class EqProof Node conclusion, std::vector>& transitivityMatrix, CDProof* p, - std::unordered_map& visited, - std::unordered_set& assumptions, + std::unordered_map& visited, + std::unordered_set& assumptions, bool isNary) const; }; /* class EqProof */ diff --git a/src/theory/uf/equality_engine.h b/src/theory/uf/equality_engine.h index 8676e446e..024774593 100644 --- a/src/theory/uf/equality_engine.h +++ b/src/theory/uf/equality_engine.h @@ -136,7 +136,7 @@ private: KindMap d_congruenceKindsExtOperators; /** Map from nodes to their ids */ - std::unordered_map d_nodeIds; + std::unordered_map d_nodeIds; /** Map from function applications to their ids */ typedef std::unordered_map ApplicationIdsMap; diff --git a/src/theory/uf/ho_extension.cpp b/src/theory/uf/ho_extension.cpp index 13709c2ab..853ae719b 100644 --- a/src/theory/uf/ho_extension.cpp +++ b/src/theory/uf/ho_extension.cpp @@ -128,7 +128,7 @@ Node HoExtension::getApplyUfForHoApply(Node node) NodeNodeMap::const_iterator itus = d_uf_std_skolem.find(f); if (itus == d_uf_std_skolem.end()) { - std::unordered_set fvs; + std::unordered_set fvs; expr::getFreeVariables(f, fvs); Node lem; if (!fvs.empty()) diff --git a/src/theory/uf/ho_extension.h b/src/theory/uf/ho_extension.h index 58320d07b..af8f727fd 100644 --- a/src/theory/uf/ho_extension.h +++ b/src/theory/uf/ho_extension.h @@ -49,8 +49,8 @@ class TheoryUF; */ class HoExtension { - typedef context::CDHashSet NodeSet; - typedef context::CDHashMap NodeNodeMap; + typedef context::CDHashSet NodeSet; + typedef context::CDHashMap NodeNodeMap; public: HoExtension(TheoryState& state, TheoryInferenceManager& im); diff --git a/src/theory/uf/proof_equality_engine.h b/src/theory/uf/proof_equality_engine.h index aed662c4c..4ca13d93f 100644 --- a/src/theory/uf/proof_equality_engine.h +++ b/src/theory/uf/proof_equality_engine.h @@ -80,9 +80,8 @@ class EqualityEngine; */ class ProofEqEngine : public EagerProofGenerator { - typedef context::CDHashSet NodeSet; - typedef context::CDHashMap, NodeHashFunction> - NodeProofMap; + typedef context::CDHashSet NodeSet; + typedef context::CDHashMap> NodeProofMap; public: ProofEqEngine(context::Context* c, diff --git a/src/theory/uf/symmetry_breaker.cpp b/src/theory/uf/symmetry_breaker.cpp index 65ed4d542..aa5d9d953 100644 --- a/src/theory/uf/symmetry_breaker.cpp +++ b/src/theory/uf/symmetry_breaker.cpp @@ -59,7 +59,7 @@ SymmetryBreaker::Template::Template() : } TNode SymmetryBreaker::Template::find(TNode n) { - unordered_map::iterator i = d_reps.find(n); + unordered_map::iterator i = d_reps.find(n); if(i == d_reps.end()) { return n; } else { @@ -396,7 +396,7 @@ void SymmetryBreaker::assertFormula(TNode phi) { break; } } - unordered_map, TNodeHashFunction>& ps = t.partitions(); + unordered_map>& ps = t.partitions(); for (auto& kv : ps) { Debug("ufsymm") << "UFSYMM partition*: " << kv.first; @@ -416,11 +416,12 @@ void SymmetryBreaker::assertFormula(TNode phi) { } if(!d_template.match(phi)) { // we hit a bad match, extract the partitions and reset the template - unordered_map, TNodeHashFunction>& ps = d_template.partitions(); + unordered_map>& ps = d_template.partitions(); Debug("ufsymm") << "UFSYMM hit a bad match---have " << ps.size() << " partitions:" << endl; - for(unordered_map, TNodeHashFunction>::iterator i = ps.begin(); - i != ps.end(); - ++i) { + for (unordered_map>::iterator i = ps.begin(); + i != ps.end(); + ++i) + { Debug("ufsymm") << "UFSYMM partition: " << (*i).first; set& p = (*i).second; if(Debug.isOn("ufsymm")) { diff --git a/src/theory/uf/symmetry_breaker.h b/src/theory/uf/symmetry_breaker.h index b5d0fbdf9..67eabb6ba 100644 --- a/src/theory/uf/symmetry_breaker.h +++ b/src/theory/uf/symmetry_breaker.h @@ -63,8 +63,8 @@ class SymmetryBreaker : public context::ContextNotifyObj { class Template { Node d_template; NodeBuilder d_assertions; - std::unordered_map, TNodeHashFunction> d_sets; - std::unordered_map d_reps; + std::unordered_map> d_sets; + std::unordered_map d_reps; TNode find(TNode n); bool matchRecursive(TNode t, TNode n); @@ -72,7 +72,7 @@ class SymmetryBreaker : public context::ContextNotifyObj { public: Template(); bool match(TNode n); - std::unordered_map, TNodeHashFunction>& partitions() { return d_sets; } + std::unordered_map>& partitions() { return d_sets; } Node assertions() { switch(d_assertions.getNumChildren()) { case 0: return Node::null(); @@ -90,10 +90,9 @@ public: typedef TNode Term; typedef std::list Terms; typedef std::set TermEq; - typedef std::unordered_map TermEqs; - -private: + typedef std::unordered_map TermEqs; + private: /** * This class wasn't initially built to be incremental. It should * be attached to a UserContext so that it clears everything when @@ -112,7 +111,7 @@ private: Permutations d_permutations; Terms d_terms; Template d_template; - std::unordered_map d_normalizationCache; + std::unordered_map d_normalizationCache; TermEqs d_termEqs; TermEqs d_termEqsOnly; diff --git a/src/theory/uf/theory_uf.cpp b/src/theory/uf/theory_uf.cpp index 5d91faa87..9cf47bab3 100644 --- a/src/theory/uf/theory_uf.cpp +++ b/src/theory/uf/theory_uf.cpp @@ -349,7 +349,7 @@ void TheoryUF::ppStaticLearn(TNode n, NodeBuilder& learned) vector workList; workList.push_back(n); - std::unordered_set processed; + std::unordered_set processed; while(!workList.empty()) { n = workList.back(); diff --git a/test/unit/node/node_algorithm_black.cpp b/test/unit/node/node_algorithm_black.cpp index 6b8c27c17..e96d3ec9e 100644 --- a/test/unit/node/node_algorithm_black.cpp +++ b/test/unit/node/node_algorithm_black.cpp @@ -40,7 +40,7 @@ TEST_F(TestNodeBlackNodeAlgorithm, get_symbols1) // The only symbol in ~x (x is a boolean varible) should be x Node x = d_skolemManager->mkDummySkolem("x", d_nodeManager->booleanType()); Node n = d_nodeManager->mkNode(NOT, x); - std::unordered_set syms; + std::unordered_set syms; getSymbols(n, syms); ASSERT_EQ(syms.size(), 1); ASSERT_NE(syms.find(x), syms.end()); @@ -69,7 +69,7 @@ TEST_F(TestNodeBlackNodeAlgorithm, get_symbols2) Node res = d_nodeManager->mkNode(AND, left, right); // symbols - std::unordered_set syms; + std::unordered_set syms; getSymbols(res, syms); // assertions @@ -82,8 +82,8 @@ TEST_F(TestNodeBlackNodeAlgorithm, get_symbols2) TEST_F(TestNodeBlackNodeAlgorithm, get_operators_map) { // map to store result - std::map > result = - std::map >(); + std::map > result = + std::map >(); // create test formula Node x = d_skolemManager->mkDummySkolem("x", d_nodeManager->integerType()); @@ -146,7 +146,7 @@ TEST_F(TestNodeBlackNodeAlgorithm, match) Node a = d_skolemManager->mkDummySkolem("a", integer); Node n1 = d_nodeManager->mkNode(MULT, two, x); - std::unordered_map subs; + std::unordered_map subs; // check reflexivity ASSERT_TRUE(match(n1, n1, subs)); diff --git a/test/unit/preprocessing/pass_bv_gauss_white.cpp b/test/unit/preprocessing/pass_bv_gauss_white.cpp index 5905f8404..839b516e4 100644 --- a/test/unit/preprocessing/pass_bv_gauss_white.cpp +++ b/test/unit/preprocessing/pass_bv_gauss_white.cpp @@ -924,7 +924,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_unique1) d_two); std::vector eqs = {eq1, eq2, eq3}; - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret = BVGauss::gaussElimRewriteForUrem(eqs, res); ASSERT_EQ(ret, BVGauss::Result::UNIQUE); ASSERT_EQ(res.size(), 3); @@ -1030,7 +1030,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_unique2) d_two); std::vector eqs = {eq1, eq2, eq3}; - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret = BVGauss::gaussElimRewriteForUrem(eqs, res); ASSERT_EQ(ret, BVGauss::Result::UNIQUE); ASSERT_EQ(res.size(), 3); @@ -1041,7 +1041,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_unique2) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial1a) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -1167,7 +1167,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial1a) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial1b) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -1291,7 +1291,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial1b) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial2) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -1380,7 +1380,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial2) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial3) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -1509,7 +1509,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial3) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial4) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -1660,7 +1660,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial4) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial5) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -1772,7 +1772,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial5) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial6) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -1860,7 +1860,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_partial6) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_with_expr_partial) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -2011,7 +2011,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_with_expr_partial) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_nary_partial) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -2182,7 +2182,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_nary_partial) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_not_invalid1) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -2230,7 +2230,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_not_invalid1) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_not_invalid2) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -2301,7 +2301,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_not_invalid2) TEST_F(TestPPWhiteBVGauss, elim_rewrite_for_urem_invalid) { - std::unordered_map res; + std::unordered_map res; BVGauss::Result ret; /* ------------------------------------------------------------------- @@ -2401,7 +2401,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_unique1) AssertionPipeline apipe; apipe.push_back(a); passes::BVGauss bgauss(nullptr, "bv-gauss-unit"); - std::unordered_map res; + std::unordered_map res; PreprocessingPassResult pres = bgauss.applyInternal(&apipe); ASSERT_EQ(pres, PreprocessingPassResult::NO_CONFLICT); Node resx = d_nodeManager->mkNode( @@ -2490,7 +2490,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_unique2) apipe.push_back(eq4); apipe.push_back(eq5); passes::BVGauss bgauss(nullptr, "bv-gauss-unit"); - std::unordered_map res; + std::unordered_map res; PreprocessingPassResult pres = bgauss.applyInternal(&apipe); ASSERT_EQ(pres, PreprocessingPassResult::NO_CONFLICT); Node resx1 = d_nodeManager->mkNode( @@ -2542,7 +2542,7 @@ TEST_F(TestPPWhiteBVGauss, elim_rewrite_partial) apipe.push_back(eq1); apipe.push_back(eq2); passes::BVGauss bgauss(nullptr, "bv-gauss-unit"); - std::unordered_map res; + std::unordered_map res; PreprocessingPassResult pres = bgauss.applyInternal(&apipe); ASSERT_EQ(pres, PreprocessingPassResult::NO_CONFLICT); ASSERT_EQ(apipe.size(), 4); diff --git a/test/unit/theory/theory_quantifiers_bv_instantiator_white.cpp b/test/unit/theory/theory_quantifiers_bv_instantiator_white.cpp index 211552590..85f14b245 100644 --- a/test/unit/theory/theory_quantifiers_bv_instantiator_white.cpp +++ b/test/unit/theory/theory_quantifiers_bv_instantiator_white.cpp @@ -113,7 +113,7 @@ TEST_F(TestTheoryWhiteyQuantifiersBvInstantiator, normalizePvMult) Node zero = mkZero(32); Node one = mkOne(32); BvLinearAttribute is_linear; - std::unordered_map contains_x; + std::unordered_map contains_x; contains_x[x] = true; contains_x[neg_x] = true; @@ -211,7 +211,7 @@ TEST_F(TestTheoryWhiteyQuantifiersBvInstantiator, normalizePvPlus) Node c = mkVar(32); Node d = mkVar(32); BvLinearAttribute is_linear; - std::unordered_map contains_x; + std::unordered_map contains_x; contains_x[x] = true; contains_x[neg_x] = true; @@ -334,7 +334,7 @@ TEST_F(TestTheoryWhiteyQuantifiersBvInstantiator, normalizePvEqual) Node one = mkOne(32); Node ntrue = mkTrue(); BvLinearAttribute is_linear; - std::unordered_map contains_x; + std::unordered_map contains_x; contains_x[x] = true; contains_x[neg_x] = true; diff --git a/test/unit/theory/type_enumerator_white.cpp b/test/unit/theory/type_enumerator_white.cpp index ab77a74ce..baf3af40e 100644 --- a/test/unit/theory/type_enumerator_white.cpp +++ b/test/unit/theory/type_enumerator_white.cpp @@ -248,7 +248,7 @@ TEST_F(TestTheoryWhiteTypeEnumerator, arrays_infinite) { TypeEnumerator te(d_nodeManager->mkArrayType(d_nodeManager->integerType(), d_nodeManager->integerType())); - std::unordered_set elts; + std::unordered_set elts; for (uint32_t i = 0; i < 1000; ++i) { ASSERT_FALSE(te.isFinished()); -- 2.30.2