Closed fsaad closed 4 years ago
These are now fine, but the major hurdle remains the unions and intersections of the symbolic events cases (from test_transforms_solve):
# TODO: These test cases need to be fixed, so that
# Intersection(FiniteSet('a'), FiniteSet('b'))
# becomes EmptySet.
# Solve a conjunction with intersection.
event = (Y << {'a', 'b'}) & (Y << {'b', 'c'})
assert event.solve() == sympy.Union(
sympy.FiniteSet('b'),
sympy.Intersection(sympy.FiniteSet('a'), sympy.FiniteSet('c')))
# Solve a conjunction with no intersection.
event = (Y << {'a', 'b'}) & (Y << {'c'})
assert event.solve() == sympy.Intersection(
sympy.FiniteSet('a', 'b'),
sympy.FiniteSet('c'))
Example 1
Example 2
The solution is to create two classes
EventFiniteReal
andEventFiniteNominal
and handle the inversion appropriately under each case.