o
    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   ๚r/var/www/html/construction_image-detection-poc/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"    