o
    h                     @   s   d dl mZ d dlmZ d dlmZ 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 ed	ed
ZZdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd ZdS )    )rewriterule)Basic)S)Symbol)sinxy)rebuild)Qpqc                  C   s   t tttdtttdtfd} t| ttdtdttdtdgks+J td }td }t ||tfd} td }t| |td gksLJ d S N      )	variables   )r   r   r   r   listr   )rlp1p2expr r   T/var/www/html/ai/venv/lib/python3.10/site-packages/sympy/unify/tests/test_rewrite.pytest_simple   s   $2r   c                  C   s   t tttdtttdtfd} t| ttdtdttdtdgks+J t td td tfd} t| td td gksFJ d S r   )r   r   r   r   r   r	   r   r   r   r   test_simple_variables   s   $2"r   c                  C   s^   t d td  } t t d }t| |t tf}td td  }t||tt d gks-J d S )Nr   r      )r   r   r   r   r	   r   )r   r   r   r   r   r   r   test_moderate   s
   "r   c                  C   s   t td t td  } d}t| |ttf}t|t td t td  dgks+J t|t td t td  dgks@J d S )Nr   r   )r   r   r   r   r   r   r	   )r   r   r   r   r   r   test_sincos&   s
   *.r   c                  C   sB   t tt tt ttf} t| tt j tt| tt  d S N)r   r   r   nextr   r	   is_commutativestrr   r   r   r   test_Exprs_ok.   s   r$   c                  C   sL   t ttd tgdd } t| tdrJ tt| tddks$J d S )Nr   c                 S   s   | dk S )N
   r   )r   r   r   r   <lambda>4   s    z'test_condition_simple.<locals>.<lambda>         )r   r   r   r   r
   r!   r   r   r   r   test_condition_simple3   s    r*   c                  C   s   t tt tt ttgdd } td}tddd}|| }t| ||| gks*J tddd}tddd}t| || || || hksHJ d S )	Nc                 S   s   | j S r    )
is_integerr   r   r   r   r&   :   s    z)test_condition_multiple.<locals>.<lambda>abT)integercd)r   r   r	   r   r   set)r   r,   r-   r   r/   r0   r   r   r   test_condition_multiple9   s   (r2   c                  C   s^   t tt tt ttgttd} ttd\}}|| }t| |t||| gks-J d S )N)assumeab)r   r   r	   r   r.   mapr   r   )r   r,   r-   r   r   r   r   test_assumptionsE   s   "&r6   N)sympy.unify.rewriter   sympy.core.basicr   sympy.core.singletonr   sympy.core.symbolr   (sympy.functions.elementary.trigonometricr   	sympy.abcr   r	   sympy.strategies.rlr
   sympy.assumptionsr   r   r   r   r   r   r   r$   r*   r2   r6   r   r   r   r   <module>   s"    