# Path: tt/definitions/operands.py
# BOOLEAN_VALUES = {0, 1, True, False}
# 
# Path: tt/errors/evaluation.py
# class InvalidBooleanValueError(EvaluationError):
#     """An exception for when an invalid truth or don't care value is passed.
# 
#     Here's an example where we attempt to evaluate a \
#     :class:`BooleanExpression <tt.expressions.bexpr.BooleanExpression>` with
#     an invalid value passed through ``kwargs``::
# 
#         >>> from tt import BooleanExpression
#         >>> b = BooleanExpression('A or B')
#         >>> b.evaluate(A=1, B='brian')
#         Traceback (most recent call last):
#             ...
#         tt.errors.evaluation.InvalidBooleanValueError: "brian" passed as \
# value for "B" is not a valid Boolean value
# 
#     """
# 
# Path: tt/errors/symbols.py
# class DuplicateSymbolError(SymbolError):
#     """An exception type for user-specified duplicate symbols.
# 
#     Here's an example where we try to pass duplicate symbols to the
#     ``ordering`` property of the :class:`TruthTable \
#     <tt.tables.truth_table.TruthTable>` class::
# 
#         >>> from tt import TruthTable
#         >>> t = TruthTable('A or B', ordering=['A', 'A', 'B'])
#         Traceback (most recent call last):
#             ...
#         tt.errors.symbols.DuplicateSymbolError: Received duplicate symbols
# 
#     """
# 
# class ExtraSymbolError(SymbolError):
#     """An exception for a passed token that is not a parsed symbol.
# 
#     Here's a quick table example::
# 
#         >>> from tt import TruthTable
#         >>> t = TruthTable('A or B', ordering=['A', 'B', 'C'])
#         Traceback (most recent call last):
#             ...
#         tt.errors.symbols.ExtraSymbolError: Received unexpected symbols: "C"
# 
#     """
# 
# class MissingSymbolError(SymbolError):
#     """An exception type for a missing token value in evaluation.
# 
#     .. code-block:: python
# 
#         >>> from tt import BooleanExpression
#         >>> b = BooleanExpression('A and B')
#         >>> b.evaluate(A=1)
#         Traceback (most recent call last):
#             ...
#         tt.errors.symbols.MissingSymbolError: Did not receive value for the \
# following symbols: "B"
# 
#     """


from tt.definitions import BOOLEAN_VALUES
from tt.errors import (
    DuplicateSymbolError,
    ExtraSymbolError,
    InvalidBooleanValueError,
    MissingSymbolError)



def assert_iterable_contains_all_expr_symbols(iter_of_strs, reference_set):
    """Assert a one-to-one presence of all symbols in the passed iterable.

    :param iter_of_strs: An iterable of strings to assert.
    :type iter_of_strs: Iterable[:class:`str <python:str>`]

    :param reference_set: A set of strings, each of which will be asserted to
        be present in the passed iterable.
    :type reference_set: Set[:class:`str <python:str>`]

    .. note::

        This function will consume ``iter_of_strs``.

    :raises DuplicateSymbolError: If the passed iterable contains more than one
        of a given symbol.
    :raises ExtraSymbolError: If the passed iterable contains symbols not
        present in the reference set.
    :raises MissingSymbolError: If the passed iterable is missing symbols
        present in the reference set.

    This assertion is used for validation of user-specified sets of symbols.

    """
    passed_symbol_list = list(iter_of_strs)
    passed_symbol_set = set(passed_symbol_list)
    if len(passed_symbol_list) != len(passed_symbol_set):

# Path: tt/definitions/operands.py
# BOOLEAN_VALUES = {0, 1, True, False}
# 
# Path: tt/errors/evaluation.py
# class InvalidBooleanValueError(EvaluationError):
#     """An exception for when an invalid truth or don't care value is passed.
# 
#     Here's an example where we attempt to evaluate a \
#     :class:`BooleanExpression <tt.expressions.bexpr.BooleanExpression>` with
#     an invalid value passed through ``kwargs``::
# 
#         >>> from tt import BooleanExpression
#         >>> b = BooleanExpression('A or B')
#         >>> b.evaluate(A=1, B='brian')
#         Traceback (most recent call last):
#             ...
#         tt.errors.evaluation.InvalidBooleanValueError: "brian" passed as \
# value for "B" is not a valid Boolean value
# 
#     """
# 
# Path: tt/errors/symbols.py
# class DuplicateSymbolError(SymbolError):
#     """An exception type for user-specified duplicate symbols.
# 
#     Here's an example where we try to pass duplicate symbols to the
#     ``ordering`` property of the :class:`TruthTable \
#     <tt.tables.truth_table.TruthTable>` class::
# 
#         >>> from tt import TruthTable
#         >>> t = TruthTable('A or B', ordering=['A', 'A', 'B'])
#         Traceback (most recent call last):
#             ...
#         tt.errors.symbols.DuplicateSymbolError: Received duplicate symbols
# 
#     """
# 
# class ExtraSymbolError(SymbolError):
#     """An exception for a passed token that is not a parsed symbol.
# 
#     Here's a quick table example::
# 
#         >>> from tt import TruthTable
#         >>> t = TruthTable('A or B', ordering=['A', 'B', 'C'])
#         Traceback (most recent call last):
#             ...
#         tt.errors.symbols.ExtraSymbolError: Received unexpected symbols: "C"
# 
#     """
# 
# class MissingSymbolError(SymbolError):
#     """An exception type for a missing token value in evaluation.
# 
#     .. code-block:: python
# 
#         >>> from tt import BooleanExpression
#         >>> b = BooleanExpression('A and B')
#         >>> b.evaluate(A=1)
#         Traceback (most recent call last):
#             ...
#         tt.errors.symbols.MissingSymbolError: Did not receive value for the \
# following symbols: "B"
# 
#     """


# Path: tt/_assertions/collections.py
from tt.definitions import BOOLEAN_VALUES
from tt.errors import (
    DuplicateSymbolError,
    ExtraSymbolError,
    InvalidBooleanValueError,
    MissingSymbolError)




def assert_iterable_contains_all_expr_symbols(iter_of_strs, reference_set):
    """Assert a one-to-one presence of all symbols in the passed iterable.

    :param iter_of_strs: An iterable of strings to assert.
    :type iter_of_strs: Iterable[:class:`str <python:str>`]

    :param reference_set: A set of strings, each of which will be asserted to
        be present in the passed iterable.
    :type reference_set: Set[:class:`str <python:str>`]

    .. note::

        This function will consume ``iter_of_strs``.

    :raises DuplicateSymbolError: If the passed iterable contains more than one
        of a given symbol.
    :raises ExtraSymbolError: If the passed iterable contains symbols not
        present in the reference set.
    :raises MissingSymbolError: If the passed iterable is missing symbols
        present in the reference set.

    This assertion is used for validation of user-specified sets of symbols.

    """
    passed_symbol_list = list(iter_of_strs)
    passed_symbol_set = set(passed_symbol_list)
    if len(passed_symbol_list) != len(passed_symbol_set):

        raise DuplicateSymbolError('Received duplicate symbols')