o
    g                     @   s   d dl mZ dddZdS )    )
EncodedCNFFc                    s   dd l }t tst }|  | dh jv r$|r"dd dD S dS |s=| j}|dk}|s4|S  fdd|D S | j}|dk}|sK|S  fd	d
}||S )Nr   c                 s   s    | ]}|V  qd S )N ).0fr   r   ]/var/www/visachat/venv/lib/python3.10/site-packages/sympy/logic/algorithms/pycosat_wrapper.py	<genexpr>   s    z&pycosat_satisfiable.<locals>.<genexpr>FFUNSATc                    $   i | ]} j t|d   |dkqS    r   symbolsabsr   litexprr   r   
<dictcomp>      $ z'pycosat_satisfiable.<locals>.<dictcomp>c                 3   sP    d}z	 t | } fdd|D V  d}q ty'   |s$dV  Y d S Y d S w )NFTc                    r
   r   r   r   r   r   r   r   #   r   z5pycosat_satisfiable.<locals>._gen.<locals>.<dictcomp>)nextStopIteration)resultssatisfiablesolr   r   r   _gen   s   z!pycosat_satisfiable.<locals>._gen)pycosat
isinstancer   add_propdatasolve	itersolve)r   
all_modelsr   exprsrresultr   r   r   r   pycosat_satisfiable   s*   

r&   Nr   )sympy.assumptions.cnfr   r&   r   r   r   r   <module>   s    