33 const nlohmann::json &call,
48 const nlohmann::json &call,
52 exprt create_expr_from_call();
65 try_hoist_call_arg_for_view_method(
const std::string &
function);
70 std::optional<exprt> try_hoist_array_arg();
71 bool is_hoistable_array_arg(
const nlohmann::json &call)
const;
93 exprt get_arange_expr();
100 const nlohmann::json &call,
102 const nlohmann::json &ast);
105 bool binds_static_array(
const nlohmann::json &list)
const;
106 long long eye_diagonal_offset(
const std::string &
function)
const;
107 static std::size_t eye_dimension(
const nlohmann::json &node);
108 nlohmann::json eye_literal(
111 std::size_t cols)
const;
113 exprt literal_constructor_expr(
const nlohmann::json &list);
116 typet constructor_element_type(
const nlohmann::json &list)
const;
117 void reject_complex_array_operands(
const std::string &
function)
const;
118 bool is_complex_operand(
const nlohmann::json &arg)
const;
121 exprt with_element_type(
122 const nlohmann::json &list,
123 const std::function<
exprt(
const nlohmann::json &)> &build);
124 exprt typed_static_array(
const nlohmann::json &list,
const typet &shape);
125 exprt full_of_runtime_fill(
const std::vector<std::size_t> &dims);
127 nlohmann::json linspace_literal(
128 const nlohmann::json &start_node,
129 const nlohmann::json &stop_node,
130 const nlohmann::json &num_node)
const;
132 bool is_math_function()
const;
134 void broadcast_check(
const nlohmann::json &operands)
const;
136 std::string get_dtype()
const;
137 typet get_typet_from_dtype()
const;
138 size_t get_dtype_size()
const;
150 nlohmann::json apply_constructor_dtype(nlohmann::json node);
156 const nlohmann::json *find_keyword_arg(
const std::string &name)
const;
158 void reject_invalid_eye_identity_args(
const std::string &
function)
const;
160 nlohmann::json eye_column_arg_or_default(
162 const nlohmann::json &default_arg)
const;
169 std::optional<exprt> try_get_pointer_view_call_result();
175 long long extract_literal_diagonal_offset(
const char *error_context);
177 exprt handle_diagonal_call();
178 exprt handle_trace_call();
179 exprt handle_fill_diagonal_call();
180 std::optional<exprt> handle_ravel_pointer_view_attempt();
181 exprt handle_axis_permutation_view_call(
const std::string &
function);
185 exprt build_default_axis_transpose_expr(
186 const exprt &source_expr,
187 const std::string &error_message);
200 try_transpose_decayed_2d_param(
const nlohmann::json &arg,
typet t);
210 try_transpose_name_arg(
const nlohmann::json &arg,
const exprt &arg_expr);
218 exprt handle_argsort_call();
219 exprt handle_searchsorted_call();
220 exprt handle_sort_call();
225 const nlohmann::json *resolve_argsort_axis_node()
const;
231 void parse_sort_axis_and_keywords(
bool &flatten,
long long &axis);
232 exprt handle_broadcast_to_call();
234 try_build_nditer_descriptor_list(
const nlohmann::json &arg);
235 std::vector<std::size_t>
236 resolve_reshape_shape(std::optional<std::size_t> total)
const;
237 std::optional<exprt> try_build_reshape_pointer_view();
238 std::optional<exprt> reshape_strided_view(
241 const nlohmann::json &arg,
244 axes_are_symbolic(
const std::vector<python_list::strided_axis> &axes);
245 bool describe_view_operand(
246 const nlohmann::json &arg,
248 std::optional<python_list::strided_view_desc> &source);
249 exprt emit_strided_result(
252 const std::vector<python_list::strided_axis> &axes,
254 std::optional<exprt> try_build_view_flatten_copy();
255 std::optional<exprt> try_build_axis_permutation_view();
256 std::optional<exprt> try_build_shape_only_view();
257 std::optional<exprt> try_materialize_descriptor_copy_call();
259 try_materialize_descriptor_array_call(nlohmann::json &array_arg);
260 std::optional<exprt> try_reduce_descriptor_call(
const std::string &
function);
261 std::optional<exprt> try_reduce_descriptor_call_along_axis(
263 const std::pair<std::vector<std::size_t>, std::vector<exprt>>
265 void reject_unsupported_nditer_keywords(
const nlohmann::json &arg)
const;
266 bool is_runtime_layout_view(
const nlohmann::json &arg)
const;
267 exprt get_nditer_list(
const nlohmann::json &arg);
268 exprt scalar_binary_call(
const std::string &
function,
bool allow_numpy_fold);
269 exprt lapack_value(
double exact,
double radius);
270 exprt numpy_math_value(
const std::string &
function,
double x);
271 std::optional<exprt> try_numpy_math_constant();
272 std::optional<exprt> try_runtime_math(
const std::string &
function);
273 const std::string &canonical_function();
275 copy_of_view(
const std::string &
function,
const exprt &operand);
277 reject_non_numeric_elements(
const std::string &
function,
const typet &type);
280 exprt numpy_math_list(
const std::string &
function,
const nlohmann::json &arg);
281 std::vector<std::vector<double>>
282 linalg_matrix(
const std::function<
void(nlohmann::json &)> &unwrap);
284 exprt eigenvalues(
const std::vector<std::vector<double>> &m);
285 std::vector<exprt> eigenvalue_pair(
const std::vector<std::vector<double>> &m);
286 exprt singular_values(
const std::vector<std::vector<double>> &m);
287 exprt lapack_vector(
const std::vector<double> &exact,
double radius);
289 lapack_matrix(
const std::vector<std::vector<double>> &exact,
double radius);
290 void report_integer_overflow();
291 typet scalar_dtype_result();
292 std::optional<exprt> fold_scalar_binary(
297 exprt unfolded_scalar_binary(
302 void reject_unsupported_transpose_axes_rank(
const std::string &
function);
308 void reject_unsupported_flattened_reducer_keywords(
317 std::optional<exprt> try_argmin_argmax_along_axis(
319 const nlohmann::json &arg);
324 std::optional<exprt> try_argmin_argmax_axis_result(
326 const nlohmann::json &arg);
331 exprt empty_reducer_identity_result(
const std::string &
function)
const;
339 std::optional<exprt> try_any_all_result(
const std::string &
function);
340 std::optional<exprt> try_early_result(
const std::string &
function);
351 nlohmann::json resolve_literal_numpy_array_input(
352 nlohmann::json arr_arg,
353 const std::string &function_name,
354 bool inline_only =
false);
362 std::optional<std::vector<exprt>>
363 resolve_searchsorted_array_via_descriptor(
const nlohmann::json &raw_arg);
373 std::optional<std::vector<exprt>>
374 resolve_searchsorted_sorted_values_via_descriptor(
375 const nlohmann::json &raw_arg,
376 const nlohmann::json &sorter_node,
385 std::optional<nlohmann::json>
386 hoist_call_argument_into_temp(
const nlohmann::json &call_node);
392 exprt handle_searchsorted_call_over_descriptor(
393 std::vector<exprt> values,
400 std::optional<exprt> try_searchsorted_probe_placeholder();
404 std::optional<nlohmann::json>
405 try_resolve_searchsorted_literal_array(
const std::string &
function);
410 std::optional<exprt> try_searchsorted_call_over_descriptor(
bool right);
415 nlohmann::json resolve_searchsorted_space(
416 nlohmann::json arr_arg,
417 const nlohmann::json *sorter_node,
421 exprt handle_searchsorted_call_over_literal(
422 nlohmann::json search_space,
425 std::optional<exprt> try_searchsorted_sorter_descriptor_fallback(
426 const nlohmann::json *sorter_node,
430 exprt finish_searchsorted_call(
431 std::optional<nlohmann::json> literal_arg,
432 const nlohmann::json *sorter_node,
445 nlohmann::json try_inline_pure_call_arg(nlohmann::json arg)
const;