+
    ,ic  c                   s(   ^ RI 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t^RIHtHt ^RIHt ^R	IHt ^R
IHtHtHt ^RIHtHt ^RIHt ^RIHt ]	! R4      t]	! R4      t]! RRR7       ! R R]4      4       t ]! RRR7       ! R R]4      4       t!]! RRR7       ! R R]4      4       t" ! R R]4      t#] ! R R4      4       t$] ! R R4      4       t%] ! R R4      4       t&]PN                  ](,          t)]*](,          t+],])],]+],](],](],](]%3,          3,          3,          3,          3,          t-R  R! lt.R" R# lt/R$ R% lt0R& R' lt1R( R) lt2R* R+ lt3R, R- lt4 ! R. R/]4      t5 ! R0 R1]]Pl                  ,          4      t7 ! R2 R3]4      t8R# )4    N)defaultdict)CallableIterable)	dataclass)intern)Enum)	exception	policyrep)conditional_wrapper_factory)DiffResultDescriptor)
DifferenceDifferenceResultWrapper)type_wrapper_factorytype_or_attr_wrapper_factory)RuleList)class_wrapper_factoryz<<unconditional>>ZTrueT)ZfrozenZorderc                   s0   a  ] tR t^t o RtV 3R ltRtV tR# )ModifiedAVRule5Difference details for a modified access vector rule.c                s   < V ^8  d   Qh/ S[ P                  ;R&   S[S[,          ;R&   S[S[,          ;R&   S[S[,          ;R&   #    ruleadded_permsremoved_permsmatched_perms)r   AVRulesetstrformat__classdict__   ";/usr/lib64/python3.14/site-packages/setools/diff/terules.py__annotate__ZModifiedAVRule.__annotate__   sK     
 

  S  s8  s8      N__name__
__module____qualname____firstlineno____doc____annotate_func____static_attributes____classdictcell__r      @r!   r   r            @  r#   r   c                   s0   a  ] tR t^&t o RtV 3R ltRtV tR# )ModifiedAVRuleXpermr   c                s   < V ^8  d   Qh/ S[ P                  ;R&   S[ P                  ;R&   S[ P                  ;R&   S[ P                  ;R&   # r   )r   AVRuleXpermXpermSetr   r    r!   r"   Z ModifiedAVRuleXperm.__annotate__&   sQ     
 

  ###  %%%  %%% r#   r$   Nr%   r.   r/   r!   r1   r1   &   r0   r#   r1   c                   s0   a  ] tR t^1t o RtV 3R ltRtV tR# )ModifiedTERulez.Difference details for a modified type_* rule.c                sz   < V ^8  d   Qh/ S[ P                  ;R&   S[ P                  ;R&   S[ P                  ;R&   # )r   r   Zadded_defaultZremoved_default)r   r   Typer   r    r!   r"   ZModifiedTERule.__annotate__1   s:     
 

  >>!  ^^# r#   r$   Nr%   r.   r/   r!   r4   r4   1   s      9  r#   r4   c                   s    ] tR t^>t^ t^tRtR# )Sider$   N)r&   r'   r(   r)   leftrightr,   r$   r#   r!   r6   r6   >   s    DEr#   r6   c                   s,   a  ] tR t^Ct o V 3R ltRtV tR# )RuleDBSideDataRecordc                sV   < V ^8  d   Qh/ S[ S[,          ;R&   S[P                  ;R&   # )r   perms	orig_rule)r   r   r   r   r   r    r!   r"   Z!RuleDBSideDataRecord.__annotate__C   s&     s8O   r#   r$   Nr&   r'   r(   r)   r+   r,   r-   r.   r/   r!   r9   r9   C         r#   r9   c                   s,   a  ] tR t^It o V 3R ltRtV tR# )RuleDBSidesRecordc                sN   < V ^8  d   Qh/ S[ R,          ;R&   S[ R,          ;R&   # )r   Nr7   r8   )r9   r   r    r!   r"   ZRuleDBSidesRecord.__annotate__I   s'     

