Replace `__pos__` op with `lambda x: x`
Closed this issue · 2 comments
zwimer commented
Description
Here we define the __pos__
op:
Line 403 in 2e24e67
This op is really just a no-op; that is to say x == +x
should always be true; thus instead of creating an op for __pos__
, why do we not just replace this function with lambda x: x
?
Alternatives
Leave the function as is or add a simplifier.
Additional context
It adds code bloat and wastes cycles
zwimer commented
This is also what the Z3 backend does internally: https://z3prover.github.io/api/html/classz3py_1_1_bit_vec_ref.html#a222a5ab96b9653fccdf62318c0b75b4e
zwimer commented
Fixed via 306