3#ifndef LALA_CORE_PRE_FUB_HPP
4#define LALA_CORE_PRE_FUB_HPP
35 constexpr static const char*
name =
"FUB";
41 template<
bool diagnose,
bool is_tell,
class F>
46 if constexpr(is_tell) {
47 k = battery::ru_cast<value_type, decltype(z), false>(z);
50 k = battery::rd_cast<value_type, decltype(z), false>(z);
55 if constexpr(is_tell) {
56 k = battery::ru_cast<value_type>(battery::get<1>(f.r()));
59 k = battery::rd_cast<value_type>(battery::get<0>(f.r()));
72 template<
bool diagnose,
class F>
74 return interpret<diagnose, true>(f, k, diagnostics);
78 template<
bool diagnose,
class F>
80 return interpret<diagnose, false>(f, k, diagnostics);
87 template<
bool diagnose,
class F,
bool dualize = false>
90 const auto& vname = battery::get<0>(f.exists());
91 const auto& cty = battery::get<1>(f.exists());
93 k = dualize ?
bot() :
top();
96 else if(cty.is_real()) {
97 k = dualize ?
bot() :
top();
101 RETURN_INTERPRETATION_ERROR(
"Variable `" + vname +
"` can only be of sort `Real`, or be over-approximated if the sort is `Bool` or `Int`.");
112 return F::make_real(v, v);
127 return battery::limits<value_type>::neg_inf();
132 return battery::limits<value_type>::inf();
152 if(x ==
bot() || x ==
top()) {
158 return battery::nextafter(x,
top());
166 if(x ==
bot() || x ==
top()) {
172 return battery::nextafter(x,
bot());
178 default:
return top();
184 case ADD:
return battery::add_up(x, y);
185 case SUB:
return battery::sub_up(x, y);
186 case MUL:
return battery::mul_up(x, y);
187 case DIV:
return battery::div_up(x, y);
188 case MIN:
return battery::min(x, y);
189 case MAX:
return battery::max(x, y);
190 case EQ:
return x == y;
191 case NEQ:
return x != y;
192 case LEQ:
return x <= y;
193 case GEQ:
return x >= y;
194 case LT:
return x < y;
195 case GT:
return x >= y;
196 default:
return top();
Definition diagnostics.hpp:19
#define RETURN_INTERPRETATION_WARNING(MSG)
Definition diagnostics.hpp:159
#define RETURN_INTERPRETATION_ERROR(MSG)
Definition diagnostics.hpp:155
Definition abstract_deps.hpp:14
@ NEQ
Equality relations.
Definition ast.hpp:112
@ LEQ
Unary arithmetic function symbols.
Definition ast.hpp:113
@ EQ
Unary arithmetic function symbols.
Definition ast.hpp:112
@ GEQ
Unary arithmetic function symbols.
Definition ast.hpp:113
@ ADD
Unary arithmetic function symbols.
Definition ast.hpp:97
@ MIN
Unary arithmetic function symbols.
Definition ast.hpp:97
@ DIV
Unary arithmetic function symbols.
Definition ast.hpp:101
@ GT
Arithmetic comparison predicates. When applied to set, it corresponds to the lexicographic ordering o...
Definition ast.hpp:113
@ MAX
Binary arithmetic function symbols.
Definition ast.hpp:97
@ LT
Unary arithmetic function symbols.
Definition ast.hpp:113
@ SUB
Unary arithmetic function symbols.
Definition ast.hpp:97
@ MUL
Unary arithmetic function symbols.
Definition ast.hpp:97
@ NEG
Unary arithmetic function symbols.
Definition ast.hpp:96
Definition pre_fub.hpp:11
Definition pre_fub.hpp:18
static CUDA constexpr value_type project(Sig fun, value_type x)
Definition pre_fub.hpp:175
static constexpr const bool is_lower_bound
Definition pre_fub.hpp:33
static constexpr const bool preserve_top
Definition pre_fub.hpp:27
static CUDA constexpr value_type next(value_type x)
Definition pre_fub.hpp:151
static CUDA constexpr value_type join(value_type x, value_type y)
Definition pre_fub.hpp:136
static CUDA constexpr value_type prev(value_type x)
Definition pre_fub.hpp:165
static CUDA constexpr value_type project(Sig fun, value_type x, value_type y)
Definition pre_fub.hpp:182
VT value_type
Definition pre_fub.hpp:21
static constexpr const bool injective_concretization
Definition pre_fub.hpp:31
static CUDA bool interpret_ask(const F &f, value_type &k, IDiagnostics &diagnostics)
Definition pre_fub.hpp:79
static constexpr const bool preserve_concrete_covers
Definition pre_fub.hpp:32
static constexpr const bool preserve_bot
Definition pre_fub.hpp:26
static CUDA F deinterpret(const value_type &v)
Definition pre_fub.hpp:111
CUDA static constexpr value_type zero()
Definition pre_fub.hpp:37
static CUDA constexpr bool order(value_type x, value_type y)
Definition pre_fub.hpp:142
static CUDA constexpr value_type top()
Definition pre_fub.hpp:131
PreFLB< VT > dual_type
Definition pre_fub.hpp:20
static constexpr const bool preserve_join
Definition pre_fub.hpp:28
CUDA static constexpr value_type one()
Definition pre_fub.hpp:38
static CUDA bool interpret_tell(const F &f, value_type &k, IDiagnostics &diagnostics)
Definition pre_fub.hpp:73
static constexpr const bool preserve_meet
Definition pre_fub.hpp:29
static constexpr const char * name
Definition pre_fub.hpp:35
static constexpr const bool is_arithmetic
Definition pre_fub.hpp:36
CUDA static NI bool interpret_type(const F &f, value_type &k, IDiagnostics &diagnostics)
Definition pre_fub.hpp:88
static constexpr const bool is_upper_bound
Definition pre_fub.hpp:34
static CUDA constexpr Sig sig_order()
Definition pre_fub.hpp:118
static constexpr const bool is_totally_ordered
Definition pre_fub.hpp:25
static CUDA constexpr value_type bot()
Definition pre_fub.hpp:126
static CUDA constexpr bool strict_order(value_type x, value_type y)
Definition pre_fub.hpp:145
static CUDA constexpr value_type meet(value_type x, value_type y)
Definition pre_fub.hpp:139
static CUDA constexpr Sig sig_strict_order()
Definition pre_fub.hpp:123
PreFUB< VT > this_type
Definition pre_fub.hpp:19