ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
preprocessor.function_value_dispatch._Plan Class Reference

Public Member Functions

 __init__ (self, module, analysis, roots)
 check_uses (self)
 check_param_holders (self)

Public Attributes

 module = module
 parents = _parents(module)
dict functions = {}
list groups = []
dict holders = {}
dict param_holders = {}
 local_fns = set()
 defs = defs
 callable_names = set(self.functions) | set(self.param_holders)
dict kinds = {}
dict values = {}

Protected Member Functions

 _add_holders (self, analysis, root, group, defs)
 _add_param_holder (self, analysis, fn, param, group)
 _collect_bindings (self)
 _bind (self, target, value)
 _kind (self, name, seen)
 _value_kind (self, expr, seen)
 _literal_kind (self, literal, seen)
 _is_element (cls, expr)
 _element_kind (self, expr)
 _nested (self, node)
 _check_use (self, node)
 _is_returned_read (self, node)
 _is_flat (self, fn, name)
 _is_returned_callee (self, top, call, node)
 _enclosing_def (self, node)
 _check_variable (self, var, is_param, group, nodes)
 _check_variable_use (self, use, group, is_param)
 _check_dispatched_arguments (self, call)
 _is_function_value (self, expr, site)
 _variables_at (self, node)
 _check_returned_call (self, use, group)
 _check_store (self, node)
 _check_function_holder (self, node, parent)
 _check_container_holder (self, node, parent)
 _check_element (self, element)
 _check_element_store (self, element, assign)
 _is_membership (self, parent, node)
 _is_update (self, attribute, node)
 _assign_target (self, node)
 _plain_targets (self, assign)
 _plain_target (self, target)
 _check_value (self, expr)
 _is_dispatched_argument (self, parent, expr)
 _is_plain_value (self, parent, expr)
 _check_identity (self, compare)
 _check_value_list (self, literal)
 _is_update_value (self, call, literal)
 _is_code (self, expr)
 _check_site (self, call)
 _check_arguments (self, call, group)
 _site_holder (self, call)
 _check_always_evaluated (self, call)

Static Protected Member Functions

 _is_dict_value (parent, expr)

Detailed Description

Check that every use of the groups' names can be rewritten, and mark them.

Constructor & Destructor Documentation

◆ __init__()

preprocessor.function_value_dispatch._Plan.__init__ ( self,
module,
analysis,
roots )

Member Function Documentation

◆ _add_holders()

preprocessor.function_value_dispatch._Plan._add_holders ( self,
analysis,
root,
group,
defs )
protected
Record the module names and parameters in `root`'s group; refuse any other value.

◆ _add_param_holder()

preprocessor.function_value_dispatch._Plan._add_param_holder ( self,
analysis,
fn,
param,
group )
protected
Record a parameter or local of a module-level def, which the def may dispatch on.

◆ _assign_target()

preprocessor.function_value_dispatch._Plan._assign_target ( self,
node )
protected
Whether `node` is bound by an assignment whose value for it can be read off.

◆ _bind()

preprocessor.function_value_dispatch._Plan._bind ( self,
target,
value )
protected

◆ _check_always_evaluated()

preprocessor.function_value_dispatch._Plan._check_always_evaluated ( self,
call )
protected
Only a call evaluated whenever its statement is may be dispatched before it.

◆ _check_arguments()

preprocessor.function_value_dispatch._Plan._check_arguments ( self,
call,
group )
protected
Every function of `group` takes exactly the positional arguments of `call`.

◆ _check_container_holder()

preprocessor.function_value_dispatch._Plan._check_container_holder ( self,
node,
parent )
protected

◆ _check_dispatched_arguments()

preprocessor.function_value_dispatch._Plan._check_dispatched_arguments ( self,
call )
protected
Every parameter of the callee that is dispatched on gets a function positionally.

◆ _check_element()

preprocessor.function_value_dispatch._Plan._check_element ( self,
element )
protected
The outermost element `xs[i]...` is a store target, a callee or a value.

◆ _check_element_store()

preprocessor.function_value_dispatch._Plan._check_element_store ( self,
element,
assign )
protected
`xs[i] = value` stores a value as deep as the elements of `xs`.

◆ _check_function_holder()

preprocessor.function_value_dispatch._Plan._check_function_holder ( self,
node,
parent )
protected

◆ _check_identity()

preprocessor.function_value_dispatch._Plan._check_identity ( self,
compare )
protected
`compare` tests two codes for identity or equality.

◆ _check_returned_call()

preprocessor.function_value_dispatch._Plan._check_returned_call ( self,
use,
group )
protected
`use` is the callee of a call that is a whole `return`; mark that return.

◆ _check_site()

preprocessor.function_value_dispatch._Plan._check_site ( self,
call )
protected
A call through a holder: every function of its group must take its arguments.

◆ _check_store()

preprocessor.function_value_dispatch._Plan._check_store ( self,
node )
protected

◆ _check_use()

preprocessor.function_value_dispatch._Plan._check_use ( self,
node )
protected

◆ _check_value()

preprocessor.function_value_dispatch._Plan._check_value ( self,
expr )
protected
`expr`, a function or an element, flows only where a code can stand for it.

◆ _check_value_list()

preprocessor.function_value_dispatch._Plan._check_value_list ( self,
literal )
protected

◆ _check_variable()

