Skip to content

Commit

Permalink
throw exceptions where sls lacks support
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <[email protected]>
  • Loading branch information
NikolajBjorner committed Jan 15, 2025
1 parent 5fec07a commit 498c9a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
18 changes: 10 additions & 8 deletions src/ast/sls/sls_arith_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ namespace sls {
val = abs(value(vx));
break;
default:
throw default_exception("unsupported for sls " + mk_pp(e, m));
NOT_IMPLEMENTED_YET();
break;
}
Expand Down Expand Up @@ -999,11 +1000,11 @@ namespace sls {
}
else if (is_distinct(e)) {
verbose_stream() << "distinct " << mk_pp(e, m) << "\n";
throw default_exception("unsupported for sls " + mk_pp(e, m));
}
else if (a.is_is_int(e, x))
{
NOT_IMPLEMENTED_YET();
}
else if (a.is_is_int(e, x))
throw default_exception("unsupported for sls " + mk_pp(e, m));

#if 0
else if (a.is_idivides(e, x, y))
NOT_IMPLEMENTED_YET();
Expand Down Expand Up @@ -2278,7 +2279,7 @@ namespace sls {
}
case arith_op_kind::OP_POWER: {
//auto od = m_ops[vi.m_def_idx];
NOT_IMPLEMENTED_YET();
throw default_exception("unsupported " + mk_pp(vi.m_expr, m));
break;
}
case arith_op_kind::OP_IDIV: {
Expand All @@ -2294,13 +2295,13 @@ namespace sls {
return value(v) == abs(value(od.m_arg1));
}
case arith_op_kind::OP_TO_INT: {
throw default_exception("unsupported " + mk_pp(vi.m_expr, m));
// auto od = m_ops[vi.m_def_idx];
NOT_IMPLEMENTED_YET();
break;
}
case arith_op_kind::OP_TO_REAL: {
throw default_exception("unsupported " + mk_pp(vi.m_expr, m));
// auto od = m_ops[vi.m_def_idx];
NOT_IMPLEMENTED_YET();
break;
}
default: {
Expand Down Expand Up @@ -2973,6 +2974,7 @@ namespace sls {
case arith_move_type::random_update: out << "random-update"; break;
case arith_move_type::hillclimb: out << "hillclimb"; break;
case arith_move_type::random_inc_dec: out << "random-inc-dec"; break;
case arith_move_type::hillclimb_plateau: out << "hillclimb-plateau"; break;
}
return out;
}
Expand Down Expand Up @@ -3190,7 +3192,7 @@ namespace sls {

template<typename num_t>
void arith_base<num_t>::start_propagation() {
updt_params();
updt_params();
if (m_config.arith_use_lookahead)
global_search();
}
Expand Down
6 changes: 4 additions & 2 deletions src/ast/sls/sls_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ namespace sls {
register_plugin(alloc(datatype_plugin, *this));
else if (fid == seq_util(m).get_family_id())
register_plugin(alloc(seq_plugin, *this));
else
else {
verbose_stream() << "did not find plugin for " << fid << "\n";
throw default_exception("no plugin for family id " + m.get_family_name(fid).str());
}
}

scoped_ptr<euf::egraph>& context::egraph() {
Expand Down Expand Up @@ -241,7 +243,7 @@ namespace sls {

family_id context::get_fid(expr* e) const {
if (!is_app(e))
return user_sort_family_id;
throw default_exception("no plugin for " + mk_pp(e, m));
family_id fid = to_app(e)->get_family_id();
if (m.is_eq(e))
fid = to_app(e)->get_arg(0)->get_sort()->get_family_id();
Expand Down

0 comments on commit 498c9a6

Please sign in to comment.