%%   $&& r#   r$   Nr<   r.   r/   r!   r>   r>   I   r=   r#   r>   c                   s,   a  ] tR t^Ot o V 3R ltRtV tR# )TypeDBRecordc                s   < V ^8  d   Qh/ S[ S[S[P                  3,          ;R&   S[ S[S[P                  3,          ;R&   # )r   r7   r8   )dictr   r   r5   r   r    r!   r"   ZTypeDBRecord.__annotate__O   s9     
sINN"
##  Y^^#$$ r#   r$   Nr<   r.   r/   r!   r?   r?   O   r=   r#   r?   c          
      sv    V ^8  d   QhR\         \        P                  ,          R\        R\        R\
        RR/# )r   	rule_listrule_dbtype_dbsidereturnN)listr   r   RuleDBr?   r6   r      "r!   r"   r"   [   sK     X[ X[Y-=-=(> X[ X[&2X[:>X[CGX[r#   c                sl   V\         P                  8X  d   VP                  pMVP                  pV  EFV  p \        \	        VP
                  4      4      p\        \	        VP                  4      4      pWa9  d!   \        4       W&   \        4       W,          V&   M WqV,          9  d   \        4       W,          V&   VP                  P                  p\        VP                  4      p	\!        W4      p
W,          V,          pVP"                  P%                  4        EFk  pVP                  pW9  d   WV&   W9  d   \        4       W&   VP&                  P%                  4        EF   pVP                  pW9  d   WV&   WV,          9  d   \        4       W,          V&   RpRpWV,          V,          9   d/   W,          V,          V,          pVP                  pVP                  pV\         P                  8X  d9   V'       g   T
pMd VP                  V	,          pVP(                  p\!        VV4      pM7V'       g   T
pM, VP                  V	,          pVP(                  p\!        VV4      p\+        VV4      W,          V,          V&   EK#  	  EKn  	  EKY  	  R#   \        P                   d    \        p\        p EL@i ; i)a  
Using rule_list, build up rule_db which is a data structure which consists
of nested dicts that store BOTH the left and the right policies. All of the
keys are interned strings. The permissions are stored as a set. The basic
structure is rule_db[cond_exp][block_bool][src][tgt][tclass] = sides
where:
  cond_exp is a boolean expression
  block_bool is either true or false
  src is the source type
  tgt is the target type
  tclass is the target class
  sides is a named tuple with attributes "left" and "right" referring to the
    left or right policy. Each attribute in the sides named tuple refers to a
    named tuple with attributes "perms" and "orig_rule" which refer to a
    permission set and the original unexpanded rule.
    sides = ((left_perms, left_orig_rule),(right_perms, right_orig_rule))
There are a few advantages to this structure. First, it takes up way less
memory. Second, it allows redundant rules to be easily eliminated. And,
third, it makes it easy to create the added, removed, and modified rules.
N)r6   r7   r8   r   r   conditionalconditional_blockr   RuleNotConditionalTERULES_UNCONDITIONALTERULES_UNCONDITIONAL_BLOCKr@   tclassZnamer   r:   r9   sourceexpandtargetr;   r>   )rA   rB   rC   rD   typesunexpanded_rulecond_expZ
block_boolrO   r:   	side_datablocksrcZsrc_strtgtZtgt_str	left_side
right_sideZsidespZorigs   &&&&                 r!   _avrule_expand_generatorr]   [   s?   , tyy$	5c/"="=>?HO$E$E FGJ
 " $G,0FGj)x00,0FGj) '',,O))*(@	!*-"))002ChhG#!$g#!%&--446(('%('N.0.2fEN7+ 	!
7^G44!N73F;E %

I!&J499$$$-	 &OOe3(22$8D$A	%%.
 ',,u4)33%9!T%B
2CIz2Zw'/I 7 3' % ++ 	5,H4J	5s   <J!J32J3c                s(    V ^8  d   QhR\         RR/# )r   rB   rE   N)rG   rH   rI   r!   r"   r"      s     #\ #\ #\4 #\r#   c           	      sB   V \         ,          \        ,          pV P                  4        EF  w  r#V\         8X  d   K  VP                  4        EF  pVP                  4        EF  w  rVWQ9  d   K  VP                  4        EF  w  rxWqV,          9  d   K  VP                  4        EFc  w  rWV,          V,          9  d   K  W,          V,          V	,          pV
P                  pV
P
                  pVP                  '       dx   V'       dp   VP                  VP                  P                  ,          pV'       dA   VP                  V,
          pV'       d   \        WP                  4      pMR p\        W4      W&   VP
                  '       g   K  V'       g   K  VP                  VP
                  P                  ,          pV'       g   EK#  VP                  V,
          pV'       d   \        WP                  4      pMR p\        W4      W&   EKf  	  EK  	  EK  	  EK  	  EK  	  R # N)
rM   rN   itemsvaluesr7   r8   r:   r9   r;   r>   )rB   Zuncond_blockrU   cond_blocksrW   rX   src_datarY   tgt_datarO   rV   Zuncond_side_datarZ   r[   Zcr\   s   &               r!   _av_remove_redundant_rulesrd      s   012MNL!(,, '')E!&*%-^^%5MCs"33 -5^^-=)!c):3)??$+7+<S+A&+I($-NN	%.__
+000Y )2B2G2G2M2M MA $-OOa$7#$0DQH[H[0\I04I3DY3[ 0+111jj * 0 03C3I3I3O3O OA q$.$4$4q$8#$1EaI]I]1^J15J3DY3[ 0/ .> &6 "/ * "1r#   c          
      s    V ^8  d   QhR\         R\        R\        \        \        P
                  ,          \        \        P
                  ,          \        \        ,          3,          /# )r   rB   rC   rE   )rG   r?   ZtuplerF   r   r   r   rH   rI   r!   r"   r"      sI     $$ $$ $$ $$d9##$d9+;+;&<d>>RRS$$r#   c                 sp   . p. p. pV P                  4        EF  pVP                  4        EF  pVP                  4        EFf  w  rxVP                  4        EFK  w  rV
P                  4        EF0  pVP                  '       Ed   VP                  '       d   VP                  P                  VP                  P                  ,          pVP                  P                  V,
          pVP                  P                  V,
          pV'       g	   V'       d   VP                  P
                  pVP                  VP                  V,          VP                  V	,          VP                  P                  4      pVP                  \        VVVV4      4       EK#  EK&  VP                  '       dt   VP                  P
                  pVP                  VP                  V,          VP                  V	,          VP                  P                  4      pVP                  V4       EK  VP                  '       g   EK  VP                  P
                  pVP                  VP                  V,          VP                  V	,          VP                  P                  4      pVP                  V4       EK3  	  EKN  	  EKi  	  EK  	  EK  	  W#V3# r^   )	r`   r_   r7   r8   r:   r;   Zderive_expandedappendr   )rB   rC   addedremovedmodifiedra   rW   rX   rb   rY   rc   rV   Zcommon_permsZ
left_permsZright_permsZoriginal_ruler   s   &&               r!   _av_generate_diffsri      s    %'E&(G%'H~~' '')E!&%-^^%5MC%-__%6	$>>>iooo+4>>+?+?)//BWBW+WL)2)=)=)LJ*3//*?*?,*NK)[090H0H'4'D'D$+LL$5w||C7H$-NN$8$8(: !)t[?I?K1M !N .9 '^^^,5NN,D,DM#0#@#@ 'S 17<<3D ) 4 4$6D $NN40&___,5OO,E,EM#0#@#@ 'c 2GMM#4F ) 5 5$7D "LL.1 &7 &6 "/ * (< 8##r#   c                X    V ^8  d   QhR\         P                  R\        R.R3,          /# r   ruletyperE   TERulesDifferenceNr   
TERuletyper   rH   rI   r!   r"   r"     s/     * *y33 *BUAVX\A\8] *r#   c                   a  R V 3R llpV# )zp
This is a template for the access vector diff functions.

Parameters:
ruletype    The rule type, e.g. "allow".
c                    V ^8  d   QhRR/# r   rE   Nr$   rH   rI   r!   r"   Z&av_diff_template.<locals>.__annotate__  s      9  9d  9r#   c                sV  < V P                   P                  RS RV P                   RV P                   24       V P                  e   V P
                  f   V P                  4        \        \        4       \        4       4      p\        4       p\        4       V\        &   \        4       V\        ,          \        &   V P                   P                  RV P                   R24       \        V P                  S,          W!\        P                  4       V P                   P                  RV P                   R24       \        V P
                  S,          W!\        P                  4       V P                   P                  R4       \        V4       V P                   P                  R4       \!        W!4      w  r4pVP                  P#                  4        VP                  P#                  4        VP#                  4        \%        V R	S R
