|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
Classes | |
| class | ModuleImportInfo |
| class | ResolverCallbacks |
| class | _SubmoduleImportSplitter |
Functions | |
| None | reset_state () |
| None | _resolver_error (str detail) |
| None | _resolver_warning (str detail) |
| str | _node_location (ast.AST node) |
| None | _mark_import_resolution (ast.AST node, bool ok, str|None full_path=None, str|None reason=None) |
| bool | _has_model_file (str module_name, str output_dir) |
| None | _warn_unmodelled_module (str module_name) |
| None | _warn_module_file_not_found (str module_name) |
| None | _warn_resolution_failure (str module_name, ast.AST node, str reason) |
| bool | _is_imported_model (str module_name) |
| bool | is_imported_model (str module_name) |
| bool | _is_unsupported_module (str module_name) |
| bool | _is_testing_framework (str module_name) |
| str | _base_module_name (str module_name) |
| bool | _is_standard_library_file (str filename) |
| str|None | _normalize_existing_path (str|None path) |
| str|None | _module_filename (ModuleType|str|None module) |
| ModuleType|str|None | import_module_by_name (str module_name, str output_dir) |
| tuple[list[str], list[ast.alias]|None] | _collect_import_targets (ast.Import|ast.ImportFrom node) |
| None | process_imports (ast.Import|ast.ImportFrom node, str output_dir) |
| list[str] | _bound_names (ast.AST node) |
| dict[str, object] | _unmodelled_import_bindings (list[ast.stmt] stmts) |
| None | _mark_unmodelled_classes (ast.Module tree) |
| list[tuple[ast.expr, ast.expr]] | _param_annotations (list[ast.stmt] stmts) |
| bool | _has_star_import (list[ast.stmt] stmts) |
| bool | _can_create_class (str name, list bases) |
| bool | _is_submodule_import (str package_name, str name) |
| tuple[str, str]|None | _reexport_origin (str module_name, str name) |
| dict[ast.alias, ast.stmt] | _reexport_imports (ast.ImportFrom node) |
| None | split_submodule_imports (ast.AST tree) |
| str|None | resolve_module_file (str module_qualname, str output_dir) |
| list[str] | _extract_module_names (ast.Import|ast.ImportFrom node) |
| tuple[str,...]|None | _find_cycle_from (dict[str, set[str]] graph, str start) |
| None | _warn_if_cycle (dict[str, set[str]] import_graph, str module_name) |
| ast.AST | filter_imports (ast.AST tree) |
| None | ensure_default_helper_imports (ast.AST tree) |
| None | process_collected_imports (str output_dir, ResolverCallbacks callbacks, ast.Module|None entry_tree=None) |
| None | _request_vararg_specializations (ast.Module entry_tree, ParsedTreeState parsed_trees) |
| tuple[set, set, set] | _imports_of (ast.AST tree, str module_name) |
| str|None | _called_name (ast.AST node, set module_names, set from_names) |
| tuple[dict, set] | _references_into (ast.AST tree, str module_name) |
| None | _request_type_specializations (ast.Module entry_tree, ParsedTreeState parsed_trees) |
| None | _adopt_type_specializations (ast.Module entry_tree, ParsedTreeState parsed_trees) |
| None | _finalize_parsed_trees (ParsedTreeState parsed_trees, ast.Module|None entry_tree) |
| None | _finalize_after_imports (str module_name, ParsedTreeState parsed_trees, set[str] started, set[str] done) |
| None | _qualify_imported_nested_classes (ParsedTreeState parsed_trees, ast.Module|None entry_tree) |
| None | _separate_colliding_classes (ast.Module entry_tree, ParsedTreeState parsed_trees) |
| None | _emit_collected_import_json (ParsedTreeState parsed_trees, str output_dir, ResolverCallbacks callbacks) |
| None | rewrite_relative_import (ast.ImportFrom node, str|None parent_module) |
| None | _emit_submodule_asts (str module_dir, str base_module, str output_dir, GenerateAstJsonFn generate_ast_json_fn) |
| None | detect_and_process_submodules (ast.AST node, set[str] processed_submodules, str output_dir, GenerateAstJsonFn generate_ast_json_fn) |
| None | emit_module_json (str module_qualname, str output_dir, GenerateAstJsonFn generate_ast_json_fn, ParseFileCanonicalisedFn parse_file_canonicalised_fn) |
Variables | |
| list | imported_signature_sources = [] |
| dict | default_helper_exports = {} |
Import resolution helpers for python-frontend parser orchestration.
|
protected |
Import the copies an imported module made in place of a def the entry module called, now that the calls name them.
|
protected |
|
protected |
|
protected |
The name of the module a call, or a bare reference, reaches.
|
protected |
Whether CPython can create class `name` over `bases`.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Finalize a module after the modules it imports names from. It then adopts their signatures, as the entry module does, so a call it makes into them is bound too: defaults filled, extra arguments a TypeError. A module in an import cycle adopts only from those already finalized.
|
protected |
|
protected |
|
protected |
Whether a model stands in for this exact module. The dotted name matters: `_emit_model_jsons` emits one JSON per `models/*.py`, so a model for `string` says nothing about `string.templatelib`, which the converter would then look for in vain.
|
protected |
|
protected |
The names `tree` binds the module to, the names it imports from the
module, and those it imports in a way that hides their uses ("*" for a
star import).
|
protected |
|
protected |
|
protected |
Whether `from package_name import name` binds the submodule `package_name.name`.
|
protected |
|
protected |
|
protected |
|
protected |
Mark each class base, and each parameter annotation of a top-level function or method, that CPython resolves to a class of a module with no model. The converter has no such class to derive from and skips it (#9161), which is sound only once CPython would create the class: it evaluates the bases when the definition runs.
|
protected |
|
protected |
|
protected |
|
protected |
Each parameter annotation of a function in `stmts` spelled as a name, with the expression it spells. A string annotation is never evaluated.
|
protected |
|
protected |
Map each name `node` takes from a module that re-exports it to an import from its origin.
|
protected |
The (module, name) that `module_name` binds `name` to with a top-level `from` import. Only the last such import counts, and only when `name` still holds what it imported once the module has run.
|
protected |
The calls `tree` makes to each name of `module_name`, and the names
whose other uses it could not see: a name read other than to call it, an
aliased or star import, or the module itself used as a value ("*").
|
protected |
Hand each imported module the calls the entry module makes into it. A parameter that only ever receives builtin classes is read as those classes (#9049), which needs every call in view; the module is finalized before the entry module, so it is told here. Another module's reference to a name, or any use of it that cannot be seen, leaves that name alone.
|
protected |
Hand each imported module the arities the entry module calls its names with. A module builds the fixed-arity copies of a variadic def only for calls it sees, and it is finalized before the entry module.
|
protected |
|
protected |
|
protected |
|
protected |
The object each import in `stmts` of a module with no model binds.
|
protected |
|
protected |
Warn unless `_warn_unmodelled_module` already named this module.
|
protected |
|
protected |
| None parser.import_resolver.detect_and_process_submodules | ( | ast.AST | node, |
| set[str] | processed_submodules, | ||
| str | output_dir, | ||
| GenerateAstJsonFn | generate_ast_json_fn ) |
Emit AST JSON for discovered modeled submodules referenced via attributes.
| None parser.import_resolver.emit_module_json | ( | str | module_qualname, |
| str | output_dir, | ||
| GenerateAstJsonFn | generate_ast_json_fn, | ||
| ParseFileCanonicalisedFn | parse_file_canonicalised_fn ) |
Parse and emit JSON for one module resolved by qualified name.
| None parser.import_resolver.ensure_default_helper_imports | ( | ast.AST | tree | ) |
Import the def-time default helpers a filled call site now references. A container default is hoisted to a module-level variable where the function is defined; a call in another module reaches it only if the name is imported alongside the function itself.
| ast.AST parser.import_resolver.filter_imports | ( | ast.AST | tree | ) |
Remove unsupported testing-framework imports from module top level.
| ModuleType | str | None parser.import_resolver.import_module_by_name | ( | str | module_name, |
| str | output_dir ) |
Resolve an import target to a module object or model-file path.
| bool parser.import_resolver.is_imported_model | ( | str | module_name | ) |
Public helper for parser-side checks against the modeled modules set.
| None parser.import_resolver.process_collected_imports | ( | str | output_dir, |
| ResolverCallbacks | callbacks, | ||
| ast.Module | None | entry_tree = None ) |
Emit collected imports after transitive discovery converges. Callback parameters wire parser-owned routines (parse, rewrite propagation, and AST emission) without coupling this module to parser internals.
| None parser.import_resolver.process_imports | ( | ast.Import | ast.ImportFrom | node, |
| str | output_dir ) |
Collect import targets and attach best-effort resolution metadata.
| None parser.import_resolver.reset_state | ( | ) |
Reset resolver global state for a fresh parser run.
| str | None parser.import_resolver.resolve_module_file | ( | str | module_qualname, |
| str | output_dir ) |
Resolve a fully-qualified module name into an emit-able source file.
| None parser.import_resolver.rewrite_relative_import | ( | ast.ImportFrom | node, |
| str | None | parent_module ) |
Rewrite relative imports to absolute module names for resolver passes.
| None parser.import_resolver.split_submodule_imports | ( | ast.AST | tree | ) |
Bind each submodule named by a `from pkg import ...` through `import pkg.mod as mod`.
| dict parser.import_resolver.default_helper_exports = {} |
| list parser.import_resolver.imported_signature_sources = [] |