ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
bounded_math.h
Go to the documentation of this file.
1#pragma once
2
3#include <nlohmann/json.hpp>
4#include <util/irep/expr.h>
5
6#include <string>
7
9
13enum class math_module
14{
17};
18
22{
23public:
24 bounded_math(python_converter &converter, const nlohmann::json &call);
25
27 static bool is_bounded(const std::string &function);
29 static bool has_runtime_model(const std::string &function);
30 static double host_value(const std::string &function, double x);
31
33 exprt literal(const std::string &function, double x);
35 exprt
36 runtime(const std::string &function, const exprt &x, math_module module);
37
38private:
39 python_converter &converter_;
40 const nlohmann::json &call_;
41
42 exprt
43 bounded_call(const std::string &function, const exprt &x, math_module module);
44 exprt
45 special_cases(const std::string &function, const exprt &x, exprt result);
46 void raise_math_errors(
47 const std::string &function,
48 const exprt &x,
49 const exprt &value);
50 exprt fresh(const std::string &name, const exprt &value);
51 exprt read_once(const exprt &x);
52 exprt within(double low, double high);
53 void raise_if(
54 const exprt &condition,
55 const std::string &exception,
56 const std::string &message);
57 void assume(const exprt &condition);
58};
math_module
numpy.
Definition bounded_math.h:14
static bool is_bounded(const std::string &function)
Functions whose result of a run-time argument is bounded.
Definition bounded_math.cpp:75
exprt literal(const std::string &function, double x)
The numpy.* result for a literal argument.
Definition bounded_math.cpp:90
bounded_math(python_converter &converter, const nlohmann::json &call)
Definition bounded_math.cpp:68
static double host_value(const std::string &function, double x)
Definition bounded_math.cpp:85
exprt runtime(const std::string &function, const exprt &x, math_module module)
The result for a number known only at run time, which is read once.
Definition bounded_math.cpp:98
static bool has_runtime_model(const std::string &function)
is_bounded() or exact (sqrt).
Definition bounded_math.cpp:80
Definition expr.h:34
Definition module.h:60
Main converter for transforming Python AST into ESBMC's intermediate representation.
Definition python_converter.h:76
Definition toml.hpp:1531
Definition math.py:1
Definition numpy.py:1
Definition module.h:12