1#ifndef ESBMC_PYTHON_LAMBDA_H
2#define ESBMC_PYTHON_LAMBDA_H
7#include <nlohmann/json.hpp>
24 const nlohmann::json &element,
25 const std::vector<std::optional<typet>> &argument_types);
37 const nlohmann::json &call,
38 const nlohmann::json &scope,
50 static int lambda_counter_;
53 void process_lambda_parameters(
54 const nlohmann::json &args_node,
56 const std::string &lambda_id,
57 const std::string ¶m_scope_id,
59 const nlohmann::json &body_node,
60 const std::vector<std::optional<typet>> &call_site_types);
65 std::vector<std::optional<typet>> call_site_argument_types(
66 const nlohmann::json &element,
67 const std::vector<std::optional<typet>> &argument_types)
const;
69 exprt process_lambda_body(
70 const nlohmann::json &body_node,
73 std::string generate_unique_lambda_name();
76 const std::string &
id,
77 const std::string &name,
80 const std::string &module_name,
82 bool is_parameter =
false);
89size_t count_bindings(
const nlohmann::json &node,
const std::string &name);
Definition std_types.h:280
Main converter for transforming Python AST into ESBMC's intermediate representation.
Definition python_converter.h:76
typet infer_lambda_return_type(const nlohmann::json &body_node)
Definition python_lambda.cpp:163
void handle_lambda_assignment(symbolt *lhs_symbol, exprt &lhs, exprt &rhs)
Definition python_lambda.cpp:40
std::vector< std::optional< typet > > narrowed_parameter_types(const nlohmann::json &call, const nlohmann::json &scope, const code_typet &signature) const
Definition python_lambda.cpp:913
bool is_lambda_assignment(const nlohmann::json &ast_node) const
Definition python_lambda.cpp:34
exprt get_lambda_expr(const nlohmann::json &element, const std::vector< std::optional< typet > > &argument_types)
Definition python_lambda.cpp:1100
python_lambda(python_converter &converter, contextt &context, type_handler &type_handler)
Definition python_lambda.cpp:21
Definition type_handler.h:113
size_t count_bindings(const nlohmann::json &node, const std::string &name)
Every construct under node that binds name, in any nested scope too.
Definition python_lambda.cpp:625
const nlohmann::json * binding_target(const nlohmann::json &stmt)
The one name target a plain x = v or x: T = v statement binds, or null.
Definition python_lambda.cpp:283