Skip to content

Commit 8089c08

Browse files
committed
Enable and use the automatic limit for array-as-uninterpreted-function
Previously, the command line permitted setting uninterpreted functions to "never" or "always", where "never" actually was the default. The "automatic" mode could not be enabled in any way. Furthermore the limit should apply across all dimensions of an array, not just the top-level size. Fixes: #2018
1 parent fa9e204 commit 8089c08

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/solvers/flattening/boolbv.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -638,14 +638,12 @@ bool boolbvt::is_unbounded_array(const typet &type) const
638638
if(unbounded_array==unbounded_arrayt::U_ALL)
639639
return true;
640640

641-
const exprt &size=to_array_type(type).size();
642-
643-
const auto s = numeric_cast<mp_integer>(size);
644-
if(!s.has_value())
641+
const std::size_t size = boolbv_width(type);
642+
if(size == 0)
645643
return true;
646644

647645
if(unbounded_array==unbounded_arrayt::U_AUTO)
648-
if(*s > MAX_FLATTENED_ARRAY_SIZE)
646+
if(size > MAX_FLATTENED_ARRAY_SIZE)
649647
return true;
650648

651649
return false;

src/solvers/flattening/boolbv.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class boolbvt:public arrayst
3838
propt &_prop,
3939
message_handlert &message_handler)
4040
: arrayst(_ns, _prop, message_handler),
41-
unbounded_array(unbounded_arrayt::U_NONE),
41+
unbounded_array(unbounded_arrayt::U_AUTO),
4242
boolbv_width(_ns),
4343
bv_utils(_prop),
4444
functions(*this),

0 commit comments

Comments
 (0)