MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / operator+

Method operator+

smt/expr.cpp:719–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

717 z3app)
718
719expr expr::operator+(const expr &rhs) const {
720 expr a, b;
721 // (concat x const) + rhs -> (concat const+rhs) if no overflow happens
722 if (rhs.isConst() && isConcat(a, b) && b.isConst()) {
723 auto rhs2 = rhs.trunc(b.bits());
724 if (rhs2.zextOrTrunc(rhs.bits()).eq(rhs) &&
725 b.add_no_uoverflow(rhs2).isTrue())
726 return a.concat(b + rhs2);
727 }
728 return binopc(Z3_mk_bvadd, operator+, Z3_OP_BADD, isZero, alwaysFalse);
729}
730
731expr expr::operator-(const expr &rhs) const {
732 C();

Callers

nothing calls this directly

Calls 8

add_no_uoverflowMethod · 0.80
isConstMethod · 0.45
truncMethod · 0.45
bitsMethod · 0.45
eqMethod · 0.45
zextOrTruncMethod · 0.45
isTrueMethod · 0.45
concatMethod · 0.45

Tested by

no test coverage detected