+
    ,i  c                   s    ^ RI Ht ^ RIHt ^RIHtHtHt ^RIH	t	 ^RI
HtHtHt ^RIHt ^RIHt ^RIHt ^R	IHt ]! R
R
R7       ! R R]4      4       t ! R R]4      t ! R R]],          4      tR# )i    )defaultdict)	dataclass)MLSRuleMLSRuletypeRange)DiffResultDescriptor)
DifferenceDifferenceResultWrapper)RangeWrapper)class_wrapper_factory)type_or_attr_wrapper_factory)RuleListT)ZfrozenZorderc                   s0   a  ] tR t^t o RtV 3R ltRtV tR# )ModifiedMLSRulez+Difference details for a modified MLS rule.c                s>   < V ^8  d   Qh/ S[ ;R&   S[;R&   S[;R&   # )   ruleZadded_defaultZremoved_default)r   r   Zformat__classdict__   "</usr/lib64/python3.14/site-packages/setools/diff/mlsrules.py__annotate__ZModifiedMLSRule.__annotate__   s+     
 M          N)__name__
__module____qualname____firstlineno____doc____annotate_func____static_attributes____classdictcell__r      @r   r   r      s      6  r   r   c                   s   a  ] tR t^t o RtV 3R lR lt]],          ! ]4      t]],          ! ]4      t	]]
,          ! ]4      tRtRtV 3R lR ltV 3R lR ltV 3R	 ltR
tV tR# )MLSRulesDifferencez;Determine the difference in MLS rules between two policies.c                   < V ^8  d   QhRR/# r   returnNr   r   r   r   r   MLSRulesDifference.__annotate__!   s     3 3 3r   c                s   V P                   P                  RV P                   RV P                   24       V P                  e   V P
                  f   V P                  4        V P                  V P                  V P                  \        P                  ,          \        4      V P                  V P
                  \        P                  ,          \        4      4      w  rp\        \        ,          ! 4       pV Fd  w  rV\        VP                  4      \        VP                  4      8w  g   K4  VP!                  \        VVP                  VP                  4      4       Kf  	  Wn        W n        W@n        R# )zGGenerate the difference in range_transition rules between the policies.z-Generating range_transition differences from z to N)logZinfoleft_policyright_policy_left_mls_rules_right_mls_rules_create_mls_rule_listsZ	_set_diffZ_expand_generatorr   Zrange_transitionMLSRuleWrapperlistr   r	   Zdefaultappendadded_range_transitionsremoved_range_transitionsmodified_range_transitions)selfZaddedZremovedZmatchedZmodifiedZ	left_ruleZ
right_rules   &      r   diff_range_transitionsZ)MLSRulesDifference.diff_range_transitions!   s4    	;D<L<L;M N##$&	' '4+@+@+H'')
 #'..""4#7#78T8T#U#13""4#8#89U9U#V#13#4 (*%,!I I--.,z?Q?Q2RR	0:0B0B090A0A!C D	 &- (-$)0&*2'r   Nc                r"   r#   r   r   r   r   r   r%   M   s     = = =r   c                s`   \        \        4      V n        V P                  P	                  RV P
                   24       V P
                  P                  4        F/  pV P                  VP                  ,          P                  V4       K1  	  \        \        4      V n	        V P                  P	                  RV P                   24       V P                  P                  4        F/  pV P                  VP                  ,          P                  V4       K1  	  V P                  P	                  R4       R# )z$Create rule lists for both policies.zBuilding MLS rule lists from z"Completed building MLS rule lists.N)r    r-   r)   r&   debugr'   Zmlsrulesruletyper.   r*   r(   r2   r   s   & r   r+   Z)MLSRulesDifference._create_mls_rule_listsM   s      +406t7G7G6HIJ$$--/D  /66t< 0 !,D 16t7H7H6IJK%%..0D!!$--077= 1 	;<r   c                r"   r#   r   r   r   r   r   r%   ]   s     	% 	%T 	%r   c                sd    V P                   P                  R4       V =V =V =RV n        RV n        R# )z%Reset diff results on policy changes.zResetting MLS rule differencesN)r&   r4   r/   r0   r1   r)   r*   r2      &r   _reset_diffZMLSRulesDifference._reset_diff]   s7    78(*+  $ $r   c                s^   < V ^8  d   Qh/ S[ S[S[3,          ;R&   S[ S[S[3,          ;R&   # )r   r)   r*   )r   r   r   r   r   r   r   r%      s7     T k723:U V {G34;W r   )r)   r*   r/   r1   r0   )r   r   r   r   r   r3   r   r   r/   r0   r   r1   r)   r*   r+   r9   r   r   r   r   r    r   r!   r!      sq     E3 3B 37;<RS 4W =>T U!5o!FG]!^ 7;O7;
= = 	% 	%A  r   r!   c                   sL   a  ] tR t^it o RtR	tV 3R lR ltR tR tR t	Rt
V tR# )
r,   z'Wrap MLS rules to allow set operations.c                s$   < V ^8  d   QhRS[ RR/# )r   r   r$   N)r   r   r   r   r   ZMLSRuleWrapper.__annotate__o   s      W  r   c                s    Wn         \        VP                  4      V n        \        VP                  4      V n        \	        VP
                  4      V n        \        V4      V n        R # N)originr   sourcetargetr
   tclassZhashkeyr6      &&r   __init__ZMLSRuleWrapper.__init__o   sB    24;;?24;;?+DKK8:r   c                s    V P                   # r:   r?   r7   r8   r   __hash__ZMLSRuleWrapper.__hash__v   s    xxr   c                s4    V P                   VP                   8  # r:   rB   r2   Zotherr@   r   __lt__ZMLSRuleWrapper.__lt__y   s    xx%))##r   c                s    V P                   VP                   8H  ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # r:   )r<   r=   r>   rD   r@   r   __eq__ZMLSRuleWrapper.__eq__|   sM     {{ell* ( (KK5<<'( (KK5<<'	(r   )r?   r;   r<   r=   r>   N)r5   r<   r=   r>   )r   r   r   r   r   Z	__slots__rA   rC   rE   rF   r   r   r   r    r   r,   r,   i   s+     1:I $( (r   r,   N)Zcollectionsr    Zdataclassesr   Z	policyrepr   r   r   Zdescriptorsr   Z
differencer   r   r   Zmlsr	   Zobjclassr
   Ztypesr   Ztypingr   r   r!   r,   r   r   r   <module>rG      sk    $ ! 3 3 - = =  + /  $d#&  $I% I%X(WW% (r   