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

Method ssub_sat

smt/expr.cpp:823–833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

821}
822
823expr expr::ssub_sat(const expr &rhs) const {
824 expr sub_ext = sext(1) - rhs.sext(1);
825 auto bw = bits();
826 auto min = IntSMin(bw);
827 auto max = IntSMax(bw);
828 return mkIf(sub_ext.sle(min.sext(1)),
829 min,
830 mkIf(sub_ext.sge(max.sext(1)),
831 max,
832 *this - rhs));
833}
834
835expr expr::usub_sat(const expr &rhs) const {
836 C();

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