3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00
This commit is contained in:
Nikolaj Bjorner 2022-02-09 12:08:36 +02:00
parent 4f6fcf8ea7
commit 07d02ea415
2 changed files with 7 additions and 10 deletions

View file

@ -33,11 +33,9 @@ func_decl * pb_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters, p
unsigned arity, sort * const * domain, sort * range) {
SASSERT(m_manager);
ast_manager& m = *m_manager;
for (unsigned i = 0; i < arity; ++i) {
if (!m.is_bool(domain[i])) {
for (unsigned i = 0; i < arity; ++i)
if (!m.is_bool(domain[i]))
m.raise_exception("invalid non-Boolean sort applied to 'at-most'");
}
}
symbol sym;
switch(k) {
case OP_AT_LEAST_K: sym = m_at_least_sym; break;
@ -50,9 +48,8 @@ func_decl * pb_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters, p
switch(k) {
case OP_AT_LEAST_K:
case OP_AT_MOST_K: {
if (num_parameters != 1 || !parameters[0].is_int() || parameters[0].get_int() < 0) {
if (num_parameters != 1 || !parameters[0].is_int() || parameters[0].get_int() < 0)
m.raise_exception("function expects one non-negative integer parameter");
}
func_decl_info info(m_family_id, k, 1, parameters);
return m.mk_func_decl(sym, arity, domain, m.mk_bool_sort(), info);
}