o
    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   úf/var/www/html/construction_image-detection-poc/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