mirror of
https://github.com/Z3Prover/z3
synced 2026-07-02 21:36:09 +00:00
add local search functionality to sls_seq_plugin
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
b4e768cfb0
commit
4559b23caf
4 changed files with 709 additions and 77 deletions
|
|
@ -18,6 +18,7 @@ Author:
|
|||
|
||||
#include "ast/sls/sls_context.h"
|
||||
#include "ast/seq_decl_plugin.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
|
||||
|
||||
namespace sls {
|
||||
|
|
@ -34,32 +35,66 @@ namespace sls {
|
|||
val0(m), val1(m) {}
|
||||
value val0;
|
||||
value val1;
|
||||
bool is_value = false;
|
||||
unsigned min_length = 0;
|
||||
unsigned max_length = UINT_MAX;
|
||||
};
|
||||
|
||||
seq_util seq;
|
||||
arith_util a;
|
||||
scoped_ptr_vector<eval> m_values;
|
||||
indexed_uint_set m_chars;
|
||||
bool m_initialized = false;
|
||||
|
||||
struct str_update {
|
||||
expr* e;
|
||||
zstring value;
|
||||
unsigned m_score;
|
||||
};
|
||||
struct int_update {
|
||||
expr* e;
|
||||
rational value;
|
||||
unsigned m_score;
|
||||
};
|
||||
vector<str_update> m_str_updates;
|
||||
bool apply_str_update();
|
||||
vector<int_update> m_int_updates;
|
||||
bool apply_update();
|
||||
bool update(expr* e, zstring const& value);
|
||||
bool update(expr* e, rational const& value);
|
||||
|
||||
bool bval1(expr* e);
|
||||
bool bval1_seq(app* e);
|
||||
zstring& strval0(expr* e);
|
||||
zstring const& strval1(expr* e);
|
||||
|
||||
bool repair_contains(expr* e);
|
||||
|
||||
bool repair_down_seq(app* e);
|
||||
bool repair_down_eq(app* e);
|
||||
bool repair_down_str_eq(app* e);
|
||||
bool repair_down_str_extract(app* e);
|
||||
bool repair_down_str_contains(expr* e);
|
||||
bool repair_down_str_concat(app* e);
|
||||
bool repair_down_str_length(app* e);
|
||||
bool repair_down_str_at(app* e);
|
||||
bool repair_down_str_indexof(app* e);
|
||||
bool repair_down_str_replace(app* e);
|
||||
bool repair_down_str_prefixof(app* e);
|
||||
bool repair_down_str_suffixof(app* e);
|
||||
|
||||
void repair_up_str_length(app* e);
|
||||
void repair_up_str_indexof(app* e);
|
||||
|
||||
|
||||
bool is_seq_predicate(expr* e);
|
||||
|
||||
eval& get_eval(expr* e);
|
||||
eval* get_eval(expr* e) const;
|
||||
|
||||
bool is_value(expr* e);
|
||||
public:
|
||||
seq_plugin(context& c);
|
||||
~seq_plugin() override {}
|
||||
expr_ref get_value(expr* e) override;
|
||||
void initialize() override {}
|
||||
void initialize() override;
|
||||
void start_propagation() override {}
|
||||
void propagate_literal(sat::literal lit) override;
|
||||
bool propagate() override;
|
||||
|
|
@ -67,7 +102,7 @@ namespace sls {
|
|||
void register_term(expr* e) override;
|
||||
std::ostream& display(std::ostream& out) const override;
|
||||
bool set_value(expr* e, expr* v) override;
|
||||
bool include_func_interp(func_decl* f) const override { return true; }
|
||||
bool include_func_interp(func_decl* f) const override { return false; }
|
||||
|
||||
void repair_up(app* e) override;
|
||||
bool repair_down(app* e) override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue