mirror of
https://github.com/Z3Prover/z3
synced 2025-06-03 21:01:22 +00:00
Ensure that Z3 uses the correct SMT-LIB2 syntax for push
and pop
(#4495)
* When pretty-printing SMTLIB2, ensure that Z3 uses the correct syntax for 'push' Signed-off-by: Andrew V. Jones <andrew.jones@vector.com> * When pretty-printing SMTLIB2, ensure that Z3 uses the correct syntax for 'pop' Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
This commit is contained in:
parent
0bc33e9c9d
commit
a23ca1792b
6 changed files with 11 additions and 11 deletions
|
@ -61,7 +61,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
void solver2smt2_pp::push() {
|
void solver2smt2_pp::push() {
|
||||||
m_out << "(push)\n";
|
m_out << "(push 1)\n";
|
||||||
m_pp_util.push();
|
m_pp_util.push();
|
||||||
m_tracked_lim.push_back(m_tracked.size());
|
m_tracked_lim.push_back(m_tracked.size());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1231,14 +1231,14 @@ namespace datalog {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (unsigned i = 0; i < queries.size(); ++i) {
|
for (unsigned i = 0; i < queries.size(); ++i) {
|
||||||
if (queries.size() > 1) out << "(push)\n";
|
if (queries.size() > 1) out << "(push 1)\n";
|
||||||
out << "(assert ";
|
out << "(assert ";
|
||||||
expr_ref q(m);
|
expr_ref q(m);
|
||||||
q = m.mk_not(queries[i].get());
|
q = m.mk_not(queries[i].get());
|
||||||
PP(q);
|
PP(q);
|
||||||
out << ")\n";
|
out << ")\n";
|
||||||
out << "(check-sat)\n";
|
out << "(check-sat)\n";
|
||||||
if (queries.size() > 1) out << "(pop)\n";
|
if (queries.size() > 1) out << "(pop 1)\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,12 +141,12 @@ void inductive_property::display(datalog::rule_manager& rm, ptr_vector<datalog::
|
||||||
|
|
||||||
out << to_string() << "\n";
|
out << to_string() << "\n";
|
||||||
for (auto* r : rules) {
|
for (auto* r : rules) {
|
||||||
out << "(push)\n";
|
out << "(push 1)\n";
|
||||||
out << "(assert (not\n";
|
out << "(assert (not\n";
|
||||||
rm.display_smt2(*r, out);
|
rm.display_smt2(*r, out);
|
||||||
out << "))\n";
|
out << "))\n";
|
||||||
out << "(check-sat)\n";
|
out << "(check-sat)\n";
|
||||||
out << "(pop)\n";
|
out << "(pop 1)\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,13 +124,13 @@ namespace spacer {
|
||||||
out << "(define-fun mbp_benchmark_fml () Bool\n ";
|
out << "(define-fun mbp_benchmark_fml () Bool\n ";
|
||||||
out << mk_pp(fml, m) << ")\n\n";
|
out << mk_pp(fml, m) << ")\n\n";
|
||||||
|
|
||||||
out << "(push)\n"
|
out << "(push 1)\n"
|
||||||
<< "(assert mbp_benchmark_fml)\n"
|
<< "(assert mbp_benchmark_fml)\n"
|
||||||
<< "(check-sat)\n"
|
<< "(check-sat)\n"
|
||||||
<< "(mbp mbp_benchmark_fml (";
|
<< "(mbp mbp_benchmark_fml (";
|
||||||
for (auto v : vars) {out << mk_pp(v, m) << " ";}
|
for (auto v : vars) {out << mk_pp(v, m) << " ";}
|
||||||
out << "))\n"
|
out << "))\n"
|
||||||
<< "(pop)\n"
|
<< "(pop 1)\n"
|
||||||
<< "(exit)\n";
|
<< "(exit)\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1208,9 +1208,9 @@ namespace qe {
|
||||||
fml = mk_not(m, m.mk_iff(q, fml));
|
fml = mk_not(m, m.mk_iff(q, fml));
|
||||||
ast_smt_pp pp(m);
|
ast_smt_pp pp(m);
|
||||||
out << "; eliminate " << mk_pp(m_var, m) << "\n";
|
out << "; eliminate " << mk_pp(m_var, m) << "\n";
|
||||||
out << "(push)\n";
|
out << "(push 1)\n";
|
||||||
pp.display_smt2(out, fml);
|
pp.display_smt2(out, fml);
|
||||||
out << "(pop)\n\n";
|
out << "(pop 1)\n\n";
|
||||||
#if 0
|
#if 0
|
||||||
DEBUG_CODE(
|
DEBUG_CODE(
|
||||||
smt_params params;
|
smt_params params;
|
||||||
|
|
|
@ -90,7 +90,7 @@ private:
|
||||||
void fuzz_round(unsigned& num_rounds, unsigned lvl) {
|
void fuzz_round(unsigned& num_rounds, unsigned lvl) {
|
||||||
unsigned num_rounds2 = 0;
|
unsigned num_rounds2 = 0;
|
||||||
lbool is_sat = l_true;
|
lbool is_sat = l_true;
|
||||||
std::cout << "(push)\n";
|
std::cout << "(push 1)\n";
|
||||||
ctx.push();
|
ctx.push();
|
||||||
unsigned r = 0;
|
unsigned r = 0;
|
||||||
while (is_sat == l_true && r <= num_rounds + 1) {
|
while (is_sat == l_true && r <= num_rounds + 1) {
|
||||||
|
@ -105,7 +105,7 @@ private:
|
||||||
num_rounds = r;
|
num_rounds = r;
|
||||||
std::cout << "; number of rounds: " << num_rounds << " level: " << lvl << "\n";
|
std::cout << "; number of rounds: " << num_rounds << " level: " << lvl << "\n";
|
||||||
ctx.pop(1);
|
ctx.pop(1);
|
||||||
std::cout << "(pop)\n";
|
std::cout << "(pop 1)\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue