probsys / sppl

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

Make sure EventAnd.__invert__ and EventOr.__invert__ use reduce, not manual constructors #21

Closed fsaad closed 4 years ago

fsaad commented 4 years ago

Using reduce with & and | will correctly handle the simplification

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

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