mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 19:52:29 +00:00 
			
		
		
		
	rename set-flat to set-flat-and-or to allow to differentiate parameters
This commit is contained in:
		
							parent
							
								
									fe1b4bf5ce
								
							
						
					
					
						commit
						1fae3aa152
					
				
					 9 changed files with 15 additions and 15 deletions
				
			
		|  | @ -106,7 +106,7 @@ public: | |||
|     { | ||||
|         ast_manager &m = args.get_manager(); | ||||
|         bool_rewriter brwr(m); | ||||
|         brwr.set_flat(false); | ||||
|         brwr.set_flat_and_or(false); | ||||
| 
 | ||||
|         if (m.is_or(decl)) | ||||
|         { mk_or_core(args, res); } | ||||
|  |  | |||
|  | @ -59,7 +59,7 @@ class bit_blaster : public bit_blaster_tpl<bit_blaster_cfg> { | |||
| public: | ||||
|     bit_blaster(ast_manager & m, bit_blaster_params const & params); | ||||
|     bit_blaster_params const & get_params() const { return this->m_params; } | ||||
|     void set_flat(bool f) { m_rw.set_flat(f); } | ||||
|     void set_flat_and_or(bool f) { m_rw.set_flat_and_or(f); } | ||||
| }; | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -75,7 +75,7 @@ public: | |||
|         bit_blaster_tpl<blaster_cfg>(blaster_cfg(m_rewriter, m_util)), | ||||
|         m_rewriter(m), | ||||
|         m_util(m) { | ||||
|         m_rewriter.set_flat(false); | ||||
|         m_rewriter.set_flat_and_or(false); | ||||
|         m_rewriter.set_elim_and(true); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -24,7 +24,7 @@ Notes: | |||
| 
 | ||||
| void bool_rewriter::updt_params(params_ref const & _p) { | ||||
|     bool_rewriter_params p(_p); | ||||
|     m_flat                 = p.flat(); | ||||
|     m_flat_and_or          = p.flat(); | ||||
|     m_elim_and             = p.elim_and(); | ||||
|     m_elim_ite             = p.elim_ite(); | ||||
|     m_local_ctx            = p.local_ctx(); | ||||
|  | @ -555,7 +555,7 @@ bool bool_rewriter::local_ctx_simp(unsigned num_args, expr * const * args, expr_ | |||
|                 result = arg;                                                                   \ | ||||
|                 return true;                                                                    \ | ||||
|             }                                                                                   \ | ||||
|             if (m_flat && m().is_or(arg)) {                                                     \ | ||||
|             if (m_flat_and_or && m().is_or(arg)) {                                              \ | ||||
|                 unsigned sz = to_app(arg)->get_num_args();                                      \ | ||||
|                 for (unsigned j = 0; j < sz; j++) {                                             \ | ||||
|                     expr * arg_arg = to_app(arg)->get_arg(j);                                   \ | ||||
|  |  | |||
|  | @ -50,7 +50,7 @@ Notes: | |||
| */ | ||||
| class bool_rewriter { | ||||
|     ast_manager &  m_manager; | ||||
|     bool           m_flat; | ||||
|     bool           m_flat_and_or; | ||||
|     bool           m_local_ctx; | ||||
|     bool           m_elim_and; | ||||
|     bool           m_blast_distinct; | ||||
|  | @ -83,8 +83,8 @@ public: | |||
|     family_id get_fid() const { return m().get_basic_family_id(); } | ||||
|     bool is_eq(expr * t) const { return m().is_eq(t); } | ||||
|      | ||||
|     bool flat() const { return m_flat; } | ||||
|     void set_flat(bool f) { m_flat = f; } | ||||
|     bool flat_and_or() const { return m_flat_and_or; } | ||||
|     void set_flat_and_or(bool f) { m_flat_and_or = f; } | ||||
|     bool elim_and() const { return m_elim_and; } | ||||
|     void set_elim_and(bool f) { m_elim_and = f; } | ||||
|     void reset_local_ctx_cost() { m_local_ctx_cost = 0; } | ||||
|  | @ -111,7 +111,7 @@ public: | |||
|             mk_and_as_or(num_args, args, result); | ||||
|             return BR_DONE; | ||||
|         } | ||||
|         else if (m_flat) { | ||||
|         else if (m_flat_and_or) { | ||||
|             return mk_flat_and_core(num_args, args, result); | ||||
|         } | ||||
|         else { | ||||
|  | @ -119,7 +119,7 @@ public: | |||
|         } | ||||
|     } | ||||
|     br_status mk_or_core(unsigned num_args, expr * const * args, expr_ref & result) { | ||||
|         return m_flat ? | ||||
|         return m_flat_and_or ? | ||||
|             mk_flat_or_core(num_args, args, result) : | ||||
|             mk_nflat_or_core(num_args, args, result); | ||||
|     } | ||||
|  | @ -234,7 +234,7 @@ public: | |||
| 
 | ||||
| struct bool_rewriter_cfg : public default_rewriter_cfg { | ||||
|     bool_rewriter m_r; | ||||
|     bool flat_assoc(func_decl * f) const { return m_r.flat() && (m_r.m().is_and(f) || m_r.m().is_or(f)); } | ||||
|     bool flat_assoc(func_decl * f) const { return m_r.flat_and_or() && (m_r.m().is_and(f) || m_r.m().is_or(f)); } | ||||
|     bool rewrite_patterns() const { return false; } | ||||
|     br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) { | ||||
|         result_pr = nullptr; | ||||
|  |  | |||
|  | @ -86,7 +86,7 @@ struct evaluator_cfg : public default_rewriter_cfg { | |||
|         m_dt(m), | ||||
|         m_pinned(m) { | ||||
|         bool flat = true; | ||||
|         m_b_rw.set_flat(flat); | ||||
|         m_b_rw.set_flat_and_or(flat); | ||||
|         m_a_rw.set_flat(flat); | ||||
|         m_bv_rw.set_flat(flat); | ||||
|         m_bv_rw.set_mkbv2num(true); | ||||
|  |  | |||
|  | @ -55,7 +55,7 @@ namespace bv { | |||
|         m_ackerman(*this), | ||||
|         m_bb(m, get_config()), | ||||
|         m_find(*this) { | ||||
|         m_bb.set_flat(false); | ||||
|         m_bb.set_flat_and_or(false); | ||||
|     } | ||||
| 
 | ||||
|     bool solver::is_fixed(euf::theory_var v, expr_ref& val, sat::literal_vector& lits) { | ||||
|  |  | |||
|  | @ -866,7 +866,7 @@ private: | |||
|             m_used_dependencies(m), | ||||
|             m_rw(*this) { | ||||
|             updt_params(p);             | ||||
|             m_b_rw.set_flat(false); // no flattening otherwise will blowup the memory
 | ||||
|             m_b_rw.set_flat_and_or(false); // no flattening otherwise will blowup the memory
 | ||||
|             m_b_rw.set_elim_and(true); | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
|  | @ -116,7 +116,7 @@ class tseitin_cnf_tactic : public tactic { | |||
|             m_rw(_m), | ||||
|             m_num_aux_vars(0) { | ||||
|             updt_params(p); | ||||
|             m_rw.set_flat(false); | ||||
|             m_rw.set_flat_and_or(false); | ||||
|         } | ||||
|          | ||||
|         void updt_params(params_ref const & p) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue