ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
cmath_lowering_policy Namespace Reference

Budget model that decides when cmath calls should be lowered inline vs dispatched to the Python model. More...

Classes

struct  expr_cost
struct  budget

Functions

static void measure_recursive (const nlohmann::json &node, size_t depth, expr_cost &cost)
expr_cost measure (const nlohmann::json &arg)
bool within_budget (const nlohmann::json &arg, const budget &b)

Detailed Description

Budget model that decides when cmath calls should be lowered inline vs dispatched to the Python model.

Inline expansion of complex-math (e.g. cmath.log) can create large IR trees that stall the solver; the budget caps structural cost of the argument AST to prevent that.

Function Documentation

◆ measure()

expr_cost cmath_lowering_policy::measure ( const nlohmann::json & arg)

◆ measure_recursive()

void cmath_lowering_policy::measure_recursive ( const nlohmann::json & node,
size_t depth,
expr_cost & cost )
static

◆ within_budget()

bool cmath_lowering_policy::within_budget ( const nlohmann::json & arg,
const budget & b )