+
    ip                         ^ RI Ht ^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ R	IHtHt ^ R
IHtHtHt ^ RIHt ^RIHt ^RIHtHtHtH t  ]! R4      t! ! R R]4      t"R# )    )S)Basic)Tuple)LambdaBadSignatureError)
fuzzy_boolEq)Dummy)_sympify)And
as_Boolean)siftflattenhas_dups)sympy_deprecation_warning)Contains)SetUnion	FiniteSetSetKindconditionsetc                      a  ] tR t^t o Rt]P                  3R lt]! R 4      t	]! R 4      t
]! R 4      t]R 4       t]R 4       tR tR	 tR
 tR tRtV tR# )ConditionSeta  
Set of elements which satisfies a given condition.

.. math:: \{x \mid \textrm{condition}(x) = \texttt{True}, x \in S\}

Examples
========

>>> from sympy import Symbol, S, ConditionSet, pi, Eq, sin, Interval
>>> from sympy.abc import x, y, z

>>> sin_sols = ConditionSet(x, Eq(sin(x), 0), Interval(0, 2*pi))
>>> 2*pi in sin_sols
True
>>> pi/2 in sin_sols
False
>>> 3*pi in sin_sols
False
>>> 5 in ConditionSet(x, x**2 > 4, S.Reals)
True

If the value is not in the base set, the result is false:

>>> 5 in ConditionSet(x, x**2 > 4, Interval(2, 4))
False

Notes
=====

Symbols with assumptions should be avoided or else the
condition may evaluate without consideration of the set:

>>> n = Symbol('n', negative=True)
>>> cond = (n > 0); cond
False
>>> ConditionSet(n, cond, S.Integers)
EmptySet

Only free symbols can be changed by using `subs`:

>>> c = ConditionSet(x, x < 1, {x, z})
>>> c.subs(x, y)
ConditionSet(x, x < 1, {y, z})

To check if ``pi`` is in ``c`` use:

>>> pi in c
False

If no base set is specified, the universal set is implied:

>>> ConditionSet(x, x < 1).base_set
UniversalSet

Only symbols or symbol-like expressions can be used:

>>> ConditionSet(x + 1, x + 1 < 1, S.Integers)
Traceback (most recent call last):
...
ValueError: non-symbol dummy not recognized in condition

When the base set is a ConditionSet, the symbols will be
unified if possible with preference for the outermost symbols:

>>> ConditionSet(x, x < y, ConditionSet(z, z + y < 2, S.Integers))
ConditionSet(x, (x < y) & (x + y < 2), Integers)

c                  a aa \        S4      o\        S.4      p\        V4      '       d   \        R 4      h\        V4      p\	        V\
        4      '       g   \        RV,          4      h\        S4      o\	        S\        4      '       d*   SpR S 4       p\        V!  o\        RV RS R2RRR7       \        S4      oS\        P                  J d   V# S\        P                  J d   \        P                  # V\        P                  J d   \        P                  # V F(  p\        VR	R
4      '       d   K  \!        RV,          4      h	  VP#                  S4      \        P                  J d   \        RS: RV: R24      hRp\	        V\        4      '       dR   \%        VVV3R l4      p	V	R,          '       d"   \        V	R,          !  p\        V	R,          !  pM\        V	R,          !  # \	        VS 4      '       Ed-   VP&                  w  rpV 3R lp\)        VSV
34      w  rW8w  d   \        R4      h\+        \-        \        S.4      \        V
.4      4      4      pV
S8X  d   \        SV4      oTpMVP.                  SP.                  ,          '       gD   VP1                  4        UUu/ uF	  w  ppVVbK  	  ppp\        SVP3                  V4      4      oTpMQSP.                  V
P.                  ,          '       g/   SP3                  V4      o\        SP3                  V4      V4      oTp\	        S\4        4      '       db   SSP&                  ^ ,          8X  dJ   \	        SP&                  ^,          \
        4      '       d#   SP&                  ^,          P7                  V4      # \8        P:                  ! S SSV4      pVf   V# \=        VV4      # u uppi )zDuplicate symbols detectedz'base set should be a Set object, not %sc              3   :   "   T F  p\        V^ 4      x  K  	  R# 5i)r   Nr	   ).0lhss   & w/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/sets/conditionset.py	<genexpr>'ConditionSet.__new__.<locals>.<genexpr>e   s     4)3BsAJJ)s   zq
Using a set for the condition in ConditionSet is deprecated. Use a boolean
instead.

In this case, replace

    z

with

    
z1.5zdeprecated-conditionset-set)deprecated_since_versionactive_deprecations_target	_diff_wrtFz`%s` is not symbol-likezsym `z` is not in base_set ``Nc                 :   < \        SP                  SV 4      4      # N)r   subs)_	conditionsyms   &r   <lambda>&ConditionSet.__new__.<locals>.<lambda>   s    Jy~~c1/E$F    Tc                 b   < S! V \        \        ^ 4      4      P                  4       P                  # r   )r
   adummyas_dummyr,   )sclss   &r   sig!ConditionSet.__new__.<locals>.sig   s%    1bm,557;;;r/   z"sym does not match sym of base set)r   r   r   r   
isinstancer   	TypeErrorr   r   r   r   r   truefalseEmptySetgetattr
ValueErrorcontainsr   argsmapdictzipfree_symbolsitemsxreplacer   	intersectr   __new__r   )r5   r,   r+   base_setflatcondition_origtempiknowsiftedr4   cbr6   sasbrepskvrvs   fff&                r   rH   ConditionSet.__new__X   s5   smu~D>>#$@AAH%(C((9HDF FY'	i++&N4)4DT
I%   K  */+H" y)	O::qzz!:: A1k511 !:Q!>??  S!QWW,#xPQQh	**FHFd|| &,/$fTl3 &,//h$$mmGA!<sAh'FBx'(LMMGSENGQCL9:DCx	1-	^^c&6&666)-6A16	1::d+;<	++ann<<ll4(	 2 24 8!<	 i**y~~a7H0H)..+S11 ~~a(228<<]]3Y9\r6uT26 7s   )Oc                (    V P                   ^ ,          # r1   r@   selfs   &r   r-   ConditionSet.<lambda>   s    		!r/   c                (    V P                   ^,          # )   rZ   r[   s   &r   r-   r]      s    diilr/   c                (    V P                   ^,          # )   rZ   r[   s   &r   r-   r]      s    TYYq\r/   c                    V P                   P                  V P                  P                  ,
          pWP                  P                  ,          # r(   )r+   rD   r,   rI   )r\   	cond_symss   & r   rD   ConditionSet.free_symbols   s3    NN//$((2G2GG	==5555r/   c                .    \        V P                  .4      # r(   )r   r,   r[   s   &r   bound_symbolsConditionSet.bound_symbols   s    z""r/   c                b  a V3R  loS! V P                   V4      '       g   \        P                  # \        WP                  4      pV\        P                  J d   \        P                  # \        V P                   3V P                  4      p V! V4      p\        W$4      #   \         d     R# i ; i)c                 j  < W3 Uu. uF  p\        V\        4      NK  	  ppVP                  R 4      pV^8X  d   R# V^ 8X  d   R # \        V 4      \        V4      8H  ;'       dM    \        ;QJ d(    V3R l\        W4       4       F  '       d   K   R# 	  R # ! V3R l\        W4       4       4      # u upi )TFc              3   8   <"   T F  w  rS! W4      x  K  	  R # 5ir(    )r   rM   jok_sigs   &  r   r    9ConditionSet._contains.<locals>.ok_sig.<locals>.<genexpr>   s      ,4)2qs   )r8   r   countlenallrC   )arQ   rM   tuplesrP   rm   s   &&   r   rm   &ConditionSet._contains.<locals>.ok_sig   s    56F;FqjE*FF;T"AAvAvq6SV# 4 4 ,4),Q,4 4 4 ,4),Q,4 )4 4 <s   B0N)	r,   r   r;   r   rI   r   r+   r   r9   )r\   other	base_condlamdalambda_condrm   s   &&   @r   	_containsConditionSet._contains   s    	4 dhh&&77N UMM2	77N {DNN3	/,K y..  		s   B B.-B.c                    \        V P                  V P                  4      p\        V P                  \        4      '       d   V! V!  pMV! V4      p\        W P                  P                  V4      4      # r(   )r   r,   r+   r8   r   r   rI   r?   )r\   ru   fs   && r   as_relationalConditionSet.as_relational   sS    488T^^,dhh&&5	A%A1mm,,U344r/   c                |   V P                   w  r4pVP                  V\        4      pVP                  \        4      pVP                  W4      pW8w  d,   V'       g   VP                  W4      pV P	                  W4V4      # V'       d   M&\        VR R4      '       d   VP                  W4      pM V P	                  W4V4      # )r%   F)r@   r)   r2   hasfuncr=   )	r\   oldnewr,   condbasedsyminsymnewbases	   &&&      r   
_eval_subsConditionSet._eval_subs   s    ))4xxV$ ))C%?yy*99S00S+u--99S&DyyD))r/   c                @    \        V P                  P                  4      # r(   )r   r,   kindr[   s   &r   _kindConditionSet._kind   s    txx}}%%r/   rk   N)__name__
__module____qualname____firstlineno____doc__r   UniversalSetrH   propertyr,   r+   rI   rD   rf   ry   r}   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s~     CH /0nn W7r ,
-C23I12H6 6 # #/:5*$& &r/   r   N)#sympy.core.singletonr   sympy.core.basicr   sympy.core.containersr   sympy.core.functionr   r   sympy.core.logicr   sympy.core.relationalr
   sympy.core.symbolr   sympy.core.sympifyr   sympy.logic.boolalgr   r   sympy.utilities.iterablesr   r   r   sympy.utilities.exceptionsr   r?   r   setsr   r   r   r   r2   r   rk   r/   r   <module>r      sL    " " ' 9 ' $ # ' / = = @  0 0 
~	c&3 c&r/   