Skip to content

Commit 72c89e1

Browse files
fix #7952 - make auto-selector detect large bit-vectors so it does't use the datalog engine for hopelessly large tables
Signed-off-by: Nikolaj Bjorner <[email protected]>
1 parent 0881a71 commit 72c89e1

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/muz/base/dl_context.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,10 +776,26 @@ namespace datalog {
776776
array_util ar;
777777
DL_ENGINE m_engine_type;
778778

779-
bool is_large_bv(sort* s) {
779+
bool is_large_bv(expr *e) {
780+
sort *s = e->get_sort();
781+
if (bv.is_bv_sort(s)) {
782+
unsigned sz = bv.get_bv_size(s);
783+
if (sz > 24)
784+
return true;
785+
}
786+
if (is_app(e)) {
787+
unsigned sz = 0;
788+
for (auto arg : *to_app(e)) {
789+
if (bv.is_bv(arg))
790+
sz += bv.get_bv_size(arg->get_sort());
791+
}
792+
if (sz > 24)
793+
return true;
794+
}
780795
return false;
781796
}
782797

798+
783799
public:
784800
engine_type_proc(ast_manager& m): m(m), a(m), dt(m), bv(m), ar(m), m_engine_type(DATALOG_ENGINE) {}
785801

@@ -795,7 +811,7 @@ namespace datalog {
795811
else if (dt.is_datatype(e->get_sort())) {
796812
m_engine_type = SPACER_ENGINE;
797813
}
798-
else if (is_large_bv(e->get_sort())) {
814+
else if (is_large_bv(e)) {
799815
m_engine_type = SPACER_ENGINE;
800816
}
801817
else if (!e->get_sort()->get_num_elements().is_finite()) {

0 commit comments

Comments
 (0)