3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-27 05:26:01 +00:00

enable bounding for various domains

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-12-06 19:36:12 -08:00
parent 437a545c3b
commit a617eac010
8 changed files with 39 additions and 19 deletions

View file

@ -999,8 +999,8 @@ namespace smt {
// -----------------------------------
virtual inf_eps_rational<inf_rational> maximize(theory_var v);
virtual theory_var add_objective(app* term);
virtual expr* block_lower_bound(theory_var v, inf_rational const& val);
expr* block_upper_bound(theory_var v, inf_numeral const& val);
virtual expr* mk_gt(theory_var v, inf_rational const& val);
virtual expr* mk_ge(theory_var v, inf_numeral const& val);
void enable_record_conflict(expr* bound);
void record_conflict(unsigned num_lits, literal const * lits,
unsigned num_eqs, enode_pair const * eqs,

View file

@ -1044,7 +1044,7 @@ namespace smt {
\brief: assert val < v
*/
template<typename Ext>
expr* theory_arith<Ext>::block_lower_bound(theory_var v, inf_rational const& val) {
expr* theory_arith<Ext>::mk_gt(theory_var v, inf_rational const& val) {
ast_manager& m = get_manager();
expr* obj = get_enode(v)->get_owner();
expr_ref e(m);
@ -1062,7 +1062,7 @@ namespace smt {
\brief assert val <= v
*/
template<typename Ext>
expr* theory_arith<Ext>::block_upper_bound(theory_var v, inf_numeral const& val) {
expr* theory_arith<Ext>::mk_ge(theory_var v, inf_numeral const& val) {
ast_manager& m = get_manager();
context& ctx = get_context();
std::ostringstream strm;

View file

@ -310,7 +310,8 @@ namespace smt {
virtual inf_eps_rational<inf_rational> maximize(theory_var v);
virtual theory_var add_objective(app* term);
virtual expr* block_lower_bound(theory_var v, inf_rational const& val);
virtual expr* mk_gt(theory_var v, inf_rational const& val);
virtual expr* mk_ge(theory_var v, inf_rational const& val) { return 0; }
bool internalize_objective(expr * n, rational const& m, rational& r, objective_term & objective);

View file

@ -1146,7 +1146,7 @@ expr* theory_diff_logic<Ext>::block_objective(theory_var v, inf_rational const&
}
template<typename Ext>
expr* theory_diff_logic<Ext>::block_lower_bound(theory_var v, inf_rational const& val) {
expr* theory_diff_logic<Ext>::mk_gt(theory_var v, inf_rational const& val) {
expr * o = block_objective(v, val);
context & ctx = get_context();
model_ref mdl;

View file

@ -28,9 +28,10 @@ namespace smt {
class theory_opt {
public:
typedef inf_eps_rational<inf_rational> inf_eps;
virtual inf_eps_rational<inf_rational> maximize(theory_var v) { UNREACHABLE(); return inf_eps::infinity(); }
virtual inf_eps maximize(theory_var v) { UNREACHABLE(); return inf_eps::infinity(); }
virtual theory_var add_objective(app* term) { UNREACHABLE(); return null_theory_var; }
virtual expr* block_lower_bound(theory_var v, inf_rational const& val) { return 0; }
virtual expr* mk_gt(theory_var v, inf_rational const& val) { UNREACHABLE(); return 0; }
virtual expr* mk_ge(theory_var v, inf_eps const& val) { UNREACHABLE(); return 0; }
};
}