mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 11:42:28 +00:00 
			
		
		
		
	bool_vector, some spacer tidy
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
		
							parent
							
								
									2ed26e8e73
								
							
						
					
					
						commit
						b889b110ee
					
				
					 106 changed files with 239 additions and 266 deletions
				
			
		|  | @ -3110,7 +3110,7 @@ proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * pro | ||||||
|         app const * cls   = to_app(f1); |         app const * cls   = to_app(f1); | ||||||
|         unsigned num_args = cls->get_num_args(); |         unsigned num_args = cls->get_num_args(); | ||||||
| #ifdef Z3DEBUG | #ifdef Z3DEBUG | ||||||
|         svector<bool> found; |         bool_vector found; | ||||||
| #endif | #endif | ||||||
|         ast_mark mark; |         ast_mark mark; | ||||||
|         for (unsigned i = 0; i < num_args; i++) { |         for (unsigned i = 0; i < num_args; i++) { | ||||||
|  |  | ||||||
|  | @ -100,7 +100,7 @@ protected: | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class default_expr2polynomial : public expr2polynomial { | class default_expr2polynomial : public expr2polynomial { | ||||||
|     svector<bool> m_is_int; |     bool_vector m_is_int; | ||||||
| public: | public: | ||||||
|     default_expr2polynomial(ast_manager & am, polynomial::manager & pm); |     default_expr2polynomial(ast_manager & am, polynomial::manager & pm); | ||||||
|     ~default_expr2polynomial() override; |     ~default_expr2polynomial() override; | ||||||
|  |  | ||||||
|  | @ -34,9 +34,9 @@ public: | ||||||
|         ptr_vector<func_decl> m_fs; |         ptr_vector<func_decl> m_fs; | ||||||
|         expr_ref_vector       m_defs; |         expr_ref_vector       m_defs; | ||||||
|         expr_ref_vector       m_conds; |         expr_ref_vector       m_conds; | ||||||
|         svector<bool>         m_ineq; // true if the macro is based on an inequality instead of equality.
 |         bool_vector         m_ineq; // true if the macro is based on an inequality instead of equality.
 | ||||||
|         svector<bool>         m_satisfy; |         bool_vector         m_satisfy; | ||||||
|         svector<bool>         m_hint; // macro did not contain all universal variables in the quantifier.
 |         bool_vector         m_hint; // macro did not contain all universal variables in the quantifier.
 | ||||||
|         friend class macro_util; |         friend class macro_util; | ||||||
|         ast_manager & get_manager() { return m_conds.get_manager(); } |         ast_manager & get_manager() { return m_conds.get_manager(); } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -112,7 +112,7 @@ struct static_features { | ||||||
|     u_map<unsigned>          m_expr2formula_depth; |     u_map<unsigned>          m_expr2formula_depth; | ||||||
| 
 | 
 | ||||||
|     unsigned                 m_num_theories;  |     unsigned                 m_num_theories;  | ||||||
|     svector<bool>            m_theories;       // mapping family_id -> bool
 |     bool_vector            m_theories;       // mapping family_id -> bool
 | ||||||
| 
 | 
 | ||||||
|     symbol                   m_label_sym; |     symbol                   m_label_sym; | ||||||
|     symbol                   m_pattern_sym; |     symbol                   m_pattern_sym; | ||||||
|  |  | ||||||
|  | @ -440,7 +440,7 @@ typename symbolic_automata<T, M>::automaton_t* symbolic_automata<T, M>::mk_produ | ||||||
|         inv[mv.dst()].push_back(move_t(m, mv.dst(), mv.src(), mv.t()));  |         inv[mv.dst()].push_back(move_t(m, mv.dst(), mv.src(), mv.t()));  | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     svector<bool> back_reachable(n, false); |     bool_vector back_reachable(n, false); | ||||||
|     for (unsigned f : final) { |     for (unsigned f : final) { | ||||||
|         back_reachable[f] = true; |         back_reachable[f] = true; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -748,7 +748,7 @@ namespace dd { | ||||||
|     void bdd_manager::gc() { |     void bdd_manager::gc() { | ||||||
|         m_free_nodes.reset(); |         m_free_nodes.reset(); | ||||||
|         IF_VERBOSE(13, verbose_stream() << "(bdd :gc " << m_nodes.size() << ")\n";); |         IF_VERBOSE(13, verbose_stream() << "(bdd :gc " << m_nodes.size() << ")\n";); | ||||||
|         svector<bool> reachable(m_nodes.size(), false); |         bool_vector reachable(m_nodes.size(), false); | ||||||
|         for (unsigned i = m_bdd_stack.size(); i-- > 0; ) { |         for (unsigned i = m_bdd_stack.size(); i-- > 0; ) { | ||||||
|             reachable[m_bdd_stack[i]] = true; |             reachable[m_bdd_stack[i]] = true; | ||||||
|             m_todo.push_back(m_bdd_stack[i]); |             m_todo.push_back(m_bdd_stack[i]); | ||||||
|  |  | ||||||
|  | @ -952,12 +952,12 @@ namespace dd { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     bool pdd_manager::is_reachable(PDD p) { |     bool pdd_manager::is_reachable(PDD p) { | ||||||
|         svector<bool> reachable(m_nodes.size(), false); |         bool_vector reachable(m_nodes.size(), false); | ||||||
|         compute_reachable(reachable); |         compute_reachable(reachable); | ||||||
|         return reachable[p]; |         return reachable[p]; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void pdd_manager::compute_reachable(svector<bool>& reachable) { |     void pdd_manager::compute_reachable(bool_vector& reachable) { | ||||||
|         for (unsigned i = m_pdd_stack.size(); i-- > 0; ) { |         for (unsigned i = m_pdd_stack.size(); i-- > 0; ) { | ||||||
|             reachable[m_pdd_stack[i]] = true; |             reachable[m_pdd_stack[i]] = true; | ||||||
|             m_todo.push_back(m_pdd_stack[i]); |             m_todo.push_back(m_pdd_stack[i]); | ||||||
|  | @ -994,7 +994,7 @@ namespace dd { | ||||||
|         m_free_nodes.reset(); |         m_free_nodes.reset(); | ||||||
|         SASSERT(well_formed()); |         SASSERT(well_formed()); | ||||||
|         IF_VERBOSE(13, verbose_stream() << "(pdd :gc " << m_nodes.size() << ")\n";); |         IF_VERBOSE(13, verbose_stream() << "(pdd :gc " << m_nodes.size() << ")\n";); | ||||||
|         svector<bool> reachable(m_nodes.size(), false); |         bool_vector reachable(m_nodes.size(), false); | ||||||
|         compute_reachable(reachable); |         compute_reachable(reachable); | ||||||
|         for (unsigned i = m_nodes.size(); i-- > pdd_no_op; ) { |         for (unsigned i = m_nodes.size(); i-- > pdd_no_op; ) { | ||||||
|             if (!reachable[i]) { |             if (!reachable[i]) { | ||||||
|  |  | ||||||
|  | @ -227,7 +227,7 @@ namespace dd { | ||||||
|         bool var_is_leaf(PDD p, unsigned v); |         bool var_is_leaf(PDD p, unsigned v); | ||||||
| 
 | 
 | ||||||
|         bool is_reachable(PDD p); |         bool is_reachable(PDD p); | ||||||
|         void compute_reachable(svector<bool>& reachable); |         void compute_reachable(bool_vector& reachable); | ||||||
|         void try_gc(); |         void try_gc(); | ||||||
|         void reserve_var(unsigned v); |         void reserve_var(unsigned v); | ||||||
|         bool well_formed(); |         bool well_formed(); | ||||||
|  |  | ||||||
|  | @ -88,7 +88,7 @@ class hilbert_basis { | ||||||
| 
 | 
 | ||||||
|     reslimit&          m_limit; |     reslimit&          m_limit; | ||||||
|     vector<num_vector> m_ineqs;      // set of asserted inequalities
 |     vector<num_vector> m_ineqs;      // set of asserted inequalities
 | ||||||
|     svector<bool>      m_iseq;       // inequalities that are equalities
 |     bool_vector      m_iseq;       // inequalities that are equalities
 | ||||||
|     num_vector         m_store;      // store of vectors
 |     num_vector         m_store;      // store of vectors
 | ||||||
|     svector<offset_t>  m_basis;      // vector of current basis
 |     svector<offset_t>  m_basis;      // vector of current basis
 | ||||||
|     svector<offset_t>  m_free_list;  // free list of unused storage
 |     svector<offset_t>  m_free_list;  // free list of unused storage
 | ||||||
|  |  | ||||||
|  | @ -75,7 +75,7 @@ void const_iterator_mon::advance_mask() { | ||||||
| const_iterator_mon::self_type const_iterator_mon::operator++() {  self_type i = *this; operator++(1); return i;  } | const_iterator_mon::self_type const_iterator_mon::operator++() {  self_type i = *this; operator++(1); return i;  } | ||||||
| const_iterator_mon::self_type const_iterator_mon::operator++(int) { advance_mask(); return *this; } | const_iterator_mon::self_type const_iterator_mon::operator++(int) { advance_mask(); return *this; } | ||||||
| 
 | 
 | ||||||
| const_iterator_mon::const_iterator_mon(const svector<bool>& mask, const factorization_factory *f) :  | const_iterator_mon::const_iterator_mon(const bool_vector& mask, const factorization_factory *f) :  | ||||||
|     m_mask(mask), |     m_mask(mask), | ||||||
|     m_ff(f) , |     m_ff(f) , | ||||||
|     m_full_factorization_returned(false) |     m_full_factorization_returned(false) | ||||||
|  |  | ||||||
|  | @ -77,7 +77,7 @@ public: | ||||||
| 
 | 
 | ||||||
| struct const_iterator_mon { | struct const_iterator_mon { | ||||||
|     // fields
 |     // fields
 | ||||||
|     svector<bool>                  m_mask; |     bool_vector                  m_mask; | ||||||
|     const factorization_factory *  m_ff; |     const factorization_factory *  m_ff; | ||||||
|     bool                           m_full_factorization_returned; |     bool                           m_full_factorization_returned; | ||||||
| 
 | 
 | ||||||
|  | @ -97,7 +97,7 @@ struct const_iterator_mon { | ||||||
|     self_type operator++(); |     self_type operator++(); | ||||||
|     self_type operator++(int); |     self_type operator++(int); | ||||||
| 
 | 
 | ||||||
|     const_iterator_mon(const svector<bool>& mask, const factorization_factory *f); |     const_iterator_mon(const bool_vector& mask, const factorization_factory *f); | ||||||
|      |      | ||||||
|     bool operator==(const self_type &other) const; |     bool operator==(const self_type &other) const; | ||||||
|     bool operator!=(const self_type &other) const; |     bool operator!=(const self_type &other) const; | ||||||
|  | @ -119,15 +119,15 @@ struct factorization_factory { | ||||||
|         m_vars(vars), m_monic(m) { |         m_vars(vars), m_monic(m) { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     svector<bool> get_mask() const { |     bool_vector get_mask() const { | ||||||
|         // we keep the last element always in the first factor to avoid
 |         // we keep the last element always in the first factor to avoid
 | ||||||
|         // repeating a pair twice, that is why m_mask is shorter by one then m_vars
 |         // repeating a pair twice, that is why m_mask is shorter by one then m_vars
 | ||||||
|          |          | ||||||
|         return |         return | ||||||
|             m_vars.size() != 2 ? |             m_vars.size() != 2 ? | ||||||
|             svector<bool>(m_vars.size() - 1, false) |             bool_vector(m_vars.size() - 1, false) | ||||||
|             : |             : | ||||||
|             svector<bool>(1, true); // init mask as in the end() since the full iteration will do the job
 |             bool_vector(1, true); // init mask as in the end() since the full iteration will do the job
 | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     const_iterator_mon begin() const { |     const_iterator_mon begin() const { | ||||||
|  | @ -135,7 +135,7 @@ struct factorization_factory { | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     const_iterator_mon end() const { |     const_iterator_mon end() const { | ||||||
|         svector<bool> mask(m_vars.size() - 1, true); |         bool_vector mask(m_vars.size() - 1, true); | ||||||
|         auto it = const_iterator_mon(mask, this); |         auto it = const_iterator_mon(mask, this); | ||||||
|         it.m_full_factorization_returned = true; |         it.m_full_factorization_returned = true; | ||||||
|         return it; |         return it; | ||||||
|  |  | ||||||
|  | @ -74,7 +74,7 @@ class var_eqs { | ||||||
| 
 | 
 | ||||||
|     trail_stack<var_eqs>              m_stack; |     trail_stack<var_eqs>              m_stack; | ||||||
|     mutable svector<var_frame>        m_todo; |     mutable svector<var_frame>        m_todo; | ||||||
|     mutable svector<bool>             m_marked; |     mutable bool_vector             m_marked; | ||||||
|     mutable unsigned_vector           m_marked_trail; |     mutable unsigned_vector           m_marked_trail; | ||||||
|     mutable svector<eq_justification> m_justtrail; |     mutable svector<eq_justification> m_justtrail; | ||||||
|          |          | ||||||
|  |  | ||||||
|  | @ -1272,7 +1272,7 @@ namespace polynomial { | ||||||
|             SASSERT(sz == num_vars()); |             SASSERT(sz == num_vars()); | ||||||
|             DEBUG_CODE({ |             DEBUG_CODE({ | ||||||
|                 // check whether xs is really a permutation
 |                 // check whether xs is really a permutation
 | ||||||
|                 svector<bool> found; |                 bool_vector found; | ||||||
|                 found.resize(num_vars(), false); |                 found.resize(num_vars(), false); | ||||||
|                 for (unsigned i = 0; i < sz; i++) { |                 for (unsigned i = 0; i < sz; i++) { | ||||||
|                     SASSERT(xs[i] < num_vars()); |                     SASSERT(xs[i] < num_vars()); | ||||||
|  | @ -3218,7 +3218,7 @@ namespace polynomial { | ||||||
|             } |             } | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         svector<bool>  m_found_vars; |         bool_vector  m_found_vars; | ||||||
|         void vars(polynomial const * p, var_vector & xs) { |         void vars(polynomial const * p, var_vector & xs) { | ||||||
|             xs.reset(); |             xs.reset(); | ||||||
|             m_found_vars.reserve(num_vars(), false); |             m_found_vars.reserve(num_vars(), false); | ||||||
|  |  | ||||||
|  | @ -138,7 +138,7 @@ namespace upolynomial { | ||||||
|         // the factors to select from
 |         // the factors to select from
 | ||||||
|         factors_type const   & m_factors; |         factors_type const   & m_factors; | ||||||
|         // which factors are enabled
 |         // which factors are enabled
 | ||||||
|         svector<bool>          m_enabled; |         bool_vector          m_enabled; | ||||||
|         // the size of the current selection
 |         // the size of the current selection
 | ||||||
|         int                    m_current_size; |         int                    m_current_size; | ||||||
|         // the current selection: indices at positions < m_current_size, other values are maxed out
 |         // the current selection: indices at positions < m_current_size, other values are maxed out
 | ||||||
|  |  | ||||||
|  | @ -85,7 +85,7 @@ namespace opt { | ||||||
|         static const unsigned   m_objective_id = 0; |         static const unsigned   m_objective_id = 0; | ||||||
|         vector<unsigned_vector> m_var2row_ids; |         vector<unsigned_vector> m_var2row_ids; | ||||||
|         vector<rational>        m_var2value; |         vector<rational>        m_var2value; | ||||||
|         svector<bool>           m_var2is_int; |         bool_vector           m_var2is_int; | ||||||
|         vector<var>             m_new_vars; |         vector<var>             m_new_vars; | ||||||
|         unsigned_vector         m_lub, m_glb, m_mod; |         unsigned_vector         m_lub, m_glb, m_mod; | ||||||
|         unsigned_vector         m_above, m_below; |         unsigned_vector         m_above, m_below; | ||||||
|  |  | ||||||
|  | @ -224,7 +224,7 @@ namespace smt { | ||||||
|         node src = m_graph.get_source(m_enter_id); |         node src = m_graph.get_source(m_enter_id); | ||||||
|         node tgt = m_graph.get_target(m_enter_id);  |         node tgt = m_graph.get_target(m_enter_id);  | ||||||
|         svector<edge_id> path; |         svector<edge_id> path; | ||||||
|         svector<bool> against; |         bool_vector against; | ||||||
|         m_tree->get_path(src, tgt, path, against); |         m_tree->get_path(src, tgt, path, against); | ||||||
|         SASSERT(path.size() >= 1); |         SASSERT(path.size() >= 1); | ||||||
|         for (unsigned i = 0; i < path.size(); ++i) { |         for (unsigned i = 0; i < path.size(); ++i) { | ||||||
|  | @ -241,7 +241,7 @@ namespace smt { | ||||||
|         m_delta.set_invalid(); |         m_delta.set_invalid(); | ||||||
|         edge_id leave_id = null_edge_id; |         edge_id leave_id = null_edge_id; | ||||||
|         svector<edge_id> path; |         svector<edge_id> path; | ||||||
|         svector<bool> against; |         bool_vector against; | ||||||
|         m_tree->get_path(src, tgt, path, against); |         m_tree->get_path(src, tgt, path, against); | ||||||
|         SASSERT(path.size() >= 1); |         SASSERT(path.size() >= 1); | ||||||
|         for (unsigned i = 0; i < path.size(); ++i) { |         for (unsigned i = 0; i < path.size(); ++i) { | ||||||
|  |  | ||||||
|  | @ -476,7 +476,7 @@ private: | ||||||
|     interval_manager          m_im; |     interval_manager          m_im; | ||||||
|     scoped_numeral_vector     m_num_buffer; |     scoped_numeral_vector     m_num_buffer; | ||||||
| 
 | 
 | ||||||
|     svector<bool>             m_is_int; |     bool_vector             m_is_int; | ||||||
|     ptr_vector<definition>    m_defs; |     ptr_vector<definition>    m_defs; | ||||||
|     vector<watch_list>        m_wlist; |     vector<watch_list>        m_wlist; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -153,7 +153,7 @@ namespace datalog { | ||||||
|         mk_rule_core(fml1, pr, rules, name); |         mk_rule_core(fml1, pr, rules, name); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void rule_manager::mk_negations(app_ref_vector& body, svector<bool>& is_negated) { |     void rule_manager::mk_negations(app_ref_vector& body, bool_vector& is_negated) { | ||||||
|         for (unsigned i = 0; i < body.size(); ++i) { |         for (unsigned i = 0; i < body.size(); ++i) { | ||||||
|             expr* e = body[i].get(), *e1; |             expr* e = body[i].get(), *e1; | ||||||
|             if (m.is_not(e, e1) && m_ctx.is_predicate(e1)) { |             if (m.is_not(e, e1) && m_ctx.is_predicate(e1)) { | ||||||
|  | @ -628,7 +628,7 @@ namespace datalog { | ||||||
|         } |         } | ||||||
|         if (change) { |         if (change) { | ||||||
|             app_ref_vector tail(m); |             app_ref_vector tail(m); | ||||||
|             svector<bool> tail_neg; |             bool_vector tail_neg; | ||||||
|             for (unsigned i = 0; i < ut_len; ++i) { |             for (unsigned i = 0; i < ut_len; ++i) { | ||||||
|                 tail.push_back(r->get_tail(i)); |                 tail.push_back(r->get_tail(i)); | ||||||
|                 tail_neg.push_back(r->is_neg_tail(i)); |                 tail_neg.push_back(r->is_neg_tail(i)); | ||||||
|  | @ -660,7 +660,7 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
|         var_counter vctr; |         var_counter vctr; | ||||||
|         app_ref_vector tail(m); |         app_ref_vector tail(m); | ||||||
|         svector<bool> tail_neg; |         bool_vector tail_neg; | ||||||
|         app_ref head(r->get_head(), m); |         app_ref head(r->get_head(), m); | ||||||
| 
 | 
 | ||||||
|         vctr.count_vars(head); |         vctr.count_vars(head); | ||||||
|  | @ -811,7 +811,7 @@ namespace datalog { | ||||||
|         expr_ref tmp(m); |         expr_ref tmp(m); | ||||||
|         app_ref  new_head(m); |         app_ref  new_head(m); | ||||||
|         app_ref_vector new_tail(m); |         app_ref_vector new_tail(m); | ||||||
|         svector<bool> tail_neg; |         bool_vector tail_neg; | ||||||
|         var_subst vs(m, false); |         var_subst vs(m, false); | ||||||
|         tmp = vs(r->get_head(), sz, es); |         tmp = vs(r->get_head(), sz, es); | ||||||
|         new_head = to_app(tmp); |         new_head = to_app(tmp); | ||||||
|  |  | ||||||
|  | @ -124,7 +124,7 @@ namespace datalog { | ||||||
|         app_ref_vector       m_body; |         app_ref_vector       m_body; | ||||||
|         app_ref              m_head; |         app_ref              m_head; | ||||||
|         expr_ref_vector      m_args; |         expr_ref_vector      m_args; | ||||||
|         svector<bool>        m_neg; |         bool_vector        m_neg; | ||||||
|         hnf                  m_hnf; |         hnf                  m_hnf; | ||||||
|         qe_lite              m_qe; |         qe_lite              m_qe; | ||||||
|         label_rewriter       m_rwr; |         label_rewriter       m_rwr; | ||||||
|  | @ -158,7 +158,7 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
|         void bind_variables(expr* fml, bool is_forall, expr_ref& result); |         void bind_variables(expr* fml, bool is_forall, expr_ref& result); | ||||||
| 
 | 
 | ||||||
|         void mk_negations(app_ref_vector& body, svector<bool>& is_negated); |         void mk_negations(app_ref_vector& body, bool_vector& is_negated); | ||||||
| 
 | 
 | ||||||
|         void mk_rule_core(expr* fml, proof* p, rule_set& rules, symbol const& name); |         void mk_rule_core(expr* fml, proof* p, rule_set& rules, symbol const& name); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -132,7 +132,7 @@ namespace datalog { | ||||||
|     //
 |     //
 | ||||||
|     //------------------------------
 |     //------------------------------
 | ||||||
| 
 | 
 | ||||||
|     void rule_transformer::plugin::remove_duplicate_tails(app_ref_vector& tail, svector<bool>& tail_neg) |     void rule_transformer::plugin::remove_duplicate_tails(app_ref_vector& tail, bool_vector& tail_neg) | ||||||
|     { |     { | ||||||
|         //one set for positive and one for negative
 |         //one set for positive and one for negative
 | ||||||
|         obj_hashtable<app> tail_apps[2]; |         obj_hashtable<app> tail_apps[2]; | ||||||
|  |  | ||||||
|  | @ -108,7 +108,7 @@ namespace datalog { | ||||||
|         /**
 |         /**
 | ||||||
|            Removes duplicate tails. |            Removes duplicate tails. | ||||||
|         */ |         */ | ||||||
|         static void remove_duplicate_tails(app_ref_vector& tail, svector<bool>& tail_neg); |         static void remove_duplicate_tails(app_ref_vector& tail, bool_vector& tail_neg); | ||||||
| 
 | 
 | ||||||
|     }; |     }; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -135,7 +135,7 @@ namespace datalog { | ||||||
|         ddnf_node::hash        m_hash; |         ddnf_node::hash        m_hash; | ||||||
|         ddnf_node::eq          m_eq; |         ddnf_node::eq          m_eq; | ||||||
|         ddnf_nodes             m_nodes; |         ddnf_nodes             m_nodes; | ||||||
|         svector<bool>          m_marked; |         bool_vector          m_marked; | ||||||
|         stats                  m_stats; |         stats                  m_stats; | ||||||
|     public: |     public: | ||||||
|         ddnf_mgr(unsigned n): m_noderefs(*this), m_internalized(false), m_tbv(n), |         ddnf_mgr(unsigned n): m_noderefs(*this), m_internalized(false), m_tbv(n), | ||||||
|  | @ -338,7 +338,7 @@ namespace datalog { | ||||||
|             } |             } | ||||||
|             ptr_vector<ddnf_node> todo; |             ptr_vector<ddnf_node> todo; | ||||||
|             todo.push_back(m_root); |             todo.push_back(m_root); | ||||||
|             svector<bool> done(m_noderefs.size(), false); |             bool_vector done(m_noderefs.size(), false); | ||||||
|             while (!todo.empty()) { |             while (!todo.empty()) { | ||||||
|                 ddnf_node& n = *todo.back(); |                 ddnf_node& n = *todo.back(); | ||||||
|                 if (done[n.get_id()]) { |                 if (done[n.get_id()]) { | ||||||
|  |  | ||||||
|  | @ -724,7 +724,7 @@ protected: | ||||||
| 
 | 
 | ||||||
|     dtoken parse_body(app* head) { |     dtoken parse_body(app* head) { | ||||||
|         app_ref_vector body(m_manager); |         app_ref_vector body(m_manager); | ||||||
|         svector<bool> polarity_vect; |         bool_vector polarity_vect; | ||||||
|         dtoken tok = m_lexer->next_token(); |         dtoken tok = m_lexer->next_token(); | ||||||
|         while (tok != TK_ERROR && tok != TK_EOS) {             |         while (tok != TK_ERROR && tok != TK_EOS) {             | ||||||
|             if (tok == TK_PERIOD) { |             if (tok == TK_PERIOD) { | ||||||
|  |  | ||||||
|  | @ -582,7 +582,7 @@ namespace datalog { | ||||||
|             const unsigned_vector m_cols2; |             const unsigned_vector m_cols2; | ||||||
|             bool m_all_neg_bound; //all columns are bound at least once
 |             bool m_all_neg_bound; //all columns are bound at least once
 | ||||||
|             bool m_overlap; //one column in negated table is bound multiple times
 |             bool m_overlap; //one column in negated table is bound multiple times
 | ||||||
|             svector<bool> m_bound; |             bool_vector m_bound; | ||||||
| 
 | 
 | ||||||
|             convenient_negation_filter_fn(const base_object & tgt, const base_object & neg_t, |             convenient_negation_filter_fn(const base_object & tgt, const base_object & neg_t, | ||||||
|                     unsigned joined_col_cnt, const unsigned * t_cols, const unsigned * negated_cols) |                     unsigned joined_col_cnt, const unsigned * t_cols, const unsigned * negated_cols) | ||||||
|  |  | ||||||
|  | @ -92,12 +92,12 @@ namespace datalog { | ||||||
|     family_id finite_product_relation_plugin::get_relation_kind(finite_product_relation & r, |     family_id finite_product_relation_plugin::get_relation_kind(finite_product_relation & r, | ||||||
|             const bool * table_columns) { |             const bool * table_columns) { | ||||||
|         const relation_signature & sig = r.get_signature(); |         const relation_signature & sig = r.get_signature(); | ||||||
|         svector<bool> table_cols_vect(sig.size(), table_columns); |         bool_vector table_cols_vect(sig.size(), table_columns); | ||||||
|         return m_spec_store.get_relation_kind(sig, rel_spec(table_cols_vect)); |         return m_spec_store.get_relation_kind(sig, rel_spec(table_cols_vect)); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void finite_product_relation_plugin::get_all_possible_table_columns(relation_manager & rmgr, |     void finite_product_relation_plugin::get_all_possible_table_columns(relation_manager & rmgr, | ||||||
|             const relation_signature & s, svector<bool> & table_columns) { |             const relation_signature & s, bool_vector & table_columns) { | ||||||
|         SASSERT(table_columns.empty()); |         SASSERT(table_columns.empty()); | ||||||
|         unsigned s_sz = s.size(); |         unsigned s_sz = s.size(); | ||||||
|         for(unsigned i=0; i<s_sz; i++) { |         for(unsigned i=0; i<s_sz; i++) { | ||||||
|  | @ -148,7 +148,7 @@ namespace datalog { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     relation_base * finite_product_relation_plugin::mk_empty(const relation_signature & s) { |     relation_base * finite_product_relation_plugin::mk_empty(const relation_signature & s) { | ||||||
|         svector<bool> table_columns; |         bool_vector table_columns; | ||||||
|         get_all_possible_table_columns(s, table_columns); |         get_all_possible_table_columns(s, table_columns); | ||||||
| #ifndef _EXTERNAL_RELEASE | #ifndef _EXTERNAL_RELEASE | ||||||
|         unsigned s_sz = s.size(); |         unsigned s_sz = s.size(); | ||||||
|  | @ -275,7 +275,7 @@ namespace datalog { | ||||||
|         SASSERT(join_fun); |         SASSERT(join_fun); | ||||||
|         scoped_rel<table_base> res_table = (*join_fun)(t, *idx_singleton); |         scoped_rel<table_base> res_table = (*join_fun)(t, *idx_singleton); | ||||||
| 
 | 
 | ||||||
|         svector<bool> table_cols(sig.size(), true); |         bool_vector table_cols(sig.size(), true); | ||||||
|         finite_product_relation * res = mk_empty(sig, table_cols.c_ptr()); |         finite_product_relation * res = mk_empty(sig, table_cols.c_ptr()); | ||||||
| 
 | 
 | ||||||
|         //this one does not need to be deleted -- it will be taken over by \c res in the \c init function
 |         //this one does not need to be deleted -- it will be taken over by \c res in the \c init function
 | ||||||
|  | @ -301,7 +301,7 @@ namespace datalog { | ||||||
|         idx_singleton_fact.push_back(0); |         idx_singleton_fact.push_back(0); | ||||||
|         idx_singleton->add_fact(idx_singleton_fact); |         idx_singleton->add_fact(idx_singleton_fact); | ||||||
| 
 | 
 | ||||||
|         svector<bool> table_cols(sig.size(), false); |         bool_vector table_cols(sig.size(), false); | ||||||
|         finite_product_relation * res = mk_empty(sig, table_cols.c_ptr()); |         finite_product_relation * res = mk_empty(sig, table_cols.c_ptr()); | ||||||
| 
 | 
 | ||||||
|         relation_vector rels; |         relation_vector rels; | ||||||
|  | @ -378,7 +378,7 @@ namespace datalog { | ||||||
|         scoped_ptr<table_transformer_fn> m_tjoined_second_rel_remover; |         scoped_ptr<table_transformer_fn> m_tjoined_second_rel_remover; | ||||||
| 
 | 
 | ||||||
|         //determines which columns of the result are table columns and which are in the inner relation
 |         //determines which columns of the result are table columns and which are in the inner relation
 | ||||||
|         svector<bool> m_res_table_columns; |         bool_vector m_res_table_columns; | ||||||
| 
 | 
 | ||||||
|     public: |     public: | ||||||
|         class join_maker : public table_row_mutator_fn { |         class join_maker : public table_row_mutator_fn { | ||||||
|  | @ -529,7 +529,7 @@ namespace datalog { | ||||||
|         scoped_ptr<relation_union_fn> m_inner_rel_union; |         scoped_ptr<relation_union_fn> m_inner_rel_union; | ||||||
| 
 | 
 | ||||||
|         //determines which columns of the result are table columns and which are in the inner relation
 |         //determines which columns of the result are table columns and which are in the inner relation
 | ||||||
|         svector<bool> m_res_table_columns; |         bool_vector m_res_table_columns; | ||||||
|     public: |     public: | ||||||
|         project_fn(const finite_product_relation & r, unsigned col_cnt, const unsigned * removed_cols) |         project_fn(const finite_product_relation & r, unsigned col_cnt, const unsigned * removed_cols) | ||||||
|                 : convenient_relation_project_fn(r.get_signature(), col_cnt, removed_cols) { |                 : convenient_relation_project_fn(r.get_signature(), col_cnt, removed_cols) { | ||||||
|  | @ -665,7 +665,7 @@ namespace datalog { | ||||||
|         unsigned_vector m_rel_permutation; |         unsigned_vector m_rel_permutation; | ||||||
| 
 | 
 | ||||||
|         //determines which columns of the result are table columns and which are in the inner relation
 |         //determines which columns of the result are table columns and which are in the inner relation
 | ||||||
|         svector<bool> m_res_table_columns; |         bool_vector m_res_table_columns; | ||||||
|     public: |     public: | ||||||
|         rename_fn(const finite_product_relation & r, unsigned cycle_len, const unsigned * permutation_cycle) |         rename_fn(const finite_product_relation & r, unsigned cycle_len, const unsigned * permutation_cycle) | ||||||
|                 : convenient_relation_rename_fn(r.get_signature(), cycle_len, permutation_cycle) { |                 : convenient_relation_rename_fn(r.get_signature(), cycle_len, permutation_cycle) { | ||||||
|  | @ -2156,7 +2156,7 @@ namespace datalog { | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|         unsigned sig_sz = rels.back()->get_signature().size(); |         unsigned sig_sz = rels.back()->get_signature().size(); | ||||||
|         svector<bool> table_cols(sig_sz, true); |         bool_vector table_cols(sig_sz, true); | ||||||
| 
 | 
 | ||||||
|         ptr_vector<finite_product_relation>::iterator it = rels.begin(); |         ptr_vector<finite_product_relation>::iterator it = rels.begin(); | ||||||
|         ptr_vector<finite_product_relation>::iterator end = rels.end(); |         ptr_vector<finite_product_relation>::iterator end = rels.end(); | ||||||
|  | @ -2221,7 +2221,7 @@ namespace datalog { | ||||||
|         scoped_rel<relation_base> moved_cols_trel = |         scoped_rel<relation_base> moved_cols_trel = | ||||||
|             rmgr.get_table_relation_plugin(moved_cols_table->get_plugin()).mk_from_table(moved_cols_sig, moved_cols_table); |             rmgr.get_table_relation_plugin(moved_cols_table->get_plugin()).mk_from_table(moved_cols_sig, moved_cols_table); | ||||||
| 
 | 
 | ||||||
|         svector<bool> moved_cols_table_flags(moved_cols_sig.size(), false); |         bool_vector moved_cols_table_flags(moved_cols_sig.size(), false); | ||||||
| 
 | 
 | ||||||
|         scoped_rel<finite_product_relation> moved_cols_rel = get_plugin().mk_empty(moved_cols_sig, |         scoped_rel<finite_product_relation> moved_cols_rel = get_plugin().mk_empty(moved_cols_sig, | ||||||
|             moved_cols_table_flags.c_ptr()); |             moved_cols_table_flags.c_ptr()); | ||||||
|  |  | ||||||
|  | @ -36,10 +36,10 @@ namespace datalog { | ||||||
|     public: |     public: | ||||||
|         struct rel_spec { |         struct rel_spec { | ||||||
|             family_id m_inner_kind; //null_family_id means we don't care about the kind
 |             family_id m_inner_kind; //null_family_id means we don't care about the kind
 | ||||||
|             svector<bool> m_table_cols; |             bool_vector m_table_cols; | ||||||
| 
 | 
 | ||||||
|             rel_spec() : m_inner_kind(null_family_id) {} |             rel_spec() : m_inner_kind(null_family_id) {} | ||||||
|             rel_spec(const svector<bool>& table_cols)  |             rel_spec(const bool_vector& table_cols)  | ||||||
|                 : m_inner_kind(null_family_id), m_table_cols(table_cols) {} |                 : m_inner_kind(null_family_id), m_table_cols(table_cols) {} | ||||||
| 
 | 
 | ||||||
|             bool operator==(const rel_spec & o) const { |             bool operator==(const rel_spec & o) const { | ||||||
|  | @ -74,8 +74,8 @@ namespace datalog { | ||||||
|         family_id get_relation_kind(finite_product_relation & r, const bool * table_columns); |         family_id get_relation_kind(finite_product_relation & r, const bool * table_columns); | ||||||
| 
 | 
 | ||||||
|         static void get_all_possible_table_columns(relation_manager & rmgr, const relation_signature & s,  |         static void get_all_possible_table_columns(relation_manager & rmgr, const relation_signature & s,  | ||||||
|             svector<bool> & table_columns); |             bool_vector & table_columns); | ||||||
|         void get_all_possible_table_columns(const relation_signature & s, svector<bool> & table_columns) { |         void get_all_possible_table_columns(const relation_signature & s, bool_vector & table_columns) { | ||||||
|             get_all_possible_table_columns(get_manager(), s, table_columns); |             get_all_possible_table_columns(get_manager(), s, table_columns); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -644,10 +644,10 @@ namespace datalog { | ||||||
|         relation_signature sig; |         relation_signature sig; | ||||||
|         rmgr.from_predicate(e_decl, sig); |         rmgr.from_predicate(e_decl, sig); | ||||||
| 
 | 
 | ||||||
|         svector<bool> inner_sieve(sz-1, true); |         bool_vector inner_sieve(sz-1, true); | ||||||
|         inner_sieve.push_back(false); |         inner_sieve.push_back(false); | ||||||
| 
 | 
 | ||||||
|         svector<bool> expl_sieve(sz-1, false); |         bool_vector expl_sieve(sz-1, false); | ||||||
|         expl_sieve.push_back(true); |         expl_sieve.push_back(true); | ||||||
| 
 | 
 | ||||||
|         sieve_relation_plugin & sieve_plugin = sieve_relation_plugin::get_plugin(rmgr); |         sieve_relation_plugin & sieve_plugin = sieve_relation_plugin::get_plugin(rmgr); | ||||||
|  | @ -715,7 +715,7 @@ namespace datalog { | ||||||
|         app_ref e_head(get_e_lit(r->get_head(), head_var), m_manager); |         app_ref e_head(get_e_lit(r->get_head(), head_var), m_manager); | ||||||
| 
 | 
 | ||||||
|         app_ref_vector e_tail(m_manager); |         app_ref_vector e_tail(m_manager); | ||||||
|         svector<bool> neg_flags; |         bool_vector neg_flags; | ||||||
|         unsigned pos_tail_sz = r->get_positive_tail_size(); |         unsigned pos_tail_sz = r->get_positive_tail_size(); | ||||||
|         for (unsigned i=0; i<pos_tail_sz; i++) { |         for (unsigned i=0; i<pos_tail_sz; i++) { | ||||||
|             unsigned e_var = next_var++; |             unsigned e_var = next_var++; | ||||||
|  |  | ||||||
|  | @ -373,7 +373,7 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
|         app * new_head = r->get_head(); |         app * new_head = r->get_head(); | ||||||
|         ptr_vector<app> new_tail; |         ptr_vector<app> new_tail; | ||||||
|         svector<bool> new_negs; |         bool_vector new_negs; | ||||||
|         unsigned tail_sz = r->get_tail_size(); |         unsigned tail_sz = r->get_tail_size(); | ||||||
|         for (unsigned i=0; i<tail_sz; i++) { |         for (unsigned i=0; i<tail_sz; i++) { | ||||||
|             new_tail.push_back(r->get_tail(i)); |             new_tail.push_back(r->get_tail(i)); | ||||||
|  |  | ||||||
|  | @ -711,7 +711,7 @@ namespace datalog { | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 ptr_vector<app> tail(content); |                 ptr_vector<app> tail(content); | ||||||
|                 svector<bool> negs(tail.size(), false); |                 bool_vector negs(tail.size(), false); | ||||||
|                 unsigned or_len = orig_r->get_tail_size(); |                 unsigned or_len = orig_r->get_tail_size(); | ||||||
|                 for (unsigned i=orig_r->get_positive_tail_size(); i < or_len; i++) { |                 for (unsigned i=orig_r->get_positive_tail_size(); i < or_len; i++) { | ||||||
|                     tail.push_back(orig_r->get_tail(i)); |                     tail.push_back(orig_r->get_tail(i)); | ||||||
|  |  | ||||||
|  | @ -149,7 +149,7 @@ namespace datalog { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void sieve_relation_plugin::extract_inner_columns(const relation_signature & s, relation_plugin & inner,  |     void sieve_relation_plugin::extract_inner_columns(const relation_signature & s, relation_plugin & inner,  | ||||||
|             svector<bool> & inner_columns) { |             bool_vector & inner_columns) { | ||||||
|         SASSERT(inner_columns.size()==s.size()); |         SASSERT(inner_columns.size()==s.size()); | ||||||
|         unsigned n = s.size(); |         unsigned n = s.size(); | ||||||
|         relation_signature inner_sig_singleton; |         relation_signature inner_sig_singleton; | ||||||
|  | @ -168,7 +168,7 @@ namespace datalog { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void sieve_relation_plugin::collect_inner_signature(const relation_signature & s,  |     void sieve_relation_plugin::collect_inner_signature(const relation_signature & s,  | ||||||
|             const svector<bool> & inner_columns, relation_signature & inner_sig) { |             const bool_vector & inner_columns, relation_signature & inner_sig) { | ||||||
|         SASSERT(inner_columns.size()==s.size()); |         SASSERT(inner_columns.size()==s.size()); | ||||||
|         inner_sig.reset(); |         inner_sig.reset(); | ||||||
|         unsigned n = s.size(); |         unsigned n = s.size(); | ||||||
|  | @ -183,7 +183,7 @@ namespace datalog { | ||||||
|             relation_signature & inner_sig) { |             relation_signature & inner_sig) { | ||||||
|         UNREACHABLE(); |         UNREACHABLE(); | ||||||
| #if 0 | #if 0 | ||||||
|         svector<bool> inner_cols(s.size()); |         bool_vector inner_cols(s.size()); | ||||||
|         extract_inner_columns(s, inner_cols.c_ptr()); |         extract_inner_columns(s, inner_cols.c_ptr()); | ||||||
|         collect_inner_signature(s, inner_cols, inner_sig); |         collect_inner_signature(s, inner_cols, inner_sig); | ||||||
| #endif | #endif | ||||||
|  | @ -228,7 +228,7 @@ namespace datalog { | ||||||
|         UNREACHABLE(); |         UNREACHABLE(); | ||||||
|         return nullptr; |         return nullptr; | ||||||
| #if 0 | #if 0 | ||||||
|         svector<bool> inner_cols(s.size()); |         bool_vector inner_cols(s.size()); | ||||||
|         extract_inner_columns(s, inner_cols.c_ptr()); |         extract_inner_columns(s, inner_cols.c_ptr()); | ||||||
|         return mk_empty(s, inner_cols.c_ptr()); |         return mk_empty(s, inner_cols.c_ptr()); | ||||||
| #endif | #endif | ||||||
|  | @ -236,7 +236,7 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
|     sieve_relation * sieve_relation_plugin::mk_empty(const relation_signature & s, relation_plugin & inner_plugin) { |     sieve_relation * sieve_relation_plugin::mk_empty(const relation_signature & s, relation_plugin & inner_plugin) { | ||||||
|         SASSERT(!inner_plugin.is_sieve_relation()); //it does not make sense to make a sieve of a sieve
 |         SASSERT(!inner_plugin.is_sieve_relation()); //it does not make sense to make a sieve of a sieve
 | ||||||
|         svector<bool> inner_cols(s.size()); |         bool_vector inner_cols(s.size()); | ||||||
|         extract_inner_columns(s, inner_plugin, inner_cols); |         extract_inner_columns(s, inner_plugin, inner_cols); | ||||||
|         relation_signature inner_sig; |         relation_signature inner_sig; | ||||||
|         collect_inner_signature(s, inner_cols, inner_sig); |         collect_inner_signature(s, inner_cols, inner_sig); | ||||||
|  | @ -248,14 +248,14 @@ namespace datalog { | ||||||
|         relation_signature empty_sig; |         relation_signature empty_sig; | ||||||
|         relation_plugin& plugin = get_manager().get_appropriate_plugin(s); |         relation_plugin& plugin = get_manager().get_appropriate_plugin(s); | ||||||
|         relation_base * inner = plugin.mk_full(p, empty_sig, null_family_id); |         relation_base * inner = plugin.mk_full(p, empty_sig, null_family_id); | ||||||
|         svector<bool> inner_cols; |         bool_vector inner_cols; | ||||||
|         inner_cols.resize(s.size(), false); |         inner_cols.resize(s.size(), false); | ||||||
|         return mk_from_inner(s, inner_cols, inner); |         return mk_from_inner(s, inner_cols, inner); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     sieve_relation * sieve_relation_plugin::full(func_decl* p, const relation_signature & s, relation_plugin & inner_plugin) { |     sieve_relation * sieve_relation_plugin::full(func_decl* p, const relation_signature & s, relation_plugin & inner_plugin) { | ||||||
|         SASSERT(!inner_plugin.is_sieve_relation()); //it does not make sense to make a sieve of a sieve
 |         SASSERT(!inner_plugin.is_sieve_relation()); //it does not make sense to make a sieve of a sieve
 | ||||||
|         svector<bool> inner_cols(s.size()); |         bool_vector inner_cols(s.size()); | ||||||
|         extract_inner_columns(s, inner_plugin, inner_cols); |         extract_inner_columns(s, inner_plugin, inner_cols); | ||||||
|         relation_signature inner_sig; |         relation_signature inner_sig; | ||||||
|         collect_inner_signature(s, inner_cols, inner_sig); |         collect_inner_signature(s, inner_cols, inner_sig); | ||||||
|  | @ -267,7 +267,7 @@ namespace datalog { | ||||||
|         sieve_relation_plugin & m_plugin; |         sieve_relation_plugin & m_plugin; | ||||||
|         unsigned_vector m_inner_cols_1; |         unsigned_vector m_inner_cols_1; | ||||||
|         unsigned_vector m_inner_cols_2; |         unsigned_vector m_inner_cols_2; | ||||||
|         svector<bool> m_result_inner_cols; |         bool_vector m_result_inner_cols; | ||||||
| 
 | 
 | ||||||
|         scoped_ptr<relation_join_fn> m_inner_join_fun; |         scoped_ptr<relation_join_fn> m_inner_join_fun; | ||||||
|     public: |     public: | ||||||
|  | @ -347,7 +347,7 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     class sieve_relation_plugin::transformer_fn : public convenient_relation_transformer_fn { |     class sieve_relation_plugin::transformer_fn : public convenient_relation_transformer_fn { | ||||||
|         svector<bool> m_result_inner_cols; |         bool_vector m_result_inner_cols; | ||||||
| 
 | 
 | ||||||
|         scoped_ptr<relation_transformer_fn> m_inner_fun; |         scoped_ptr<relation_transformer_fn> m_inner_fun; | ||||||
|     public: |     public: | ||||||
|  | @ -383,7 +383,7 @@ namespace datalog { | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         svector<bool> result_inner_cols = r.m_inner_cols; |         bool_vector result_inner_cols = r.m_inner_cols; | ||||||
|         project_out_vector_columns(result_inner_cols, col_cnt, removed_cols); |         project_out_vector_columns(result_inner_cols, col_cnt, removed_cols); | ||||||
| 
 | 
 | ||||||
|         relation_signature result_sig; |         relation_signature result_sig; | ||||||
|  | @ -419,7 +419,7 @@ namespace datalog { | ||||||
|         unsigned_vector inner_permutation; |         unsigned_vector inner_permutation; | ||||||
|         collect_sub_permutation(permutation, r.m_sig2inner, inner_permutation, inner_identity); |         collect_sub_permutation(permutation, r.m_sig2inner, inner_permutation, inner_identity); | ||||||
| 
 | 
 | ||||||
|         svector<bool> result_inner_cols = r.m_inner_cols; |         bool_vector result_inner_cols = r.m_inner_cols; | ||||||
|         permutate_by_cycle(result_inner_cols, cycle_len, permutation_cycle); |         permutate_by_cycle(result_inner_cols, cycle_len, permutation_cycle); | ||||||
| 
 | 
 | ||||||
|         relation_signature result_sig; |         relation_signature result_sig; | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ namespace datalog { | ||||||
|         friend class sieve_relation; |         friend class sieve_relation; | ||||||
|     public: |     public: | ||||||
|         struct rel_spec { |         struct rel_spec { | ||||||
|             svector<bool> m_inner_cols; |             bool_vector m_inner_cols; | ||||||
|             family_id m_inner_kind; |             family_id m_inner_kind; | ||||||
| 
 | 
 | ||||||
|             /**
 |             /**
 | ||||||
|  | @ -70,9 +70,9 @@ namespace datalog { | ||||||
|         family_id get_relation_kind(sieve_relation & r, const bool * inner_columns); |         family_id get_relation_kind(sieve_relation & r, const bool * inner_columns); | ||||||
| 
 | 
 | ||||||
|         void extract_inner_columns(const relation_signature & s, relation_plugin & inner,  |         void extract_inner_columns(const relation_signature & s, relation_plugin & inner,  | ||||||
|             svector<bool> & inner_columns); |             bool_vector & inner_columns); | ||||||
|         void extract_inner_signature(const relation_signature & s, relation_signature & inner_sig); |         void extract_inner_signature(const relation_signature & s, relation_signature & inner_sig); | ||||||
|         void collect_inner_signature(const relation_signature & s, const svector<bool> & inner_columns,  |         void collect_inner_signature(const relation_signature & s, const bool_vector & inner_columns,  | ||||||
|             relation_signature & inner_sig); |             relation_signature & inner_sig); | ||||||
|     public: |     public: | ||||||
|         static symbol get_name() { return symbol("sieve_relation"); } |         static symbol get_name() { return symbol("sieve_relation"); } | ||||||
|  | @ -89,7 +89,7 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
|         family_id get_relation_kind(const relation_signature & sig, const bool * inner_columns,  |         family_id get_relation_kind(const relation_signature & sig, const bool * inner_columns,  | ||||||
|             family_id inner_kind); |             family_id inner_kind); | ||||||
|         family_id get_relation_kind(const relation_signature & sig, const svector<bool> & inner_columns,  |         family_id get_relation_kind(const relation_signature & sig, const bool_vector & inner_columns,  | ||||||
|                 family_id inner_kind) { |                 family_id inner_kind) { | ||||||
|             SASSERT(sig.size()==inner_columns.size()); |             SASSERT(sig.size()==inner_columns.size()); | ||||||
|             return get_relation_kind(sig, inner_columns.c_ptr(), inner_kind); |             return get_relation_kind(sig, inner_columns.c_ptr(), inner_kind); | ||||||
|  | @ -108,7 +108,7 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
|         sieve_relation * mk_from_inner(const relation_signature & s, const bool * inner_columns,  |         sieve_relation * mk_from_inner(const relation_signature & s, const bool * inner_columns,  | ||||||
|             relation_base * inner_rel); |             relation_base * inner_rel); | ||||||
|         sieve_relation * mk_from_inner(const relation_signature & s, const svector<bool> & inner_columns,  |         sieve_relation * mk_from_inner(const relation_signature & s, const bool_vector & inner_columns,  | ||||||
|                 relation_base * inner_rel) { |                 relation_base * inner_rel) { | ||||||
|             SASSERT(inner_columns.size()==s.size()); |             SASSERT(inner_columns.size()==s.size()); | ||||||
|             return mk_from_inner(s, inner_columns.c_ptr(), inner_rel); |             return mk_from_inner(s, inner_columns.c_ptr(), inner_rel); | ||||||
|  | @ -148,7 +148,7 @@ namespace datalog { | ||||||
|         friend class sieve_relation_plugin::union_fn; |         friend class sieve_relation_plugin::union_fn; | ||||||
|         friend class sieve_relation_plugin::filter_fn; |         friend class sieve_relation_plugin::filter_fn; | ||||||
| 
 | 
 | ||||||
|         svector<bool> m_inner_cols; |         bool_vector m_inner_cols; | ||||||
| 
 | 
 | ||||||
|         unsigned_vector m_sig2inner; |         unsigned_vector m_sig2inner; | ||||||
|         unsigned_vector m_inner2sig; |         unsigned_vector m_inner2sig; | ||||||
|  |  | ||||||
|  | @ -1112,7 +1112,7 @@ namespace datalog { | ||||||
|             SASSERT(joined_col_cnt > 0 || neg.get_signature().size() == 0); |             SASSERT(joined_col_cnt > 0 || neg.get_signature().size() == 0); | ||||||
|             m_is_subtract = (joined_col_cnt == t.get_signature().size()); |             m_is_subtract = (joined_col_cnt == t.get_signature().size()); | ||||||
|             m_is_subtract &= (joined_col_cnt == neg.get_signature().size()); |             m_is_subtract &= (joined_col_cnt == neg.get_signature().size()); | ||||||
|             svector<bool> found(joined_col_cnt, false); |             bool_vector found(joined_col_cnt, false); | ||||||
|             for (unsigned i = 0; m_is_subtract && i < joined_col_cnt; ++i) { |             for (unsigned i = 0; m_is_subtract && i < joined_col_cnt; ++i) { | ||||||
|                 m_is_subtract = !found[t_cols[i]] && (t_cols[i] == neg_cols[i]); |                 m_is_subtract = !found[t_cols[i]] && (t_cols[i] == neg_cols[i]); | ||||||
|                 found[t_cols[i]] = true; |                 found[t_cols[i]] = true; | ||||||
|  |  | ||||||
|  | @ -239,9 +239,8 @@ void derivation::exist_skolemize(expr* fml, app_ref_vector &vars, expr_ref &res) | ||||||
|         vars.shrink(j); |         vars.shrink(j); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     TRACE("spacer", tout << "Skolemizing: "; |     TRACE("spacer", tout << "Skolemizing: " << vars << "\n"; | ||||||
|           for (auto v : vars) tout << " " << mk_pp(v, m) << " "; |           tout << "from " << mk_pp(fml, m) << "\n"; | ||||||
|           tout << "\nfrom " << mk_pp(fml, m) << "\n"; |  | ||||||
|         ); |         ); | ||||||
| 
 | 
 | ||||||
|     app_ref_vector pinned(m); |     app_ref_vector pinned(m); | ||||||
|  | @ -868,7 +867,7 @@ const datalog::rule *pred_transformer::find_rule(model &model) { | ||||||
| 
 | 
 | ||||||
| const datalog::rule *pred_transformer::find_rule(model &model, | const datalog::rule *pred_transformer::find_rule(model &model, | ||||||
|                                                  bool& is_concrete, |                                                  bool& is_concrete, | ||||||
|                                                  vector<bool>& reach_pred_used, |                                                  bool_vector& reach_pred_used, | ||||||
|                                                  unsigned& num_reuse_reach) |                                                  unsigned& num_reuse_reach) | ||||||
| { | { | ||||||
|     // find a rule whose tag is true in the model;
 |     // find a rule whose tag is true in the model;
 | ||||||
|  | @ -1188,11 +1187,10 @@ expr_ref pred_transformer::get_origin_summary (model &mdl, | ||||||
|     // (skip quantified lemmas cause we can't validate them in the model)
 |     // (skip quantified lemmas cause we can't validate them in the model)
 | ||||||
|     // TBD: for quantified lemmas use current instances
 |     // TBD: for quantified lemmas use current instances
 | ||||||
|     flatten_and(summary); |     flatten_and(summary); | ||||||
|     for (auto *s : summary) { | 
 | ||||||
|  |     for (auto* s : summary) { | ||||||
|         if (!is_quantifier(s) && !mdl.is_true(s)) { |         if (!is_quantifier(s) && !mdl.is_true(s)) { | ||||||
|             TRACE("spacer", tout << "Summary not true in the model: " |             TRACE("spacer", tout << "Summary not true in the model: " << mk_pp(s, m) << "\n";); | ||||||
|                   << mk_pp(s, m) << "\n";); |  | ||||||
|             // return expr_ref(m);
 |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|      |      | ||||||
|  | @ -1209,12 +1207,10 @@ void pred_transformer::add_cover(unsigned level, expr* property, bool bg) | ||||||
|     // replace bound variables by local constants.
 |     // replace bound variables by local constants.
 | ||||||
|     expr_ref result(property, m), v(m), c(m); |     expr_ref result(property, m), v(m), c(m); | ||||||
|     expr_substitution sub(m); |     expr_substitution sub(m); | ||||||
|     proof_ref pr(m); |  | ||||||
|     pr = m.mk_asserted(m.mk_true()); |  | ||||||
|     for (unsigned i = 0; i < sig_size(); ++i) { |     for (unsigned i = 0; i < sig_size(); ++i) { | ||||||
|         c = m.mk_const(pm.o2n(sig(i), 0)); |         c = m.mk_const(pm.o2n(sig(i), 0)); | ||||||
|         v = m.mk_var(i, sig(i)->get_range()); |         v = m.mk_var(i, sig(i)->get_range()); | ||||||
|         sub.insert(v, c, pr); |         sub.insert(v, c); | ||||||
|     } |     } | ||||||
|     scoped_ptr<expr_replacer> rep = mk_default_expr_replacer(m, false); |     scoped_ptr<expr_replacer> rep = mk_default_expr_replacer(m, false); | ||||||
|     rep->set_substitution(&sub); |     rep->set_substitution(&sub); | ||||||
|  | @ -1224,13 +1220,14 @@ void pred_transformer::add_cover(unsigned level, expr* property, bool bg) | ||||||
|     // add the property.
 |     // add the property.
 | ||||||
|     expr_ref_vector lemmas(m); |     expr_ref_vector lemmas(m); | ||||||
|     flatten_and(result, lemmas); |     flatten_and(result, lemmas); | ||||||
|     for (unsigned i = 0, sz = lemmas.size(); i < sz; ++i) { |     for (expr * f: lemmas) { | ||||||
|         add_lemma(lemmas.get(i), level, bg); |         add_lemma(f, level, bg); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void pred_transformer::propagate_to_infinity (unsigned level) | void pred_transformer::propagate_to_infinity (unsigned level) { | ||||||
| {m_frames.propagate_to_infinity (level);} |     m_frames.propagate_to_infinity (level); | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| // compute a conjunction of all background facts
 | // compute a conjunction of all background facts
 | ||||||
| void pred_transformer::get_pred_bg_invs(expr_ref_vector& out) { | void pred_transformer::get_pred_bg_invs(expr_ref_vector& out) { | ||||||
|  | @ -1274,7 +1271,9 @@ bool pred_transformer::is_blocked (pob &n, unsigned &uses_level) | ||||||
|     // XXX quic3: not all lemmas are asserted at the post-condition
 |     // XXX quic3: not all lemmas are asserted at the post-condition
 | ||||||
|     lbool res = m_solver->check_assumptions (post, _aux, _aux, |     lbool res = m_solver->check_assumptions (post, _aux, _aux, | ||||||
|                                             0, nullptr, 0); |                                             0, nullptr, 0); | ||||||
|     if (res == l_false) { uses_level = m_solver->uses_level(); } |     if (res == l_false) {  | ||||||
|  |         uses_level = m_solver->uses_level();  | ||||||
|  |     } | ||||||
|     return res == l_false; |     return res == l_false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -1298,10 +1297,9 @@ bool pred_transformer::is_qblocked (pob &n) { | ||||||
| 
 | 
 | ||||||
|     // assert all lemmas
 |     // assert all lemmas
 | ||||||
|     bool has_quant = false; |     bool has_quant = false; | ||||||
|     for (unsigned i = 0, sz = frame_lemmas.size (); i < sz; ++i) |     for (expr* f : frame_lemmas) { | ||||||
|     { |         has_quant |= is_quantifier(f); | ||||||
|         has_quant = has_quant || is_quantifier(frame_lemmas.get(i)); |         s->assert_expr(f); | ||||||
|         s->assert_expr(frame_lemmas.get(i)); |  | ||||||
|     } |     } | ||||||
|     if (!has_quant) return false; |     if (!has_quant) return false; | ||||||
| 
 | 
 | ||||||
|  | @ -1335,7 +1333,7 @@ void pred_transformer::mbp(app_ref_vector &vars, expr_ref &fml, model &mdl, | ||||||
| lbool pred_transformer::is_reachable(pob& n, expr_ref_vector* core, | lbool pred_transformer::is_reachable(pob& n, expr_ref_vector* core, | ||||||
|                                      model_ref* model, unsigned& uses_level, |                                      model_ref* model, unsigned& uses_level, | ||||||
|                                      bool& is_concrete, datalog::rule const*& r, |                                      bool& is_concrete, datalog::rule const*& r, | ||||||
|                                      vector<bool>& reach_pred_used, |                                      bool_vector& reach_pred_used, | ||||||
|                                      unsigned& num_reuse_reach) |                                      unsigned& num_reuse_reach) | ||||||
| { | { | ||||||
|     TRACE("spacer", |     TRACE("spacer", | ||||||
|  | @ -1388,14 +1386,8 @@ lbool pred_transformer::is_reachable(pob& n, expr_ref_vector* core, | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     TRACE ("spacer", |     CTRACE("spacer", !reach_assumps.empty(), | ||||||
|            if (!reach_assumps.empty ()) { |         tout << "reach assumptions\n" << reach_assumps << "\n";); | ||||||
|                tout << "reach assumptions\n"; |  | ||||||
|                for (unsigned i = 0; i < reach_assumps.size (); i++) { |  | ||||||
|                    tout << mk_pp (reach_assumps.get (i), m) << "\n"; |  | ||||||
|                } |  | ||||||
|            } |  | ||||||
|         ); |  | ||||||
| 
 | 
 | ||||||
|     // check local reachability;
 |     // check local reachability;
 | ||||||
|     // result is either sat (with some reach assumps) or
 |     // result is either sat (with some reach assumps) or
 | ||||||
|  | @ -1404,24 +1396,15 @@ lbool pred_transformer::is_reachable(pob& n, expr_ref_vector* core, | ||||||
|     lbool is_sat = m_solver->check_assumptions (post, reach_assumps, |     lbool is_sat = m_solver->check_assumptions (post, reach_assumps, | ||||||
|                                                m_transition_clause, 1, &bg, 0); |                                                m_transition_clause, 1, &bg, 0); | ||||||
| 
 | 
 | ||||||
|     TRACE ("spacer", |     CTRACE("spacer", !reach_assumps.empty(), | ||||||
|            if (!reach_assumps.empty ()) { |         tout << "reach assumptions\n" << reach_assumps << "\n";); | ||||||
|                tout << "reach assumptions used\n"; |  | ||||||
|                for (unsigned i = 0; i < reach_assumps.size (); i++) { |  | ||||||
|                    tout << mk_pp (reach_assumps.get (i), m) << "\n"; |  | ||||||
|                } |  | ||||||
|            } |  | ||||||
|         ); |  | ||||||
| 
 | 
 | ||||||
|     if (is_sat == l_true || is_sat == l_undef) { |     if (is_sat == l_true || is_sat == l_undef) { | ||||||
|         if (core) { core->reset(); } |         if (core) { core->reset(); } | ||||||
|         if (model && model->get()) { |         if (model && model->get()) { | ||||||
|             r = find_rule(**model, is_concrete, reach_pred_used, num_reuse_reach); |             r = find_rule(**model, is_concrete, reach_pred_used, num_reuse_reach); | ||||||
|             TRACE ("spacer", tout << "reachable " |             TRACE("spacer",  | ||||||
|                    << "is_concrete " << is_concrete << " rused: "; |                 tout << "reachable " << r << " is_concrete " << is_concrete << " rused: " << reach_pred_used << "\n";); | ||||||
|                    for (unsigned i = 0, sz = reach_pred_used.size (); i < sz; ++i) |  | ||||||
|                        tout << reach_pred_used [i]; |  | ||||||
|                    tout << "\n";); |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         return is_sat; |         return is_sat; | ||||||
|  | @ -2924,8 +2907,6 @@ expr_ref context::get_answer() | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| expr_ref context::mk_unsat_answer() const | expr_ref context::mk_unsat_answer() const | ||||||
| { | { | ||||||
|     expr_ref_vector refs(m); |     expr_ref_vector refs(m); | ||||||
|  | @ -2935,7 +2916,6 @@ expr_ref context::mk_unsat_answer() const | ||||||
|     return ex.to_expr(); |     return ex.to_expr(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| proof_ref context::get_ground_refutation() const { | proof_ref context::get_ground_refutation() const { | ||||||
|     if (m_last_result != l_true) { |     if (m_last_result != l_true) { | ||||||
|         IF_VERBOSE(0, verbose_stream() |         IF_VERBOSE(0, verbose_stream() | ||||||
|  | @ -3272,7 +3252,7 @@ bool context::is_reachable(pob &n) | ||||||
|     bool is_concrete; |     bool is_concrete; | ||||||
|     const datalog::rule * r = nullptr; |     const datalog::rule * r = nullptr; | ||||||
|     // denotes which predecessor's (along r) reach facts are used
 |     // denotes which predecessor's (along r) reach facts are used
 | ||||||
|     vector<bool> reach_pred_used; |     bool_vector reach_pred_used; | ||||||
|     unsigned num_reuse_reach = 0; |     unsigned num_reuse_reach = 0; | ||||||
| 
 | 
 | ||||||
|     unsigned saved = n.level (); |     unsigned saved = n.level (); | ||||||
|  | @ -3382,7 +3362,7 @@ lbool context::expand_pob(pob& n, pob_ref_buffer &out) | ||||||
|     bool is_concrete; |     bool is_concrete; | ||||||
|     const datalog::rule * r = nullptr; |     const datalog::rule * r = nullptr; | ||||||
|     // denotes which predecessor's (along r) reach facts are used
 |     // denotes which predecessor's (along r) reach facts are used
 | ||||||
|     vector<bool> reach_pred_used; |     bool_vector reach_pred_used; | ||||||
|     unsigned num_reuse_reach = 0; |     unsigned num_reuse_reach = 0; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -3694,11 +3674,7 @@ reach_fact *pred_transformer::mk_rf(pob& n, model &mdl, const datalog::rule& r) | ||||||
|     TRACE ("spacer", |     TRACE ("spacer", | ||||||
|            tout << "Reach fact, before QE:\n"; |            tout << "Reach fact, before QE:\n"; | ||||||
|            tout << mk_pp (res, m) << "\n"; |            tout << mk_pp (res, m) << "\n"; | ||||||
|            tout << "Vars:\n"; |            tout << "Vars:\n" << vars << "\n";);         | ||||||
|            for (unsigned i = 0; i < vars.size(); ++i) { |  | ||||||
|                tout << mk_pp(vars.get (i), m) << "\n"; |  | ||||||
|            } |  | ||||||
|         ); |  | ||||||
| 
 | 
 | ||||||
|     { |     { | ||||||
|         timeit _timer1 (is_trace_enabled("spacer_timeit"), |         timeit _timer1 (is_trace_enabled("spacer_timeit"), | ||||||
|  | @ -3711,10 +3687,7 @@ reach_fact *pred_transformer::mk_rf(pob& n, model &mdl, const datalog::rule& r) | ||||||
|     TRACE ("spacer", |     TRACE ("spacer", | ||||||
|            tout << "Reach fact, after QE project:\n"; |            tout << "Reach fact, after QE project:\n"; | ||||||
|            tout << mk_pp (res, m) << "\n"; |            tout << mk_pp (res, m) << "\n"; | ||||||
|            tout << "Vars:\n"; |            tout << "Vars:\n" << vars << "\n"; | ||||||
|            for (unsigned i = 0; i < vars.size(); ++i) { |  | ||||||
|                tout << mk_pp(vars.get (i), m) << "\n"; |  | ||||||
|            } |  | ||||||
|         ); |         ); | ||||||
| 
 | 
 | ||||||
|     SASSERT (vars.empty ()); |     SASSERT (vars.empty ()); | ||||||
|  | @ -3733,7 +3706,7 @@ reach_fact *pred_transformer::mk_rf(pob& n, model &mdl, const datalog::rule& r) | ||||||
| */ | */ | ||||||
| bool context::create_children(pob& n, datalog::rule const& r, | bool context::create_children(pob& n, datalog::rule const& r, | ||||||
|                               model &mdl, |                               model &mdl, | ||||||
|                               const vector<bool> &reach_pred_used, |                               const bool_vector &reach_pred_used, | ||||||
|                               pob_ref_buffer &out) |                               pob_ref_buffer &out) | ||||||
| { | { | ||||||
|     scoped_watch _w_ (m_create_children_watch); |     scoped_watch _w_ (m_create_children_watch); | ||||||
|  | @ -4075,13 +4048,12 @@ inline bool pob_lt_proc::operator() (const pob *pn1, const pob *pn2) const | ||||||
|         if (p1->get_id() != p2->get_id()) { return p1->get_id() < p2->get_id(); } |         if (p1->get_id() != p2->get_id()) { return p1->get_id() < p2->get_id(); } | ||||||
| 
 | 
 | ||||||
|         if (n1.pt().head()->get_id() == n2.pt().head()->get_id()) { |         if (n1.pt().head()->get_id() == n2.pt().head()->get_id()) { | ||||||
|             IF_VERBOSE (1, |             IF_VERBOSE(1, | ||||||
|                         verbose_stream () |                 verbose_stream() | ||||||
|                         << "dup: " << n1.pt ().head ()->get_name () |                 << "dup: " << n1.pt().head()->get_name() | ||||||
|                         << "(" << n1.level () << ", " << n1.depth () << ") " |                 << "(" << n1.level() << ", " << n1.depth() << ") " | ||||||
|                         << p1->get_id () << "\n"; |                 << p1->get_id() << "\n";); | ||||||
|                         //<< " p1: " << mk_pp (const_cast<expr*>(p1), m) << "\n"
 |                         //<< " p1: " << mk_pp (const_cast<expr*>(p1), m) << "\n"
 | ||||||
|                 ); |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // XXX see comment below on identical nodes
 |         // XXX see comment below on identical nodes
 | ||||||
|  |  | ||||||
|  | @ -487,7 +487,7 @@ public: | ||||||
|     bool is_ctp_blocked(lemma *lem); |     bool is_ctp_blocked(lemma *lem); | ||||||
|     const datalog::rule *find_rule(model &mdl); |     const datalog::rule *find_rule(model &mdl); | ||||||
|     const datalog::rule *find_rule(model &mev, bool& is_concrete, |     const datalog::rule *find_rule(model &mev, bool& is_concrete, | ||||||
|                                    vector<bool>& reach_pred_used, |                                    bool_vector& reach_pred_used, | ||||||
|                                    unsigned& num_reuse_reach); |                                    unsigned& num_reuse_reach); | ||||||
|     expr* get_transition(datalog::rule const& r) { |     expr* get_transition(datalog::rule const& r) { | ||||||
|         pt_rule *p; |         pt_rule *p; | ||||||
|  | @ -530,7 +530,7 @@ public: | ||||||
|     lbool is_reachable(pob& n, expr_ref_vector* core, model_ref *model, |     lbool is_reachable(pob& n, expr_ref_vector* core, model_ref *model, | ||||||
|                        unsigned& uses_level, bool& is_concrete, |                        unsigned& uses_level, bool& is_concrete, | ||||||
|                        datalog::rule const*& r, |                        datalog::rule const*& r, | ||||||
|                        vector<bool>& reach_pred_used, |                        bool_vector& reach_pred_used, | ||||||
|                        unsigned& num_reuse_reach); |                        unsigned& num_reuse_reach); | ||||||
|     bool is_invariant(unsigned level, lemma* lem, |     bool is_invariant(unsigned level, lemma* lem, | ||||||
|                       unsigned& solver_level, |                       unsigned& solver_level, | ||||||
|  | @ -1010,7 +1010,7 @@ class context { | ||||||
|     lbool expand_pob(pob &n, pob_ref_buffer &out); |     lbool expand_pob(pob &n, pob_ref_buffer &out); | ||||||
|     bool create_children(pob& n, const datalog::rule &r, |     bool create_children(pob& n, const datalog::rule &r, | ||||||
|                          model &mdl, |                          model &mdl, | ||||||
|                          const vector<bool>& reach_pred_used, |                          const bool_vector& reach_pred_used, | ||||||
|                          pob_ref_buffer &out); |                          pob_ref_buffer &out); | ||||||
| 
 | 
 | ||||||
|     /**
 |     /**
 | ||||||
|  |  | ||||||
|  | @ -211,8 +211,8 @@ namespace spacer_qe { | ||||||
|         expr_ref_vector  m_terms; |         expr_ref_vector  m_terms; | ||||||
|         vector<rational> m_coeffs; |         vector<rational> m_coeffs; | ||||||
|         vector<rational> m_divs; |         vector<rational> m_divs; | ||||||
|         svector<bool>    m_strict; |         bool_vector    m_strict; | ||||||
|         svector<bool>    m_eq; |         bool_vector    m_eq; | ||||||
|         scoped_ptr<contains_app> m_var; |         scoped_ptr<contains_app> m_var; | ||||||
| 
 | 
 | ||||||
|         bool is_linear(rational const& mul, expr* t, rational& c, expr_ref_vector& ts) { |         bool is_linear(rational const& mul, expr* t, rational& c, expr_ref_vector& ts) { | ||||||
|  |  | ||||||
|  | @ -38,7 +38,7 @@ namespace datalog { | ||||||
|         rule_ref new_rule(rm); |         rule_ref new_rule(rm); | ||||||
|         app_ref_vector tail(m); |         app_ref_vector tail(m); | ||||||
|         app_ref head(m); |         app_ref head(m); | ||||||
|         svector<bool> neg; |         bool_vector neg; | ||||||
|         app_ref query(m); |         app_ref query(m); | ||||||
|         query = m.mk_fresh_const("Q", m.mk_bool_sort()); |         query = m.mk_fresh_const("Q", m.mk_bool_sort()); | ||||||
|         result->set_output_predicate(query->get_decl()); |         result->set_output_predicate(query->get_decl()); | ||||||
|  |  | ||||||
|  | @ -64,7 +64,7 @@ namespace datalog { | ||||||
|         expr_ref_vector revsub(m), conjs(m); |         expr_ref_vector revsub(m), conjs(m); | ||||||
|         rl.get_vars(m, sorts); |         rl.get_vars(m, sorts); | ||||||
|         revsub.resize(sorts.size());   |         revsub.resize(sorts.size());   | ||||||
|         svector<bool> valid(sorts.size(), true); |         bool_vector valid(sorts.size(), true); | ||||||
|         for (unsigned i = 0; i < sub.size(); ++i) { |         for (unsigned i = 0; i < sub.size(); ++i) { | ||||||
|             expr* e = sub[i]; |             expr* e = sub[i]; | ||||||
|             sort* s = m.get_sort(e); |             sort* s = m.get_sort(e); | ||||||
|  | @ -116,7 +116,7 @@ namespace datalog { | ||||||
|         expr_ref_vector conjs1(m), conjs(m); |         expr_ref_vector conjs1(m), conjs(m); | ||||||
|         rule_ref res(rm); |         rule_ref res(rm); | ||||||
|         bool_rewriter bwr(m); |         bool_rewriter bwr(m); | ||||||
|         svector<bool> is_neg; |         bool_vector is_neg; | ||||||
|         tgt->get_vars(m, sorts1); |         tgt->get_vars(m, sorts1); | ||||||
|         src.get_vars(m, sorts2); |         src.get_vars(m, sorts2); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -32,7 +32,7 @@ namespace datalog { | ||||||
|         ast_manager & m; |         ast_manager & m; | ||||||
|         context & m_context; |         context & m_context; | ||||||
|         vector<app*> m_new_tail; |         vector<app*> m_new_tail; | ||||||
|         svector<bool> m_new_tail_neg; |         bool_vector m_new_tail_neg; | ||||||
|         rule_set * bottom_up(rule_set const & source); |         rule_set * bottom_up(rule_set const & source); | ||||||
|         rule_set * top_down(rule_set const & source); |         rule_set * top_down(rule_set const & source); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -106,7 +106,7 @@ namespace datalog { | ||||||
|         m_current = r; |         m_current = r; | ||||||
|         app * new_head = r->get_head(); |         app * new_head = r->get_head(); | ||||||
|         app_ref_vector new_tail(m); |         app_ref_vector new_tail(m); | ||||||
|         svector<bool>  new_is_negated; |         bool_vector  new_is_negated; | ||||||
|         unsigned sz = r->get_tail_size(); |         unsigned sz = r->get_tail_size(); | ||||||
|         bool rule_modified = false; |         bool rule_modified = false; | ||||||
|         for (unsigned i = 0; i < sz; i++) { |         for (unsigned i = 0; i < sz; i++) { | ||||||
|  |  | ||||||
|  | @ -38,7 +38,7 @@ namespace datalog { | ||||||
|             unifier        m_unif; |             unifier        m_unif; | ||||||
|             app_ref        m_head; |             app_ref        m_head; | ||||||
|             app_ref_vector m_tail; |             app_ref_vector m_tail; | ||||||
|             svector<bool>  m_neg; |             bool_vector  m_neg; | ||||||
|             rule *         m_rule; |             rule *         m_rule; | ||||||
| 
 | 
 | ||||||
|             void apply(app * a, app_ref& res); |             void apply(app * a, app_ref& res); | ||||||
|  | @ -76,7 +76,7 @@ namespace datalog { | ||||||
|         app_ref_vector    m_tail; |         app_ref_vector    m_tail; | ||||||
|         expr_ref_vector   m_itail_members; |         expr_ref_vector   m_itail_members; | ||||||
|         expr_ref_vector   m_conj; |         expr_ref_vector   m_conj; | ||||||
|         svector<bool>     m_tail_neg; |         bool_vector     m_tail_neg; | ||||||
|         normalizer_cfg*   m_cfg; |         normalizer_cfg*   m_cfg; | ||||||
|         normalizer_rw*    m_rw; |         normalizer_rw*    m_rw; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -34,7 +34,7 @@ namespace datalog { | ||||||
|     struct matrix { |     struct matrix { | ||||||
|         vector<vector<rational> > A; |         vector<vector<rational> > A; | ||||||
|         vector<rational>          b; |         vector<rational>          b; | ||||||
|         svector<bool>             eq; |         bool_vector             eq; | ||||||
|         unsigned size() const { return A.size(); } |         unsigned size() const { return A.size(); } | ||||||
|         void reset() { A.reset(); b.reset(); eq.reset(); } |         void reset() { A.reset(); b.reset(); eq.reset(); } | ||||||
|         matrix& operator=(matrix const& other); |         matrix& operator=(matrix const& other); | ||||||
|  |  | ||||||
|  | @ -73,7 +73,7 @@ namespace datalog { | ||||||
|         rule_ref new_rule(rm); |         rule_ref new_rule(rm); | ||||||
|         app_ref_vector tail(m); |         app_ref_vector tail(m); | ||||||
|         app_ref head(m); |         app_ref head(m); | ||||||
|         svector<bool> neg; |         bool_vector neg; | ||||||
|         rule_counter& vc = rm.get_counter(); |         rule_counter& vc = rm.get_counter(); | ||||||
|         for (unsigned i = 0; i < sz; ++i) {             |         for (unsigned i = 0; i < sz; ++i) {             | ||||||
|             tail.reset(); |             tail.reset(); | ||||||
|  | @ -129,7 +129,7 @@ namespace datalog { | ||||||
|         rule_ref new_rule(rm); |         rule_ref new_rule(rm); | ||||||
|         app_ref_vector tail(m); |         app_ref_vector tail(m); | ||||||
|         app_ref head(m); |         app_ref head(m); | ||||||
|         svector<bool> neg; |         bool_vector neg; | ||||||
|         for (unsigned i = 0; i < sz; ++i) {             |         for (unsigned i = 0; i < sz; ++i) {             | ||||||
|             tail.reset(); |             tail.reset(); | ||||||
|             neg.reset(); |             neg.reset(); | ||||||
|  |  | ||||||
|  | @ -187,7 +187,7 @@ namespace datalog { | ||||||
|     void mk_magic_sets::create_magic_rules(app * head, unsigned tail_cnt, app * const * tail, bool const* negated, rule_set& result) { |     void mk_magic_sets::create_magic_rules(app * head, unsigned tail_cnt, app * const * tail, bool const* negated, rule_set& result) { | ||||||
|         //TODO: maybe include relevant interpreted predicates from the original rule
 |         //TODO: maybe include relevant interpreted predicates from the original rule
 | ||||||
|         ptr_vector<app> new_tail; |         ptr_vector<app> new_tail; | ||||||
|         svector<bool> negations; |         bool_vector negations; | ||||||
|         new_tail.push_back(create_magic_literal(head)); |         new_tail.push_back(create_magic_literal(head)); | ||||||
|         new_tail.append(tail_cnt, tail); |         new_tail.append(tail_cnt, tail); | ||||||
|         negations.push_back(false); |         negations.push_back(false); | ||||||
|  | @ -231,7 +231,7 @@ namespace datalog { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         ptr_vector<app> new_tail; |         ptr_vector<app> new_tail; | ||||||
|         svector<bool> negations; |         bool_vector negations; | ||||||
|         while (new_tail.size()!=processed_tail_len) { |         while (new_tail.size()!=processed_tail_len) { | ||||||
|             bool intentional = false; |             bool intentional = false; | ||||||
|             int curr_index = pop_bound(exten_tails, r, bound_vars); |             int curr_index = pop_bound(exten_tails, r, bound_vars); | ||||||
|  |  | ||||||
|  | @ -77,7 +77,7 @@ namespace datalog { | ||||||
|         rule_ref new_rule(rm); |         rule_ref new_rule(rm); | ||||||
|         app_ref_vector tail(m); |         app_ref_vector tail(m); | ||||||
|         app_ref head(m); |         app_ref head(m); | ||||||
|         svector<bool> neg; |         bool_vector neg; | ||||||
|         for (unsigned i = 0; i < sz; ++i) {             |         for (unsigned i = 0; i < sz; ++i) {             | ||||||
|             rule & r = *source.get_rule(i); |             rule & r = *source.get_rule(i); | ||||||
|             unsigned utsz = r.get_uninterpreted_tail_size(); |             unsigned utsz = r.get_uninterpreted_tail_size(); | ||||||
|  |  | ||||||
|  | @ -39,7 +39,7 @@ namespace datalog { | ||||||
|         func_decl_ref_vector    m_new_funcs; |         func_decl_ref_vector    m_new_funcs; | ||||||
|         vector<expr_ref_vector> m_subst; |         vector<expr_ref_vector> m_subst; | ||||||
|         vector<sort_ref_vector> m_sorts; |         vector<sort_ref_vector> m_sorts; | ||||||
|         vector<svector<bool> >  m_bound; |         vector<bool_vector >  m_bound; | ||||||
| 
 | 
 | ||||||
|     public: |     public: | ||||||
| 
 | 
 | ||||||
|  | @ -56,7 +56,7 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
|         void get_units(obj_map<expr, bool>& units) override { units.reset(); } |         void get_units(obj_map<expr, bool>& units) override { units.reset(); } | ||||||
| 
 | 
 | ||||||
|         void insert(func_decl* old_p, func_decl* new_p, expr_ref_vector& sub, sort_ref_vector& sorts, svector<bool> const& bound) { |         void insert(func_decl* old_p, func_decl* new_p, expr_ref_vector& sub, sort_ref_vector& sorts, bool_vector const& bound) { | ||||||
|             m_old_funcs.push_back(old_p); |             m_old_funcs.push_back(old_p); | ||||||
|             m_new_funcs.push_back(new_p); |             m_new_funcs.push_back(new_p); | ||||||
|             m_subst.push_back(sub); |             m_subst.push_back(sub); | ||||||
|  | @ -71,7 +71,7 @@ namespace datalog { | ||||||
|                 func_decl* q = m_old_funcs[i].get(); |                 func_decl* q = m_old_funcs[i].get(); | ||||||
|                 expr_ref_vector const& sub = m_subst[i]; |                 expr_ref_vector const& sub = m_subst[i]; | ||||||
|                 sort_ref_vector const& sorts = m_sorts[i]; |                 sort_ref_vector const& sorts = m_sorts[i]; | ||||||
|                 svector<bool> const& is_bound  = m_bound[i]; |                 bool_vector const& is_bound  = m_bound[i]; | ||||||
|                 func_interp* f = old_model->get_func_interp(p); |                 func_interp* f = old_model->get_func_interp(p); | ||||||
|                 expr_ref body(m); |                 expr_ref body(m); | ||||||
|                 unsigned arity_q = q->get_arity(); |                 unsigned arity_q = q->get_arity(); | ||||||
|  | @ -177,7 +177,7 @@ namespace datalog { | ||||||
|         func_decl* new_p = nullptr; |         func_decl* new_p = nullptr; | ||||||
|         if (!m_old2new.find(old_p, new_p)) { |         if (!m_old2new.find(old_p, new_p)) { | ||||||
|             expr_ref_vector sub(m), vars(m); |             expr_ref_vector sub(m), vars(m); | ||||||
|             svector<bool> bound; |             bool_vector bound; | ||||||
|             sort_ref_vector domain(m), sorts(m); |             sort_ref_vector domain(m), sorts(m); | ||||||
|             expr_ref arg(m); |             expr_ref arg(m); | ||||||
|             for (unsigned i = 0; i < sz; ++i) { |             for (unsigned i = 0; i < sz; ++i) { | ||||||
|  |  | ||||||
|  | @ -91,7 +91,7 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
|     void rule_unifier::apply( |     void rule_unifier::apply( | ||||||
|         rule const& r, bool is_tgt, unsigned skipped_index, |         rule const& r, bool is_tgt, unsigned skipped_index, | ||||||
|         app_ref_vector& res, svector<bool>& res_neg) { |         app_ref_vector& res, bool_vector& res_neg) { | ||||||
|         unsigned rule_len = r.get_tail_size(); |         unsigned rule_len = r.get_tail_size(); | ||||||
|         for (unsigned i = 0; i < rule_len; i++) { |         for (unsigned i = 0; i < rule_len; i++) { | ||||||
|             if (i != skipped_index) { //i can never be UINT_MAX, so we'll never skip if we're not supposed to
 |             if (i != skipped_index) { //i can never be UINT_MAX, so we'll never skip if we're not supposed to
 | ||||||
|  | @ -107,7 +107,7 @@ namespace datalog { | ||||||
|         SASSERT(m_ready); |         SASSERT(m_ready); | ||||||
|         app_ref new_head(m); |         app_ref new_head(m); | ||||||
|         app_ref_vector tail(m); |         app_ref_vector tail(m); | ||||||
|         svector<bool> tail_neg; |         bool_vector tail_neg; | ||||||
|         rule_ref simpl_rule(m_rm); |         rule_ref simpl_rule(m_rm); | ||||||
|         apply(tgt.get_head(), true, new_head); |         apply(tgt.get_head(), true, new_head); | ||||||
|         apply(tgt, true,  tail_index, tail, tail_neg); |         apply(tgt, true,  tail_index, tail, tail_neg); | ||||||
|  | @ -647,8 +647,8 @@ namespace datalog { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void mk_rule_inliner::add_rule(rule_set const& source, rule* r, unsigned i) { |     void mk_rule_inliner::add_rule(rule_set const& source, rule* r, unsigned i) { | ||||||
|         svector<bool>& can_remove = m_head_visitor.can_remove(); |         bool_vector& can_remove = m_head_visitor.can_remove(); | ||||||
|         svector<bool>& can_expand = m_head_visitor.can_expand(); |         bool_vector& can_expand = m_head_visitor.can_expand(); | ||||||
|         app* head = r->get_head(); |         app* head = r->get_head(); | ||||||
|         func_decl* headd = head->get_decl(); |         func_decl* headd = head->get_decl(); | ||||||
|         m_head_visitor.add_position(head, i); |         m_head_visitor.add_position(head, i); | ||||||
|  | @ -705,8 +705,8 @@ namespace datalog { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // set up unification index.
 |         // set up unification index.
 | ||||||
|         svector<bool>& can_remove = m_head_visitor.can_remove(); |         bool_vector& can_remove = m_head_visitor.can_remove(); | ||||||
|         svector<bool>& can_expand = m_head_visitor.can_expand(); |         bool_vector& can_expand = m_head_visitor.can_expand(); | ||||||
| 
 | 
 | ||||||
|         for (unsigned i = 0; i < sz; ++i) { |         for (unsigned i = 0; i < sz; ++i) { | ||||||
|             add_rule(*rules, acc[i].get(), i); |             add_rule(*rules, acc[i].get(), i); | ||||||
|  | @ -727,7 +727,7 @@ namespace datalog { | ||||||
|         m_subst.reserve_vars(max_var+1); |         m_subst.reserve_vars(max_var+1); | ||||||
|         m_subst.reserve_offsets(std::max(m_tail_index.get_approx_num_regs(), 2+m_head_index.get_approx_num_regs())); |         m_subst.reserve_offsets(std::max(m_tail_index.get_approx_num_regs(), 2+m_head_index.get_approx_num_regs())); | ||||||
| 
 | 
 | ||||||
|         svector<bool> valid; |         bool_vector valid; | ||||||
|         valid.reset(); |         valid.reset(); | ||||||
|         valid.resize(sz, true); |         valid.resize(sz, true); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -76,7 +76,7 @@ namespace datalog { | ||||||
|            unless skipped_index is equal to UINT_MAX |            unless skipped_index is equal to UINT_MAX | ||||||
|         */         |         */         | ||||||
|         void apply(rule const& r, bool is_tgt, unsigned skipped_index, app_ref_vector& res,  |         void apply(rule const& r, bool is_tgt, unsigned skipped_index, app_ref_vector& res,  | ||||||
|                    svector<bool>& res_neg); |                    bool_vector& res_neg); | ||||||
|          |          | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  | @ -85,15 +85,15 @@ namespace datalog { | ||||||
|         class visitor : public st_visitor { |         class visitor : public st_visitor { | ||||||
|             context& m_context; |             context& m_context; | ||||||
|             unsigned_vector m_unifiers; |             unsigned_vector m_unifiers; | ||||||
|             svector<bool> m_can_remove, m_can_expand; |             bool_vector m_can_remove, m_can_expand; | ||||||
|             obj_map<expr, unsigned_vector> m_positions; |             obj_map<expr, unsigned_vector> m_positions; | ||||||
|         public: |         public: | ||||||
|             visitor(context& c, substitution & s): st_visitor(s), m_context(c) { (void) m_context; } |             visitor(context& c, substitution & s): st_visitor(s), m_context(c) { (void) m_context; } | ||||||
|             bool operator()(expr* e) override; |             bool operator()(expr* e) override; | ||||||
|             void         reset() { m_unifiers.reset(); } |             void         reset() { m_unifiers.reset(); } | ||||||
|             void         reset(unsigned sz); |             void         reset(unsigned sz); | ||||||
|             svector<bool>& can_remove() { return m_can_remove; } |             bool_vector& can_remove() { return m_can_remove; } | ||||||
|             svector<bool>& can_expand() { return m_can_expand; } |             bool_vector& can_expand() { return m_can_expand; } | ||||||
|             unsigned_vector const& add_position(expr* e, unsigned j); |             unsigned_vector const& add_position(expr* e, unsigned j); | ||||||
|             unsigned_vector const& del_position(expr* e, unsigned j); |             unsigned_vector const& del_position(expr* e, unsigned j); | ||||||
|             unsigned_vector const& get_unifiers() { return m_unifiers; } |             unsigned_vector const& get_unifiers() { return m_unifiers; } | ||||||
|  |  | ||||||
|  | @ -127,7 +127,7 @@ namespace datalog { | ||||||
|         rule_ref new_rule(rm); |         rule_ref new_rule(rm); | ||||||
|         app_ref_vector tail(m); |         app_ref_vector tail(m); | ||||||
|         app_ref head(m); |         app_ref head(m); | ||||||
|         svector<bool> neg; |         bool_vector neg; | ||||||
|         ptr_vector<sort> vars; |         ptr_vector<sort> vars; | ||||||
|         ref<scale_model_converter> smc; |         ref<scale_model_converter> smc; | ||||||
|         if (m_ctx.get_model_converter()) { |         if (m_ctx.get_model_converter()) { | ||||||
|  |  | ||||||
|  | @ -80,7 +80,7 @@ namespace datalog { | ||||||
|         unsigned tsz  = r.get_tail_size(); |         unsigned tsz  = r.get_tail_size(); | ||||||
|         app_ref_vector tail(m); |         app_ref_vector tail(m); | ||||||
|         app_ref p(m); |         app_ref p(m); | ||||||
|         svector<bool> neg; |         bool_vector neg; | ||||||
|         for (unsigned i = 0; i < ptsz; ++i) { |         for (unsigned i = 0; i < ptsz; ++i) { | ||||||
|             tail.push_back(r.get_tail(i)); |             tail.push_back(r.get_tail(i)); | ||||||
|             neg.push_back(false); |             neg.push_back(false); | ||||||
|  |  | ||||||
|  | @ -35,10 +35,10 @@ namespace datalog { | ||||||
|         context&      m_ctx; |         context&      m_ctx; | ||||||
|         ast_manager&  m; |         ast_manager&  m; | ||||||
|         rule_manager& rm; |         rule_manager& rm; | ||||||
|         svector<bool>   m_input; |         bool_vector   m_input; | ||||||
|         svector<bool>   m_output; |         bool_vector   m_output; | ||||||
|         expr_ref_vector m_solved_vars; |         expr_ref_vector m_solved_vars; | ||||||
|         svector<bool>   m_var_is_sliceable; |         bool_vector   m_var_is_sliceable; | ||||||
|         obj_map<func_decl, func_decl*>  m_predicates;         |         obj_map<func_decl, func_decl*>  m_predicates;         | ||||||
|         obj_map<func_decl, bit_vector> m_sliceable; |         obj_map<func_decl, bit_vector> m_sliceable; | ||||||
|         ast_ref_vector  m_pinned; |         ast_ref_vector  m_pinned; | ||||||
|  |  | ||||||
|  | @ -125,7 +125,7 @@ namespace datalog { | ||||||
|         app_ref head(r->get_head(), m); |         app_ref head(r->get_head(), m); | ||||||
| 
 | 
 | ||||||
|         app_ref_vector tail(m); |         app_ref_vector tail(m); | ||||||
|         svector<bool> tail_neg; |         bool_vector tail_neg; | ||||||
| 
 | 
 | ||||||
|         for(unsigned i=0; i<u_len; i++) { |         for(unsigned i=0; i<u_len; i++) { | ||||||
|             app * tail_atom = r->get_tail(i); |             app * tail_atom = r->get_tail(i); | ||||||
|  |  | ||||||
|  | @ -101,7 +101,7 @@ namespace datalog { | ||||||
|         app_ref replacing = product_application(apps); |         app_ref replacing = product_application(apps); | ||||||
| 
 | 
 | ||||||
|         ptr_vector<app> new_tail; |         ptr_vector<app> new_tail; | ||||||
|         svector<bool> new_tail_neg; |         bool_vector new_tail_neg; | ||||||
|         unsigned n = r.get_tail_size() - apps.size() + 1; |         unsigned n = r.get_tail_size() - apps.size() + 1; | ||||||
|         unsigned tail_idx = 0; |         unsigned tail_idx = 0; | ||||||
|         new_tail.resize(n); |         new_tail.resize(n); | ||||||
|  | @ -176,7 +176,7 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
|     void mk_synchronize::add_rec_tail(vector< ptr_vector<app> > & recursive_calls, |     void mk_synchronize::add_rec_tail(vector< ptr_vector<app> > & recursive_calls, | ||||||
|                                       app_ref_vector & new_tail, |                                       app_ref_vector & new_tail, | ||||||
|                                       svector<bool> & new_tail_neg, |                                       bool_vector & new_tail_neg, | ||||||
|                                       unsigned & tail_idx) { |                                       unsigned & tail_idx) { | ||||||
|         unsigned max_sz = 0; |         unsigned max_sz = 0; | ||||||
|         for (auto &rc : recursive_calls) |         for (auto &rc : recursive_calls) | ||||||
|  | @ -200,7 +200,7 @@ namespace datalog { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void mk_synchronize::add_non_rec_tail(rule & r, app_ref_vector & new_tail, |     void mk_synchronize::add_non_rec_tail(rule & r, app_ref_vector & new_tail, | ||||||
|                                           svector<bool> & new_tail_neg, |                                           bool_vector & new_tail_neg, | ||||||
|                                           unsigned & tail_idx) { |                                           unsigned & tail_idx) { | ||||||
|         for (unsigned i = 0, sz = r.get_positive_tail_size(); i < sz; ++i) { |         for (unsigned i = 0, sz = r.get_positive_tail_size(); i < sz; ++i) { | ||||||
|             app* tail = r.get_tail(i); |             app* tail = r.get_tail(i); | ||||||
|  | @ -287,7 +287,7 @@ namespace datalog { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         app_ref_vector new_tail(m); |         app_ref_vector new_tail(m); | ||||||
|         svector<bool> new_tail_neg; |         bool_vector new_tail_neg; | ||||||
|         new_tail.resize(product_tail_length); |         new_tail.resize(product_tail_length); | ||||||
|         new_tail_neg.resize(product_tail_length); |         new_tail_neg.resize(product_tail_length); | ||||||
|         unsigned tail_idx = -1; |         unsigned tail_idx = -1; | ||||||
|  |  | ||||||
|  | @ -109,9 +109,9 @@ namespace datalog { | ||||||
| 
 | 
 | ||||||
|         void add_rec_tail(vector< ptr_vector<app> > & recursive_calls, |         void add_rec_tail(vector< ptr_vector<app> > & recursive_calls, | ||||||
|                           app_ref_vector & new_tail, |                           app_ref_vector & new_tail, | ||||||
|                           svector<bool> & new_tail_neg, unsigned & tail_idx); |                           bool_vector & new_tail_neg, unsigned & tail_idx); | ||||||
|         void add_non_rec_tail(rule & r, app_ref_vector & new_tail, |         void add_non_rec_tail(rule & r, app_ref_vector & new_tail, | ||||||
|                               svector<bool> & new_tail_neg, |                               bool_vector & new_tail_neg, | ||||||
|                               unsigned & tail_idx); |                               unsigned & tail_idx); | ||||||
| 
 | 
 | ||||||
|         rule_ref product_rule(rule_ref_vector const & rules); |         rule_ref product_rule(rule_ref_vector const & rules); | ||||||
|  |  | ||||||
|  | @ -205,7 +205,7 @@ namespace datalog { | ||||||
|         SASSERT(dtail_args.size()==dtail_pred->get_arity()); |         SASSERT(dtail_args.size()==dtail_pred->get_arity()); | ||||||
|         app_ref dtail(m.mk_app(dtail_pred, dtail_args.size(), dtail_args.c_ptr()), m); |         app_ref dtail(m.mk_app(dtail_pred, dtail_args.size(), dtail_args.c_ptr()), m); | ||||||
| 
 | 
 | ||||||
|         svector<bool> tails_negated; |         bool_vector tails_negated; | ||||||
|         app_ref_vector tails(m); |         app_ref_vector tails(m); | ||||||
|         unsigned tail_len = r->get_tail_size(); |         unsigned tail_len = r->get_tail_size(); | ||||||
|         for (unsigned i = 0; i < tail_len; i++) { |         for (unsigned i = 0; i < tail_len; i++) { | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ namespace nlsat { | ||||||
|     */ |     */ | ||||||
|     class assignment : public polynomial::var2anum { |     class assignment : public polynomial::var2anum { | ||||||
|         scoped_anum_vector m_values; |         scoped_anum_vector m_values; | ||||||
|         svector<bool>      m_assigned; |         bool_vector      m_assigned; | ||||||
|     public: |     public: | ||||||
|         assignment(anum_manager & _m):m_values(_m) {} |         assignment(anum_manager & _m):m_values(_m) {} | ||||||
|         virtual ~assignment() {} |         virtual ~assignment() {} | ||||||
|  |  | ||||||
|  | @ -258,7 +258,7 @@ namespace nlsat { | ||||||
|            \brief Add literal p != 0 into m_result. |            \brief Add literal p != 0 into m_result. | ||||||
|         */ |         */ | ||||||
|         ptr_vector<poly>  m_zero_fs; |         ptr_vector<poly>  m_zero_fs; | ||||||
|         svector<bool>     m_is_even; |         bool_vector     m_is_even; | ||||||
|         void add_zero_assumption(polynomial_ref & p) { |         void add_zero_assumption(polynomial_ref & p) { | ||||||
|             // If p is of the form p1^n1 * ... * pk^nk,
 |             // If p is of the form p1^n1 * ... * pk^nk,
 | ||||||
|             // then only the factors that are zero in the current interpretation needed to be considered.
 |             // then only the factors that are zero in the current interpretation needed to be considered.
 | ||||||
|  |  | ||||||
|  | @ -114,10 +114,10 @@ namespace nlsat { | ||||||
|         unsigned_vector        m_levels;       // bool_var -> level
 |         unsigned_vector        m_levels;       // bool_var -> level
 | ||||||
|         svector<justification> m_justifications; |         svector<justification> m_justifications; | ||||||
|         vector<clause_vector>  m_bwatches;     // bool_var (that are not attached to atoms) -> clauses where it is maximal
 |         vector<clause_vector>  m_bwatches;     // bool_var (that are not attached to atoms) -> clauses where it is maximal
 | ||||||
|         svector<bool>          m_dead;         // mark dead boolean variables
 |         bool_vector          m_dead;         // mark dead boolean variables
 | ||||||
|         id_gen                 m_bid_gen; |         id_gen                 m_bid_gen; | ||||||
| 
 | 
 | ||||||
|         svector<bool>          m_is_int;     // m_is_int[x] is true if variable is integer
 |         bool_vector          m_is_int;     // m_is_int[x] is true if variable is integer
 | ||||||
|         vector<clause_vector>  m_watches;    // var -> clauses where variable is maximal
 |         vector<clause_vector>  m_watches;    // var -> clauses where variable is maximal
 | ||||||
|         interval_set_vector    m_infeasible; // var -> to a set of interval where the variable cannot be assigned to.
 |         interval_set_vector    m_infeasible; // var -> to a set of interval where the variable cannot be assigned to.
 | ||||||
|         atom_vector            m_var2eq;     // var -> to asserted equality
 |         atom_vector            m_var2eq;     // var -> to asserted equality
 | ||||||
|  | @ -497,7 +497,7 @@ namespace nlsat { | ||||||
|             SASSERT(m_is_int.size() == m_inv_perm.size()); |             SASSERT(m_is_int.size() == m_inv_perm.size()); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         svector<bool> m_found_vars; |         bool_vector m_found_vars; | ||||||
|         void vars(literal l, var_vector& vs) {                 |         void vars(literal l, var_vector& vs) {                 | ||||||
|             vs.reset(); |             vs.reset(); | ||||||
|             atom * a = m_atoms[l.var()]; |             atom * a = m_atoms[l.var()]; | ||||||
|  | @ -835,7 +835,7 @@ namespace nlsat { | ||||||
|                     ineq_atom& ia = *to_ineq_atom(a); |                     ineq_atom& ia = *to_ineq_atom(a); | ||||||
|                     unsigned sz = ia.size(); |                     unsigned sz = ia.size(); | ||||||
|                     ptr_vector<poly> ps; |                     ptr_vector<poly> ps; | ||||||
|                     svector<bool> is_even; |                     bool_vector is_even; | ||||||
|                     for (unsigned i = 0; i < sz; ++i) { |                     for (unsigned i = 0; i < sz; ++i) { | ||||||
|                         ps.push_back(ia.p(i)); |                         ps.push_back(ia.p(i)); | ||||||
|                         is_even.push_back(ia.is_even(i)); |                         is_even.push_back(ia.is_even(i)); | ||||||
|  | @ -2400,7 +2400,7 @@ namespace nlsat { | ||||||
|                 new_inv_perm[ext_x] = p[m_inv_perm[ext_x]]; |                 new_inv_perm[ext_x] = p[m_inv_perm[ext_x]]; | ||||||
|                 m_perm.set(new_inv_perm[ext_x], ext_x); |                 m_perm.set(new_inv_perm[ext_x], ext_x); | ||||||
|             } |             } | ||||||
|             svector<bool> is_int; |             bool_vector is_int; | ||||||
|             is_int.swap(m_is_int); |             is_int.swap(m_is_int); | ||||||
|             for (var x = 0; x < sz; x++) { |             for (var x = 0; x < sz; x++) { | ||||||
|                 m_is_int.setx(p[x], is_int[x], false); |                 m_is_int.setx(p[x], is_int[x], false); | ||||||
|  | @ -2698,7 +2698,7 @@ namespace nlsat { | ||||||
| 
 | 
 | ||||||
|             u_map<literal> b2l; |             u_map<literal> b2l; | ||||||
|             scoped_literal_vector lits(m_solver); |             scoped_literal_vector lits(m_solver); | ||||||
|             svector<bool> even; |             bool_vector even; | ||||||
|             unsigned num_atoms = m_atoms.size(); |             unsigned num_atoms = m_atoms.size(); | ||||||
|             for (unsigned j = 0; j < num_atoms; ++j) { |             for (unsigned j = 0; j < num_atoms; ++j) { | ||||||
|                 atom* a = m_atoms[j]; |                 atom* a = m_atoms[j]; | ||||||
|  |  | ||||||
|  | @ -78,7 +78,7 @@ namespace opt { | ||||||
|         svector<symbol>  m_labels; |         svector<symbol>  m_labels; | ||||||
|         //const expr_ref_vector  m_soft;
 |         //const expr_ref_vector  m_soft;
 | ||||||
|         //vector<rational> m_weights;
 |         //vector<rational> m_weights;
 | ||||||
|         //svector<bool>    m_assignment;       // truth assignment to soft constraints
 |         //bool_vector    m_assignment;       // truth assignment to soft constraints
 | ||||||
|         params_ref       m_params;           // config
 |         params_ref       m_params;           // config
 | ||||||
| 
 | 
 | ||||||
|     public: |     public: | ||||||
|  |  | ||||||
|  | @ -78,7 +78,7 @@ namespace opt { | ||||||
|         vector<inf_eps>     m_objective_values; |         vector<inf_eps>     m_objective_values; | ||||||
|         sref_vector<model>  m_models; |         sref_vector<model>  m_models; | ||||||
|         expr_ref_vector     m_objective_terms; |         expr_ref_vector     m_objective_terms; | ||||||
|         svector<bool>       m_valid_objectives; |         bool_vector       m_valid_objectives; | ||||||
|         bool                m_dump_benchmarks; |         bool                m_dump_benchmarks; | ||||||
|         static unsigned     m_dump_count; |         static unsigned     m_dump_count; | ||||||
|         statistics          m_stats; |         statistics          m_stats; | ||||||
|  |  | ||||||
|  | @ -108,8 +108,8 @@ namespace smt { | ||||||
|         rational         m_penalty;      // current penalty of soft constraints
 |         rational         m_penalty;      // current penalty of soft constraints
 | ||||||
|         rational         m_best_penalty; |         rational         m_best_penalty; | ||||||
|         vector<unsigned_vector>  m_hard_occ, m_soft_occ;  // variable occurrence
 |         vector<unsigned_vector>  m_hard_occ, m_soft_occ;  // variable occurrence
 | ||||||
|         svector<bool>    m_assignment;   // current assignment.
 |         bool_vector    m_assignment;   // current assignment.
 | ||||||
|         svector<bool>    m_best_assignment; |         bool_vector    m_best_assignment; | ||||||
|         expr_ref_vector  m_trail; |         expr_ref_vector  m_trail; | ||||||
|         obj_map<expr, unsigned> m_decl2var; // map declarations to Boolean variables.
 |         obj_map<expr, unsigned> m_decl2var; // map declarations to Boolean variables.
 | ||||||
|         ptr_vector<expr> m_var2decl;        // reverse map
 |         ptr_vector<expr> m_var2decl;        // reverse map
 | ||||||
|  | @ -188,7 +188,7 @@ namespace smt { | ||||||
|             IF_VERBOSE(1, verbose_stream() << "(pb.sls initial penalty: " << m_best_penalty << ")\n"; |             IF_VERBOSE(1, verbose_stream() << "(pb.sls initial penalty: " << m_best_penalty << ")\n"; | ||||||
|                        verbose_stream() << "(pb.sls violated: " << m_hard_false.num_elems() |                        verbose_stream() << "(pb.sls violated: " << m_hard_false.num_elems() | ||||||
|                        << " penalty: " << m_penalty << ")\n";); |                        << " penalty: " << m_penalty << ")\n";); | ||||||
|             svector<bool> assignment(m_assignment); |             bool_vector assignment(m_assignment); | ||||||
|             for (unsigned round = 0; round < 40; ++round) { |             for (unsigned round = 0; round < 40; ++round) { | ||||||
|                 init_max_flips(); |                 init_max_flips(); | ||||||
|                 while (m_max_flips > 0) { |                 while (m_max_flips > 0) { | ||||||
|  |  | ||||||
|  | @ -415,7 +415,7 @@ namespace qe { | ||||||
|         expr_ref_vector  m_trail;          // trail for generated terms
 |         expr_ref_vector  m_trail;          // trail for generated terms
 | ||||||
|         expr_ref_vector  m_args;  |         expr_ref_vector  m_args;  | ||||||
|         ptr_vector<expr> m_todo;           // stack of formulas to visit
 |         ptr_vector<expr> m_todo;           // stack of formulas to visit
 | ||||||
|         svector<bool>    m_pols;           // stack of polarities
 |         bool_vector    m_pols;           // stack of polarities
 | ||||||
|         bool_rewriter    m_rewriter; |         bool_rewriter    m_rewriter; | ||||||
|          |          | ||||||
|     public: |     public: | ||||||
|  |  | ||||||
|  | @ -244,7 +244,7 @@ namespace qe { | ||||||
|      */ |      */ | ||||||
|     app_ref_vector uflia_mbi::get_arith_vars(expr_ref_vector const& lits) { |     app_ref_vector uflia_mbi::get_arith_vars(expr_ref_vector const& lits) { | ||||||
|         app_ref_vector avars(m);  |         app_ref_vector avars(m);  | ||||||
|         svector<bool> seen; |         bool_vector seen; | ||||||
|         arith_util a(m); |         arith_util a(m); | ||||||
|         for (expr* e : subterms(lits)) { |         for (expr* e : subterms(lits)) { | ||||||
|             if ((m.is_eq(e) && a.is_int_real(to_app(e)->get_arg(0))) || a.is_arith_expr(e)) { |             if ((m.is_eq(e) && a.is_int_real(to_app(e)->get_arg(0))) || a.is_arith_expr(e)) { | ||||||
|  |  | ||||||
|  | @ -295,7 +295,7 @@ namespace sat { | ||||||
|         bool                      m_clause_removed; |         bool                      m_clause_removed; | ||||||
|         bool                      m_constraint_removed; |         bool                      m_constraint_removed; | ||||||
|         literal_vector            m_roots; |         literal_vector            m_roots; | ||||||
|         svector<bool>             m_root_vars; |         bool_vector             m_root_vars; | ||||||
|         unsigned_vector           m_weights; |         unsigned_vector           m_weights; | ||||||
|         svector<wliteral>         m_wlits; |         svector<wliteral>         m_wlits; | ||||||
|         bool subsumes(card& c1, card& c2, literal_vector& comp); |         bool subsumes(card& c1, card& c2, literal_vector& comp); | ||||||
|  |  | ||||||
|  | @ -742,7 +742,7 @@ namespace sat { | ||||||
|      * Assume only the first definition for a node is used for all cuts. |      * Assume only the first definition for a node is used for all cuts. | ||||||
|      */ |      */ | ||||||
|     void aig_cuts::cut2clauses(on_clause_t& on_clause, unsigned v, cut const& c) { |     void aig_cuts::cut2clauses(on_clause_t& on_clause, unsigned v, cut const& c) { | ||||||
|         svector<bool> visited(m_aig.size(), false); |         bool_vector visited(m_aig.size(), false); | ||||||
|         for (unsigned u : c) visited[u] = true; |         for (unsigned u : c) visited[u] = true; | ||||||
|         unsigned_vector todo; |         unsigned_vector todo; | ||||||
|         todo.push_back(v); |         todo.push_back(v); | ||||||
|  | @ -797,7 +797,7 @@ namespace sat { | ||||||
|         reslimit lim; |         reslimit lim; | ||||||
|         solver s; |         solver s; | ||||||
|         unsigned_vector vars; |         unsigned_vector vars; | ||||||
|         svector<bool>   is_var; |         bool_vector   is_var; | ||||||
| 
 | 
 | ||||||
|         validator(aig_cuts& t):t(t),s(p, lim) { |         validator(aig_cuts& t):t(t),s(p, lim) { | ||||||
|             p.set_bool("cut_simplifier", false); |             p.set_bool("cut_simplifier", false); | ||||||
|  |  | ||||||
|  | @ -66,12 +66,12 @@ namespace sat { | ||||||
| 
 | 
 | ||||||
|         solver&        s; |         solver&        s; | ||||||
|         config         m_config; |         config         m_config; | ||||||
|         svector<bool>  m_relevant; |         bool_vector  m_relevant; | ||||||
|         stats          m_stats; |         stats          m_stats; | ||||||
|         statistics     m_st; |         statistics     m_st; | ||||||
|         unsigned_vector m_eval_cache; |         unsigned_vector m_eval_cache; | ||||||
|         unsigned        m_eval_ts; |         unsigned        m_eval_ts; | ||||||
|         svector<bool>   m_used_for_evaluation; |         bool_vector   m_used_for_evaluation; | ||||||
| 
 | 
 | ||||||
|         void clauses2anf(pdd_solver& solver); |         void clauses2anf(pdd_solver& solver); | ||||||
|         void anf2clauses(pdd_solver& solver); |         void anf2clauses(pdd_solver& solver); | ||||||
|  |  | ||||||
|  | @ -170,7 +170,7 @@ namespace sat { | ||||||
|         CASSERT("asymm_branch", s.check_invariant()); |         CASSERT("asymm_branch", s.check_invariant()); | ||||||
|         TRACE("asymm_branch_detail", s.display(tout);); |         TRACE("asymm_branch_detail", s.display(tout);); | ||||||
|         report rpt(*this); |         report rpt(*this); | ||||||
|         svector<bool> saved_phase(s.m_phase); |         bool_vector saved_phase(s.m_phase); | ||||||
| 
 | 
 | ||||||
|         bool change = true; |         bool change = true; | ||||||
|         unsigned counter = 0; |         unsigned counter = 0; | ||||||
|  |  | ||||||
|  | @ -43,8 +43,8 @@ namespace sat { | ||||||
|         svector<bclause>  m_L, m_R, m_live_clauses, m_new_L; |         svector<bclause>  m_L, m_R, m_live_clauses, m_new_L; | ||||||
|         clause_vector     m_bin_clauses; |         clause_vector     m_bin_clauses; | ||||||
|         svector<uint64_t> m_rbits; |         svector<uint64_t> m_rbits; | ||||||
|         svector<bool>     m_marked; |         bool_vector     m_marked; | ||||||
|         svector<bool>     m_removed; // set of clauses removed (not considered in clause set during BCE)
 |         bool_vector     m_removed; // set of clauses removed (not considered in clause set during BCE)
 | ||||||
| 
 | 
 | ||||||
|         void init(use_list& ul); |         void init(use_list& ul); | ||||||
|         void register_clause(clause* cls); |         void register_clause(clause* cls); | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ namespace sat { | ||||||
|         random_gen&            m_rand; |         random_gen&            m_rand; | ||||||
|         unsigned               m_num_vars; |         unsigned               m_num_vars; | ||||||
|         vector<literal_vector> m_dag; |         vector<literal_vector> m_dag; | ||||||
|         svector<bool>          m_roots; |         bool_vector          m_roots; | ||||||
|         svector<int>           m_left, m_right; |         svector<int>           m_left, m_right; | ||||||
|         literal_vector         m_root, m_parent; |         literal_vector         m_root, m_parent; | ||||||
|         bool                   m_learned; |         bool                   m_learned; | ||||||
|  |  | ||||||
|  | @ -43,7 +43,7 @@ namespace sat { | ||||||
|         unsigned                             m_stopped_at; |         unsigned                             m_stopped_at; | ||||||
|         vector<clause_vector>                m_use_list; |         vector<clause_vector>                m_use_list; | ||||||
|         unsigned                             m_limit1, m_limit2; |         unsigned                             m_limit1, m_limit2; | ||||||
|         svector<bool>                        m_mark, m_mark2; |         bool_vector                        m_mark, m_mark2; | ||||||
|         literal_vector                       m_must_candidates, m_may_candidates; |         literal_vector                       m_must_candidates, m_may_candidates; | ||||||
|         unsigned                             m_state; |         unsigned                             m_state; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -78,7 +78,7 @@ namespace sat { | ||||||
|             pbcoeff(unsigned id, unsigned coeff): |             pbcoeff(unsigned id, unsigned coeff): | ||||||
|                 m_constraint_id(id), m_coeff(coeff) {} |                 m_constraint_id(id), m_coeff(coeff) {} | ||||||
|         }; |         }; | ||||||
|         typedef svector<bool> bool_vector; |         typedef bool_vector bool_vector; | ||||||
|         typedef svector<pbcoeff> coeff_vector; |         typedef svector<pbcoeff> coeff_vector; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -139,7 +139,7 @@ namespace sat { | ||||||
|         local_search_config m_config;         |         local_search_config m_config;         | ||||||
|          |          | ||||||
|         vector<var_info>    m_vars;                      // variables
 |         vector<var_info>    m_vars;                      // variables
 | ||||||
|         svector<bool>       m_best_phase;                // best value in round
 |         bool_vector       m_best_phase;                // best value in round
 | ||||||
|         svector<bool_var>   m_units;                     // unit clauses
 |         svector<bool_var>   m_units;                     // unit clauses
 | ||||||
|         vector<constraint>  m_constraints;               // all constraints
 |         vector<constraint>  m_constraints;               // all constraints
 | ||||||
|         literal_vector      m_assumptions;               // temporary assumptions
 |         literal_vector      m_assumptions;               // temporary assumptions
 | ||||||
|  |  | ||||||
|  | @ -2082,7 +2082,7 @@ namespace sat { | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     bool lookahead::backtrack(literal_vector& trail, svector<bool> & is_decision) { |     bool lookahead::backtrack(literal_vector& trail, bool_vector & is_decision) { | ||||||
|         m_cube_state.m_backtracks++; |         m_cube_state.m_backtracks++; | ||||||
|         while (inconsistent()) { |         while (inconsistent()) { | ||||||
|             if (trail.empty()) return false; |             if (trail.empty()) return false; | ||||||
|  |  | ||||||
|  | @ -175,7 +175,7 @@ namespace sat { | ||||||
| 
 | 
 | ||||||
|         struct cube_state { |         struct cube_state { | ||||||
|             bool           m_first; |             bool           m_first; | ||||||
|             svector<bool>  m_is_decision; |             bool_vector  m_is_decision; | ||||||
|             literal_vector m_cube; |             literal_vector m_cube; | ||||||
|             double         m_freevars_threshold; |             double         m_freevars_threshold; | ||||||
|             double         m_psat_threshold; |             double         m_psat_threshold; | ||||||
|  | @ -540,7 +540,7 @@ namespace sat { | ||||||
|         void assign(literal l); |         void assign(literal l); | ||||||
|         void propagated(literal l); |         void propagated(literal l); | ||||||
|         bool backtrack(literal_vector& trail); |         bool backtrack(literal_vector& trail); | ||||||
|         bool backtrack(literal_vector& trail, svector<bool> & is_decision); |         bool backtrack(literal_vector& trail, bool_vector & is_decision); | ||||||
|         lbool search(); |         lbool search(); | ||||||
|         void init_model(); |         void init_model(); | ||||||
|         std::ostream& display_binary(std::ostream& out) const; |         std::ostream& display_binary(std::ostream& out) const; | ||||||
|  |  | ||||||
|  | @ -37,7 +37,7 @@ namespace sat { | ||||||
|             clause_filter(unsigned f, clause* cp): |             clause_filter(unsigned f, clause* cp): | ||||||
|                 m_filter(f), m_clause(cp) {} |                 m_filter(f), m_clause(cp) {} | ||||||
|         }; |         }; | ||||||
|         typedef svector<bool> bool_vector; |         typedef bool_vector bool_vector; | ||||||
|         unsigned                m_max_lut_size; |         unsigned                m_max_lut_size; | ||||||
|         vector<svector<clause_filter>>   m_clause_filters;  // index of clauses.
 |         vector<svector<clause_filter>>   m_clause_filters;  // index of clauses.
 | ||||||
|         uint64_t                m_combination;              // bit-mask of parities that have been found
 |         uint64_t                m_combination;              // bit-mask of parities that have been found
 | ||||||
|  |  | ||||||
|  | @ -90,7 +90,7 @@ namespace sat { | ||||||
|     private: |     private: | ||||||
|         vector<entry>          m_entries;           // entries accumulated during SAT search
 |         vector<entry>          m_entries;           // entries accumulated during SAT search
 | ||||||
|         unsigned               m_exposed_lim;       // last entry that was exposed to model converter.
 |         unsigned               m_exposed_lim;       // last entry that was exposed to model converter.
 | ||||||
|         svector<bool>          m_mark;              // literals that are used in asserted clauses.
 |         bool_vector          m_mark;              // literals that are used in asserted clauses.
 | ||||||
|         solver const*          m_solver; |         solver const*          m_solver; | ||||||
|         elim_stackv            m_elim_stack; |         elim_stackv            m_elim_stack; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ namespace sat { | ||||||
|             unsigned        m_size; |             unsigned        m_size; | ||||||
|             unsigned        m_tail; |             unsigned        m_tail; | ||||||
|             unsigned_vector m_heads; |             unsigned_vector m_heads; | ||||||
|             svector<bool>   m_at_end; |             bool_vector   m_at_end; | ||||||
|             void next(unsigned& index); |             void next(unsigned& index); | ||||||
|             unsigned get_owner(unsigned index) const { return m_vectors[index]; } |             unsigned get_owner(unsigned index) const { return m_vectors[index]; } | ||||||
|             unsigned get_length(unsigned index) const { return m_vectors[index+1]; } |             unsigned get_length(unsigned index) const { return m_vectors[index+1]; } | ||||||
|  |  | ||||||
|  | @ -59,7 +59,7 @@ namespace sat { | ||||||
|         clause_allocator m_alloc; |         clause_allocator m_alloc; | ||||||
|         clause_vector    m_clause_db;      |         clause_vector    m_clause_db;      | ||||||
|         svector<clause_info> m_clauses; |         svector<clause_info> m_clauses; | ||||||
|         svector<bool>    m_values, m_best_values; |         bool_vector    m_values, m_best_values; | ||||||
|         unsigned         m_best_min_unsat; |         unsigned         m_best_min_unsat; | ||||||
|         vector<unsigned_vector> m_use_list; |         vector<unsigned_vector> m_use_list; | ||||||
|         unsigned_vector  m_flat_use_list; |         unsigned_vector  m_flat_use_list; | ||||||
|  |  | ||||||
|  | @ -1002,7 +1002,7 @@ namespace sat { | ||||||
|         literal_vector m_intersection;                // current resolution intersection
 |         literal_vector m_intersection;                // current resolution intersection
 | ||||||
|         literal_vector m_tautology;                   // literals that are used in blocking tautology
 |         literal_vector m_tautology;                   // literals that are used in blocking tautology
 | ||||||
|         literal_vector m_new_intersection; |         literal_vector m_new_intersection; | ||||||
|         svector<bool>  m_in_intersection; |         bool_vector  m_in_intersection; | ||||||
|         unsigned       m_ala_qhead; |         unsigned       m_ala_qhead; | ||||||
|         clause_wrapper m_clause; |         clause_wrapper m_clause; | ||||||
|         unsigned       m_ala_cost; |         unsigned       m_ala_cost; | ||||||
|  |  | ||||||
|  | @ -118,11 +118,11 @@ namespace sat { | ||||||
|         vector<watch_list>      m_watches; |         vector<watch_list>      m_watches; | ||||||
|         svector<lbool>          m_assignment; |         svector<lbool>          m_assignment; | ||||||
|         svector<justification>  m_justification;  |         svector<justification>  m_justification;  | ||||||
|         svector<bool>           m_decision; |         bool_vector             m_decision; | ||||||
|         svector<bool>           m_mark; |         bool_vector             m_mark; | ||||||
|         svector<bool>           m_lit_mark; |         bool_vector             m_lit_mark; | ||||||
|         svector<bool>           m_eliminated; |         bool_vector             m_eliminated; | ||||||
|         svector<bool>           m_external; |         bool_vector             m_external; | ||||||
|         unsigned_vector         m_touched; |         unsigned_vector         m_touched; | ||||||
|         unsigned                m_touch_index; |         unsigned                m_touch_index; | ||||||
|         literal_vector          m_replay_assign; |         literal_vector          m_replay_assign; | ||||||
|  | @ -137,9 +137,9 @@ namespace sat { | ||||||
|         int                     m_action; |         int                     m_action; | ||||||
|         double                  m_step_size; |         double                  m_step_size; | ||||||
|         // phase
 |         // phase
 | ||||||
|         svector<bool>           m_phase;  |         bool_vector             m_phase;  | ||||||
|         svector<bool>           m_best_phase; |         bool_vector             m_best_phase; | ||||||
|         svector<bool>           m_prev_phase; |         bool_vector             m_prev_phase; | ||||||
|         svector<char>           m_assigned_since_gc; |         svector<char>           m_assigned_since_gc; | ||||||
|         search_state            m_search_state;  |         search_state            m_search_state;  | ||||||
|         unsigned                m_search_unsat_conflicts; |         unsigned                m_search_unsat_conflicts; | ||||||
|  |  | ||||||
|  | @ -55,7 +55,7 @@ namespace sat { | ||||||
|         solver&           s; |         solver&           s; | ||||||
|         local_search      m_ls; |         local_search      m_ls; | ||||||
|         random_gen        m_rand; |         random_gen        m_rand; | ||||||
|         svector<bool>     m_phase; |         bool_vector     m_phase; | ||||||
|         svector<ema>      m_phase_tf; |         svector<ema>      m_phase_tf; | ||||||
|         var_priority      m_priorities; |         var_priority      m_priorities; | ||||||
|         unsigned          m_luby_index; |         unsigned          m_luby_index; | ||||||
|  |  | ||||||
|  | @ -37,7 +37,7 @@ namespace sat { | ||||||
|             clause_filter(unsigned f, clause* cp): |             clause_filter(unsigned f, clause* cp): | ||||||
|                 m_filter(f), m_clause(cp) {} |                 m_filter(f), m_clause(cp) {} | ||||||
|         }; |         }; | ||||||
|         typedef svector<bool> bool_vector; |         typedef bool_vector bool_vector; | ||||||
|         unsigned                m_max_xor_size; |         unsigned                m_max_xor_size; | ||||||
|         vector<svector<clause_filter>>   m_clause_filters;      // index of clauses.
 |         vector<svector<clause_filter>>   m_clause_filters;      // index of clauses.
 | ||||||
|         unsigned                m_combination;  // bit-mask of parities that have been found
 |         unsigned                m_combination;  // bit-mask of parities that have been found
 | ||||||
|  |  | ||||||
|  | @ -1385,7 +1385,7 @@ public: | ||||||
|     template<typename Functor> |     template<typename Functor> | ||||||
|     bool find_shortest_path_aux(dl_var source, dl_var target, unsigned timestamp, Functor & f, bool zero_edge) { |     bool find_shortest_path_aux(dl_var source, dl_var target, unsigned timestamp, Functor & f, bool zero_edge) { | ||||||
|         svector<bfs_elem> bfs_todo; |         svector<bfs_elem> bfs_todo; | ||||||
|         svector<bool>     bfs_mark; |         bool_vector     bfs_mark; | ||||||
|         bfs_mark.resize(m_assignment.size(), false); |         bfs_mark.resize(m_assignment.size(), false); | ||||||
|          |          | ||||||
|         bfs_todo.push_back(bfs_elem(source, -1, null_edge_id)); |         bfs_todo.push_back(bfs_elem(source, -1, null_edge_id)); | ||||||
|  |  | ||||||
|  | @ -334,7 +334,7 @@ void expr_strong_context_simplifier::simplify_basic(expr* fml, expr_ref& result) | ||||||
| 
 | 
 | ||||||
|     ptr_vector<expr> todo; |     ptr_vector<expr> todo; | ||||||
|     ptr_vector<expr> names; |     ptr_vector<expr> names; | ||||||
|     svector<bool>    is_checked; |     bool_vector    is_checked; | ||||||
|     svector<unsigned> parent_ids, self_ids; |     svector<unsigned> parent_ids, self_ids; | ||||||
|     expr_ref_vector  fresh_vars(m); |     expr_ref_vector  fresh_vars(m); | ||||||
|     expr_ref_vector trail(m); |     expr_ref_vector trail(m); | ||||||
|  | @ -484,7 +484,7 @@ void expr_strong_context_simplifier::simplify_model_based(expr* fml, expr_ref& r | ||||||
| 
 | 
 | ||||||
|     ptr_vector<expr> todo; |     ptr_vector<expr> todo; | ||||||
|     ptr_vector<expr> names; |     ptr_vector<expr> names; | ||||||
|     svector<bool>    is_checked; |     bool_vector    is_checked; | ||||||
|     svector<unsigned> parent_ids, self_ids; |     svector<unsigned> parent_ids, self_ids; | ||||||
|     expr_ref_vector  fresh_vars(m); |     expr_ref_vector  fresh_vars(m); | ||||||
|     expr_ref_vector trail(m); |     expr_ref_vector trail(m); | ||||||
|  |  | ||||||
|  | @ -797,7 +797,7 @@ namespace { | ||||||
|         code_tree *             m_tree; |         code_tree *             m_tree; | ||||||
|         unsigned                m_num_choices; |         unsigned                m_num_choices; | ||||||
|         bool                    m_is_tmp_tree; |         bool                    m_is_tmp_tree; | ||||||
|         svector<bool>           m_mp_already_processed; |         bool_vector           m_mp_already_processed; | ||||||
|         obj_map<expr, unsigned> m_matched_exprs; |         obj_map<expr, unsigned> m_matched_exprs; | ||||||
| 
 | 
 | ||||||
|         struct pcheck_checked { |         struct pcheck_checked { | ||||||
|  | @ -3106,10 +3106,10 @@ namespace { | ||||||
| 
 | 
 | ||||||
|         // m_is_plbl[f] is true, then when f(c_1, ..., c_n) becomes relevant,
 |         // m_is_plbl[f] is true, then when f(c_1, ..., c_n) becomes relevant,
 | ||||||
|         //  for each c_i. c_i->get_root()->lbls().insert(lbl_hash(f))
 |         //  for each c_i. c_i->get_root()->lbls().insert(lbl_hash(f))
 | ||||||
|         svector<bool>               m_is_plbl; |         bool_vector               m_is_plbl; | ||||||
|         // m_is_clbl[f] is true, then when n=f(c_1, ..., c_n) becomes relevant,
 |         // m_is_clbl[f] is true, then when n=f(c_1, ..., c_n) becomes relevant,
 | ||||||
|         //  n->get_root()->lbls().insert(lbl_hash(f))
 |         //  n->get_root()->lbls().insert(lbl_hash(f))
 | ||||||
|         svector<bool>               m_is_clbl;    // children labels
 |         bool_vector               m_is_clbl;    // children labels
 | ||||||
| 
 | 
 | ||||||
|         // auxiliary field used to update data-structures...
 |         // auxiliary field used to update data-structures...
 | ||||||
|         typedef ptr_vector<func_decl> func_decls; |         typedef ptr_vector<func_decl> func_decls; | ||||||
|  |  | ||||||
|  | @ -3989,7 +3989,7 @@ namespace smt { | ||||||
| 
 | 
 | ||||||
| #ifdef Z3DEBUG | #ifdef Z3DEBUG | ||||||
|             expr_ref_vector expr_lits(m); |             expr_ref_vector expr_lits(m); | ||||||
|             svector<bool>   expr_signs; |             bool_vector   expr_signs; | ||||||
|             for (unsigned i = 0; i < num_lits; i++) { |             for (unsigned i = 0; i < num_lits; i++) { | ||||||
|                 literal l = lits[i]; |                 literal l = lits[i]; | ||||||
|                 if (get_assignment(l) != l_false) { |                 if (get_assignment(l) != l_false) { | ||||||
|  |  | ||||||
|  | @ -1200,7 +1200,7 @@ namespace smt { | ||||||
| 
 | 
 | ||||||
|         bool is_relevant_core(expr * n) const { return m_relevancy_propagator->is_relevant(n); } |         bool is_relevant_core(expr * n) const { return m_relevancy_propagator->is_relevant(n); } | ||||||
| 
 | 
 | ||||||
|         svector<bool>  m_relevant_conflict_literals; |         bool_vector  m_relevant_conflict_literals; | ||||||
|         void record_relevancy(unsigned n, literal const* lits); |         void record_relevancy(unsigned n, literal const* lits); | ||||||
|         void restore_relevancy(unsigned n, literal const* lits); |         void restore_relevancy(unsigned n, literal const* lits); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -42,7 +42,7 @@ namespace smt { | ||||||
|             ast_manager &        m_manager; |             ast_manager &        m_manager; | ||||||
|             bool                 m_conservative; |             bool                 m_conservative; | ||||||
|             unsigned             m_num_vars; |             unsigned             m_num_vars; | ||||||
|             svector<bool>        m_already_found;     // mapping from var_idx -> bool
 |             bool_vector        m_already_found;     // mapping from var_idx -> bool
 | ||||||
|             vector<enode_set>    m_candidates;        // mapping from var_idx -> set of candidates
 |             vector<enode_set>    m_candidates;        // mapping from var_idx -> set of candidates
 | ||||||
|             vector<enode_set>    m_tmp_candidates;    // auxiliary mapping from var_idx -> set of candidates
 |             vector<enode_set>    m_tmp_candidates;    // auxiliary mapping from var_idx -> set of candidates
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -60,7 +60,7 @@ namespace smt { | ||||||
|         void get_descendants(node_id start, svector<node_id> & descendants); |         void get_descendants(node_id start, svector<node_id> & descendants); | ||||||
|          |          | ||||||
|         virtual void update(edge_id enter_id, edge_id leave_id);                 |         virtual void update(edge_id enter_id, edge_id leave_id);                 | ||||||
|         void get_path(node_id start, node_id end, svector<edge_id> & path, svector<bool> & against);               |         void get_path(node_id start, node_id end, svector<edge_id> & path, bool_vector & against);               | ||||||
|         bool in_subtree_t2(node_id child); |         bool in_subtree_t2(node_id child); | ||||||
| 
 | 
 | ||||||
|         bool check_well_formed();         |         bool check_well_formed();         | ||||||
|  |  | ||||||
|  | @ -43,7 +43,7 @@ namespace smt { | ||||||
|         virtual void get_descendants(node_id start, svector<node_id> & descendants) = 0; |         virtual void get_descendants(node_id start, svector<node_id> & descendants) = 0; | ||||||
|          |          | ||||||
|         virtual void update(edge_id enter_id, edge_id leave_id) = 0; |         virtual void update(edge_id enter_id, edge_id leave_id) = 0; | ||||||
|         virtual void get_path(node_id start, node_id end, svector<edge_id> & path, svector<bool> & against) = 0; |         virtual void get_path(node_id start, node_id end, svector<edge_id> & path, bool_vector & against) = 0; | ||||||
|         virtual bool in_subtree_t2(node_id child) = 0; |         virtual bool in_subtree_t2(node_id child) = 0; | ||||||
| 
 | 
 | ||||||
|         virtual bool check_well_formed() = 0; |         virtual bool check_well_formed() = 0; | ||||||
|  |  | ||||||
|  | @ -67,7 +67,7 @@ namespace smt { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     template<typename Ext> |     template<typename Ext> | ||||||
|     void thread_spanning_tree<Ext>::get_path(node_id start, node_id end, svector<edge_id> & path, svector<bool> & against) { |     void thread_spanning_tree<Ext>::get_path(node_id start, node_id end, svector<edge_id> & path, bool_vector & against) { | ||||||
|         node_id join = get_common_ancestor(start, end); |         node_id join = get_common_ancestor(start, end); | ||||||
|         path.reset(); |         path.reset(); | ||||||
|         while (start != join) { |         while (start != join) { | ||||||
|  | @ -282,7 +282,7 @@ namespace smt { | ||||||
| 
 | 
 | ||||||
|         // Check that m_thread traverses each node.
 |         // Check that m_thread traverses each node.
 | ||||||
|         // This gets checked using union-find as well.
 |         // This gets checked using union-find as well.
 | ||||||
|         svector<bool> found(m_thread.size(), false); |         bool_vector found(m_thread.size(), false); | ||||||
|         found[root] = true; |         found[root] = true; | ||||||
|         for (node_id x = m_thread[root]; x != root; x = m_thread[x]) { |         for (node_id x = m_thread[root]; x != root; x = m_thread[x]) { | ||||||
|             SASSERT(x != m_thread[x]); |             SASSERT(x != m_thread[x]); | ||||||
|  |  | ||||||
|  | @ -1850,7 +1850,7 @@ namespace smt { | ||||||
|         if (get_context().inconsistent()) |         if (get_context().inconsistent()) | ||||||
|             return true; // property is only valid if the context is not in a conflict.
 |             return true; // property is only valid if the context is not in a conflict.
 | ||||||
|         if (is_root(v) && is_bv(v)) { |         if (is_root(v) && is_bv(v)) { | ||||||
|             svector<bool> bits[2]; |             bool_vector bits[2]; | ||||||
|             unsigned      num_bits = 0; |             unsigned      num_bits = 0; | ||||||
|             unsigned      bv_sz    = get_bv_size(v); |             unsigned      bv_sz    = get_bv_size(v); | ||||||
|             bits[0].resize(bv_sz, false); |             bits[0].resize(bv_sz, false); | ||||||
|  | @ -1878,7 +1878,7 @@ namespace smt { | ||||||
| 
 | 
 | ||||||
|             zero_one_bits const & _bits = m_zero_one_bits[v]; |             zero_one_bits const & _bits = m_zero_one_bits[v]; | ||||||
|             SASSERT(_bits.size() == num_bits); |             SASSERT(_bits.size() == num_bits); | ||||||
|             svector<bool> already_found; |             bool_vector already_found; | ||||||
|             already_found.resize(bv_sz, false); |             already_found.resize(bv_sz, false); | ||||||
|             for (auto & zo : _bits) { |             for (auto & zo : _bits) { | ||||||
|                 SASSERT(find(zo.m_owner) == v); |                 SASSERT(find(zo.m_owner) == v); | ||||||
|  |  | ||||||
|  | @ -124,7 +124,7 @@ namespace smt { | ||||||
|         atoms                 m_bv2atoms; |         atoms                 m_bv2atoms; | ||||||
|         edges                 m_edges;  // list of asserted edges
 |         edges                 m_edges;  // list of asserted edges
 | ||||||
|         matrix                m_matrix; |         matrix                m_matrix; | ||||||
|         svector<bool>         m_is_int; |         bool_vector         m_is_int; | ||||||
|         vector<cell_trail>    m_cell_trail; |         vector<cell_trail>    m_cell_trail; | ||||||
|         svector<scope>        m_scopes; |         svector<scope>        m_scopes; | ||||||
|         bool                  m_non_diff_logic_exprs; |         bool                  m_non_diff_logic_exprs; | ||||||
|  |  | ||||||
|  | @ -175,7 +175,7 @@ namespace smt { | ||||||
|         ptr_vector<eq_prop_info>       m_eq_prop_infos; |         ptr_vector<eq_prop_info>       m_eq_prop_infos; | ||||||
| 
 | 
 | ||||||
|         app_ref_vector                 m_terms; |         app_ref_vector                 m_terms; | ||||||
|         svector<bool>                  m_signs; |         bool_vector                  m_signs; | ||||||
| 
 | 
 | ||||||
|         ptr_vector<atom>               m_atoms; |         ptr_vector<atom>               m_atoms; | ||||||
|         ptr_vector<atom>               m_asserted_atoms;   // set of asserted atoms
 |         ptr_vector<atom>               m_asserted_atoms;   // set of asserted atoms
 | ||||||
|  | @ -337,7 +337,7 @@ namespace smt { | ||||||
| 
 | 
 | ||||||
|         virtual void new_diseq_eh(theory_var v1, theory_var v2, justification& j); |         virtual void new_diseq_eh(theory_var v1, theory_var v2, justification& j); | ||||||
| 
 | 
 | ||||||
|         bool decompose_linear(app_ref_vector& args, svector<bool>& signs); |         bool decompose_linear(app_ref_vector& args, bool_vector& signs); | ||||||
| 
 | 
 | ||||||
|         bool is_sign(expr* n, bool& sign); |         bool is_sign(expr* n, bool& sign); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -399,7 +399,7 @@ void theory_diff_logic<Ext>::del_atoms(unsigned old_size) { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| template<typename Ext> | template<typename Ext> | ||||||
| bool theory_diff_logic<Ext>::decompose_linear(app_ref_vector& terms, svector<bool>& signs) { | bool theory_diff_logic<Ext>::decompose_linear(app_ref_vector& terms, bool_vector& signs) { | ||||||
|     for (unsigned i = 0; i < terms.size(); ++i) { |     for (unsigned i = 0; i < terms.size(); ++i) { | ||||||
|         app* n = terms.get(i); |         app* n = terms.get(i); | ||||||
|         bool sign; |         bool sign; | ||||||
|  |  | ||||||
|  | @ -356,9 +356,9 @@ namespace smt { | ||||||
|         literal_vector    m_antecedents; |         literal_vector    m_antecedents; | ||||||
|         tracked_uint_set  m_active_var_set; |         tracked_uint_set  m_active_var_set; | ||||||
|         expr_ref_vector   m_antecedent_exprs; |         expr_ref_vector   m_antecedent_exprs; | ||||||
|         svector<bool>     m_antecedent_signs; |         bool_vector     m_antecedent_signs; | ||||||
|         expr_ref_vector   m_cardinality_exprs; |         expr_ref_vector   m_cardinality_exprs; | ||||||
|         svector<bool>     m_cardinality_signs; |         bool_vector     m_cardinality_signs; | ||||||
| 
 | 
 | ||||||
|         void normalize_active_coeffs(); |         void normalize_active_coeffs(); | ||||||
|         void inc_coeff(literal l, int offset); |         void inc_coeff(literal l, int offset); | ||||||
|  |  | ||||||
|  | @ -1033,7 +1033,7 @@ namespace smt { | ||||||
|         unsigned sz = g.get_num_nodes(); |         unsigned sz = g.get_num_nodes(); | ||||||
|         svector<dl_var> nodes; |         svector<dl_var> nodes; | ||||||
|         num_children.resize(sz, 0); |         num_children.resize(sz, 0); | ||||||
|         svector<bool> processed(sz, false); |         bool_vector processed(sz, false); | ||||||
|         for (unsigned i = 0; i < sz; ++i) nodes.push_back(i); |         for (unsigned i = 0; i < sz; ++i) nodes.push_back(i); | ||||||
|         while (!nodes.empty()) { |         while (!nodes.empty()) { | ||||||
|             dl_var v = nodes.back(); |             dl_var v = nodes.back(); | ||||||
|  |  | ||||||
|  | @ -47,7 +47,7 @@ namespace smt { | ||||||
|     /**
 |     /**
 | ||||||
|        \brief return the complement of variables that are currently assigned. |        \brief return the complement of variables that are currently assigned. | ||||||
|     */ |     */ | ||||||
|     void theory_wmaxsat::get_assignment(svector<bool>& result) { |     void theory_wmaxsat::get_assignment(bool_vector& result) { | ||||||
|         result.reset(); |         result.reset(); | ||||||
|          |          | ||||||
|         if (!m_found_optimal) { |         if (!m_found_optimal) { | ||||||
|  |  | ||||||
|  | @ -53,12 +53,12 @@ namespace smt { | ||||||
|         bool                     m_can_propagate; |         bool                     m_can_propagate; | ||||||
|         bool                     m_normalize;  |         bool                     m_normalize;  | ||||||
|         rational                 m_den;         // lcm of denominators for rational weights.
 |         rational                 m_den;         // lcm of denominators for rational weights.
 | ||||||
|         svector<bool>            m_assigned, m_enabled; |         bool_vector            m_assigned, m_enabled; | ||||||
|         stats                    m_stats; |         stats                    m_stats; | ||||||
|     public: |     public: | ||||||
|         theory_wmaxsat(ast_manager& m, generic_model_converter& mc); |         theory_wmaxsat(ast_manager& m, generic_model_converter& mc); | ||||||
|         ~theory_wmaxsat() override; |         ~theory_wmaxsat() override; | ||||||
|         void get_assignment(svector<bool>& result); |         void get_assignment(bool_vector& result); | ||||||
|         expr* assert_weighted(expr* fml, rational const& w); |         expr* assert_weighted(expr* fml, rational const& w); | ||||||
|         void  disable_var(expr* var); |         void  disable_var(expr* var); | ||||||
|         bool_var register_var(app* var, bool attach); |         bool_var register_var(app* var, bool attach); | ||||||
|  |  | ||||||
|  | @ -202,7 +202,7 @@ class diff_neq_tactic : public tactic { | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|          |          | ||||||
|         svector<bool>  m_forbidden; |         bool_vector  m_forbidden; | ||||||
|          |          | ||||||
|         // make sure m_forbidden.size() > max upper bound
 |         // make sure m_forbidden.size() > max upper bound
 | ||||||
|         void init_forbidden() { |         void init_forbidden() { | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ Revision History: | ||||||
| 
 | 
 | ||||||
| static void tst1() { | static void tst1() { | ||||||
|     bit_vector     v1; |     bit_vector     v1; | ||||||
|     svector<bool> v2; |     bool_vector v2; | ||||||
|     unsigned n = rand()%10000; |     unsigned n = rand()%10000; | ||||||
|     for (unsigned i = 0; i < n; i++) { |     for (unsigned i = 0; i < n; i++) { | ||||||
|         int op = rand()%6; |         int op = rand()%6; | ||||||
|  |  | ||||||
|  | @ -86,7 +86,7 @@ static void tst2() { | ||||||
|     ENSURE(!g.is_feasible()); |     ENSURE(!g.is_feasible()); | ||||||
|     TRACE("diff_logic", g.display(tout);); |     TRACE("diff_logic", g.display(tout);); | ||||||
|     struct proc { |     struct proc { | ||||||
|         svector<bool> found; |         bool_vector found; | ||||||
|         proc(): |         proc(): | ||||||
|             found(7, false) { |             found(7, false) { | ||||||
|         } |         } | ||||||
|  |  | ||||||
Some files were not shown because too many files have changed in this diff Show more
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue