ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
preprocessor.check_type_lowering Namespace Reference

Classes

class  _Lowering
class  _CallSites

Functions

 _bound_names (node)
 _unsupported (node, module_name, detail)
 _parse (filename)
 _class_in (scope, path)
 _scope_nodes (body)
 _imports (module)
 _is_ellipsis (node)
 lower_check_type (module, module_name)

Variables

str _MODULE = "_sv_verifier"
tuple _FUNCTIONS = ("check_type", "_matches_type")
tuple _ITERABLES = ("list", "set")

Detailed Description

Model `check_type(value, hint)` of the `_sv_verifier` module (#8281).

The module's own `check_type` matches the hint by reflection (`typing.get_origin`,
`get_args`, `collections.abc`), which the converter cannot model. Its meaning
is fixed, so each call is replaced by the test it makes for its hint, and the
module's bodies of `check_type` and `_matches_type` are never converted, as
the converter already does for the module's `nondet_*` functions.

Function Documentation

◆ _bound_names()

preprocessor.check_type_lowering._bound_names ( node)
protected
Names `node` binds in its scope.

◆ _class_in()

preprocessor.check_type_lowering._class_in ( scope,
path )
protected
Whether `path` names a class of the module `scope` through class
statements, each the only binding of its name in its scope.

◆ _imports()

preprocessor.check_type_lowering._imports ( module)
protected
The dotted origin of each name an absolute import binds, and the
modules imported with `*`.

◆ _is_ellipsis()

preprocessor.check_type_lowering._is_ellipsis ( node)
protected

◆ _parse()

preprocessor.check_type_lowering._parse ( filename)
protected

◆ _scope_nodes()

preprocessor.check_type_lowering._scope_nodes ( body)
protected
The nodes of `body` that belong to its scope, and the defining nodes of
the functions and classes it contains, but nothing inside them.

◆ _unsupported()

preprocessor.check_type_lowering._unsupported ( node,
module_name,
detail )
protected

◆ lower_check_type()

preprocessor.check_type_lowering.lower_check_type ( module,
module_name )
Replace each call of `_sv_verifier.check_type` with its test, and drop
`check_type` and `_matches_type` from `_sv_verifier` itself. A stub left
in their place would be taken for a user's function of the same name.

Variable Documentation

◆ _FUNCTIONS

tuple preprocessor.check_type_lowering._FUNCTIONS = ("check_type", "_matches_type")
protected

◆ _ITERABLES

tuple preprocessor.check_type_lowering._ITERABLES = ("list", "set")
protected

◆ _MODULE

str preprocessor.check_type_lowering._MODULE = "_sv_verifier"
protected