+
        l                     8  a  R t/0 t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	 ^ RI
HtHt ^ RIt ^ RIt^ RIHtHtHt ^RIHtHtHtHt ^R	IH t H!t!H"t" Rt#] ^ k ] ! R R4      4       t$] ! R R4      4       t%]]%,          t&]]PN                  ](]PR                  ,          3,          t* ! R R
]PV                  4      t,] ! R R]PZ                  4      4       t.R#   ] d9   t]P,                  ! ]4      P1                  ]P2                   R24        RtALRtAii ; i)    Ndefaultdict)Iterable)suppress)	dataclassInitVar)NetworkXErrorNetworkXNoPathNodeNotFoundz failed to import.)	exceptionmixins	policyrepquery)CriteriaDescriptorEdgeAttrDictEdgeAttrListDomainTransitionAnalysisDomainTransitionDomainEntrypointc                   T   a  ] tR t^t o 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# )	r   zEntrypoint list entry.c                $   < V ^8  d   QhRRRS[ /# )   otherr   returnbool)format__classdict__s   "2/usr/lib64/python3.14/site-packages/setools/dta.py__annotate__DomainEntrypoint.__annotate__)   s     & &. &4 &    c                4    V P                   VP                   8  # N)name)selfr   s   &&r   __lt__DomainEntrypoint.__lt__)   s    yy5::%%r"   c                    < V ^8  d   QhRS[ /# r   r   str)r   r   s   "r   r    r!   -   s          r"   c                   R V P                    R2R.pVP                  R \        V P                  4       4       4       VP	                  R4       VP                  R \        V P
                  4       4       4       V P                  '       d=   VP	                  R4       VP                  R \        V P                  4       4       4       RP                  V4      # )	z
Entrypoint :z	Domain entrypoint rule(s):c              3   ,   "   T F
  pR V 2x  K  	  R# 5i	N .0es   & r   	<genexpr>+DomainEntrypoint.__str__.<locals>.<genexpr>0   s     ?'>!r!X'>   z
	File execute rule(s):c              3   ,   "   T F
  pR V 2x  K  	  R# 5ir0   r2   r3   s   & r   r6   r7   3   s     <';!r!X';r8   z
	Type transition rule(s):c              3   ,   "   T F
  pR V 2x  K  	  R# 5ir0   r2   r4   ts   & r   r6   r7   7   s     H+Ga2aS+Gr8   
)r%   extendsorted
entrypointappendexecutetype_transitionjoin)r&   liness   & r   __str__DomainEntrypoint.__str__-   s    +DII;a8:<?vdoo'>??01<vdll';<<LL78LLH6$2F2F+GHHyyr"   c                   < V ^8  d   Qh/ S[ P                  ;R&   S[S[ P                  ,          ;R&   S[S[ P                  ,          ;R&   S[S[ P                  ,          ;R&   # )r   r%   r@   rB   rC   )r   Typelist	AnyTERule)r   r   s   "r   r    r!      s^     
 ..  Y(())  )%%&&  )--.. r"   r2   N)
__name__
__module____qualname____firstlineno____doc__r'   rF   __annotate_func____static_attributes____classdictcell__r   s   @r   r   r      s%      !& &     r"   c                   `   a a ] tR t^<t oRtV3R lV 3R lltV3R lR ltV3R ltRtVt	V ;t
# )r   zTransition step output.c                &   < V ^8  d   QhRS[ RS[ /# )r   specr   r+   )r   r   s   "r   r    DomainTransition.__annotate__I   s     ( (s (s (r"   c                t  < V P                    R V P                   R2.pVR8X  Edt   V P                  '       d   VP                  R4       VP	                  R \        V P                  4       4       4       V P                  '       d=   VP                  R4       VP	                  R \        V P                  4       4       4       VP	                  R \        V P                  4       4       4       V P                  '       d   VP                  R4       VP	                  R	 \        V P                  4       4       4       VP                  R
4       VP	                  R \        V P                  4       4       4       VP                  R4       RP                  V4      # V'       g
   V^ ,          # \        SV `1  V4      # )z -> r=   fullzDomain transition rule(s):c              3   8   "   T F  p\        V4      x  K  	  R # 5ir$   r+   r;   s   & r   r6   .DomainTransition.__format__.<locals>.<genexpr>N        E-DSVV-D   z
Set execution context rule(s):c              3   8   "   T F  p\        V4      x  K  	  R # 5ir$   r+   r4   ss   & r   r6   r\   R   s      F1EAQ1Er^   c              3   *   "   T F	  q R 2x  K  	  R# 5i)r=   Nr2   r3   s   & r   r6   r\   T   s     H/G!s"X/Gs   zDynamic transition rule(s):c              3   8   "   T F  p\        V4      x  K  	  R # 5ir$   r+   )r4   ds   & r   r6   r\   X   s     H-GSVV-Gr^   z%
Set current process context rule(s):c              3   8   "   T F  p\        V4      x  K  	  R # 5ir$   r+   r`   s   & r   r6   r\   [   r]   r^    )sourcetarget
transitionrA   r>   r?   setexecentrypointsdyntransition
setcurrentrD   super
__format__)r&   rW   rE   	__class__s   && r   ro   DomainTransition.__format__I   s;   #{{m4}B?@6>9:EVDOO-DEE<<<LL!CDLL F1E FFHvd6F6F/GHH!!!:;HVD4F4F-GHHEFEVDOO-DEER 99U##8Ow!$''r"   c                    < V ^8  d   QhRS[ /# r*   r+   )r   r   s   "r   r    rX   f   s     ' ' 'r"   c                $    V P                  R 4      # )rZ   )ro   r&   s   &r   rF   DomainTransition.__str__f   s    v&&r"   c                6  < V ^8  d   Qh/ S[ P                  ;R&   S[ P                  ;R&   S[S[ P                  ,          ;R&   S[S[,          ;R&   S[S[ P                  ,          ;R&   S[S[ P                  ,          ;R&   S[S[ P                  ,          ;R&   # )r   rg   rh   ri   rk   rj   rl   rm   )r   rI   rJ   rK   r   )r   r   s   "r   r    rX   <   s     
 NN  NN  Y(())  &''  )%%&&  	++,,  Y(()) r"   r2   )rL   rM   rN   rO   rP   ro   rF   rQ   rR   rS   __classcell__rp   r   s   @@r   r   r   <   s&      "( (:' 'U  r"   c                     a a ] tR t^qt oRt ! R R]P                  4      t]P                  ]P                  3t
]P                  ]P                  3t]]P                   ,          ! RR7      t]]P                   ,          ! RR7      t]P                  tRRRR	R
R	R]P                  R^RR	/V3R lV 3R lllt]V3R lR l4       t]P.                  V3R lR l4       t]V3R lR l4       t]P.                  V3R lR l4       t]V3R lR l4       t]P.                  V3R lR l4       tV3R lR ltV3R lR ltV3R  lR! lt]V3R" lR# l4       tV3R$ lR% ltV3R& lR' lt V3R( lR) lt!V3R* lR+ lt"V3R, lt#R-t$Vt%V ;t&# ).r   a_  
Domain transition analysis.

Parameters:
policy      The policy to analyze.

Keyword Parameters
source      The source type of the analysis.
target      The target type of the analysis.
mode        The analysis mode (see DomainTransitionAnalysis.Mode)
exclude     The types excluded from the domain transition analysis.
            (default is none)
c                   *    ] tR t^tRtRtRtRtRtRt	R# )DomainTransitionAnalysis.Modez Domain transition analysis modeszAll shortest pathszAll paths up toz%Transitions out of the source domain.z#Transitions into the target domain.r2   N)
rL   rM   rN   rO   rP   ShortestPathsAllPathsTransitionsOutTransitionsInrR   r2   r"   r   Moder{      s    .,$@=r"   r   lookup_type)lookup_functionreverseFrg   Nrh   modedepth_limitexcludec                  < V ^8  d   QhRS[ P                  RS[RS[ P                  S[,          R,          RS[ P                  S[,          R,          RS[RS[R,          RS[S[ P                  S[,          ,          R,          R	R/# )
r   policyr   rg   Nrh   r   r   r   r   )r   SELinuxPolicyr   rI   r,   r   intr   )r   r   s   "r   r    %DomainTransitionAnalysis.__annotate__   s      y66 "#-4 ##-4 	
 "Dj #9>>C#784? LPr"   c         
     R  < \         SV `  WW4VWgR 7       V  V  RV n        RV n         \        P
                  ! 4       V n        V P                  P                  4       V n        R#   \         d9    T P                  P                  R4       T P                  P                  R4       h i ; i))r   rg   rh   r   r   r   TzLNetworkX is not available.  This is required for Domain Transition Analysis.z2This is typically in the python3-networkx package.N)rn   __init__rebuildgraphrebuildsubgraphnxDiGraphGcopysubG	NameErrorlogcritical)	r&   r   r   rg   rh   r   r   r   rp   s	   ""$$$$$$r   r   !DomainTransitionAnalysis.__init__   s     	UY%0 	 	C 	 #	ZZ\DFDI 	HH I JHHRS		s   9A# #AB&c                .   < V ^8  d   QhRS[ R,          /# r   r   Nr   )r   r   s   "r   r    r      s     ! !S4Z !r"   c                    V P                   # r$   )_depth_limitrt   s   &r   r   $DomainTransitionAnalysis.depth_limit   s       r"   c                2   < V ^8  d   QhRS[ R,          RR/# )r   valueNr   r   )r   r   s   "r   r    r      s     " "t " "r"   c                >    Ve   V^8  d   \        R4      hWn        R # )Nz-Domain transition max depth must be positive.)
ValueErrorr   )r&   r   s   &&r   r   r      s     LMM!r"   c                    < V ^8  d   QhRS[ /# r*   r   )r   r   s   "r   r    r      s       r"   c                    V P                   # r$   )_reversert   s   &r   r    DomainTransitionAnalysis.reverse       }}r"   c                   < V ^8  d   QhRR/# r   r2   )r   r   s   "r   r    r      s     $ $D $r"   c                4    \        V4      V n        R V n        R# TN)r   r   r   )r&   	directions   &&r   r   r      s    Y#r"   c                D   < V ^8  d   QhRS[ S[P                  ,          /# r*   )rJ   r   rI   )r   r   s   "r   r    r      s      inn- r"   c                    V P                   # r$   )_excludert   s   &r   r    DomainTransitionAnalysis.exclude   r   r"   c                f   < V ^8  d   QhRS[ S[P                  S[,          ,          R,          RR/# )r   typesNr   )r   r   rI   r,   )r   r   s   "r   r    r      s.     $ $Xinns&:;dB $t $r"   c                    V'       d1   V Uu. uF  q P                   P                  V4      NK  	  upV n        M. V n        R V n        R# u upi r   )r   r   r   r   )r&   r   r<   s   && r   r   r      s=    AFGA[[44Q7GDMDM#	 Hs   #A	c                P   < V ^8  d   QhRS[ S[,          S[ S[,          ,          /# r*   )r   DTAPathr   )r   r   s   "r   r    r      s*     JL JL'*X6F-GG JLr"   c              #  *
  "   V P                   '       d   V P                  4        V P                  P                  R V P                   24       V P                  P                  RV P                  : 24       V P                  P                  RV P                  : 24       V P                  P                  RV P                  : RV P                  : 24       \        \        \        \        4      ;_uu_ 4        V P                  ;\        P                  P                   8X  d    \#        V P                  V P                  34      '       g   \%        R4      hV P                  P                  RV P                   RV P                   R24       \&        P(                  ! V P*                  V P                  V P                  4       F  pV P-                  V4      x  K  	  EM;\        P                  P.                  8X  d    \#        V P                  V P                  34      '       g   \%        R4      hV P                  P                  R	V P                   RV P                   R
V P                   R24       \&        P0                  ! V P*                  V P                  V P                  V P                  R7       F  pV P-                  V4      x  K  	  EM%;\        P                  P2                  8X  d    V P                  '       g   \%        R4      hV P                  P                  RV P                   24       \&        P4                  ! V P*                  V P                  V P                  R7       Fe  w  r#\7        V P*                  W#4      p\9        VVVP:                  V P=                  V4      VP>                  VP@                  VPB                  4      x  Kg  	  EM\        P                  PD                  8X  d   V P                  '       g   \%        R4      hV P                  P                  RV P                   24       \&        P4                  ! V P*                  V P                  RV P                  R7       Fe  w  r2\7        V P*                  W#4      p\9        VVVP:                  V P=                  V4      VP>                  VP@                  VPB                  4      x  Kg  	  M \%        RV P                   24      hRRR4       R#   + '       g   i     R# ; i5i)z*Generating domain transition results from self.source=self.target=
self.mode=, self.depth_limit=*Source and target types must be specified.z5Generating all shortest domain transition paths from  to ...,Generating all domain transition paths from , max length cutoffSource type must be specified.)Generating all domain transitions out of r   Target type must be specified.'Generating all domain transitions into Tr   r   Unknown analysis mode: N)#r   _build_subgraphr   infor   debugrg   rh   r   r   r   r
   r   r	   r   r   r|   allr   r   all_shortest_pathsr   _generate_stepsr}   all_simple_pathsr~   	bfs_edgesEdger   ri   _generate_entrypointsrj   rl   rm   r   )r&   pathrg   rh   edges   &    r   results DomainTransitionAnalysis.results   s      "B4;;-PQ,$++(),$++()*$))%9(8(8':;<nlMBB))@-22@@T[[9::()UVVHHMM"Y%)[[Mdkk]##G H !# 5 5dii6:kk6:kk!C #22488	!C <-22;;T[[9::()UVVHHMM$PQUQ\Q\P] ^((,}M$BRBRASSV#X Y !# 3 3DII48KK48KK;?;K;K!M
 #22488!M B-22AA;;;()IJJHHMM$Mdkk]"[\*,,,tyy$++CGCSCS+U#DIIv>.v/5/3/3/I/I$/O/3||/3/A/A/3@ @	+U .22@@;;;()IJJHHMM$KDKK="YZ*,,,tyy$++W[CGCSCS+U#DIIv>.v/5/3/3/I/I$/O/3||/3/A/A/3@ @	+U $'>tyyk%JKKC CBBBs-   C5T7H
S?DS?C.S?5
T?T	
	Tc                   < V ^8  d   QhRR/# )r   r   
nx.DiGraphr2   )r   r   s   "r   r    r     s     GG GG< GGr"   c           	     	   V P                   '       d   V P                  4        V P                  P                  RV P                   24       V P                  P                  RV P                  : 24       V P                  P                  RV P                  : 24       V P                  P                  RV P                  : RV P                  : 24        V P                  ;\        P                  P                  8X  Ed
    \        V P                  V P                  34      '       g   \        R4      hV P                  P                  RV P                   RV P                   R	24       \        P                   ! V P"                  V P                  V P                  4      pV UUu. uF4  p\        P$                  P&                  P)                  V4       F  q3NK  	  K6  	  ppp\        P*                  ! 4       pVP-                  V4       V# ;\        P                  P.                  8X  Ed#    \        V P                  V P                  34      '       g   \        R4      hV P                  P                  R
V P                   RV P                   RV P                   R	24       \        P0                  ! V P"                  V P                  V P                  V P                  R7      pV UUu. uF4  p\        P$                  P&                  P)                  V4       F  q3NK  	  K6  	  ppp\        P*                  ! 4       pVP-                  V4       V# ;\        P                  P2                  8X  d    V P                  '       g   \        R4      hV P                  P                  RV P                   R24       \        P4                  ! V P"                  V P                  V P                  R7      # \        P                  P6                  8X  d   V P                  '       g   \        R4      hV P                  P                  RV P                   R24       \        P4                  ! V P"                  V P                  RV P                  R7      p\        P8                  ! VRR7      #  \        RV P                   24      hu uppi u uppi   \:         d    p\<        P>                  ! RT 24      ThRp?ii ; i)a  
Return the results of the analysis as a NetworkX directed graph.
Caller has the responsibility of converting the graph to a
visualization.

For example, to convert to a pygraphviz graph:
    pgv = nx.nx_agraph.to_agraph(g.graphical_results())
    pgv.layout(prog="dot")
z4Generating graphical domain transition results from r   r   r   r   r   z?Generating graphical all shortest domain transition paths from r   r   r   r   r   r   r   .r   r   r   Tr   Fr   r   z&Unable to generate graphical results: N) r   r   r   r   r   r   rg   rh   r   r   r   r   r|   r   r   r   r   r   utilsmiscpairwiser   add_edges_fromr}   r   r~   bfs_treer   r   	Exceptionr   AnalysisException)r&   pathsr   pairedgesoutexs   &      r   graphical_results*DomainTransitionAnalysis.graphical_results  s      "LT[[MZ[,$++(),$++()*$))%9(8(8':;<3	G))@-22@@T[[9::()UVVHHMM"c%)[[Mdkk]##G H11$))T[[$++VE.3]ed@V@VW[@\T@\TeE]**,C&&u-J;-22;;T[[9::()UVVHHMM$PQUQ\Q\P] ^((,}M$BRBRASSV#X Y//		4;;7;7G7GIE.3]ed@V@VW[@\T@\TeE]**,C&&u-JA-22AA;;;()IJJHHMM$Mdkk]Z["\];;tyy$++4K[K[\\-22@@;;;()IJJHHMM$KDKK=XY"Z[++diid262B2BDC ::c66$'>tyyk%JKKM ^ ^4  	G--8=?DFG	GsX   CS $:R5*S 	CS &:R; *S 1S =A*S (/S BS %S S+S&&S+c                    < V ^8  d   QhRS[ /# r*   r+   )r   r   s   "r   r    r   b  s     # #3 #r"   c                   V P                   '       d   V P                  4        R\        P                  ! V P                  4      : R\        P
                  ! V P                  4      : R\        V P                  4      : R2# )z:
Get the domain transition graph statistics.

Return: str
znx.number_of_nodes(self.G)=z
nx.number_of_edges(self.G)=z
len(self.G)=r=   )r   _build_graphr   number_of_nodesr   number_of_edgeslenrt   s   &r   	get_stats"DomainTransitionAnalysis.get_statsb  sk     -"$$TVV,. /.$$TVV,. /dff+r# 	#r"   c                4   < V ^8  d   QhRRRS[ S[,          /# )r   r   r   r   )rJ   r   )r   r   s   "r   r    r   s  s!     * *F *t4D/E *r"   c           
         V P                    Uu. uFC  p\        WP                   V,          V P                  V,          V P                  V,          4      NKE  	  up# u upi )aR  
Creates a list of entrypoint, execute, and
type_transition rules for each entrypoint.

Parameter:
data     The dictionary of entrypoints.

Return: list of tuple(type, entry, exec, trans)

type     The entrypoint type.
entry    The list of entrypoint rules.
exec     The list of execute rules.
trans    The list of type_transition rules.
)r@   r   rB   rC   )r   r5   s   & r   r   .DomainTransitionAnalysis._generate_entrypointsr  sS    " *(A !OOA$6QI]I]^_I`a(* 	* *s   A	Ac                J   < V ^8  d   QhRS[ S[P                  ,          RS[/# )r   r   r   )rJ   r   rI   r   )r   r   s   "r   r    r     s$     $4 $4D$8 $4W $4r"   c           
   #  ^  "   \         P                  P                  P                  V4       F{  w  r#\	        V P
                  W#4      pV P                  '       d   Y2reMY#re\        WVVP                  V P                  V4      VP                  VP                  VP                  4      x  K}  	  R# 5i)a  
Generator which yields the source, target, and associated rules
for each domain transition.

Parameter:
path     A list of graph node names representing an information flow path.

Yield: tuple(source, target, transition, entrypoints,
             setexec, dyntransition, setcurrent)

source          The source type for this step of the domain transition.
target          The target type for this step of the domain transition.
transition      The list of transition rules.
entrypoints     Generator which yields entrypoint-related rules.
setexec         The list of setexec rules.
dyntranstion    The list of dynamic transition rules.
setcurrent      The list of setcurrent rules.
N)r   r   r   r   r   r   r   r   ri   r   rj   rl   rm   )r&   r   rg   rh   r   real_sourcereal_targets   &&     r   r   (DomainTransitionAnalysis._generate_steps  s     ( !hhmm44T:NF		62D
 |||+1[+1[";#'??#'#=#=d#C#'<<#'#5#5#'??4 4 ;s   B+B-c                   < V ^8  d   QhRR/# r   r2   )r   r   s   "r   r    r     s     R5 R5d R5r"   c           	        V P                   P                  4        R V P                   R2V P                   n        V P                  P                  RV P                   R24       \        \        4      p\        \        4      p\        R 4      p\        R 4      p\        R 4      pV P                  P                  4        EF  pVP                  \        P                  P                  8X  Ed   VP                  R9  d   KA  VP                  R8X  Ed   RVP                  9   d   \        P                   ! VP"                  P%                  4       VP&                  P%                  4       4       F@  w  rxWx8w  g   K  \)        V P                   WxR	R
7      p	V	P*                  P-                  V4       KB  	  RVP                  9   d   \        P                   ! VP"                  P%                  4       VP&                  P%                  4       4       F@  w  rxWx8w  g   K  \)        V P                   WxR	R
7      p
V
P.                  P-                  V4       KB  	  RVP                  9   d9   VP"                  P%                  4        F  pW,          P-                  V4       K  	  RVP                  9   d<   VP"                  P%                  4        F  pW',          P-                  V4       K  	  EK   EK#  RVP                  9   do   \        P                   ! VP"                  P%                  4       VP&                  P%                  4       4       F#  w  rxW7,          V,          P-                  V4       K%  	  RVP                  9   dr   \        P                   ! VP"                  P%                  4       VP&                  P%                  4       4       F#  w  rxWG,          V,          P-                  V4       K%  	  EK$  EK'  VP                  \        P                  P0                  8X  g   EKS  VP                  R8w  d   EKg  VP2                  p\        P                   ! VP"                  P%                  4       VP&                  P%                  4       4       F*  w  rxWW,          V,          V,          P-                  V4       K,  	  EK  	  . p. p. pV P                   P5                  4        EFF  w  rx\)        V P                   Wx4      p	RpRpV	P*                  '       Edw   \7        WH,          P9                  4       4      p\7        W7,          P9                  4       4      pVP;                  V4      pV'       g   R	pEMV F  pWq9   g   WW,          V,          '       dY   V	P<                  V;;,          WH,          V,          ,          uu&   V	P>                  V;;,          W7,          V,          ,          uu&   WW,          V,          V,          '       g   K  V	P0                  V;;,          WW,          V,          V,          ,          uu&   K  	  Wq9   d"   V	P@                  PC                  W,          4       V	P@                  '       g   V	P0                  '       g   R	pMR	pV	P.                  '       d,   Wr9   d#   V	PD                  PC                  W',          4       MR	pMR	pV'       d   V'       d   VP-                  V	4       EK  V'       d   VP-                  V	4       EK*  V'       g   EK5  VP-                  V	4       EKI  	  V P                   PG                  V4       V F  p	V	=V	=V	=V	=V	= K  	  V F  p	V	=V	="K	  	  RV n$        R	V n%        V P                  P                  R4       V P                  PM                  R\N        PP                  ! V P                   4       R\N        PR                  ! V P                   4       R24       R# )zDomain transition graph for r   z&Building domain transition graph from r   c                       \        \        4      # r$   r   rJ   r2   r"   r   <lambda>7DomainTransitionAnalysis._build_graph.<locals>.<lambda>  s
    [Y]M^r"   c                       \        \        4      # r$   r   r2   r"   r   r   r     s    P[\`Par"   c                      \        R  4      # )c                       \        \        4      # r$   r   r2   r"   r   r   IDomainTransitionAnalysis._build_graph.<locals>.<lambda>.<locals>.<lambda>  s	    K4Er"   r   r2   r"   r   r   r     s
    ,E Fr"   processri   T)createrl   rj   rm   rB   r@   Fz+Completed building domain transition graph.zGraph stats: nodes: 	, edges: N)r  file)*r   clearr   r%   r   r   r   rJ   terulesruletyper   
TERuletypeallowtclassperms	itertoolsproductrg   expandrh   r   ri   rA   rl   rC   defaultr   setkeysintersectionr@   rB   rj   r>   rm   remove_edges_fromr   r   r   r   r   r   )r&   rj   rm   rB   r@   
type_transrulera   r<   r   r5   rd   invalid_edgeclear_transitionclear_dyntransitioninvalid_transinvalid_dyntransentryexematchms   &                    r   r   %DomainTransitionAnalysis._build_graph  s   4T[[MC>t{{m3OP (-*40

 :EE^9_<GHa<b
 FG 	 KK'')D}}	 4 4 : ::;;&99;;)+#tzz1$-$5$5dkk6H6H6JDKKL^L^L`$aDA  !v'+DFFA'F $ 6 6t < %b '$**4$-$5$5dkk6H6H6JDKKL^L^L`$aDA  !v$(d$C ! 6 6t < %b !DJJ.!%!3!3!5A#J--d3 "6 $tzz1!%!3!3!5A&M006 "6 2
 !DJJ.$-$5$5 $ 2 2 4 $ 2 2 4%6DA $JqM006%6
 $tzz1$-$5$5dkk6H6H6JDKKL^L^L`$aDA&M!,33D9 %b 2 )"6"6"F"FF;;)+LL%--dkk.@.@.BDKKDVDVDXYDAM!$Q'..t4 Z] *b $&')*,FFLLNDA%D!M$JM..01'*//+,**3/$(M #<:=+;+; OOA.*-2BB. LLOwz!}<O%=+A.. 003z}Q7G7JJ3 # |++GJ7<<<0D0D0D(, $!!!?OO**:=9'+$#'  !1##D) ''-!!#**40e #j 	  .$D $ % (D "	 ( "#CD"2#5#5dff#="> ?((014	5r"   c                   < V ^8  d   QhRR/# r   r2   )r   r   s   "r   r    r   u  s     3 3d 3r"   c           	     `   . pV P                   P                  4        F  w  r#\        V P                   W#4      p\        VP                  4      pVP                  V P                  4       V'       g   KU  V FJ  pVP                  V VP                  V \        \        4      ;_uu_ 4        VP                  V R R R 4       KL  	  VP                  '       d   K  VP                  '       d   K  VP                  V4       K  	  V P                   P                  V4       R #   + '       g   i     K  ; ir$   )r   r   r   r  r@   intersection_updater   rB   r   KeyErrorrC   rl   rA   r  )r&   invalid_edgesrg   rh   r   rk   r5   s   &      r   _remove_excluded_entrypoints5DomainTransitionAnalysis._remove_excluded_entrypointsu  s    $&"iioo/NF		62Ddoo.K++DLL9   OOA&LLOh'',,Q/ (' ! ???4+=+=+=$$T*- 00 			##M2 (''s   (D	D-c                   < V ^8  d   QhRR/# r   r2   )r   r   s   "r   r    r     s     8 8 8r"   c                "   V P                   '       d   V P                  4        V P                  P                  R 4       V P                  P	                  RV P
                  : RV P                  : 24       V P
                  '       d#   V P                  P                  RR7      V n        MV P                  P                  4       V n        V P                  '       d6   V P                  P                  V P                  4       V P                  4        RV n        V P                  P                  R4       V P                  P	                  R\        P                  ! V P                  4       R\        P                  ! V P                  4       R	24       R
# )z$Building domain transition subgraph.zself.reverse=z self.exclude=Tr   Fz.Completed building domain transition subgraph.zSubgraph stats: nodes: r  r   N)r   r   r   r   r   r   r   r   r   r   remove_nodes_fromr'  r   r   r   r   rt   s   &r   r   (DomainTransitionAnalysis._build_subgraph  s   <=-$,,$,,9: <<<D1DIDI<<<II''5 --/$FG%b&8&8&C%D E((34A7	8r"   c                   < V ^8  d   Qh/ S[ P                  S[S[R3,          ,          ;R&   S[ P                  S[S[R3,          ,          ;R&   # )r   .DIRECT_MODESTRANSITIVE_MODES)typingFinaltupler   )r   r   s   "r   r    r   q   sC     2 ,,uT3Y/0\3 4 ll5s#34Z5 r"   )r   r   r   r   r   r   r   )'rL   rM   rN   rO   rP   enumEnumr   r   r~   r.  r|   r}   r/  r   r   rI   rg   rh   r   r   propertyr   setterr   r   r   r   r   staticmethodr   r   r   r'  r   rQ   rR   rS   rw   rx   s   @@r   r   r   q   s    >tyy > 594F4FH[H[3\L8<8J8JDMM7Z	/NF	/NFD!&7; 8< #00	
 ,- CG 4 ! ! " "   ^^$ $   ^^$ $JL JLXGG GGR# #  * *$$4 $4xR5 R5h3 388 8A  r"   c                      a  ] tR tRt o RtRt]! 4       t]! 4       t]! 4       t	]! 4       t
]! 4       t]! 4       t]! 4       tV 3R lR ltV 3R ltRtV tR# )	r   i  a/  
A graph edge.  Also used for returning domain transition steps.

Parameters:
graph       The NetworkX graph.
source      The source type of the edge.
target      The target type of the edge.

Keyword Parameters:
create      (T/F) create the edge if it does not exist.
            The default is False.
Fc                   < V ^8  d   QhRR/# r   r2   )r   r   s   "r   r    Edge.__annotate__  s     A At Ar"   c                ^   V P                   P                  V P                  V P                  4      '       gw   V'       dd   V P                   P	                  V P                  V P                  4       R V n        R V n        R V n        R V n        R V n	        R V n
        R V n        R # \        R4      hR # )NzEdge does not exist in graph)r   has_edgerg   rh   add_edgeri   r@   rB   rC   rj   rl   rm   r   )r&   r  s   &&r   __post_init__Edge.__post_init__  s    vvt{{DKK88T[[9"&"&#'+$#%)""& !?@@ 9r"   c                   < V ^8  d   Qh/ R;R&   S[ P                  ;R&   S[ P                  ;R&   S[S[,          ;R&   # )r   r   r   rg   rh   r  )r   rI   r   r   )r   r   s   "r   r    r:    sD       O! " NN# $ NN% & DM!' r"   )rl   r@   rB   rm   rj   ri   rC   N)rL   rM   rN   rO   rP   r  r   ri   rj   rl   rm   r   r@   rB   rC   r>  rQ   rR   rS   rT   s   @r   r   r     sU       "FJnG NMJJnG"nOA A9  r"   r   c                    V ^8  d   Qh/ ^ \         9   d,   \        P                  \        \        R3,          ,          ;R&   # )r   .__all__)__conditional_annotations__r0  r1  r2  r,   )r   s   "r   r    r       s-    &5 5eCHo	& 5' r"   )r   r   r   r   )0rC  r3  r  loggingcollectionsr   collections.abcr   
contextlibr   dataclassesr   r   r0  networkxr   networkx.exceptionr	   r
   r   ImportErroriex	getLoggerrL   r   r%   rf   r   r   r   r   descriptorsr   r   r   rB  r   r   r   rI   rJ   rK   RuleHashDirectedGraphAnalysisr   NetworkXGraphEdger   r    )rC  s   @r   <module>rR     s      # $  * GNN
 2 1 G G*5 5      8 *' *' *'` #
$y~~tI,?,?'@@Ax8u:: x8v 'A6## 'A 'Au  Gh%%
2D&EFFGs   C D!.DD