3#include <nlohmann/json.hpp>
29 is_random_call(
const nlohmann::json &call,
const nlohmann::json &ast);
35 static std::optional<std::vector<std::size_t>>
36 output_shape(
const nlohmann::json &call,
const nlohmann::json &ast);
46 const nlohmann::json &call_;
48 std::string function_;
53 std::map<std::string, exprt> values_;
55 std::set<std::string> bound_;
60 std::vector<long long> shape_;
62 static constexpr long long max_samples = 1024;
67 bool has_probabilities_ =
false;
68 std::vector<exprt> drawn_indices_;
70 exprt reject_unmodelled();
71 void bind_arguments();
72 void bind_positional();
74 void bind(
const std::string ¶m,
const nlohmann::json &arg);
75 [[noreturn]]
void reject_unpacked()
const;
76 std::string missing_argument()
const;
77 exprt read_population(
const nlohmann::json &arg);
79 [[noreturn]]
void reject_population()
const;
80 bool holds_numpy_array(
const nlohmann::json &arg)
const;
81 bool read_replace(
const nlohmann::json &arg)
const;
82 bool read_probabilities(
const nlohmann::json &arg);
83 long long population_size()
const;
84 long long sample_count()
const;
85 void validate_choice();
86 exprt sample_choice();
87 bool takes_dimensions()
const;
88 void bind_dimensions();
89 void read_shape(
const nlohmann::json &size);
90 [[noreturn]]
void reject_shape()
const;
93 void fill(
const exprt &target);
94 exprt evaluate_once(
const nlohmann::json &arg,
const std::string ¶m);
98 void validate_randint();
100 exprt sample_integer();
102 exprt nan_from_parameters(
const exprt &sample);
108 raise_if(
const exprt &
cond,
const std::string &exc,
const std::string &msg);
Definition std_expr.h:1168
static std::string list_annotation(const nlohmann::json &call, const nlohmann::json &ast)
"list" for a random call that returns an array, so the annotator types it and arithmetic on it as it ...
Definition numpy_random.cpp:247
exprt get()
Definition numpy_random.cpp:254
static bool is_random_call(const nlohmann::json &call, const nlohmann::json &ast)
Definition numpy_random.cpp:196
static std::optional< std::vector< std::size_t > > output_shape(const nlohmann::json &call, const nlohmann::json &ast)
The literal output shape of a random call that returns an array, read from the source; nullopt for a ...
Definition numpy_random.cpp:214
numpy_random(python_converter &converter, const nlohmann::json &call)
Definition numpy_random.cpp:185
Main converter for transforming Python AST into ESBMC's intermediate representation.
Definition python_converter.h:76
pthread_cond_t cond
Definition cuda.h:50
@ elements
The container's own elements: lists, sets, tuples, and a dict's internal keys/values lists.
Definition element_type_registry.h:24
void * value
Definition solidity_mapping.c:2