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

#include <python_typechecking.h>

Public Member Functions

 python_typechecking (python_converter &converter)
std::vector< typet > collect_annotation_types (const nlohmann::json &annotation) const
void cache_annotation_types (symbolt &symbol, const nlohmann::json &annotation)
std::vector< typet > get_annotation_types (const std::string &symbol_id) const
void inject_parameter_type_assertions (const nlohmann::json &function_node, const symbol_id &function_id, const code_typet &type, exprt &function_body)
bool should_skip_type_assertion (const typet &annotated_type) const
exprt build_isinstance_check (const exprt &value_expr, const typet &annotated_type) const
bool build_type_assertion (const exprt &value_expr, const typet &annotated_type, const std::vector< typet > &allowed_types, const std::string &context_name, const locationt &location, code_assertt &out_assert) const
void emit_type_annotation_assertion (const exprt &value_expr, const typet &annotated_type, const std::vector< typet > &allowed_types, const std::string &context_name, const locationt &location, codet &target_block)
std::string get_constructor_name (const nlohmann::json &func_node) const
bool class_derives_from (const std::string &class_name, const std::string &expected_base) const

Constructor & Destructor Documentation

◆ python_typechecking()

python_typechecking::python_typechecking ( python_converter & converter)
explicit

Member Function Documentation

◆ build_isinstance_check()

exprt python_typechecking::build_isinstance_check ( const exprt & value_expr,
const typet & annotated_type ) const

◆ build_type_assertion()

bool python_typechecking::build_type_assertion ( const exprt & value_expr,
const typet & annotated_type,
const std::vector< typet > & allowed_types,
const std::string & context_name,
const locationt & location,
code_assertt & out_assert ) const

◆ cache_annotation_types()

void python_typechecking::cache_annotation_types ( symbolt & symbol,
const nlohmann::json & annotation )

◆ class_derives_from()

bool python_typechecking::class_derives_from ( const std::string & class_name,
const std::string & expected_base ) const

◆ collect_annotation_types()

std::vector< typet > python_typechecking::collect_annotation_types ( const nlohmann::json & annotation) const

◆ emit_type_annotation_assertion()

void python_typechecking::emit_type_annotation_assertion ( const exprt & value_expr,
const typet & annotated_type,
const std::vector< typet > & allowed_types,
const std::string & context_name,
const locationt & location,
codet & target_block )

◆ get_annotation_types()

std::vector< typet > python_typechecking::get_annotation_types ( const std::string & symbol_id) const

◆ get_constructor_name()

std::string python_typechecking::get_constructor_name ( const nlohmann::json & func_node) const

◆ inject_parameter_type_assertions()

void python_typechecking::inject_parameter_type_assertions ( const nlohmann::json & function_node,
const symbol_id & function_id,
const code_typet & type,
exprt & function_body )

◆ should_skip_type_assertion()

bool python_typechecking::should_skip_type_assertion ( const typet & annotated_type) const

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