probsys / sppl

Probabilistic programming system for fast and exact symbolic inference
Apache License 2.0
76 stars 10 forks source link

Consider implementing simplifications of And/Or in EventBasic #22

Closed fsaad closed 4 years ago

fsaad commented 4 years ago

https://github.com/probcomp/sum-product-dsl/blob/de4d0478da0ca6e7037120ddf7a2658368719f64/src/transforms.py#L769-L781

Example of present behavior

print((1.5 <= X) & ((1 <= X) < 2))                                                                    
(1.5 < X) & (1 <= X < 2)

If the subexpressions match, we can simplify it to 1.5 < X < 2

There is not much of a simplification that we can do for Or.