# Path: pyknow/conditionalelement.py
# class ConditionalElement(tuple):
#     """Base Conditional Element"""
# 
#     def __new__(cls, *args):
#         return super(ConditionalElement, cls).__new__(cls, args)
# 
#     def __repr__(self):  # pragma: no cover
#         return "%s%s" % (self.__class__.__name__, super().__repr__())
# 
# Path: pyknow/pattern.py
# class Bindable:
#     def __rlshift__(self, other):
#         if not isinstance(other, str):
#             raise TypeError("%s can only be binded to a string" % self)
#         elif self.__bind__ is not None:
#             raise RuntimeError("%s can only be binded once" % repr(self))
#         else:
#             self.__bind__ = other
#             return self
# 
#     def __hash__(self):
#         return hash((self.__bind__, ) + tuple(self))
# 
#     def __eq__(self, other):
#         return (self.__class__ == other.__class__
#                 and self.__bind__ == other.__bind__
#                 and super().__eq__(other))


from collections.abc import Callable
from pyknow.conditionalelement import ConditionalElement
from pyknow.pattern import Bindable

    def __or__(self, other):
        if isinstance(self, ORFC) and isinstance(other, ORFC):
            return ORFC(*[x for x in chain(self, other)])
        elif isinstance(self, ORFC):
            return ORFC(*[x for x in self]+[other])
        elif isinstance(other, ORFC):
            return ORFC(*[self]+[x for x in other])
        else:
            return ORFC(self, other)

    def __invert__(self):
        return NOTFC(self)


class ANDFC(FieldConstraint):
    pass


class ORFC(FieldConstraint):
    pass


class NOTFC(FieldConstraint):
    def __rlshift__(self, other):
        """Pass the binding to the internal element."""
        self[0].__rlshift__(other)
        return self



# Path: pyknow/conditionalelement.py
# class ConditionalElement(tuple):
#     """Base Conditional Element"""
# 
#     def __new__(cls, *args):
#         return super(ConditionalElement, cls).__new__(cls, args)
# 
#     def __repr__(self):  # pragma: no cover
#         return "%s%s" % (self.__class__.__name__, super().__repr__())
# 
# Path: pyknow/pattern.py
# class Bindable:
#     def __rlshift__(self, other):
#         if not isinstance(other, str):
#             raise TypeError("%s can only be binded to a string" % self)
#         elif self.__bind__ is not None:
#             raise RuntimeError("%s can only be binded once" % repr(self))
#         else:
#             self.__bind__ = other
#             return self
# 
#     def __hash__(self):
#         return hash((self.__bind__, ) + tuple(self))
# 
#     def __eq__(self, other):
#         return (self.__class__ == other.__class__
#                 and self.__bind__ == other.__bind__
#                 and super().__eq__(other))


# Path: pyknow/fieldconstraint.py
from collections.abc import Callable
from pyknow.conditionalelement import ConditionalElement
from pyknow.pattern import Bindable


    def __or__(self, other):
        if isinstance(self, ORFC) and isinstance(other, ORFC):
            return ORFC(*[x for x in chain(self, other)])
        elif isinstance(self, ORFC):
            return ORFC(*[x for x in self]+[other])
        elif isinstance(other, ORFC):
            return ORFC(*[self]+[x for x in other])
        else:
            return ORFC(self, other)

    def __invert__(self):
        return NOTFC(self)


class ANDFC(FieldConstraint):
    pass


class ORFC(FieldConstraint):
    pass


class NOTFC(FieldConstraint):
    def __rlshift__(self, other):
        """Pass the binding to the internal element."""
        self[0].__rlshift__(other)
        return self



class L(Bindable, FieldConstraint):