|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
#include <python-frontend/json_utils.h>#include <python-frontend/python_converter.h>#include <filesystem>#include <python-frontend/symbol_id.h>#include <util/arith/arith_tools.h>#include <util/message/message.h>#include <algorithm>#include <functional>#include <optional>#include <regex>#include <set>#include <utility>Typedefs | |
| using | scope_bindings = python_converter::scope_bindings |
Functions | |
| static std::pair< std::string, std::string > | from_import_binding (const nlohmann::json &ast, const std::string &bound) |
Module file and the name that module defines, for the top-level from <module> import <bound> binding bound; an empty path when none does. | |
| static std::string | base_class_name (const nlohmann::json &base_class_node) |
| Class name a bases entry denotes. | |
| static bool | alias_binds_name (const nlohmann::json &alias, const std::string &name) |
Whether import alias alias binds name: import a.b binds a, and from m import * may bind any name. | |
| static bool | binds_by_name (const nlohmann::json &node, const std::string &type, const std::string &name, bool any_scope) |
Whether node of type type names name as what it binds: an import alias, a parameter, or a def or class statement. | |
| static bool | may_bind_name (const nlohmann::json &node, const std::string &name, bool any_scope) |
Whether node, a statement or part of one, may bind name. | |
| static bool | may_bind_within (const nlohmann::json &node, const std::string &type, const std::string &name, bool any_scope) |
Whether anything node of type type holds may bind name, reading a node that binds by itself rather than through a child. | |
| static bool | names_contain (const nlohmann::json &names, const std::string &name) |
| static bool | record_declaration (const nlohmann::json &node, const std::string &type, const std::string &name, scope_bindings &found) |
Records an import of name, or a declaration handing it to an outer scope. | |
| static void | collect_scope_bindings (const nlohmann::json &node, const std::string &name, scope_bindings &found) |
Records how node binds name in its own scope. | |
| static bool | declares_global (const nlohmann::json &node, const std::string &name) |
| static std::runtime_error | undecided_module_binding (const std::string &name, const nlohmann::json &use) |
| static std::pair< int, int > | source_position (const nlohmann::json &node, bool end) |
| static bool | deferred_at (const nlohmann::json &node, std::pair< int, int > at) |
Whether the code at at, under node, runs only when something defined there is called or iterated, which need not follow the statements before it. | |
| static bool | module_level_binding_is_import (const nlohmann::json &body, const std::string &name, const nlohmann::json &use) |
At module level, with every binding of name a plain top-level statement and use run in order, the last binding to complete before use is the one it reads. | |
| static std::optional< bool > | function_binding_is_import (const nlohmann::json &function, const std::string &name, const nlohmann::json &use) |
How function binds name: by an import alone (true), as a parameter or another local (false), or not at all (empty). | |
| static void | collect_class_nodes (const nlohmann::json &node, std::vector< const nlohmann::json * > &classes) |
| static bool | names_attribute_hook (const nlohmann::json &node) |
Whether node names a hook (setattr, dict, ...) that can reach any attribute. | |
| static bool | may_store (const nlohmann::json &node) |
Whether node is not known to be only read. | |
| static const nlohmann::json * | attribute_store_target (const nlohmann::json &node, const std::string &type) |
| The attribute an assignment statement stores a value into, or null. | |
| static std::string | import_lookup_name (const std::string &id, const ::symbol_id &parsed) |
The name id asks for, as an import would spell it. | |
| static std::optional< std::string > | imported_module_name (const nlohmann::json &obj, const std::string &lookup_name) |
|
static |
Whether import alias alias binds name: import a.b binds a, and from m import * may bind any name.
|
static |
The attribute an assignment statement stores a value into, or null.
|
static |
Class name a bases entry denotes.
A qualified base (module.Class) parses as an Attribute carrying attr instead of id – reading id unconditionally aborted on any model-provided base such as unittest.TestCase (#6745). The symbol id uses the bare name either way.
|
static |
Whether node of type type names name as what it binds: an import alias, a parameter, or a def or class statement.
|
static |
|
static |
Records how node binds name in its own scope.
Function, class, lambda and comprehension bodies are scopes of their own and are not entered.
|
static |
|
static |
Whether the code at at, under node, runs only when something defined there is called or iterated, which need not follow the statements before it.
|
static |
Module file and the name that module defines, for the top-level from <module> import <bound> binding bound; an empty path when none does.
A bare from m import B leaves only the class name at the use site, so the module cannot be read off the base expression the way m.B spells it (#6745). Python binds the last import of a name, so later statements win, and an as alias hides the name the module really defines.
|
static |
How function binds name: by an import alone (true), as a parameter or another local (false), or not at all (empty).
|
static |
The name id asks for, as an import would spell it.
from_string parses the @C@/@F@ markers but not the trailing segment; when an id carries one, that segment is the name and the class/function are only its scope. Reading the function instead made every name used inside def acos() resolve to math.acos from an unrelated import math (#6895).
|
static |
|
static |
Whether node, a statement or part of one, may bind name.
Bindings in nested function and class bodies count only with any_scope, which a call site needs: it sees the scope it stands in as well as the module's.
|
static |
Whether anything node of type type holds may bind name, reading a node that binds by itself rather than through a child.
|
static |
Whether node is not known to be only read.
|
static |
At module level, with every binding of name a plain top-level statement and use run in order, the last binding to complete before use is the one it reads.
Whether that is an import; throws otherwise.
|
static |
Whether node names a hook (setattr, dict, ...) that can reach any attribute.
|
static |
|
static |
Records an import of name, or a declaration handing it to an outer scope.
Whether node is such a statement.
|
static |
|
static |