mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 02:45:51 +00:00
merge seq and string operators
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
70b10d53cf
commit
8bb73c8eae
6 changed files with 186 additions and 145 deletions
|
@ -365,7 +365,7 @@ format * smt2_pp_environment::pp_arith_literal(app * t, bool decimal, unsigned d
|
|||
|
||||
format * smt2_pp_environment::pp_string_literal(app * t) {
|
||||
std::string s;
|
||||
VERIFY (get_sutil().str.is_const(t, s));
|
||||
VERIFY (get_sutil().str.is_string(t, s));
|
||||
std::ostringstream buffer;
|
||||
buffer << "\"";
|
||||
for (unsigned i = 0; i < s.length(); ++i) {
|
||||
|
@ -424,10 +424,10 @@ format_ns::format * smt2_pp_environment::pp_sort(sort * s) {
|
|||
fs.push_back(mk_unsigned(m, sbits));
|
||||
return mk_seq1(m, fs.begin(), fs.end(), f2f(), "_");
|
||||
}
|
||||
if (get_sutil().is_seq(s) && !get_sutil().is_string(s)) {
|
||||
if ((get_sutil().is_seq(s) || get_sutil().is_re(s)) && !get_sutil().is_string(s)) {
|
||||
ptr_buffer<format> fs;
|
||||
fs.push_back(pp_sort(to_sort(s->get_parameter(0).get_ast())));
|
||||
return mk_seq1(m, fs.begin(), fs.end(), f2f(), "Seq");
|
||||
return mk_seq1(m, fs.begin(), fs.end(), f2f(), get_sutil().is_seq(s)?"Seq":"Re");
|
||||
}
|
||||
return format_ns::mk_string(get_manager(), s->get_name().str().c_str());
|
||||
}
|
||||
|
@ -600,7 +600,7 @@ class smt2_printer {
|
|||
if (m_env.get_autil().is_numeral(c) || m_env.get_autil().is_irrational_algebraic_numeral(c)) {
|
||||
f = m_env.pp_arith_literal(c, m_pp_decimal, m_pp_decimal_precision);
|
||||
}
|
||||
else if (m_env.get_sutil().str.is_const(c)) {
|
||||
else if (m_env.get_sutil().str.is_string(c)) {
|
||||
f = m_env.pp_string_literal(c);
|
||||
}
|
||||
else if (m_env.get_bvutil().is_numeral(c)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue