ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
converter_funcdef.cpp File Reference
Include dependency graph for converter_funcdef.cpp:

Typedefs

using numpy_layout = std::pair<std::vector<long long>, std::string>

Functions

static bool sizes_target_by_first_argument (const nlohmann::json &value)
const nlohmann::json & get_return_statement (const nlohmann::json &function)
static bool is_subscripted_as (const nlohmann::json &return_type, const nlohmann::json &node, const char *name, const char *alt=nullptr)
 A subscripted annotation spelled with either of name or alt, e.g.
static bool param_is_mutated_in_body (const std::string &param_name, const nlohmann::json &body)
static void collect_self_attr_stores_of_param (const std::string &param_name, const nlohmann::json &body, std::vector< std::string > &out)
static bool node_unpacks_param (const std::string &param_name, const nlohmann::json &node)
 True for a, b = x / first, *rest = x, which iterates x.
static bool body_unpacks_param (const std::string &param_name, const nlohmann::json &node)
 True if node anywhere within it unpacks param_name; the unpacking is commonly guarded (if xs: first, *rest = xs), so this has to look inside nested statements rather than only at the top level of the body.
static bool node_uses_param_as_list_like (const std::string &param_name, const nlohmann::json &node)
static bool param_is_list_like_in_body (const std::string &param_name, const nlohmann::json &body)
static std::optional< std::vector< std::size_t > > numpy_param_full_shape_of (bool numpy_array_param, const typet &arg_type, const type_handler &type_handler)
static bool is_numpy_array_literal_call (const nlohmann::json &node)
static bool is_literal_node (const nlohmann::json &node)
static bool is_numpy_literal_constructor (const nlohmann::json &node)
static bool numpy_arange_length_is_symbolic (const nlohmann::json &args)
static bool numpy_linspace_length_is_symbolic (const nlohmann::json &ctor_call)
static bool numpy_ctor_shape_arg_is_symbolic (const nlohmann::json &ctor_call)
static void collect_reachable_returns (const nlohmann::json &body, std::vector< const nlohmann::json * > &out)
static bool numpy_array_literal_return (const nlohmann::json &func_def, nlohmann::json &out_literal_call, const type_handler &type_handler)
static void collect_call_sites (const nlohmann::json &node, const std::string &enclosing_function, std::vector< numpy_param_call_site > &out)
static const nlohmann::json * find_function_def (const nlohmann::json &module_body, const std::string &name)
static bool is_name_target (const nlohmann::json &target, const std::string &name)
static bool is_integer_valued (const nlohmann::json &value)
static bool statement_binds_integer (const std::string &name, const nlohmann::json &node)
static bool binds_integer_index (const std::string &name, const nlohmann::json &node)
static bool is_variable_index_subscript_of (const std::string &param_name, const nlohmann::json &node, const nlohmann::json &function)
static bool param_used_in_variable_index_subscript (const std::string &param_name, const nlohmann::json &node, const nlohmann::json &function)
static bool list_literal_for_call_arg (const nlohmann::json &arg, const std::string &enclosing_function, const nlohmann::json &ast, nlohmann::json &out)
 Element type a bare list parameter receives, taken from the call sites that can be resolved statically.
static bool only_compared_for_equality (const nlohmann::json &node, const std::string &name)
 Whether name appears in node, at least once, and only as an operand of a single == or !=.
static bool is_name_node (const nlohmann::json &node, const std::string &name)
static bool is_unsigned_constant (const nlohmann::json &node)
static bool only_reads_fixed_positions (const nlohmann::json &node, const std::string &name, bool any_index)
 Whether every use of name in node reads one element at a non-negative constant index (any index with any_index) or takes its length.
static bool reads_fixed_position (const nlohmann::json &node, const std::string &name, bool any_index)
 Whether node reads one element of name at a non-negative constant index, or at any index that leaves name alone when any_index, or takes its length.
static bool only_called_directly (const nlohmann::json &node, const std::string &name)
 Whether name appears in node only as the callee of a direct call, so the calls collect_call_sites finds are every way it receives arguments.
static std::vector< typet > pooled_kinds (const std::vector< std::vector< typet > > &k)
static std::vector< nlohmann::json > nested_lists (const std::vector< nlohmann::json > &literals, std::optional< size_t > pos)
 The nested list displays among literals' elements, at pos only when given.
static std::optional< double > literal_number (const nlohmann::json &node)
static std::string literal_kind (const nlohmann::json &node)
static std::optional< std::vector< long long > > literal_shape (const nlohmann::json &node)
static std::optional< numpy_layout > filled_layout (const std::string &ctor, const nlohmann::json &args)
static std::optional< numpy_layout > square_layout (const std::string &ctor, const nlohmann::json &args)
static std::optional< numpy_layout > arange_layout (const nlohmann::json &args)
static std::optional< numpy_layout > literal_constructor_layout (const nlohmann::json &call)
static nlohmann::json zero_literal (const std::vector< long long > &shape, std::size_t axis, const std::string &kind)
static bool is_numpy_static_shape_name (const nlohmann::json &node, const std::string &param_name)
static bool is_numpy_static_shape_attribute_of (const nlohmann::json &node, const std::string &param_name)
static bool is_numpy_static_shape_call_on (const nlohmann::json &node, const std::string &param_name)
static bool uses_numpy_static_shape_op (const nlohmann::json &node, const std::string &param_name)
static std::optional< std::string > numpy_call_site_arg_name (const nlohmann::json &call, const std::string &func_name, size_t param_index)
static const nlohmann::json * module_numpy_literal (const nlohmann::json &module_body, const std::string &arg_name)
static std::size_t count_name_stores (const nlohmann::json &node, const std::string &name)
static const nlohmann::json * sole_local_numpy_literal (const nlohmann::json &def, const std::string &name)
static void record_param_type (std::optional< typet > &resolved, const typet &candidate, const std::string &func_name, size_t param_index)
static std::optional< long long > resolve_bytes_call_size (const nlohmann::json &call)
static std::string assignment_target_name (const nlohmann::json &stmt)
static std::size_t count_scope_stores (const nlohmann::json &node, const std::string &name)
static bool declared_global_or_nonlocal (const nlohmann::json &node, const std::string &name)
static std::optional< std::string > binding_function (const nlohmann::json &module_body, const std::string &enclosing_function, const std::string &name)
static const nlohmann::json * single_assigned_value (const nlohmann::json &module_body, const std::string &function, const std::string &name)
static const nlohmann::json * reaching_assigned_value (const nlohmann::json &module_body, const std::string &function, const std::string &name, int line)
static void collect_assigned_values (const nlohmann::json &node, const std::string &name, std::vector< const nlohmann::json * > &out)
static const nlohmann::json * resolve_view_subscript (const nlohmann::json &arg, const nlohmann::json &module_body, std::string &function, unsigned depth=0)
static std::optional< std::pair< std::vector< std::size_t >, typet > > array_type_shape_and_elem (const typet &arr_type)
static std::optional< std::size_t > forwarded_param_index (const nlohmann::json &arg, const nlohmann::json &module_body, const std::string &function_name)
static bool is_index_node (const nlohmann::json &node)
static const nlohmann::json * find_method_def (const nlohmann::json &module_body, const std::string &cls, const std::string &method)
static const nlohmann::json * find_callee_def (const nlohmann::json &module_body, const std::string &callee)
static bool is_module_class (const nlohmann::json &module_body, const std::string &name)
static std::string receiver_class (const nlohmann::json &receiver, const nlohmann::json &body)
static std::optional< std::size_t > callee_parameter_offset (const nlohmann::json &call, const nlohmann::json &module_body, const std::string &callee)
static const nlohmann::json * call_site_argument (const nlohmann::json &call, const nlohmann::json &module_body, const std::string &func_name, std::size_t param_index)
static std::string view_param_key (const std::string &func_name, std::size_t param_index)
static bool forwards_param_being_inferred (const nlohmann::json &arg, const nlohmann::json &module_body, const std::string &enclosing_function, const std::set< std::string > &visiting)
static std::string filled_array_dtype (const std::string &ctor, const nlohmann::json &call)
static bool has_only_dtype_keyword (const nlohmann::json &call)
static std::optional< long long > resolve_bytes_expr_size (const nlohmann::json &expr, const nlohmann::json &scope_body, std::set< std::string > &visited)
static std::optional< long long > resolve_bytes_expr_size (const nlohmann::json &expr, const nlohmann::json &scope_body)
static bool is_bare_callable_annotation (const nlohmann::json &ann)
 A Callable annotation with no [[A], R] signature, spelled either bare or through typing.
static std::string bound_name (const nlohmann::json &node)
 The name a single AST node binds, or "" when it binds none.
static bool binds_name (const nlohmann::json &node, const std::string &name)
 Whether node binds name (a parameter, nested definition, import or assignment target), which would shadow the module-level function.
static std::vector< std::string > returned_function_names (const nlohmann::json &function_node)
 The functions a body returns by name, through conditional expressions.
static bool parameter_defaults_to_any (const nlohmann::json &element)
 Whether the parameter takes the Any (void*) default: no annotation at all, a class of a module with no model (#9204), or a bare Callable, which is worse than none.
static bool references_name (const nlohmann::json &node, const std::string &param_name)
static bool return_value_safe_for_tagged_param (const nlohmann::json &value, const std::string &param_name)
static bool any_return_unsafe_for_tagged_param (const nlohmann::json &body, const std::string &param_name)
static std::vector< std::string > constructor_callees (const nlohmann::json &module_body, const std::string &callee)
static bool is_local_of (const std::string &symbol_id, const std::string &function_id)
static void hoist_nested_declarations (exprt &code, const std::set< std::string > &ids, exprt::operandst &out, bool outermost)
static bool contains_call_node (const nlohmann::json &node)
static const nlohmann::json * statement_level_call (const nlohmann::json &stmt)
static bool is_simple_name_assign_to (const nlohmann::json &stmt, const std::string &name)
static bool is_if_else_with_both_arms (const nlohmann::json &stmt)
static bool block_assigns_name_anywhere (const nlohmann::json &block, const std::string &name)
static std::optional< std::string > get_directly_returned_name (const nlohmann::json &body)
static void throw_if_branch_shapes_mismatch (const nlohmann::json *then_value, const nlohmann::json *else_value)
static bool is_written_int_annotation (const nlohmann::json &returns)
 Whether the program, not the annotator, wrote -> int.
static bool any_return (const nlohmann::json &stmts, const std::function< bool(const nlohmann::json &)> &pred)
 Whether a return in stmts (nested blocks included) satisfies pred.
static bool returns_none (const nlohmann::json &body)
 Whether a return in body yields None: a bare return, return None, or a conditional expression with a None arm.
static bool is_dynamic_lookup (const nlohmann::json &node)
static bool json_mentions (const nlohmann::json &node, const std::string &name)
static bool options_name_functions ()
static void collect_nested_local_decls (exprt &code, bool nested, std::vector< codet > &hoisted, std::set< irep_idt > &seen)

Variables

static const char *const runtime_view_call_error

Typedef Documentation

◆ numpy_layout

using numpy_layout = std::pair<std::vector<long long>, std::string>

Function Documentation

◆ any_return()

bool any_return ( const nlohmann::json & stmts,
const std::function< bool(const nlohmann::json &)> & pred )
static

Whether a return in stmts (nested blocks included) satisfies pred.

◆ any_return_unsafe_for_tagged_param()

bool any_return_unsafe_for_tagged_param ( const nlohmann::json & body,
const std::string & param_name )
static

◆ arange_layout()

std::optional< numpy_layout > arange_layout ( const nlohmann::json & args)
static

◆ array_type_shape_and_elem()

std::optional< std::pair< std::vector< std::size_t >, typet > > array_type_shape_and_elem ( const typet & arr_type)
static

◆ assignment_target_name()

std::string assignment_target_name ( const nlohmann::json & stmt)
static

◆ binding_function()

std::optional< std::string > binding_function ( const nlohmann::json & module_body,
const std::string & enclosing_function,
const std::string & name )
static

◆ binds_integer_index()

bool binds_integer_index ( const std::string & name,
const nlohmann::json & node )
static

◆ binds_name()

bool binds_name ( const nlohmann::json & node,
const std::string & name )
static

Whether node binds name (a parameter, nested definition, import or assignment target), which would shadow the module-level function.

◆ block_assigns_name_anywhere()

bool block_assigns_name_anywhere ( const nlohmann::json & block,
const std::string & name )
static

◆ body_unpacks_param()

bool body_unpacks_param ( const std::string & param_name,
const nlohmann::json & node )
static

True if node anywhere within it unpacks param_name; the unpacking is commonly guarded (if xs: first, *rest = xs), so this has to look inside nested statements rather than only at the top level of the body.

◆ bound_name()

std::string bound_name ( const nlohmann::json & node)
static

The name a single AST node binds, or "" when it binds none.

◆ call_site_argument()

const nlohmann::json * call_site_argument ( const nlohmann::json & call,
const nlohmann::json & module_body,
const std::string & func_name,
std::size_t param_index )
static

◆ callee_parameter_offset()

std::optional< std::size_t > callee_parameter_offset ( const nlohmann::json & call,
const nlohmann::json & module_body,
const std::string & callee )
static

◆ collect_assigned_values()

void collect_assigned_values ( const nlohmann::json & node,
const std::string & name,
std::vector< const nlohmann::json * > & out )
static

◆ collect_call_sites()

void collect_call_sites ( const nlohmann::json & node,
const std::string & enclosing_function,
std::vector< numpy_param_call_site > & out )
static

◆ collect_nested_local_decls()

void collect_nested_local_decls ( exprt & code,
bool nested,
std::vector< codet > & hoisted,
std::set< irep_idt > & seen )
static

◆ collect_reachable_returns()

void collect_reachable_returns ( const nlohmann::json & body,
std::vector< const nlohmann::json * > & out )
static

◆ collect_self_attr_stores_of_param()

void collect_self_attr_stores_of_param ( const std::string & param_name,
const nlohmann::json & body,
std::vector< std::string > & out )
static

◆ constructor_callees()

std::vector< std::string > constructor_callees ( const nlohmann::json & module_body,
const std::string & callee )
static

◆ contains_call_node()

bool contains_call_node ( const nlohmann::json & node)
static

◆ count_name_stores()

std::size_t count_name_stores ( const nlohmann::json & node,
const std::string & name )
static

◆ count_scope_stores()

std::size_t count_scope_stores ( const nlohmann::json & node,
const std::string & name )
static

◆ declared_global_or_nonlocal()

bool declared_global_or_nonlocal ( const nlohmann::json & node,
const std::string & name )
static

◆ filled_array_dtype()

std::string filled_array_dtype ( const std::string & ctor,
const nlohmann::json & call )
static

◆ filled_layout()

std::optional< numpy_layout > filled_layout ( const std::string & ctor,
const nlohmann::json & args )
static

◆ find_callee_def()

const nlohmann::json * find_callee_def ( const nlohmann::json & module_body,
const std::string & callee )
static

◆ find_function_def()

const nlohmann::json * find_function_def ( const nlohmann::json & module_body,
const std::string & name )
static

◆ find_method_def()

const nlohmann::json * find_method_def ( const nlohmann::json & module_body,
const std::string & cls,
const std::string & method )
static

◆ forwarded_param_index()

std::optional< std::size_t > forwarded_param_index ( const nlohmann::json & arg,
const nlohmann::json & module_body,
const std::string & function_name )
static

◆ forwards_param_being_inferred()

bool forwards_param_being_inferred ( const nlohmann::json & arg,
const nlohmann::json & module_body,
const std::string & enclosing_function,
const std::set< std::string > & visiting )
static

◆ get_directly_returned_name()

std::optional< std::string > get_directly_returned_name ( const nlohmann::json & body)
static

◆ get_return_statement()

const nlohmann::json & get_return_statement ( const nlohmann::json & function)

◆ has_only_dtype_keyword()

bool has_only_dtype_keyword ( const nlohmann::json & call)
static

◆ hoist_nested_declarations()

void hoist_nested_declarations ( exprt & code,
const std::set< std::string > & ids,
exprt::operandst & out,
bool outermost )
static

◆ is_bare_callable_annotation()

bool is_bare_callable_annotation ( const nlohmann::json & ann)
static

A Callable annotation with no [[A], R] signature, spelled either bare or through typing.

A subscripted one carries its return type and is usable.

◆ is_dynamic_lookup()

bool is_dynamic_lookup ( const nlohmann::json & node)
static

◆ is_if_else_with_both_arms()

bool is_if_else_with_both_arms ( const nlohmann::json & stmt)
static

◆ is_index_node()

bool is_index_node ( const nlohmann::json & node)
static

◆ is_integer_valued()

bool is_integer_valued ( const nlohmann::json & value)
static

◆ is_literal_node()

bool is_literal_node ( const nlohmann::json & node)
static

◆ is_local_of()

bool is_local_of ( const std::string & symbol_id,
const std::string & function_id )
static

◆ is_module_class()

bool is_module_class ( const nlohmann::json & module_body,
const std::string & name )
static

◆ is_name_node()

bool is_name_node ( const nlohmann::json & node,
const std::string & name )
static

◆ is_name_target()

bool is_name_target ( const nlohmann::json & target,
const std::string & name )
static

◆ is_numpy_array_literal_call()

bool is_numpy_array_literal_call ( const nlohmann::json & node)
static

◆ is_numpy_literal_constructor()

bool is_numpy_literal_constructor ( const nlohmann::json & node)
static

◆ is_numpy_static_shape_attribute_of()

bool is_numpy_static_shape_attribute_of ( const nlohmann::json & node,
const std::string & param_name )
static

◆ is_numpy_static_shape_call_on()

bool is_numpy_static_shape_call_on ( const nlohmann::json & node,
const std::string & param_name )
static

◆ is_numpy_static_shape_name()

bool is_numpy_static_shape_name ( const nlohmann::json & node,
const std::string & param_name )
static

◆ is_simple_name_assign_to()

bool is_simple_name_assign_to ( const nlohmann::json & stmt,
const std::string & name )
static

◆ is_subscripted_as()

bool is_subscripted_as ( const nlohmann::json & return_type,
const nlohmann::json & node,
const char * name,
const char * alt = nullptr )
static

A subscripted annotation spelled with either of name or alt, e.g.

Tuple[int, str] – the form that carries arguments, as opposed to a bare Tuple.

◆ is_unsigned_constant()

bool is_unsigned_constant ( const nlohmann::json & node)
static

◆ is_variable_index_subscript_of()

bool is_variable_index_subscript_of ( const std::string & param_name,
const nlohmann::json & node,
const nlohmann::json & function )
static

◆ is_written_int_annotation()

bool is_written_int_annotation ( const nlohmann::json & returns)
static

Whether the program, not the annotator, wrote -> int.

◆ json_mentions()

bool json_mentions ( const nlohmann::json & node,
const std::string & name )
static

◆ list_literal_for_call_arg()

bool list_literal_for_call_arg ( const nlohmann::json & arg,
const std::string & enclosing_function,
const nlohmann::json & ast,
nlohmann::json & out )
static

Element type a bare list parameter receives, taken from the call sites that can be resolved statically.

list alone carries no element type, so a subscript of such a parameter otherwise reads as Any and neither arithmetic nor equality on the result behaves (#7187). Every resolvable call site must agree, so a second caller passing a different element type cannot silently inherit the first one's. The list literal a call argument denotes, directly or through the binding of a Name. Returns false when the argument is not a statically resolvable list.

◆ literal_constructor_layout()

std::optional< numpy_layout > literal_constructor_layout ( const nlohmann::json & call)
static

◆ literal_kind()

std::string literal_kind ( const nlohmann::json & node)
static

◆ literal_number()

std::optional< double > literal_number ( const nlohmann::json & node)
static

◆ literal_shape()

std::optional< std::vector< long long > > literal_shape ( const nlohmann::json & node)
static

◆ module_numpy_literal()

const nlohmann::json * module_numpy_literal ( const nlohmann::json & module_body,
const std::string & arg_name )
static

◆ nested_lists()

std::vector< nlohmann::json > nested_lists ( const std::vector< nlohmann::json > & literals,
std::optional< size_t > pos )
static

The nested list displays among literals' elements, at pos only when given.

◆ node_unpacks_param()

bool node_unpacks_param ( const std::string & param_name,
const nlohmann::json & node )
static

True for a, b = x / first, *rest = x, which iterates x.

Unpacking is evidence that a parameter is a sequence, but on its own it says nothing about the element type, so it is used only where the call sites agree on one (see seed_unpacked_param_type).

◆ node_uses_param_as_list_like()

bool node_uses_param_as_list_like ( const std::string & param_name,
const nlohmann::json & node )
static

◆ numpy_arange_length_is_symbolic()

bool numpy_arange_length_is_symbolic ( const nlohmann::json & args)
static

◆ numpy_array_literal_return()

bool numpy_array_literal_return ( const nlohmann::json & func_def,
nlohmann::json & out_literal_call,
const type_handler & type_handler )
static

◆ numpy_call_site_arg_name()

std::optional< std::string > numpy_call_site_arg_name ( const nlohmann::json & call,
const std::string & func_name,
size_t param_index )
static

◆ numpy_ctor_shape_arg_is_symbolic()

bool numpy_ctor_shape_arg_is_symbolic ( const nlohmann::json & ctor_call)
static

◆ numpy_linspace_length_is_symbolic()

bool numpy_linspace_length_is_symbolic ( const nlohmann::json & ctor_call)
static

◆ numpy_param_full_shape_of()

std::optional< std::vector< std::size_t > > numpy_param_full_shape_of ( bool numpy_array_param,
const typet & arg_type,
const type_handler & type_handler )
static

◆ only_called_directly()

bool only_called_directly ( const nlohmann::json & node,
const std::string & name )
static

Whether name appears in node only as the callee of a direct call, so the calls collect_call_sites finds are every way it receives arguments.

◆ only_compared_for_equality()

bool only_compared_for_equality ( const nlohmann::json & node,
const std::string & name )
static

Whether name appears in node, at least once, and only as an operand of a single == or !=.

◆ only_reads_fixed_positions()

bool only_reads_fixed_positions ( const nlohmann::json & node,
const std::string & name,
bool any_index )
static

Whether every use of name in node reads one element at a non-negative constant index (any index with any_index) or takes its length.

Such a list keeps the elements, and positions, its call sites gave it, so a constant index names one of them.

◆ options_name_functions()

bool options_name_functions ( )
static

◆ param_is_list_like_in_body()

bool param_is_list_like_in_body ( const std::string & param_name,
const nlohmann::json & body )
static

◆ param_is_mutated_in_body()

bool param_is_mutated_in_body ( const std::string & param_name,
const nlohmann::json & body )
static

◆ param_used_in_variable_index_subscript()

bool param_used_in_variable_index_subscript ( const std::string & param_name,
const nlohmann::json & node,
const nlohmann::json & function )
static

◆ parameter_defaults_to_any()

bool parameter_defaults_to_any ( const nlohmann::json & element)
static

Whether the parameter takes the Any (void*) default: no annotation at all, a class of a module with no model (#9204), or a bare Callable, which is worse than none.

◆ pooled_kinds()

std::vector< typet > pooled_kinds ( const std::vector< std::vector< typet > > & k)
static

◆ reaching_assigned_value()

const nlohmann::json * reaching_assigned_value ( const nlohmann::json & module_body,
const std::string & function,
const std::string & name,
int line )
static

◆ reads_fixed_position()

bool reads_fixed_position ( const nlohmann::json & node,
const std::string & name,
bool any_index )
static

Whether node reads one element of name at a non-negative constant index, or at any index that leaves name alone when any_index, or takes its length.

◆ receiver_class()

std::string receiver_class ( const nlohmann::json & receiver,
const nlohmann::json & body )
static

◆ record_param_type()

void record_param_type ( std::optional< typet > & resolved,
const typet & candidate,
const std::string & func_name,
size_t param_index )
static

◆ references_name()

bool references_name ( const nlohmann::json & node,
const std::string & param_name )
static

◆ resolve_bytes_call_size()

std::optional< long long > resolve_bytes_call_size ( const nlohmann::json & call)
static

◆ resolve_bytes_expr_size() [1/2]

std::optional< long long > resolve_bytes_expr_size ( const nlohmann::json & expr,
const nlohmann::json & scope_body )
static

◆ resolve_bytes_expr_size() [2/2]

std::optional< long long > resolve_bytes_expr_size ( const nlohmann::json & expr,
const nlohmann::json & scope_body,
std::set< std::string > & visited )
static

◆ resolve_view_subscript()

const nlohmann::json * resolve_view_subscript ( const nlohmann::json & arg,
const nlohmann::json & module_body,
std::string & function,
unsigned depth = 0 )
static

◆ return_value_safe_for_tagged_param()

bool return_value_safe_for_tagged_param ( const nlohmann::json & value,
const std::string & param_name )
static

◆ returned_function_names()

std::vector< std::string > returned_function_names ( const nlohmann::json & function_node)
static

The functions a body returns by name, through conditional expressions.

Empty when any return value is something else.

◆ returns_none()

bool returns_none ( const nlohmann::json & body)
static

Whether a return in body yields None: a bare return, return None, or a conditional expression with a None arm.

◆ single_assigned_value()

const nlohmann::json * single_assigned_value ( const nlohmann::json & module_body,
const std::string & function,
const std::string & name )
static

◆ sizes_target_by_first_argument()

bool sizes_target_by_first_argument ( const nlohmann::json & value)
static

◆ sole_local_numpy_literal()

const nlohmann::json * sole_local_numpy_literal ( const nlohmann::json & def,
const std::string & name )
static

◆ square_layout()

std::optional< numpy_layout > square_layout ( const std::string & ctor,
const nlohmann::json & args )
static

◆ statement_binds_integer()

bool statement_binds_integer ( const std::string & name,
const nlohmann::json & node )
static

◆ statement_level_call()

const nlohmann::json * statement_level_call ( const nlohmann::json & stmt)
static

◆ throw_if_branch_shapes_mismatch()

void throw_if_branch_shapes_mismatch ( const nlohmann::json * then_value,
const nlohmann::json * else_value )
static

◆ uses_numpy_static_shape_op()

bool uses_numpy_static_shape_op ( const nlohmann::json & node,
const std::string & param_name )
static

◆ view_param_key()

std::string view_param_key ( const std::string & func_name,
std::size_t param_index )
static

◆ zero_literal()

nlohmann::json zero_literal ( const std::vector< long long > & shape,
std::size_t axis,
const std::string & kind )
static

Variable Documentation

◆ runtime_view_call_error

const char* const runtime_view_call_error
static
Initial value:
=
"TypeError: passing a numpy view whose layout is read at run time to a "
"function is supported only where the call is what its statement "
"evaluates first and its arguments are names of views and contain no "
"calls"