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

Method sadd_sat

smt/expr.cpp:805–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

803}
804
805expr expr::sadd_sat(const expr &rhs) const {
806 expr add_ext = sext(1) + rhs.sext(1);
807 auto bw = bits();
808 auto min = IntSMin(bw);
809 auto max = IntSMax(bw);
810 return mkIf(add_ext.sle(min.sext(1)),
811 min,
812 mkIf(add_ext.sge(max.sext(1)),
813 max,
814 *this + rhs));
815}
816
817expr expr::uadd_sat(const expr &rhs) const {
818 return mkIf(add_no_uoverflow(rhs),

Callers 2

toSMTMethod · 0.80
toSMTMethod · 0.80

Calls 3

sextMethod · 0.80
sleMethod · 0.80
sgeMethod · 0.80

Tested by

no test coverage detected