o
    8Va                     @   s   d Z ddlmZmZmZmZmZmZmZm	Z	m
Z
mZ ddlmZmZmZmZ ddlmZ ddlmZ dd Zdd	 Zd
d Zdd Zdd Zdd Zdd ZdS )zTests of monomial orderings.     )
monomial_keylexgrlexgrevlexilexigrlexLexOrderInverseOrderProductOrderbuild_product_order)xyzt)S)raisesc                   C   s   t ddksJ tt dksJ t dt dksJ t dt dks$J t dt dks.J t dt dks8J t dt dk sBJ t dt dk sLJ t dt dk sVJ t jd	u s]J t t ksdJ t tksjJ d S )
N         r   r   r   r   r   r   r   r   r      r   r   r   r   r   r   r   r   r   T)r   str	is_globalr   r    r   r   B/usr/lib/python3/dist-packages/sympy/polys/tests/test_orderings.pytest_lex_order   s   r!   c                   C   6  t ddksJ tt dksJ t dt dksJ t dt dks$J t dt dks.J t dt dks8J t dt dk sBJ t dt dk sLJ t d	t dk sVJ t dt dks`J t dt dksjJ t dt d	k stJ t dt d	k s~J t d
t dksJ t dt dk sJ t jdu sJ d S )Nr   )   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   T)r   r   r   r   r   r   r    test_grlex_order       r(   c                   C   r"   )Nr   )r#   )r   r   r   r   r   r   r   r$   r%   r&   r'   T)r   r   r   r   r   r   r    test_grevlex_order7   r)   r-   c                  C   s   t t} t t}| d| dksJ |d|dk sJ t| dks$J t|dks,J | jdu s3J |jdu s:J | |ks@J | t t ksIJ d S )Nr   )r   r   r   r   r   r   F)r	   r   r   r   r   r   )r   r   r   r   r    test_InverseOrderP   s   r.   c                  C   s   t tdd ftdd f} | d| dksJ t| dksJ | jdu s&J t td ftd fjd u s4J t td ftd fjdu sBJ d S )	Nc                 S   s   | d d S Nr   r   mr   r   r    <lambda>^       z#test_ProductOrder.<locals>.<lambda>c                 S   s   | dd  S r/   r   r0   r   r   r    r2   ^   r3   )r   r   r   r      )r   r   r4   r4   r4   zProductOrder(grlex, grlex)TF)r
   r   r   r   r   r   )Pr   r   r    test_ProductOrder]   s    r6   c                  C   s  t  tksJ t dtksJ t dtksJ t dtksJ ttdd  ttdd  ttd td  tt td t	j
td td ttttd  t td td  g} t| t dtttgd	t	j
ttd td ttt td td td  tttd  t td td  gksJ t| t dtttgd	t	j
ttttd tt td td td td  ttd  t td td  gksJ t| t dtttgd	t	j
ttttd tt td td td td  td td  ttd  t gksJ d S )
Nr   r   r   c                   S      t dS )NZfoor   r   r   r   r    r2   l       z#test_monomial_key.<locals>.<lambda>c                   S   r7   )Nr   r8   r   r   r   r    r2   m   r9   r   r   )key)r   r   r   r   r   
ValueErrorr   r   r   r   ZOnesorted)Mr   r   r    test_monomial_keye   s    PNNNr>   c                   C   sz   t dttfdttffttttgddksJ t dttfdttffttttgt dttfdttffttttgks;J d S )Nr   )r   r4   r#      ))	   )r   r4   )   )r#   r?   )r   r   r   r   r   r   r   r   r    test_build_product_orderw   s   $  rB   N)__doc__Zsympy.polys.orderingsr   r   r   r   r   r   r   r	   r
   r   Z	sympy.abcr   r   r   r   Z
sympy.corer   Zsympy.testing.pytestr   r!   r(   r-   r.   r6   r>   rB   r   r   r   r    <module>   s    0