angr/claripy

Bool does not support rand/ror

Closed this issue · 3 comments

Given that BV supports __radd__, __rmul__, and other reversed ops, shouldn't Bool support __rand__ and __ror__ ?

I could do a PR for this if adding these ops makes sense.

We have not encountered any cases where we would need __rand__ and __ror__ for Bools. I'd rather not add new operators unless there is a real use case for them.

I encountered this while doing some work with claripy ASTs; in general, it's just a bit weird to not have them:

>>> claripy.false | True
<Bool True>
>>> True | claripy.false
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'bool' and 'Bool'

I don't think they need new operators, just using the existing or/and also as ror/rand.

Yeah this isn't very hard to fix. Thanks for reporting!