3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-23 06:13:40 +00:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Lev Nachmanson 2017-05-16 12:04:20 -07:00
commit e78a799b53

View file

@ -440,24 +440,16 @@ br_status seq_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr * con
* (seq.unit (_ BitVector 8)) ==> String constant * (seq.unit (_ BitVector 8)) ==> String constant
*/ */
br_status seq_rewriter::mk_seq_unit(expr* e, expr_ref& result) { br_status seq_rewriter::mk_seq_unit(expr* e, expr_ref& result) {
sort * s = m().get_sort(e);
bv_util bvu(m()); bv_util bvu(m());
rational n_val;
if (is_sort_of(s, bvu.get_family_id(), BV_SORT)) { unsigned int n_size;
// specifically we want (_ BitVector 8) // specifically we want (_ BitVector 8)
rational n_val; if (bvu.is_bv(e) && bvu.is_numeral(e, n_val, n_size) && n_size == 8) {
unsigned int n_size; // convert to string constant
if (bvu.is_numeral(e, n_val, n_size)) { zstring str(n_val.get_unsigned());
if (n_size == 8) { TRACE("seq", tout << "rewrite seq.unit of 8-bit value " << n_val.to_string() << " to string constant \"" << str<< "\"" << std::endl;);
// convert to string constant result = m_util.str.mk_string(str);
char ch = (char)n_val.get_int32(); return BR_DONE;
TRACE("seq", tout << "rewrite seq.unit of 8-bit value " << n_val.to_string() << " to string constant \"" << ch << "\"" << std::endl;);
char s_tmp[2] = {ch, '\0'};
symbol s(s_tmp);
result = m_util.str.mk_string(s);
return BR_DONE;
}
}
} }
return BR_FAILED; return BR_FAILED;