|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
#include <python-frontend/function_call/expr.h>#include <python-frontend/math/bounded_math.h>#include <python-frontend/math/cmath_lowering_policy.h>#include <python-frontend/math/complex_handler.h>#include <python-frontend/math/complex_handler_utils.h>#include <python-frontend/json_utils.h>#include <python-frontend/lambda/python_lambda.h>#include <python-frontend/math/math_guard_utils.h>#include <python-frontend/math/python_int_overflow.h>#include <python-frontend/math/python_math.h>#include <python-frontend/numpy/numpy_reducer_shared.h>#include <util/base/host_rounding_mode.h>#include <python-frontend/exception/python_exception_handler.h>#include <python-frontend/python-list/python_list.h>#include <python-frontend/set/python_set.h>#include <python-frontend/string/string_builder.h>#include <python-frontend/symbol_id.h>#include <python-frontend/tuple/tuple_handler.h>#include <python-frontend/type/type_handler.h>#include <python-frontend/type/type_utils.h>#include <python-frontend/python_expr_builder.h>#include <util/arith/arith_tools.h>#include <util/arith/bitvector.h>#include <util/expr/base_type.h>#include <util/lang/c_typecast.h>#include <util/expr/expr_util.h>#include <util/arith/ieee_float.h>#include <util/message/message.h>#include <util/lang/python_types.h>#include <util/irep/std_expr.h>#include <util/lang/c_sizeof.h>#include <util/expr/string_constant.h>#include <irep2/irep2_utils.h>#include <util/irep/migrate.h>#include <algorithm>#include <cctype>#include <cmath>#include <limits>#include <unordered_map>#include <boost/algorithm/string/predicate.hpp>#include <deque>#include <optional>#include <python-frontend/consteval/python_consteval.h>#include <regex>#include <stdexcept>#include <unordered_set>Functions | |
| bool | is_cpp_throw_expr (const exprt &e) |
| True when the expression is a synthesized C++ throw used by the Python frontend to propagate exceptions through value positions. | |
| static std::string | get_classname_from_symbol_id (const std::string &symbol_id) |
| static bool | class_defines_init (const nlohmann::json &ast, const std::string &class_name) |
| static std::string | node_name (const nlohmann::json &node) |
| static bool | is_abstract_method (const nlohmann::json &member) |
| static bool | has_abcmeta_metaclass (const nlohmann::json &class_node) |
| static std::string | format_double_for_complex (double d) |
| static bool | try_extract_complex_parts_from_json (const nlohmann::json &arg, const nlohmann::json &ast, const std::string ¤t_func, double &real_val, double &imag_val) |
| static std::string | format_complex_string (double real_val, double imag_val) |
| static std::string | exact_class_of (const nlohmann::json &arg, const nlohmann::json &ast) |
The class arg evaluates to when the source alone fixes it: a class name, or type() of a constructor call or of a non-str literal (ast2json spells str, bytes and complex constants alike). | |
| static bool | is_builtin_class (const std::string &name, const nlohmann::json &ast) |
Whether name is a builtin class that the module never rebinds. | |
| static bool | is_plain_class (const std::string &name, const nlohmann::json &ast) |
Whether name is a class defined once at the top level of ast whose construction yields an instance of it: no decorator or metaclass on it or its bases, and no new anywhere in the module. | |
| static std::string | class_object_str (const std::string &name, const nlohmann::json &arg, const python_converter &converter) |
What str() of the class object name, converted from arg, gives, or "" when that is not known: a class object holds only the bare name. | |
| static std::string | py_float_hex (double d) |
| exprt | to_value_expr (const exprt &arg, const namespacet &ns) |
| Convert a code_function_callt to a side_effect_expr_function_callt so it can be used as a value expression (e.g., as an operand of if_exprt). | |
| static typet | resolve_astype_target_type (const nlohmann::json &dtype_node) |
| static std::string | numpy_spelling (const std::string &math_name) |
| static std::optional< std::string > | math_import_of (const nlohmann::json &ast, const std::string &name) |
| static bool | is_number_literal (const nlohmann::json &node) |
| static std::string | math_function_name (const std::string &raw_func_name) |
| static bool | has_common_subclass (const type_handler &th, const nlohmann::json &ast, const std::string &a, const std::string &b) |
| static std::optional< long long > | extract_any_all_axis_literal (const nlohmann::json &node) |
| static const nlohmann::json * | find_any_all_axis_keyword (const nlohmann::json &call) |
| static void | reject_unfoldable_key (const nlohmann::json &call, const std::string &func_name, bool is_sorted_min_max) |
| Reaching the runtime model means the preprocessor could not fold the call, and the model has no key parameter – the key is dropped, which silently reorders the result (sorted([a, a + 1], key=lambda v: -v) then reports a spurious counterexample). | |
| static bool | is_value_only_array (const exprt &arg) |
| static exprt | array_argument_address (const exprt &arg) |
| static bool | is_tuple_struct (const typet &type) |
| static std::string | random_element_suffix (const typet &elem_type) |
| static bool | tuple_members_are_numeric (const struct_typet::componentst &members, const namespacet &ns, bool &any_float) |
| static nlohmann::json | forward_function_node (const nlohmann::json &ast, const std::string &name) |
| The FunctionDef for a call's callee: a module-level name, or a nested path such as "outer@F@b" for a sibling the enclosing body defines later. | |
| static bool | defines_function (const nlohmann::json &ast, const std::string &name) |
| static std::optional< std::string > | string_literal (const nlohmann::json &node) |
| static std::optional< std::string > | constant_byteorder (const nlohmann::json &node, const nlohmann::json &module) |
| static void | reject_unmodelled_numpy_array_argument (const typet &type) |
|
static |
|
static |
What str() of the class object name, converted from arg, gives, or "" when that is not known: a class object holds only the bare name.
|
static |
|
static |
|
static |
The class arg evaluates to when the source alone fixes it: a class name, or type() of a constructor call or of a non-str literal (ast2json spells str, bytes and complex constants alike).
"" otherwise, as the class type() derives from a static type may be a base of the runtime class.
|
static |
|
static |
|
static |
|
static |
|
static |
The FunctionDef for a call's callee: a module-level name, or a nested path such as "outer@F@b" for a sibling the enclosing body defines later.
|
static |
|
static |
|
static |
|
static |
|
static |
Whether name is a builtin class that the module never rebinds.
True when the expression is a synthesized C++ throw used by the Python frontend to propagate exceptions through value positions.
|
static |
|
static |
Whether name is a class defined once at the top level of ast whose construction yields an instance of it: no decorator or metaclass on it or its bases, and no new anywhere in the module.
The preprocessor names the classes it hoists or renames with a "__" (Outer__Inner, C__esbmc_shadowed), which CPython would not print.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Reaching the runtime model means the preprocessor could not fold the call, and the model has no key parameter – the key is dropped, which silently reorders the result (sorted([a, a + 1], key=lambda v: -v) then reports a spurious counterexample).
Refuse instead of answering wrongly.
|
static |
|
static |
|
static |
| exprt to_value_expr | ( | const exprt & | arg, |
| const namespacet & | ns ) |
Convert a code_function_callt to a side_effect_expr_function_callt so it can be used as a value expression (e.g., as an operand of if_exprt).
|
static |
|
static |