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

Method ctlz

smt/expr.cpp:1098–1109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1096}
1097
1098expr expr::ctlz() const {
1099 C();
1100 auto nbits = bits();
1101 auto srt = sort();
1102
1103 auto cond = mkUInt(nbits, srt);
1104 for (unsigned i = 0; i < nbits; ++i) {
1105 cond = mkIf(extract(i, i) == 1u, mkUInt(nbits - 1 - i, srt), cond);
1106 }
1107
1108 return cond;
1109}
1110
1111expr expr::ctpop() const {
1112 C();

Callers 2

toSMTMethod · 0.80
frexpMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected