def test_equivalents(compounds_pair: Tuple[Compound, Compound]) -> None: left_compound, right_compound = compounds_pair result = left_compound ^ right_compound assert are_compounds_equivalent(result, (left_compound - right_compound) | (right_compound - left_compound)) assert are_compounds_equivalent(result, (left_compound | right_compound) - (left_compound & right_compound))
def test_absorption_identity( compounds_pair: Tuple[Compound, Compound]) -> None: left_compound, right_compound = compounds_pair result = left_compound & (left_compound | right_compound) assert are_compounds_equivalent(result, left_compound)
def test_connection_with_disjoint( compounds_pair: Tuple[Compound, Compound]) -> None: left_compound, right_compound = compounds_pair result = left_compound - right_compound assert implication(left_compound.disjoint(right_compound), are_compounds_equivalent(result, left_compound))
def test_associativity( compounds_triplet: Tuple[Compound, Compound, Compound]) -> None: left_compound, mid_compound, right_compound = compounds_triplet result = (left_compound ^ mid_compound) ^ right_compound assert are_compounds_equivalent( result, left_compound ^ (mid_compound ^ right_compound))
def test_distribution_over_union( compounds_triplet: Tuple[Compound, Compound, Compound]) -> None: left_compound, mid_compound, right_compound = compounds_triplet result = left_compound & (mid_compound | right_compound) assert are_compounds_equivalent(result, (left_compound & mid_compound) | (left_compound & right_compound))
def test_idempotence(compound: Compound) -> None: assert are_compounds_equivalent(compound & compound, compound)
def test_idempotence(compound: Compound) -> None: result = compound | compound assert are_compounds_equivalent(result, compound)