Пример #1
0
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))
Пример #2
0
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)
Пример #3
0
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))
Пример #4
0
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))
Пример #5
0
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))
Пример #6
0
def test_idempotence(compound: Compound) -> None:
    assert are_compounds_equivalent(compound & compound, compound)
Пример #7
0
def test_idempotence(compound: Compound) -> None:
    result = compound | compound

    assert are_compounds_equivalent(result, compound)