mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 09:34:08 +00:00
fix build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
82c3233967
commit
b1459f4fa3
|
@ -553,7 +553,7 @@ bool seq_rewriter::reduce_eq(expr* l, expr* r, expr_ref_vector& lhs, expr_ref_ve
|
|||
}
|
||||
else if(m_util.str.is_unit(l, a) &&
|
||||
m_util.str.is_unit(r, b)) {
|
||||
if (m.are_distinct(a, b)) {
|
||||
if (m().are_distinct(a, b)) {
|
||||
return false;
|
||||
}
|
||||
lhs.push_back(a);
|
||||
|
@ -564,9 +564,9 @@ bool seq_rewriter::reduce_eq(expr* l, expr* r, expr_ref_vector& lhs, expr_ref_ve
|
|||
else if (m_util.str.is_unit(l, a) && m_util.str.is_string(r, s)) {
|
||||
SASSERT(s.length() > 0);
|
||||
|
||||
expr_ref bv = m_util.str.mk_char(s, s.length()-1);
|
||||
SASSERT(m_butil.is_bv(a));
|
||||
lhs.push_back(bv);
|
||||
app* ch = m_util.str.mk_char(s, s.length()-1);
|
||||
SASSERT(m().get_sort(ch) == m().get_sort(a));
|
||||
lhs.push_back(ch);
|
||||
rhs.push_back(a);
|
||||
m_lhs.pop_back();
|
||||
if (s.length() == 1) {
|
||||
|
@ -610,7 +610,7 @@ bool seq_rewriter::reduce_eq(expr* l, expr* r, expr_ref_vector& lhs, expr_ref_ve
|
|||
}
|
||||
else if(m_util.str.is_unit(l, a) &&
|
||||
m_util.str.is_unit(r, b)) {
|
||||
if (m.are_distinct(a, b)) {
|
||||
if (m().are_distinct(a, b)) {
|
||||
return false;
|
||||
}
|
||||
lhs.push_back(a);
|
||||
|
@ -620,9 +620,9 @@ bool seq_rewriter::reduce_eq(expr* l, expr* r, expr_ref_vector& lhs, expr_ref_ve
|
|||
}
|
||||
else if (m_util.str.is_unit(l, a) && m_util.str.is_string(r, s)) {
|
||||
SASSERT(s.length() > 0);
|
||||
expr_ref bv = m_util.str.mk_unit(s, 0);
|
||||
SASSERT(m_butil.is_bv(a));
|
||||
lhs.push_back(bv);
|
||||
app* ch = m_util.str.mk_char(s, 0);
|
||||
SASSERT(m().get_sort(ch) == m().get_sort(a));
|
||||
lhs.push_back(ch);
|
||||
rhs.push_back(a);
|
||||
m_lhs.pop_back();
|
||||
if (s.length() == 1) {
|
||||
|
|
|
@ -21,7 +21,6 @@ Notes:
|
|||
|
||||
#include"seq_decl_plugin.h"
|
||||
#include"arith_decl_plugin.h"
|
||||
#include"bv_decl_plugin.h"
|
||||
#include"rewriter_types.h"
|
||||
#include"params.h"
|
||||
#include"lbool.h"
|
||||
|
@ -33,7 +32,6 @@ Notes:
|
|||
class seq_rewriter {
|
||||
seq_util m_util;
|
||||
arith_util m_autil;
|
||||
bv_util m_butil;
|
||||
ptr_vector<expr> m_es, m_lhs, m_rhs;
|
||||
|
||||
br_status mk_seq_concat(expr* a, expr* b, expr_ref& result);
|
||||
|
@ -65,7 +63,7 @@ class seq_rewriter {
|
|||
|
||||
public:
|
||||
seq_rewriter(ast_manager & m, params_ref const & p = params_ref()):
|
||||
m_util(m), m_autil(m), m_butil(m) {
|
||||
m_util(m), m_autil(m) {
|
||||
}
|
||||
ast_manager & m() const { return m_util.get_manager(); }
|
||||
family_id get_fid() const { return m_util.get_family_id(); }
|
||||
|
|
|
@ -609,10 +609,9 @@ app* seq_util::mk_skolem(symbol const& name, unsigned n, expr* const* args, sort
|
|||
app* seq_util::str::mk_string(zstring const& s) { return u.seq.mk_string(s); }
|
||||
|
||||
|
||||
expr_ref seq_util::str::mk_char(zstring const& s, unsigned idx) {
|
||||
bv_util bvu(m());
|
||||
unsigned ch = s[idx];
|
||||
return expr_ref(bvu.mk_numeral(ch, s.num_bits()), m());
|
||||
app* seq_util::str::mk_char(zstring const& s, unsigned idx) {
|
||||
bv_util bvu(m);
|
||||
return bvu.mk_numeral(s[idx], s.num_bits());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -207,7 +207,6 @@ public:
|
|||
app* mk_string(char const* s) { return mk_string(symbol(s)); }
|
||||
app* mk_string(std::string const& s) { return mk_string(symbol(s.c_str())); }
|
||||
|
||||
expr_ref mk_unit_char(zstring const& s, unsigned idx);
|
||||
|
||||
public:
|
||||
str(seq_util& u): u(u), m(u.m), m_fid(u.m_fid) {}
|
||||
|
@ -228,6 +227,8 @@ public:
|
|||
app* mk_suffix(expr* a, expr* b) { expr* es[2] = { a, b }; return m.mk_app(m_fid, OP_SEQ_SUFFIX, 2, es); }
|
||||
app* mk_index(expr* a, expr* b, expr* i) { expr* es[3] = { a, b, i}; return m.mk_app(m_fid, OP_SEQ_INDEX, 3, es); }
|
||||
app* mk_unit(expr* u) { return m.mk_app(m_fid, OP_SEQ_UNIT, 1, &u); }
|
||||
app* mk_char(zstring const& s, unsigned idx);
|
||||
|
||||
|
||||
|
||||
bool is_string(expr const * n) const { return is_app_of(n, m_fid, OP_STRING_CONST); }
|
||||
|
|
|
@ -959,9 +959,9 @@ void theory_seq::add_elim_string_axiom(expr* n) {
|
|||
zstring s;
|
||||
VERIFY(m_util.str.is_string(n, s));
|
||||
SASSERT(s.length() > 0);
|
||||
expr_ref result = m_util.str.mk_unit(m_util.str.mk_char(s, 0));
|
||||
expr_ref result(m_util.str.mk_unit(m_util.str.mk_char(s, 0)), m);
|
||||
for (unsigned i = 1; i < s.length(); ++i) {
|
||||
result = m_util.str.mk_concat(result, m_util.str.mk_unit(m_util.str.mk_unit_char(s, i)));
|
||||
result = m_util.str.mk_concat(result, m_util.str.mk_unit(m_util.str.mk_char(s, i)));
|
||||
}
|
||||
add_axiom(mk_eq(n, result, false));
|
||||
m_rep.update(n, result, 0);
|
||||
|
|
Loading…
Reference in a new issue