o
    h                     @   sd   d dl mZ d dlmZmZ ddlmZ ddlmZm	Z	m
Z
mZmZmZ G dd deZdd	 Zd
S )    )Expr)call_highest_priority
_sympifyit   )ImageSet)set_addset_subset_mulset_divset_powset_functionc                   @   s<  e Zd ZdZdZdd Zedd Zdd Ze	d	e
ed
dd Ze	d	e
eddd Ze	d	e
eddd Ze	d	e
eddd Ze	d	e
eddd Ze	d	e
eddd Ze	d	e
eddd Ze	d	e
edd d! Ze	d	e
ed"d#d$ Ze	d	e
ed%d&d' Zd(d) Zd*S )+SetExprab  An expression that can take on values of a set.

    Examples
    ========

    >>> from sympy import Interval, FiniteSet
    >>> from sympy.sets.setexpr import SetExpr

    >>> a = SetExpr(Interval(0, 5))
    >>> b = SetExpr(FiniteSet(1, 10))
    >>> (a + b).set
    Union(Interval(1, 6), Interval(10, 15))
    >>> (2*a + b).set
    Interval(1, 20)
    g      &@c                 C   s   t | |S N)r   __new__)clssetarg r   H/var/www/html/ai/venv/lib/python3.10/site-packages/sympy/sets/setexpr.pyr      s   zSetExpr.__new__c                 C   s
   | j d S )Nr   )args)selfr   r   r   <lambda>   s   
 zSetExpr.<lambda>c                 C   s   d || jS )NzSetExpr\left({}\right))format_printset)r   printerr   r   r   _latex   s   zSetExpr._latexother__radd__c                 C      t t| |S r   _setexpr_apply_operationr   r   r   r   r   r   __add__!      zSetExpr.__add__r"   c                 C      t t|| S r   r   r!   r   r   r   r   &   r#   zSetExpr.__radd____rmul__c                 C   r   r   r    r	   r!   r   r   r   __mul__+   r#   zSetExpr.__mul__r'   c                 C   r$   r   r&   r!   r   r   r   r%   0   r#   zSetExpr.__rmul____rsub__c                 C   r   r   r    r   r!   r   r   r   __sub__5   r#   zSetExpr.__sub__r*   c                 C   r$   r   r)   r!   r   r   r   r(   :   r#   zSetExpr.__rsub____rpow__c                 C   r   r   r    r   r!   r   r   r   __pow__?   r#   zSetExpr.__pow__r-   c                 C   r$   r   r,   r!   r   r   r   r+   D   r#   zSetExpr.__rpow____rtruediv__c                 C   r   r   r    r
   r!   r   r   r   __truediv__I   r#   zSetExpr.__truediv__r0   c                 C   r$   r   r/   r!   r   r   r   r.   N   r#   zSetExpr.__rtruediv__c                 C   s,   t || j}|d u rtt|| jS t|S r   )r   r   r   r   )r   funcresr   r   r   
_eval_funcS   s   zSetExpr._eval_funcN)__name__
__module____qualname____doc___op_priorityr   propertyr   r   r   NotImplementedr   r"   r   r'   r%   r*   r(   r-   r+   r0   r.   r3   r   r   r   r   r      sJ    r   c                 C   s2   t |tr|j}t |tr|j}| ||}t|S r   )
isinstancer   r   )opxyoutr   r   r   r    [   s   


r    N)
sympy.corer   sympy.core.decoratorsr   r   	fancysetsr   setsr   r   r	   r
   r   r   r   r    r   r   r   r   <module>   s     T