
    [i                        U d dl Z d dlZd dlmZ  e j        e          Zej        ej        ej        ej        ej	        ej
        ej        ej        ej
        ej	        ej        ej        iZeeej                 eej                 f         ed<   ej        ej	        ej        ej
        fZdedeej                 dz  fdZ	 	 dd	ej        d
ej        dededeej        ej        f         dz  f
dZdej        d
ej        dedej        fdZdS )    N)FloorDiv_MIRROR_REL_OPtypereturnc                 6    t                               |           S N)r   get)r   s    K/var/www/icac/venv/lib/python3.11/site-packages/torch/utils/_sympy/solve.pymirror_rel_opr      s    d###       Texprthingtrialsfloordiv_inequalityc                 T   t          t          |                     }t          | t          j                  r|*t
                              dt          |                      d S | j                            |          }| j	                            |          }|r |rt
                              d||            d S g }|r|
                    |            |r)|
                     || j	        | j                             |D ]}|t          |t          j                  st          d          t          |          D ]}	t          |||          }
|
|k    r n|
}t          |t          j                  r2|j        |k    r't
                              d| |           ||j	        fc S d S )Nz$expression with unsupported type: %sz0thing (%s) found in both sides of expression: %szexpected sympy.Rel)r   zsolved: %s ---> %s)r   r   
isinstancesympyRellogdebuglhshasrhsappendAssertionErrorrange_try_isolate_lhs)r   r   r   r   mirrorlhs_has_thingrhs_has_thingexpressionse_trials              r
   	try_solver&   (   s    4::&&F
 dEI&& &.		8$t**EEEtHLL''MHLL''M
   		DeTRRRt K  !4    766$(DH55666  9!UY'' 	7 !5666v 	 	A$QCVWWWEzzAA a## 	II*D!444ae8OOO4r   r#   c                    t          |           }t          | t          j                  rbt          | j        t          j                  r%t          fd| j        j        D                       nd} || j        |z
  | j        |z
            } t          | t          j                  rt          | j        t          j	                  r| j        \  }}t          j	        fd|j        D              }t          | t                    r|j        nt          | t                    s|j        sR||z  }||z  }t          | t                    r|j        rt          |          }|t          d           |||          } |rUt          | t          j                  r:t          | j        t                    r| j        j        j        r| j        j        r t          | t          j                  r]| j        j        \  }}	t          j        t          j        || j        |	z            t          j        || j        dz   |	z                      S t          | t          j                  r]| j        j        \  }}	t          j        t          j        || j        |	z            t          j        || j        dz   |	z                      S t          | t          j        t          j        f          rct          | t          j                  r| j        n	| j        dz   }
t          j        | j        j        d         |
| j        j        d         z            S t          | t          j        t          j        f          rct          | t          j                  r| j        n	| j        dz   }
t          j        | j        j        d         |
| j        j        d         z            S | S )Nc              3   F   K   | ]}|                               |V  d S r   r   .0ar   s     r
   	<genexpr>z#_try_isolate_lhs.<locals>.<genexpr>i   s2      ::aQUU5\\:::::::r   r   c                 >    g | ]}|                               |S  r)   r*   s     r
   
<listcomp>z$_try_isolate_lhs.<locals>.<listcomp>r   s(    DDD!quuU||DADDDr   zexpected op to be not None   )r   r   r   r   r   Addsumargsr   MulINEQUALITY_TYPESis_negativeis_zeror   r   r   divisoris_positive
is_integerEqAndGeLtNeOrGtLe)r#   r   r   oplhs_not_thingr   r   other	numeratordenominatorquotients    `         r
   r   r   a   s    
aB!UY = !%++C::::15::::::: 	
 Bqu}$aem&;<< !UY Jquei$@$@ 6S	DDDDsxDDDE
 1.// 	E4E4M1.// 5N47K 5N +C+C !-.. '53D '"2&&z$%ABBB3A 	"Gq%)$$"G quh''"G EM%	"G
 E"G a"" 	%&UZ"I{9QU[%8::aeai;%>@@   a"" 	%&UZ"I{8QU[%8::aeai;%>@@   a%(EH-.. 	G *1eh 7 7HquuaeaiH8AEJqMHquz!},DFFF a%(EH-.. 	G *1eh 7 7HquuaeaiH8AEJqMHquz!},DFFFHr   )r   T)loggingr   torch.utils._sympy.functionsr   	getLogger__name__r   r<   r@   r>   rC   rB   r?   r   dictr   Basicr   __annotations__r6   r   intbooltupleExprr&   r   r/   r   r
   <module>rU      s     1 1 1 1 1 1 g!! 
Heh	Heh	Heh	Heh	Heh	Heh<T%+&UY78    Heh%(; $ $ei4!7 $ $ $ $*  $	6 6
+6;6 6 	6
 59ej !D(6 6 6 6rR{R ;R=AR
[R R R R R Rr   