2V4       \%        V RS R
2V4       \%        V RS R
2V4       R# )6Generate the difference in rules between the policies.Generating  differences from  to NzExpanding AV rules from Z.zRemoving redundant AV rules.zGenerating AV rule diff.added_sremoved_	modified_)loginfoleft_policyright_policy_left_te_rules_right_te_rules_create_te_rule_listsr?   r@   rM   rN   r]   r6   r7   r8   rd   ri   Zclearsetattr)selfrC   rB   rf   rg   rh   rl   s   &     r!   diffZav_diff_template.<locals>.diff  s    	(#5d6F6F5GtDL]L]K^_	a &$*>*>*F&&(tvtv.&)-%&FJf%&'BC01A1A0B!DE !4!4X!>RVR[R[\01B1B0C1EF !5!5h!?SWS]S]^45"7+01#5g#G xj*E2
!,g6	(1-x8r#   r$   rl   r      f r!   av_diff_templater     s     9  9D Kr#   c                sh    V ^8  d   QhR\         \        P                  ,          R\         R,          /# )r   rA   rE   AVRuleXpermWrapper)r   r   r2   rH   rI   r!   r"   r"   0  s,      )2G2G)H #+,@#Ar#   c                s   \        4       pV  FO  pVP                  4        F8  p\        V4      p W,          ;P                  VP                  ,          un        K:  	  KQ  	  V'       d7   \
        P                  ! \        4      P                  R\        V4       R24       VP                  4       #   \         d	    YAT&    K  i ; i)zT
Generator that yields wrapped, expanded, av(x) rules with
unioned permission sets.
z	Expanded z rules)r@   rQ   r   r:   ZKeyErrorloggingZ	getLoggerr&   debuglenZkeys)rA   r_   rT   Zexpanded_ruleZexpanded_wrapped_rules   &    r!   _avxrule_expand_generatorr   0  s     ?CfE$,335M$6}$E!E,226K6Q6QQ2 6 % (#))Ic%j\*HI::<  E/D+,Es   )B..C Cc                rj   rk   rn   rH   rI   r!   r"   r"   K  s/     - -	 4 4 -CVBWY]B]9^ -r#   c                rp   )z
This is a template for the extended permission access vector diff functions.

Parameters:
ruletype    The rule type, e.g. "allowxperm".
c                rq   rr   r$   rH   rI   r!   r"   Z'avx_diff_template.<locals>.__annotate__S  s     #9 #9d #9r#   c                s  < V P                   P                  RS
 RV P                   RV P                   24       V P                  '       d   V P
                  '       g   V P                  4        V P                  \        V P                  S
,          4      \        V P
                  S
,          4      RR7      w  rp. pV F  w  rVV P                  VP                  VP                  RR7      w  rxp	V'       g   V'       g   KB  VP                  \        VP                  \        P                  ! V4      \        P                  ! V4      \        P                  ! R V	 4       4      4      4       K  	  \        V RS
 R2\!        R	 V 4       4      4       \        V R
S
 R2\!        R V 4       4      4       \        V RS
 R2V4       R# )rs   rt   ru   rv   F)Zunwrapc              3   s2   "   T F  q^ ,          x  K  	  R# 5i)r    Nr$   ).0r\      & r!   	<genexpr>2avx_diff_template.<locals>.diff.<locals>.<genexpr>r  s     :WAQ44s   rw   rx   c              3   8   "   T F  qP                   x  K  	  R # 5ir^   origin)r   Zar   r!   r   r   t  s     /H%Q%   ry   c              3   r   r^   r   )r   Zrr   r!   r   r   u  s     1LGq((Gr   rz   N)r{   r|   r}   r~   r   r   r   	_set_diffr   r:   re   r1   r   r   r3   r   r   )r   rf   rg   matchedrh   	left_rule
right_ruler   r   r   rl   s   &         r!   r   Zavx_diff_template.<locals>.diffS  s    	(#5d6F6F5G H##$&	' """$*>*>*>&&("&..%d&9&9(&CD%d&:&:8&DE #1 #
 %,!I 9=yGQGWGWNS 9G 9U5K mm'	(8(8(1(:(:;(G(1(:(:=(I(1(:(::W:W(WYZ &-" 	xj*C/H%/H,HI
!,c1LG1L.LM	(1-x8r#   r$   r   r   r!   avx_diff_templater   K  s    #9 #9J Kr#   c                st    V ^8  d   QhR\         P                  R\        \        P                  .R3,          /# )r   rl   rE   N)r   ro   r   typingZAnyrH   rI   r!   r"   r"   {  s0     " "y33 "&**tAS8T "r#   c                rp   )zs
This is a template for the type_* diff functions.

Parameters:
ruletype    The rule type, e.g. "type_transition".
c                rq   rr   r$   rH   rI   r!   r"   Z&te_diff_template.<locals>.__annotate__  s     9 9d 9r#   c                s  < V P                   P                  RS RV P                   RV P                   24       V P                  e   V P
                  f   V P                  4        V P                  V P                  V P                  S,          \        4      V P                  V P
                  S,          \        4      4      w  rp. pV Fd  w  rV\        VP                  4      \        VP                  4      8w  g   K4  VP                  \        VVP                  VP                  4      4       Kf  	  \        V RS R2V4       \        V RS R2V4       \        V RS R2V4       R# )	rs   rt   ru   rv   Nrw   rx   ry   rz   )r{   r|   r}   r~   r   r   r   r   Z_expand_generatorTERuleWrapperr   Zdefaultre   r4   r   )r   rf   rg   r   rh   r   r   rl   s   &      r!   r   Zte_diff_template.<locals>.diff  sI    	(#5d6F6F5GtDL]L]K^_	a &$*>*>*F&&("&..""4#6#6x#@-P""4#7#7#A=Q#S %,!I $I$5$56:NzOaOa:bby/9/A/A/8/@/@!B C	 &- 	xj*E2
!,g6	(1-x8r#   r$   r   r   r!   te_diff_templater   {  s    9 94 Kr#   c                   sZ  a  ] tR tRt o Rt]! ]P                  P                  4      t	]
]P                  ,          ! ]	4      t]
]P                  ,          ! ]	4      t]
],          ! ]	4      t]! ]P                  P                   4      t]
]P                  ,          ! ]4      t]
]P                  ,          ! ]4      t]
],          ! ]4      t]! ]P                  P*                  4      t]
]P                  ,          ! ]4      t]
]P                  ,          ! ]4      t]
],          ! ]4      t]! ]P                  P4                  4      t]
]P                  ,          ! ]4      t]
]P                  ,          ! ]4      t]
],          ! ]4      t]! ]P                  P@                  4      t!]
]PD                  ,          ! ]!4      t#]
]PD                  ,          ! ]!4      t$]
]%,          ! ]!4      t&]! ]P                  PN                  4      t(]
]PD                  ,          ! ](4      t)]
]PD                  ,          ! ](4      t*]
]%,          ! ](4      t+]! ]P                  PX                  4      t-]
]PD                  ,          ! ]-4      t.]
]PD                  ,          ! ]-4      t/]
]%,          ! ]-4      t0]! ]P                  Pb                  4      t2]
]PD                  ,          ! ]24      t3]
]PD                  ,          ! ]24      t4]
]%,          ! ]24      t5]6! ]P                  Pn                  4      t8]
]Pr                  ,          ! ]84      t:]
]Pr                  ,          ! ]84      t;]
]<,          ! ]84      t=]6! ]P                  P|                  4      t?]
]Pr                  ,          ! ]?4      t@]
]Pr                  ,          ! ]?4      tA]
]<,          ! ]?4      tB]6! ]P                  P                  4      tD]
]Pr                  ,          ! ]D4      tE]
]Pr                  ,          ! ]D4      tF]
]<,          ! ]D4      tGRtHRtIV 3R lR ltJV 3R lR ltKV 3R ltLR	tMV tNR# )
rm   i  zJ
Determine the difference in type enforcement rules
between two policies.
Nc                   < V ^8  d   QhRR/# rr   r$   r   r    r!   r"   TERulesDifference.__annotate__  s     < <t <r#   c                s   V P                   P                  RV P                   24       \        \        4      V n        V P                  P                  4        F/  pV P
                  VP                  ,          P                  V4       K1  	  V P
                  P                  4        F0  w  r#V P                   P                  R\        V4       RV R24       K2  	  V P                   P                  RV P                   24       \        \        4      V n        V P                  P                  4        F/  pV P                  VP                  ,          P                  V4       K1  	  V P                  P                  4        F0  w  r#V P                   P                  R\        V4       RV R24       K2  	  V P                   P                  R4       R# )z$Create rule lists for both policies.zBuilding TE rule lists from zLoaded Z z rules.z!Completed building TE rule lists.N)r{   r   r}   r   rF   r   Zterulesrl   re   r_   r   r~   r   )r   r   rl   Zruless   &   r!   r   Z'TERulesDifference._create_te_rule_lists  s]    	5d6F6F5GHI)$/$$,,.D.55d; /  $2288:OHHHNNWSZL(7CD  ; 	5d6G6G5HIJ*40%%--/D  /66t< 0  $3399;OHHHNNWSZL(7CD  < 	:;r#   c                r   rr   r$   r   r    r!   r"   r     s     '$ '$T '$r#   c                s    V P                   P                  R4       V =V =V =V =V =V =V =V =	V =
V =V =V =V =V =V =V =V =V =V =V =V =V =V =V =V =V =V =V =V =V =V = V =!V ="RV n#        RV n$        R# )z%Reset diff results on policy changes.zResetting TE rule differencesN)%r{   r   added_allowsremoved_allowsmodified_allowsadded_auditallowsremoved_auditallowsmodified_auditallowsadded_neverallowsremoved_neverallowsmodified_neverallowsadded_dontauditsremoved_dontauditsmodified_dontauditsadded_allowxpermsremoved_allowxpermsmodified_allowxpermsadded_auditallowxpermsremoved_auditallowxpermsmodified_auditallowxpermsadded_neverallowxpermsremoved_neverallowxpermsmodified_neverallowxpermsadded_dontauditxpermsremoved_dontauditxpermsmodified_dontauditxpermsadded_type_transitionsremoved_type_transitionsmodified_type_transitionsadded_type_changesremoved_type_changesmodified_type_changesadded_type_membersremoved_type_membersmodified_type_membersr   r   r      &r!   _reset_diffZTERulesDifference._reset_diff  s    67 "$%"$%!#$"$%')*')*&()')*#%&#%& ##r#   c                s   < V ^8  d   Qh/ S[ S[P                  S[P                  3,          ;R&   S[ S[P                  S[P                  3,          ;R&   # )r   r   r   )r   r   ro   Z	AnyTERuler   r    r!   r"   r     sO     | Y1193F3FFGN} ~ i22I4G4GGHO r#   )r   r   )Or&   r'   r(   r)   r*   r   r   ro   ZallowZdiff_allowsr
   r   r   r   r   r   Z
auditallowZdiff_auditallowsr   r   r   Z
neverallowZdiff_neverallowsr   r   r   Z	dontauditZdiff_dontauditsr   r   r   r   Z
allowxpermZdiff_allowxpermsr2   r   r   r1   r   ZauditallowxpermZdiff_auditallowxpermsr   r   r   ZneverallowxpermZdiff_neverallowxpermsr   r   r   ZdontauditxpermZdiff_dontauditxpermsr   r   r   r   Ztype_transitionZdiff_type_transitionsZTERuler   r   r4   r   Ztype_changeZdiff_type_changesr   r   r   Ztype_memberZdiff_type_membersr   r   r   r   r   r   r   r+   r,   r-   r.   r/   r!   rm   rm     s    
 #9#7#7#=#=>K'	(8(89+FL))*:*:;KHN*>:;GO'	(<(<(G(GH,Y-=-=>?OP.y/?/?@AQR/?@PQ'	(<(<(G(GH,Y-=-=>?OP.y/?/?@AQR/?@PQ&y';';'E'EFO+I,<,<=oN-i.>.>?P.~>O()=)=)H)HI,Y-B-BCDTU.y/D/DEFVW/0CDEUV-i.B.B.R.RS1)2G2GHI^_3I4I4IJK`a 45H IJ_ `-i.B.B.R.RS1)2G2GHI^_3I4I4IJK`a 45H IJ_ `,Y-A-A-P-PQ01F1FGH\]293H3HIJ^_34GHI]^,Y-A-A-Q-QR1)2B2BCDYZ3I4D4DEF[\ 4^ DEZ [()=)=)I)IJ-i.>.>?@QR/	0@0@ABST0@ARS()=)=)I)IJ-i.>.>?@QR/	0@0@ABST0@ARSJNNKOO
< <,'$ '$u  r#   rm   c                   sL   a  ] tR tRt o RtR
tV 3R lR ltR tR tR t	Rt
V tR	# )r   i$  zEWrap extended permission access vector rules to allow set operations.c                s8   < V ^8  d   QhRS[ P                  RR/# )r   r   rE   N)r   r2   r   r    r!   r"   ZAVRuleXpermWrapper.__annotate__*  s!      Y22 t r#   c                s$   Wn         \        VP                  4      V n        \        VP                  4      V n        \	        VP
                  4      V n        VP                  V n        \        VP                  4      V n        \        V4      V n
        R # r^   )r   r   rP   rR   r   rO   
xperm_typer   r:   hashkeyr   r      &&r!   __init__ZAVRuleXpermWrapper.__init__*  s\    24;;?24;;?+DKK8//_
:r#   c                    V P                   # r^   r   r   r   r!   __hash__ZAVRuleXpermWrapper.__hash__3      xxr#   c                4    V P                   VP                   8  # r^   r   r   Zotherr   r!   __lt__ZAVRuleXpermWrapper.__lt__6      xx%))##r#   c                s    V P                   VP                   8H  ;'       d\    V P                  VP                  8H  ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # r^   )rP   rR   rO   r   r   r   r!   __eq__ZAVRuleXpermWrapper.__eq__9  sk     {{ell* 0 0KK5<<'0 0KK5<<'0 0 OOu///	0r#   )r   r   r:   rP   rR   rO   r   N)rP   rR   rO   r   r:   r&   r'   r(   r)   r*   Z	__slots__r   r   r   r   r,   r-   r.   r/   r!   r   r   $  s+     OEI $0 0r#   r   c                   s@   a  ] tR tRt o RtR	tR tR tR tR t	Rt
V tR# )
r   iB  z*Wrap type_* rules to allow set operations.c                s   Wn         \        VP                  4      V n        \        VP                  4      V n        \	        VP
                  4      V n        \        V4      V n         \        VP                  4      V n	        VP                  V n
         VP                  V n        R #   \        P                   d    R T n	        R T n
         L9i ; i  \        P                  \        P                  3 d    R T n         R # i ; ir^   )r   r   rP   rR   r   rO   r   r   r	   rJ   rK   r   rL   filenameZRuleUseErrorZTERuleNoFilenamer   r   r!   r   ZTERuleWrapper.__init__H  s    24;;?24;;?+DKK8:	*:4;K;KLD%)%;%;D"
	! MMDM ++ 	*#D%)D"	* &&	(B(BC 	! DM	!s$   &+B% C %#C
C,C>=C>c                r   r^   r   r   r   r!   r   ZTERuleWrapper.__hash__[  r   r#   c                r   r^   r   r   r   r!   r   ZTERuleWrapper.__lt__^  r   r#   c                s~   V P                   VP                   8H  ;'       d    V P                  VP                  8H  ;'       d}    V P                  VP                  8H  ;'       d\    V P                  VP                  8H  ;'       d;    V P                  VP                  8H  ;'       d    V P
                  VP
                  8H  # r^   rP   rR   rO   rJ   rK   r   r   r   r!   r   ZTERuleWrapper.__eq__a  s     {{ell* , ,KK5<<', ,KK5<<', ,  1 11, , ""e&=&==	, ,
 MMU^^+	,r#   )rJ   rK   r   r   r   rP   rR   rO   Nr   r   r.   r/   r!   r   r   B  s&     4^I!&$, ,r#   r   )9r   Zcollectionsr   Zcollections.abcr   r   Zdataclassesr   Zsysr   Zenumr   r   Z r   r   rJ   r	   Zdescriptorsr
   Z
differencer   r   r   rS   r   r   r   Zobjclassr   rM   rN   r   r1   r4   r6   r9   r>   r?   ZConditionalr   ZCondExpZboolZ	CondBlockr@   rG   r]   rd   ri   r   r   r   r   rm   r2   r   r   r$   r#   r!   <module>r      s    # . !    # 4 - = = E  +23 $Vn  $d#%  $ $d#&* & $& $d#$% $ $$4 
      
 ' ' '
 % % % 

#
%3J		gtItCc4EV@V;W6W1X,X'YYZZ	[X[v#\L$$N*Z6-`"JA$
 A$H0!6!67 0<',G ',r#   