preprocessor.function_value_dispatch._Plan._check_variable ( self,
var,
is_param,
group,
nodes )
protected

◆ _check_variable_use()

preprocessor.function_value_dispatch._Plan._check_variable_use ( self,
use,
group,
is_param )
protected
A load is a returned call or an argument to dispatch on; a store assigns a function.

◆ _collect_bindings()

preprocessor.function_value_dispatch._Plan._collect_bindings ( self)
protected

◆ _element_kind()

preprocessor.function_value_dispatch._Plan._element_kind ( self,
expr )
protected
How deep the value of the element `expr` nests functions, or None.

◆ _enclosing_def()

preprocessor.function_value_dispatch._Plan._enclosing_def ( self,
node )
protected
The module-level def that contains `node` with no scope in between, or None.

◆ _is_code()

preprocessor.function_value_dispatch._Plan._is_code ( self,
expr )
protected

◆ _is_dict_value()

preprocessor.function_value_dispatch._Plan._is_dict_value ( parent,
expr )
staticprotected

◆ _is_dispatched_argument()

preprocessor.function_value_dispatch._Plan._is_dispatched_argument ( self,
parent,
expr )
protected
Whether `expr` is passed positionally to a parameter that the callee dispatches on.

◆ _is_element()

preprocessor.function_value_dispatch._Plan._is_element ( cls,
expr )
protected
`xs[i]`, possibly nested, with a name or literal index, whose evaluation has no effects.

◆ _is_flat()

preprocessor.function_value_dispatch._Plan._is_flat ( self,
fn,
name )
protected
Whether `fn` has no nested scope and does not bind `name`.

◆ _is_function_value()

preprocessor.function_value_dispatch._Plan._is_function_value ( self,
expr,
site )
protected
Whether `expr`, evaluated at `site`, is a function or a dispatched variable of its def.

◆ _is_membership()

preprocessor.function_value_dispatch._Plan._is_membership ( self,
parent,
node )
protected

◆ _is_plain_value()

preprocessor.function_value_dispatch._Plan._is_plain_value ( self,
parent,
expr )
protected
Whether `expr` is the whole value of an assignment to names.

◆ _is_returned_callee()

preprocessor.function_value_dispatch._Plan._is_returned_callee ( self,
top,
call,
node )
protected

◆ _is_returned_read()

preprocessor.function_value_dispatch._Plan._is_returned_read ( self,
node )
protected
A module holder read in a flat module-level def only as the callee of its `return`.

◆ _is_update()

preprocessor.function_value_dispatch._Plan._is_update ( self,
attribute,
node )
protected
`xs.update(literal)` or `xs.setdefault(key, value)` as a statement, deep as `xs`.

◆ _is_update_value()

preprocessor.function_value_dispatch._Plan._is_update_value ( self,
call,
literal )
protected
Whether `literal` is stored by a call that `_is_update` accepts.

◆ _kind()

preprocessor.function_value_dispatch._Plan._kind ( self,
name,
seen )
protected
How deep `name` nests functions: 0 for a function, 1 for a list or dict of them.

◆ _literal_kind()

preprocessor.function_value_dispatch._Plan._literal_kind ( self,
literal,
seen )
protected

◆ _nested()

preprocessor.function_value_dispatch._Plan._nested ( self,
node )
protected

◆ _plain_target()

preprocessor.function_value_dispatch._Plan._plain_target ( self,
target )
protected

◆ _plain_targets()

preprocessor.function_value_dispatch._Plan._plain_targets ( self,
assign )
protected
Whether every target of `assign` is a name, an element or a tuple of them.

◆ _site_holder()

preprocessor.function_value_dispatch._Plan._site_holder ( self,
call )
protected
The holder `call` goes through, refusing an index another scope may rebind.

◆ _value_kind()

preprocessor.function_value_dispatch._Plan._value_kind ( self,
expr,
seen )
protected

◆ _variables_at()

preprocessor.function_value_dispatch._Plan._variables_at ( self,
node )
protected
The dispatched variables of the module-level def that contains `node`.

◆ check_param_holders()

preprocessor.function_value_dispatch._Plan.check_param_holders ( self)
Each def with a dispatched parameter or local uses it only where it can be a code.

◆ check_uses()

preprocessor.function_value_dispatch._Plan.check_uses ( self)

Member Data Documentation

◆ callable_names

preprocessor.function_value_dispatch._Plan.callable_names = set(self.functions) | set(self.param_holders)

◆ defs

preprocessor.function_value_dispatch._Plan.defs = defs

◆ functions

dict preprocessor.function_value_dispatch._Plan.functions = {}

◆ groups

list preprocessor.function_value_dispatch._Plan.groups = []

◆ holders

dict preprocessor.function_value_dispatch._Plan.holders = {}

◆ kinds

dict preprocessor.function_value_dispatch._Plan.kinds = {}

◆ local_fns

preprocessor.function_value_dispatch._Plan.local_fns = set()

◆ module

preprocessor.function_value_dispatch._Plan.module = module

◆ param_holders

dict preprocessor.function_value_dispatch._Plan.param_holders = {}

◆ parents

preprocessor.function_value_dispatch._Plan.parents = _parents(module)

◆ values

dict preprocessor.function_value_dispatch._Plan.values = {}

The documentation for this class was generated from the following file: