mirror of
https://github.com/Z3Prover/z3
synced 2025-06-19 12:23:38 +00:00
move to abstract symbols
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
78a1736bd2
commit
541658fe02
16 changed files with 117 additions and 93 deletions
|
@ -76,8 +76,8 @@ inline Z3_func_decl of_func_decl(func_decl* f) { return reinterpret_cast<Z3_func
|
|||
|
||||
inline func_decl * const * to_func_decls(Z3_func_decl const* f) { return reinterpret_cast<func_decl*const*>(f); }
|
||||
|
||||
inline symbol to_symbol(Z3_symbol s) { return symbol::mk_symbol_from_c_ptr(reinterpret_cast<void*>(s)); }
|
||||
inline Z3_symbol of_symbol(symbol s) { return reinterpret_cast<Z3_symbol>(const_cast<void*>(s.c_ptr())); }
|
||||
inline symbol to_symbol(Z3_symbol s) { return symbol::c_api_ext2symbol(s); }
|
||||
inline Z3_symbol of_symbol(symbol s) { return static_cast<Z3_symbol>(s.c_api_symbol2ext()); }
|
||||
|
||||
inline Z3_pattern of_pattern(ast* a) { return reinterpret_cast<Z3_pattern>(a); }
|
||||
inline app* to_pattern(Z3_pattern p) { return reinterpret_cast<app*>(p); }
|
||||
|
|
|
@ -28,8 +28,8 @@ static void __declspec(noinline) U(uint64_t u) { *g_z3_log << "U " << u << "\n
|
|||
static void __declspec(noinline) D(double d) { *g_z3_log << "D " << d << "\n"; g_z3_log->flush(); }
|
||||
static void __declspec(noinline) S(Z3_string str) { *g_z3_log << "S \"" << ll_escaped(str) << "\"\n"; g_z3_log->flush(); }
|
||||
static void __declspec(noinline) Sy(Z3_symbol sym) {
|
||||
symbol s = symbol::mk_symbol_from_c_ptr(reinterpret_cast<void *>(sym));
|
||||
if (s == symbol::null) {
|
||||
symbol s = symbol::c_api_ext2symbol(sym);
|
||||
if (s.is_null()) {
|
||||
*g_z3_log << "N\n";
|
||||
}
|
||||
else if (s.is_numerical()) {
|
||||
|
|
|
@ -90,12 +90,14 @@ struct z3_replayer::imp {
|
|||
uint64_t m_uint;
|
||||
double m_double;
|
||||
char const * m_str;
|
||||
void const* m_sym; // uint64_t
|
||||
void * m_obj;
|
||||
float m_float;
|
||||
};
|
||||
value():m_kind(OBJECT), m_int(0) {}
|
||||
value(void * obj):m_kind(OBJECT), m_obj(obj) {}
|
||||
value(value_kind k, char const * str):m_kind(k), m_str(str) {}
|
||||
value(value_kind k, symbol const& s):m_kind(k), m_sym(s.c_api_symbol2ext()) {}
|
||||
value(value_kind k, uint64_t u):m_kind(k), m_uint(u) {}
|
||||
value(value_kind k, int64_t i):m_kind(k), m_int(i) {}
|
||||
value(value_kind k, double d):m_kind(k), m_double(d) {}
|
||||
|
@ -135,7 +137,7 @@ struct z3_replayer::imp {
|
|||
out << v.m_str;
|
||||
break;
|
||||
case SYMBOL:
|
||||
out << symbol::mk_symbol_from_c_ptr(v.m_str);
|
||||
out << symbol::c_api_ext2symbol(v.m_sym);
|
||||
break;
|
||||
case OBJECT:
|
||||
out << v.m_obj;
|
||||
|
@ -455,13 +457,13 @@ struct z3_replayer::imp {
|
|||
// push null symbol
|
||||
next();
|
||||
TRACE("z3_replayer", tout << "[" << m_line << "] " << "N\n";);
|
||||
m_args.push_back(value(SYMBOL, static_cast<char const *>(nullptr)));
|
||||
m_args.push_back(value(SYMBOL, symbol::null));
|
||||
break;
|
||||
case '$': {
|
||||
// push symbol
|
||||
next(); skip_blank(); read_quoted_symbol();
|
||||
TRACE("z3_replayer", tout << "[" << m_line << "] " << "$ " << m_id << "\n";);
|
||||
m_args.push_back(value(SYMBOL, m_id.bare_str()));
|
||||
m_args.push_back(value(SYMBOL, m_id));
|
||||
break;
|
||||
}
|
||||
case '#': {
|
||||
|
@ -469,7 +471,7 @@ struct z3_replayer::imp {
|
|||
next(); skip_blank(); read_uint64();
|
||||
TRACE("z3_replayer", tout << "[" << m_line << "] " << "# " << m_uint64 << "\n";);
|
||||
symbol sym(static_cast<unsigned>(m_uint64));
|
||||
m_args.push_back(value(SYMBOL, static_cast<char const *>(sym.c_ptr())));
|
||||
m_args.push_back(value(SYMBOL, sym));
|
||||
break;
|
||||
}
|
||||
case 'I':
|
||||
|
@ -615,7 +617,7 @@ struct z3_replayer::imp {
|
|||
|
||||
Z3_symbol get_symbol(unsigned pos) const {
|
||||
check_arg(pos, SYMBOL);
|
||||
return reinterpret_cast<Z3_symbol>(const_cast<char*>(m_args[pos].m_str));
|
||||
return (Z3_symbol)m_args[pos].m_sym;
|
||||
}
|
||||
|
||||
void * get_obj(unsigned pos) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue