1#ifndef PYTHON_FRONTEND_COMPLEX_HANDLER_H
2#define PYTHON_FRONTEND_COMPLEX_HANDLER_H
4#include <nlohmann/json.hpp>
7#include <unordered_map>
39 const std::string &op,
42 const nlohmann::json &element)
const;
83 const std::string &func_name,
84 const nlohmann::json &call,
85 const nlohmann::json &args,
86 const nlohmann::json &keywords)
const;
101 mutable std::unordered_map<std::string, const symbolt *> symbol_cache_;
104 void clear_cache()
const;
107 const symbolt *find_cached_symbol(
const std::string &
id)
const;
121 const nlohmann::json &loc_source)
const;
124 exprt complex_log(
const exprt &z,
const nlohmann::json &loc_source)
const;
127 exprt complex_exp(
const exprt &z,
const nlohmann::json &loc_source)
const;
131 promote_int_arith_to_double(
const exprt &input_expr, std::size_t
depth)
const;
exprt normalize_numeric_expr(const exprt &value) const
Normalises a numeric expression for use in complex arithmetic.
Definition complex_handler.cpp:314
exprt handle_unary_op(const std::string &op, const exprt &operand) const
Handles unary +/- on complex values.
Definition complex_handler.cpp:624
exprt handle_attribute(const nlohmann::json &element) const
Handles attribute access / method calls on complex objects.
Definition complex_handler.cpp:654
exprt handle_abs(const exprt &z) const
Computes abs(z) = sqrt(real^2 + imag^2).
Definition complex_handler.cpp:714
complex_handler(python_converter &converter, contextt &symbol_table, type_handler &type_handler_ref)
Definition complex_handler.cpp:48
exprt handle_binary_op(const std::string &op, const exprt &lhs, const exprt &rhs, const nlohmann::json &element) const
Handles binary operations when at least one operand is complex.
Definition complex_handler.cpp:333
exprt handle_cmath_log(const std::string &func_name, const nlohmann::json &call, const nlohmann::json &args, const nlohmann::json &keywords) const
Handles cmath.log / cmath.log10 with complex arguments.
Definition complex_handler.cpp:737
exprt handle_attribute_access(const exprt &obj, const std::string &attr) const
Handles direct attribute access on a complex object: .real, .imag.
Definition complex_handler.cpp:691
Main converter for transforming Python AST into ESBMC's intermediate representation.
Definition python_converter.h:76
Definition type_handler.h:113
unsigned stack_budget_guardt< Tag >::depth
Definition stack_budget.h:72