mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
adding options to maxres for experiments, include option to pretty print module parameters in smt2 style
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
b45b2872d8
commit
83a7d1a658
14 changed files with 249 additions and 131 deletions
|
@ -347,11 +347,11 @@ public:
|
|||
out << "(params";
|
||||
svector<params::entry>::const_iterator it = m_entries.begin();
|
||||
svector<params::entry>::const_iterator end = m_entries.end();
|
||||
for (; it != end; ++it) {
|
||||
out << " " << it->first;
|
||||
for (; it != end; ++it) {
|
||||
out << " " << it->first;
|
||||
switch (it->second.m_kind) {
|
||||
case CPK_BOOL:
|
||||
out << " " << it->second.m_bool_value;
|
||||
out << " " << (it->second.m_bool_value?"true":"false");
|
||||
break;
|
||||
case CPK_UINT:
|
||||
out << " " <<it->second.m_uint_value;
|
||||
|
@ -376,6 +376,41 @@ public:
|
|||
out << ")";
|
||||
}
|
||||
|
||||
void display_smt2(std::ostream & out, char const* module, param_descrs& descrs) const {
|
||||
svector<params::entry>::const_iterator it = m_entries.begin();
|
||||
svector<params::entry>::const_iterator end = m_entries.end();
|
||||
for (; it != end; ++it) {
|
||||
if (!descrs.contains(it->first)) continue;
|
||||
out << "(set-option :";
|
||||
out << module << ".";
|
||||
out << it->first;
|
||||
switch (it->second.m_kind) {
|
||||
case CPK_BOOL:
|
||||
out << " " << (it->second.m_bool_value?"true":"false");
|
||||
break;
|
||||
case CPK_UINT:
|
||||
out << " " <<it->second.m_uint_value;
|
||||
break;
|
||||
case CPK_DOUBLE:
|
||||
out << " " << it->second.m_double_value;
|
||||
break;
|
||||
case CPK_NUMERAL:
|
||||
out << " " << *(it->second.m_rat_value);
|
||||
break;
|
||||
case CPK_SYMBOL:
|
||||
out << " " << symbol::mk_symbol_from_c_ptr(it->second.m_sym_value);
|
||||
break;
|
||||
case CPK_STRING:
|
||||
out << " " << it->second.m_str_value;
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
out << ")\n";
|
||||
}
|
||||
}
|
||||
|
||||
void display(std::ostream & out, symbol const & k) const {
|
||||
svector<params::entry>::const_iterator it = m_entries.begin();
|
||||
svector<params::entry>::const_iterator end = m_entries.end();
|
||||
|
@ -423,10 +458,17 @@ params_ref::params_ref(params_ref const & p):
|
|||
void params_ref::display(std::ostream & out) const {
|
||||
if (m_params)
|
||||
m_params->display(out);
|
||||
else
|
||||
else
|
||||
out << "(params)";
|
||||
}
|
||||
|
||||
void params_ref::display_smt2(std::ostream& out, char const* module, param_descrs& descrs) const {
|
||||
if (m_params)
|
||||
m_params->display_smt2(out, module, descrs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void params_ref::display(std::ostream & out, char const * k) const {
|
||||
display(out, symbol(k));
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ public:
|
|||
void set_sym(char const * k, symbol const & v);
|
||||
|
||||
void display(std::ostream & out) const;
|
||||
void display_smt2(std::ostream& out, char const* module, param_descrs& module_desc) const;
|
||||
|
||||
void validate(param_descrs const & p) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue