mirror of
https://github.com/Z3Prover/z3
synced 2025-07-20 11:22:04 +00:00
rewrites for characters
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
f20db3e644
commit
004139b320
3 changed files with 48 additions and 1 deletions
|
@ -532,7 +532,12 @@ func_decl* seq_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters, p
|
|||
case _OP_STRING_FROM_CHAR: {
|
||||
if (!(num_parameters == 1 && parameters[0].is_int()))
|
||||
m.raise_exception("character literal expects integer parameter");
|
||||
zstring zs(parameters[0].get_int());
|
||||
int i = parameters[0].get_int();
|
||||
if (i < 0)
|
||||
m.raise_exception("character literal expects a non-negative integer parameter");
|
||||
if (i > (int)m_char_plugin->max_char())
|
||||
m.raise_exception("character literal is out of bounds");
|
||||
zstring zs(i);
|
||||
parameter p(zs);
|
||||
return m.mk_const_decl(m_stringc_sym, m_string,func_decl_info(m_family_id, OP_STRING_CONST, 1, &p));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue