�
��g�0 � �" � d Z ddlmZmZmZ ddlmZmZ ddlm Z m
Z
mZmZm
Z
mZ ddlmZ ddlmZmZmZmZ ddlmZmZmZmZmZmZ G d� d � � Z G d
� d� � Z G d� d
� � Zdd�Zd� Z G d� d� � Z! G d� d� � Z"dS )a
The classes used here are for the internal use of assumptions system
only and should not be used anywhere else as these do not possess the
signatures common to SymPy objects. For general use of logic constructs
please refer to sympy.logic classes And, Or, Not, etc.
� )�combinations�product�zip_longest)�AppliedPredicate� Predicate)�Eq�Ne�Gt�Lt�Ge�Le)�S)�Or�And�Not�Xnor)�
Equivalent�ITE�Implies�Nand�Nor�Xorc �\ � � e Zd ZdZd
� fd� Zed� � � Zd� Zd� Zd� Z e Z
d� Zd � Z� xZ
S )�Literala{
The smallest element of a CNF object.
Parameters
==========
lit : Boolean expression
is_Not : bool
Examples
========
>>> from sympy import Q
>>> from sympy.assumptions.cnf import Literal
>>> from sympy.abc import x
>>> Literal(Q.even(x))
Literal(Q.even(x), False)
>>> Literal(~Q.even(x))
Literal(Q.even(x), True)
Fc � �� t |t � � r|j d }d}n)t |t t t
f� � r|r| n|S t
� � � | � � }||_ ||_ |S )Nr T)
�
isinstancer �args�AND�ORr �super�__new__�lit�is_Not)�clsr"