1#ifndef SOLVERS_SMT_FP_IR_IEEE_CONV_H_
2#define SOLVERS_SMT_FP_IR_IEEE_CONV_H_
8#include <unordered_map>
9#include <unordered_set>
46 const std::string &name,
192 std::unordered_map<const smt_ast *, ra_interval_t> ir_ra_interval_map;
197 std::unordered_map<const smt_ast *, smt_astt> ir_ieee_nan_map;
218 std::unordered_map<const smt_ast *, smt_astt> ir_ieee_neg_zero_map;
222 std::unordered_set<std::string> ir_ieee_ranged_syms;
243 std::pair<smt_astt, smt_astt> apply_enclosure(
Floating-point bitvector type.
Definition irep2_type.h:621
smt_astt encode_ieee_mul(const expr2tc &expr)
Integer-encoding path for ieee_mul.
Definition ir_ieee_conv.cpp:581
std::pair< smt_astt, smt_astt > apply_ieee754_rne_enclosure(smt_astt real_result, smt_astt lo_r, smt_astt hi_r, const floatbv_type2t &fbv_type)
Interval-lifted RNE enclosure helper.
Definition ir_ieee_conv.cpp:175
void propagate_nan_pred(smt_astt lhs, smt_astt rhs)
Propagate a NaN predicate from rhs to lhs after an SSA assignment.
Definition ir_ieee_conv.cpp:81
void propagate_neg_zero_through_ite(smt_astt outer, smt_astt inner, smt_astt guard)
Re-attach inner's negative-zero predicate (if any) to outer, guarded by guard (the condition under wh...
Definition ir_ieee_conv.cpp:106
smt_astt apply_nan_cmp(smt_astt cmp, smt_astt a, smt_astt b, bool is_neq)
Wrap a comparison result with IEEE NaN semantics.
Definition ir_ieee_conv.cpp:167
void propagate_interval(smt_astt lhs, smt_astt rhs)
Propagate interval metadata from rhs to lhs after an SSA assignment.
Definition ir_ieee_conv.cpp:11
smt_astt encode_ieee_rem(const expr2tc &expr)
Encode ieee_rem2t (IEEE 754 remainder, C's remainder()).
Definition ir_ieee_conv.cpp:867
void store_neg_zero_pred(smt_astt t, smt_astt neg_zero_pred)
Record a predicate that is true iff the SMT AST t represents IEEE 754 -0.0.
Definition ir_ieee_conv.cpp:88
smt_astt encode_ieee_sub(const expr2tc &expr)
Integer-encoding path for ieee_sub.
Definition ir_ieee_conv.cpp:541
void store_nan_pred(smt_astt t, smt_astt nan_pred)
Record that the SMT AST t may be NaN; nan_pred is a boolean SMT term that is true iff t holds a NaN v...
Definition ir_ieee_conv.cpp:70
ra_interval_t get_interval(smt_astt t) const
Look up the tracked interval for t; fall back to the point interval {t, t}.
Definition ir_ieee_conv.cpp:59
std::pair< smt_astt, smt_astt > apply_ieee754_rna_enclosure(smt_astt real_result, smt_astt lo_r, smt_astt hi_r, const floatbv_type2t &fbv_type)
Interval-lifted RNA enclosure helper (round-to-nearest-away).
Definition ir_ieee_conv.cpp:230
ir_ieee_convt(smt_solver_baset *ctx)
Definition ir_ieee_conv.cpp:7
std::pair< smt_astt, smt_astt > apply_ieee754_rtz_enclosure(smt_astt real_result, smt_astt lo_r, smt_astt hi_r, const floatbv_type2t &fbv_type)
Interval-lifted RTZ enclosure helper (round-to-zero / truncation).
Definition ir_ieee_conv.cpp:385
std::pair< smt_astt, smt_astt > apply_ieee754_rup_enclosure(smt_astt real_result, smt_astt lo_r, smt_astt hi_r, const floatbv_type2t &fbv_type)
Interval-lifted RUP enclosure helper (round-to-plus-infinity).
Definition ir_ieee_conv.cpp:285
smt_astt encode_ieee_div(const expr2tc &expr)
Integer-encoding path for ieee_div.
Definition ir_ieee_conv.cpp:654
smt_astt combine_nan_preds(smt_astt a, smt_astt b) const
Combine two NaN predicates with OR.
Definition ir_ieee_conv.cpp:116
void propagate_neg_zero_pred(smt_astt lhs, smt_astt rhs)
Propagate a negative-zero predicate from rhs to lhs after an SSA assignment.
Definition ir_ieee_conv.cpp:99
smt_astt encode_ieee_fma(const expr2tc &expr)
Integer-encoding path for ieee_fma (fused multiply-add).
Definition ir_ieee_conv.cpp:770
void store_interval(smt_astt t, smt_astt lo, smt_astt hi)
Store an interval for t in the map.
Definition ir_ieee_conv.cpp:65
smt_astt get_nan_pred(smt_astt t) const
Return the stored NaN predicate for t, or nullptr if none is known.
Definition ir_ieee_conv.cpp:75
smt_astt get_neg_zero_pred(smt_astt t) const
Return the stored negative-zero predicate for t, or nullptr if no negative-zero metadata is recorded ...
Definition ir_ieee_conv.cpp:93
std::pair< smt_astt, smt_astt > apply_ieee754_rdn_enclosure(smt_astt real_result, smt_astt lo_r, smt_astt hi_r, const floatbv_type2t &fbv_type)
Interval-lifted RDN enclosure helper (round-to-minus-infinity).
Definition ir_ieee_conv.cpp:335
void assert_symbol_range(const std::string &name, smt_astt sym_ast, const symbol2t &sym)
Assert C integer type range for narrow symbols (width < 32 bits).
Definition ir_ieee_conv.cpp:18
void assert_representable_magnitude(smt_astt sym_ast, const floatbv_type2t &fbv_type)
Assert that a float symbol's real value is representable: every finite value has magnitude at most ma...
Definition ir_ieee_conv.cpp:45
smt_astt encode_ieee_add(const expr2tc &expr)
Integer-encoding path for ieee_add.
Definition ir_ieee_conv.cpp:501
The base SMT-conversion class/interface.
Definition smt_solver.h:170
Symbol type.
Definition irep2_expr.h:625
irep_container< expr2t > expr2tc
Definition irep2.h:431
const smt_ast * smt_astt
Definition smt_ast.h:30
Interval [lo, hi] in the real-arithmetic SMT encoding.
Definition ir_ieee_conv.h:34
smt_astt hi
Definition ir_ieee_conv.h:36
smt_astt lo
Definition ir_ieee_conv.h:35