3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-04 06:15:46 +00:00

fixed more problems in the new param framework

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-12-03 15:02:34 -08:00
parent d634c945bf
commit 6d7d205e13
30 changed files with 185 additions and 168 deletions

View file

@ -38,22 +38,6 @@ Notes:
#include"model_evaluator.h"
#include"for_each_expr.h"
std::string smt2_keyword_to_param(symbol const & opt) {
std::string r;
SASSERT(opt.bare_str()[0] == ':');
r = opt.bare_str() + 1;
unsigned sz = static_cast<unsigned>(r.size());
for (unsigned i = 0; i < sz; i++) {
char curr = r[i];
if ('A' <= curr && curr <= 'Z')
r[i] = curr - 'A' + 'a';
else if (curr == '-')
r[i] = '_';
}
TRACE("smt2_keyword_to_param", tout << opt << " -> '" << r << "'\n";);
return r;
}
func_decls::func_decls(ast_manager & m, func_decl * f):
m_decls(TAG(func_decl*, f, 0)) {
m.inc_ref(f);

View file

@ -38,11 +38,6 @@ Notes:
#include"scoped_ptr_vector.h"
#include"context_params.h"
/**
\brief Auxiliary function for converting SMT2 keywords into Z3 internal parameter names.
*/
std::string smt2_keyword_to_param(symbol const & k);
class func_decls {
func_decl * m_decls;
public:

View file

@ -38,7 +38,7 @@ cmd_arg_kind parametric_cmd::next_arg_kind(cmd_context & ctx) const {
void parametric_cmd::set_next_arg(cmd_context & ctx, symbol const & s) {
if (m_last == symbol::null) {
m_last = symbol(smt2_keyword_to_param(s).c_str());
m_last = symbol(norm_param_name(s).c_str());
if (pdescrs(ctx).get_kind(m_last.bare_str()) == CPK_INVALID)
throw cmd_exception("invalid keyword argument");
return;

View file

@ -497,7 +497,7 @@ static tactic * mk_using_params(cmd_context & ctx, sexpr * n) {
throw cmd_exception("invalid using-params combinator, keyword expected", c->get_line(), c->get_pos());
if (i == num_children)
throw cmd_exception("invalid using-params combinator, parameter value expected", c->get_line(), c->get_pos());
symbol param_name = symbol(smt2_keyword_to_param(c->get_symbol()).c_str());
symbol param_name = symbol(norm_param_name(c->get_symbol()).c_str());
c = n->get_child(i);
i++;
switch (descrs.get_kind(param_name)) {