o
    h%                     @   sl   d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
 d dlmZ ddlmZ G d	d
 d
e
ZdS )    )S)sympify)EqNe)global_parameters)Boolean)	func_name   )Setc                       s6   e Zd ZdZd	 fdd	Zedd Zdd Z  ZS )
Containsa  
    Asserts that x is an element of the set S.

    Examples
    ========

    >>> from sympy import Symbol, Integer, S, Contains
    >>> Contains(Integer(2), S.Integers)
    True
    >>> Contains(Integer(-2), S.Naturals)
    False
    >>> i = Symbol('i', integer=True)
    >>> Contains(i, S.Naturals)
    Contains(i, Naturals)

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Element_%28mathematics%29
    Nc                    s   t |}t |}|d u rtj}t|tstdt| |r;||}t|tr3|t	j
t	jfv r2|S n|d ur;tdt | ||S )Nzexpecting Set, not %sz)_contains() should return Boolean or None)r   r   evaluate
isinstancer
   	TypeErrorr   	_containsr   r   truefalsesuper__new__)clsxsr   result	__class__ I/var/www/html/ai/venv/lib/python3.10/site-packages/sympy/sets/contains.pyr      s   


zContains.__new__c                 C   s   t  jdd | jd jD  S )Nc                 S   s,   g | ]}|j s|jst|ttfr|jqS r   )
is_Boolean	is_Symbolr   r   r   binary_symbols).0ir   r   r   
<listcomp>9   s    z+Contains.binary_symbols.<locals>.<listcomp>r	   )setunionargsselfr   r   r   r   7   s   
zContains.binary_symbolsc                 C   s
   | j d S )Nr	   )r$   r%   r   r   r   as_set>   s   
zContains.as_set)N)	__name__
__module____qualname____doc__r   propertyr   r'   __classcell__r   r   r   r   r   
   s    
r   N)
sympy.corer   sympy.core.sympifyr   sympy.core.relationalr   r   sympy.core.parametersr   sympy.logic.boolalgr   sympy.utilities.miscr   setsr
   r   r   r   r   r   <module>   s    