MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / hasStored

Method hasStored

ir/memory.cpp:1351–1373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1349
1350
1351expr Memory::hasStored(const Pointer &p, const expr &bytes) const {
1352 assert(has_initializes_attr);
1353
1354 unsigned bytes_per_byte = bits_byte / 8;
1355 expr bid = p.getShortBid();
1356 expr offset = p.getShortOffset();
1357 uint64_t bytes_i;
1358 if (bytes.isUInt(bytes_i) && (bytes_i / bytes_per_byte) <= 8) {
1359 expr ret = true;
1360 for (uint64_t off = 0; off < (bytes_i / bytes_per_byte); ++off) {
1361 expr off_expr = expr::mkUInt(off, offset);
1362 ret &= has_stored_arg.load(bid.concat(offset + off_expr));
1363 }
1364 return ret;
1365 } else {
1366 expr var = expr::mkFreshVar("#off", offset);
1367 state->addQuantVar(var);
1368 expr bytes_div = bytes.zextOrTrunc(offset.bits())
1369 .udiv(expr::mkUInt(bytes_per_byte, bytes));
1370 return (var.uge(offset) && var.ult(offset + bytes_div))
1371 .implies(has_stored_arg.load(bid.concat(var)));
1372 }
1373}
1374
1375void Memory::record_store(const Pointer &p, const smt::expr &bytes) {
1376 assert(has_initializes_attr);

Callers 1

isDereferenceableMethod · 0.80

Calls 12

getShortBidMethod · 0.80
getShortOffsetMethod · 0.80
isUIntMethod · 0.80
addQuantVarMethod · 0.80
udivMethod · 0.80
ugeMethod · 0.80
ultMethod · 0.80
loadMethod · 0.45
concatMethod · 0.45
zextOrTruncMethod · 0.45
bitsMethod · 0.45
impliesMethod · 0.45

Tested by

no test coverage detected