|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
Classes | |
| class | _Analysis |
| class | _Rewriter |
Functions | |
| _own_scope_nodes (node) | |
| _target_names (target) | |
| _binding_targets (stmt) | |
| _bound_ids (stmt) | |
| _untracked_names (node) | |
| _candidates (func) | |
| _unconditional_reads (expr, out) | |
| _head_exprs (stmt) | |
| _meet (states) | |
| _flag_assign (name, value) | |
| _local_error (name) | |
| _global_error (name) | |
| _guard (name, error) | |
| _located (new_nodes, anchor) | |
| _guard_function (func) | |
| _module_candidates (module) | |
| _names_bound_elsewhere (module) | |
| _guard_module (module) | |
| guard_unbound_locals (module) | |
Variables | |
| tuple | _NESTED_SCOPES |
| str | _FLAG_PREFIX = "__ESBMC_bound_" |
Raise UnboundLocalError where a function reads a local it may not have bound. A function-local read is checked against a definite-assignment analysis. A name some read may reach unbound gets a flag, set at each of its bindings and tested before that read. A name is left alone when the analysis cannot see all of its bindings (walrus, except-as, del, import, nested def, match capture, global/nonlocal) or when a nested scope references it. Module-level code gets the same check, raising NameError, for a name bound only by module-level defs, such as a call placed above the def of its function.
|
protected |
Return the targets a statement binds by a form the analysis tracks.
|
protected |
Return the names a statement binds (an AnnAssign without value binds none).
|
protected |
Return the locals whose every binding the analysis tracks.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Return the expressions a statement evaluates on reaching it.
|
protected |
|
protected |
|
protected |
Intersect the reachable states; None when none is reachable.
|
protected |
Return the globals bound only by module-level defs the analysis sees.
|
protected |
Return the globals a nested scope may bind, or None if any name may be.
|
protected |
Yield the nodes of a function body, not descending into nested scopes.
|
protected |
Return the Name nodes an assignment target binds.
|
protected |
Collect the names an expression always reads when it is evaluated.
|
protected |
Return the names a node binds, or hides, in a way the analysis does not see.
| preprocessor.unbound_locals.guard_unbound_locals | ( | module | ) |
Make every function in `module` raise UnboundLocalError on an unbound read, and its module-level code raise NameError on a read of a def not yet run.
|
protected |
|
protected |