36using namespace SVFUtil;
47 if (
expr.getExpr().num_args() == 0)
48 if (!
expr.getExpr().is_true() && !
expr.getExpr().is_false() && !
expr.is_numeral())
55 const z3::expr &e =
expr.getExpr().arg(
i);
70 res.insert(
r.begin(),
r.end());
71 assert(!
r.empty() &&
"symbol not init?");
76 for (
const auto &
id:
r)
95 for (
const auto &
id:
vars)
138 if (
lhs.size() !=
rhs.size())
return false;
143 if (
it ==
rhs.end() || !eq(
item.second,
it->second))
151 if (
lhs.size() !=
rhs.size())
return lhs.size() <
rhs.size();
159 if (!eq(
item.second,
it->second))
160 return item.second.id() <
it->second.id();
172 assert(
loc.is_numeral() &&
"location must be numeral");
185 assert(
loc.is_numeral() &&
"location must be numeral");
198 std::cout.flags(std::ios::left);
199 std::cout <<
"-----------Var and Value-----------\n";
204 std::cout << std::setw(25) <<
exprName.str();
212 std::cout <<
"\t Value: " << std::dec <<
sim <<
"\n";
215 std::cout <<
"-----------------------------------------\n";
bool lessThanVarToValMap(const VarToValMap &lhs, const VarToValMap &rhs) const
void extractSubVars(const Z3Expr &expr, Set< u32_t > &res)
Extract sub SVFVar IDs of a Z3Expr.
void printExprValues()
Print values of all expressions.
void store(const Z3Expr &loc, const Z3Expr &value)
Store value to location.
RelExeState & operator=(const RelExeState &rhs)
virtual Z3Expr toZ3Expr(u32_t varId) const
Return Z3 expression lazily based on SVFVar ID.
Z3Expr & load(const Z3Expr &loc)
Load value at location.
bool eqVarToValMap(const VarToValMap &lhs, const VarToValMap &rhs) const
const VarToValMap & getVarToVal() const
static u32_t getInternalID(u32_t idx)
Return the internal index if idx is an address otherwise return the value of idx.
Z3Expr buildRelZ3Expr(u32_t cmp, s32_t succ, Set< u32_t > &vars, Set< u32_t > &initVars)
Build relational Z3Expr.
bool operator==(const RelExeState &rhs) const
Overloading Operator==.
bool operator<(const RelExeState &rhs) const
Overloading Operator==.
static s32_t z3Expr2NumValue(const Z3Expr &e)
Return int value from an expression if it is a numeral, otherwise return an approximate value.
static bool isVirtualMemAddress(u32_t val)
Check bit value of val start with 0x7F000000, filter by 0xFF000000.
virtual Z3Expr & getZ3Expr(u32_t varId)
Return Z3 expression eagerly based on SVFVar ID.
void extractCmpVars(const Z3Expr &expr, Set< u32_t > &res)
Extract all related SVFVar IDs based on compare expr.
Map< u32_t, Z3Expr > VarToValMap
llvm::IRBuilder IRBuilder