Limitations
Note: The following limitations apply to the current version of ESBMC-Python. Many are actively being addressed. Check the issue tracker for the latest status.
Control Flow and Loops
- Only
forloops using therange()function are supported; direct iteration over lists (for x in my_list:) is not — use index-based access withrange(len(my_list))instead. - Iteration over dictionaries via
d.keys(),d.values(), andd.items()is supported (see Supported Features — Dictionaries).
Lists and Strings
- String slicing does not support a step value (e.g.,
s[::2]is not supported). any()currently supports only list literals as arguments; other iterable types are not supported.
Dictionaries
- Supported operations are: literals, subscript access/assignment,
del,in/not in, equality, iteration overkeys()/values()/items(),update(),get(),setdefault(),pop(), andpopitem(). Other methods (e.g.,copy()) are not yet implemented.
Tuples
- Tuple indexing requires constant indices; variable indices (e.g.,
t[i]whereiis a variable) are not supported. - Tuple iteration (
for item in my_tuple:) is not yet supported. - Tuple methods
.count()and.index()are not yet supported. - Tuple concatenation (
+) and repetition (*) are not yet supported. - Tuple slicing is not yet supported.
Built-in Functions
min()andmax()support only two arguments; iterables and thekey/defaultparameters are not handled.input()is modelled as a nondeterministic string with a maximum length of 256 characters (under-approximation).print()evaluates all arguments for side effects but does not produce actual output during verification.enumerate()supports standard usage patterns but may have limitations with complex nested iterables or advanced parameter combinations.
Lambda Expressions
- Return type inference is naive and defaults to
double. - Higher-order and nested lambda expressions are not supported.
- Parameter types are assumed to be
doublefor simplicity.
F-Strings
- Complex expressions inside f-strings may have limited support.
- Only basic integer (
:d,:i) and float (:.Nf) format specs are supported; advanced format specs (e.g., string alignment:>10,:<5) are not. - Nested f-strings are not supported.
- Custom format specifications for user-defined types are not supported.
Union and Any Types
- Union types are resolved to the widest type among their members (
float > int > bool) at verification time; true union semantics are not maintained. - Union types containing types beyond basic primitives (
int,float,bool) may default to pointer types. - Type narrowing based on runtime type checks within Union-typed functions is not tracked.
Anytype inference only supports primitive return types (int,float,bool) and expressions evaluating to those types; string return values are not supported and will produce an error.- Other return types (
objects,arrays,null) are not supported forAny-typed functions; inference defaults todoublewhen no type can be determined.
Regular Expressions (re module)
- Only
re.match(),re.search(), andre.fullmatch()are supported. - Match objects do not expose group-capture methods (
.group(),.groups(),.span()). - Complex patterns beyond the explicitly supported constructs exhibit nondeterministic behavior.
- Not supported: lookahead/lookbehind assertions, backreferences, named groups, conditional patterns, Unicode property escapes.
Random Module
random.randrange()with a single argument (e.g.,randrange(10)) is not supported; two arguments are required.- Other
randomfunctions (choice,shuffle,sample,seed, etc.) are not yet supported.
Exception Handling
- Core built-in exception types are supported, but not all Python standard library exceptions; custom exception hierarchies with complex inheritance patterns may not be fully handled.
Class Attributes
- Type inference for class attributes requires values with clear, determinable types; complex expressions may require explicit type annotations.
Missing Return Detection
- Does not analyze return statements inside lambda expressions within the main function body.
Module System
- Built-in variable support is limited to
__name__;__file__,__doc__,__package__, and other built-ins are not yet supported.