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

Method concat

smt/expr.cpp:1862–1892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1860}
1861
1862expr expr::concat(const expr &rhs) const {
1863 expr a, b, c, d;
1864 unsigned h, l, h2, l2;
1865 if (isExtract(a, h, l)) {
1866 if (rhs.isExtract(b, h2, l2) && l == h2+1) {
1867 if (a.eq(b))
1868 return a.extract(h, l2);
1869
1870 // (concat (extract (concat const X)) (extract X))
1871 expr aa, ab;
1872 if (l2 == 0 && a.isConcat(aa, ab) && ab.eq(b) &&
1873 (h - aa.bits()) == b.bits())
1874 return aa.concat(b);
1875 }
1876
1877 // extract_l concat (concat extract_r foo)
1878 if (rhs.isConcat(b, c) && b.isExtract(d, h2, l2) && l == h2+1 && a.eq(d))
1879 return a.extract(h, l2).concat(c);
1880 }
1881
1882 // (concat (concat x extract) extract)
1883 if (isConcat(a, b) && b.isExtract(c, h, l) && rhs.isExtract(d, h2, l2) &&
1884 l == h2+1 && c.eq(d))
1885 return a.concat(c.extract(h, l2));
1886
1887 // (concat const (concat const2 x))
1888 if (isConst() && rhs.isConcat(a, b) && a.isConst())
1889 return concat(a).concat(b);
1890
1891 return binop_fold(rhs, Z3_mk_concat);
1892}
1893
1894expr expr::concat_zeros(unsigned bits) const {
1895 return bits ? concat(mkUInt(0, bits)) : *this;

Callers 15

IntSMinMethod · 0.45
IntSMaxMethod · 0.45
isConcatMethod · 0.45
operator+Method · 0.45
uremMethod · 0.45
operator<<Method · 0.45
lshrMethod · 0.45
bswapMethod · 0.45
bitreverseMethod · 0.45
fabsMethod · 0.45
fnegMethod · 0.45
copysignMethod · 0.45

Calls 6

isExtractMethod · 0.80
isConcatMethod · 0.80
eqMethod · 0.45
extractMethod · 0.45
bitsMethod · 0.45
isConstMethod · 0.45

Tested by

no test coverage detected