Caml1999I037)Gprinttyp'digraph{;@@@A@@@@@4typing/gprinttyp.mli@@@@ @@A@¶ms|;@@@A@@@@@ PP P[@@@@A@A@'element};@@@A@@@@@@@@@ B@A@*decoration~;@@@A@@@@@ .@@@@*C@A@%types%title&stringQ@@@^@0@@@_@$listK@,@@@a@%Types)type_expr@@@`@@b@@@c$unitF@@@d@@e@@f@@g@YzzZz@@dE@@%nodes%title:@@@h@8@@@i@7@5@@@k@p@@@j@@l@@@m0@@@n@@o@@p@@q@333{@@F@@¶ms+elide_links&optionL$boolE@@@r@@@s6expansion_as_hyperedge@@@t@@@u)short_ids@@@v@@@w(colorize)&@@@x@@@y1follow_expansions52@@@z@@@{@@@@|@@@}@@~@@@@@@@@@@@}}@@G@@-update_params+elide_linksSP@@@@@@6expansion_as_hyperedge_\@@@@@@)short_idskh@@@@@@(colorizewt@@@@@@1follow_expansions@@@@@@@@@@@@@@@@@@@@@@@@@@'(@@2H@@$node@)type_expr@@@@@@@@@;<@@FI@@$edge@)type_expr@@@@)type_expr@@@@@@@@@@@WX@@bJ@@#dir;@@&Toward@@f g @@qL@$From@@o p !@@zM@@@A@@@@@s  @@A@}K@A@)hyperedge@C@+@@@@G@@@@F)type_expr@@@@@@@@@@@@@@"""e@@N@@Ӡ*Decoration@%color;@@%Named@@@@@@@@P@#HSL!h@@%floatD@@@? @@Q@!s@@@@@> @@R@!l@@@@@= @@S@@@@@T@@@A@@@@@@@@@O@A@%greenJ@@@A@/@@Z@@$blue @@@B@020A@@[@@#red@@@C@ BD BQ@@\@@&purple%@@@D@RTRd@@ ]@@#hsl!ha@@@E!si@@@F!lq@@@GI@@@H@@I@@J@@K@9eg:e@@D^@@%style;@@&Filled`@@@L@@@M@@QR@@\`@&Dotted@@Z[@@ea@$Dash@@cd@@nb@@@A@@@@@g@@@@q_@A@%shape;@@'Ellipse@@uv@@d@&Circle@@~@@e@'Diamond@@ @@f@@@A@@@@@@@A@c@A@(property;@@%Color@@@S@@ (, (<@@h@*Font_color@@@R@@ =A =V@@i@%Stylex@@@Q@@ W[ Wk@@j@%Label@@@O@@@P@@ lp l@@k@%Shapel@@@N@@  @@l@@@A@@@@@@@@@g@A@&filled@@@@T]@@@U@@V@@@m@@#txt@@@@W@@@X@@Y@@@ n@@$make@Ѡ%@@@Z@@@[@@@\@@]@ @@!o@@@@  @%p@@@$make@@@@@@@@@@@@@@@@@@B@@@@@@@@? 4 4@ 4 n@@Jq@@#add@@@@@@@@@@@@@@@@@@@'@@@*@@@@@@@@@@h o oi o @@sr@@,add_subgraph@?@@@@4@@@@C@A@@@@ @@@@@@@@@U@@@X@@@@@@@@@@@@!!!!a@@s@@+group_nodes@@a@@@Ġ@o@@@@@@t@@@w@@@@@@@@!!!!@@t@@"pp@&Stdlib&Format)formatter@@@@@@@|@@@@@@@@!!!!@@u@@(debug_on#ref@@@@M@@@@@@@@@'"t"t'"t"@@v@@)debug_off@@@@@!a@@@@@@*""*""@@ w@@%debug@@@@@@@@@@@@@@@@-#&#&-#&#G@@%x@@-register_type@@@@@ݠ@)type_expr@@@@@@@@@@@83##93#$ @@Cy@@1register_subgraph@@@@*decoration @@@@@@@ )type_expr@@@@@@ @@@@@@@@@@b7$$c8$$@@mz@@&forget@@@@@@@@@@u;%%%%v;%%%>@@{@@'context;!a@@A@A@G@B@@@B&&B&&)@@@@|@A@&globalg@@@@@@@C&*&*C&*&D@@}@@#loc(Warnings#loc@@@@@@@D&E&ED&E&b@@~@@+set_context@)!a@@@@@o@@@@@@@@E&c&cE&c&@@@@,with_context@B!a@@@@@@@@@@!b@@@@@@@@@@F&&F&&@@@@@@9Ϡ)Gprinttyp0K2%)Š(Warnings0mJɒkgrWA+9*X*Format_doc0]mWϓ:Mݠ0CamlinternalLazy0&͂7 Pˆ8CamlinternalFormatBasics0%FU(Q/Tu(Asttypes0>n{T8cئ@@@Caml1999T037WOWC)Gprinttyp*ocaml.text&_none_@@A This module provides function for printing type expressions as digraph using graphviz format. This is mostly aimed at providing a better representation of type expressions during debugging session. 4typing/gprinttyp.mliO66S  @@@@@@3@@@@@@#intA;@@@A@@@@@:@A@$charB;@@A@@@@@>@A@&stringQ;@@ A@@@@@B@@@%bytesC;@@ A@@@@@F@@@%floatD;@@A@@@@@J@@@$boolE;@@%falsec@@T@$trued@@Z@@@A@@@@@[@A@$unitF;@@"()e@@e@@@A@@@@@f@A@ #exnG;@@@A@@@@@j@@@#effH;@@O@A@A@@@@@@s@@@,continuationI;@@Q@@P@B@A@nY@@@@@@@@@%arrayJ;@@R@A@A@@@@@@@@@ $listK;@@S@A"[]f@@@"::g@@@T@@@ @@A@Y@@@@@@@@&optionL;@@V@A$Noneh@@@$Somei@@@@@A@Y@@@@@@@@)nativeintM;@@A@@@@@@@@%int32N;@@A@@@@@@@@%int64O;@@A@@@@@@@@&lazy_tP;@@X@AJA@Y@@@@@@@@5extension_constructorR;@@A@@@@@@@@*floatarrayS;@@A@@@@@@@@&iarrayT;@@Y@A[A@Y@@@@@@@@*atomic_locU;@@Z@AdA@@@@@@@@@.Assert_failure`#@@@@@J@@@@@@@@[@@A=ocaml.warn_on_literal_pattern @ @0Division_by_zero]#@@@A  @+End_of_file\#$@@@A@'FailureY#,@'@@A!$$@0Invalid_argumentX#5@0@@A*$-#-@-Match_failureV#>@@=@9@;@@a@@A;5>4>@)Not_foundZ#O@@@AC=F<F@-Out_of_memoryW#W@@@AKENDN@.Stack_overflow^#_@@@ASMVLV@.Sys_blocked_io_#g@@@A[U^T^@)Sys_error[#o@j@@Ad^g]g@:Undefined_recursive_modulea#x@@w@s@u@@h@@Auoxnx@:Continuation_already_takenb#@@@A}wv@&Stdlib@Ax  A type node is printed as {[ .---------------. | lvl | | ID |----> | |---> .---------------. ]} where the description part might be: - a path: [list/8!] - a type variable: ['name], [α], [β], [γ] - [*] for tuples - [→] for arrows type - an universal type variable: [[β]∀], ['name ∀], ... - [[mod X with ...]] for a first class module - [∀] for a universal type binder The more complex encoding for polymorphic variants and object types uses nodes as head of the subgraph representing those types - [[obj...]] for the head of an object subgraph - [[Nil]] for the end of an object subgraph - [[Row...]] for the head of a polymorphic variant subgraph - [[Subst]] for a temporary substitution node Then each nodes is relied by arrows to any of its children types. - Type variables, universal type variables, [Nil], and [Subst] nodes don't have children. - For tuples, the children types are the elements of the tuple. For instance, [int * float] is represented as {[ .------. 0 .-------. | * 1 |-------->| int! 2| .------. .-------. | | 1 v .----------. | float! 3 | .----------. ]} - For arrows, the children types are the type of the argument and the result type. For instance, for [int -> float]: {[ .------. 0 .-------. | → 4 |-------->| int! 2| .------. .-------. | | 1 v .----------. | float! 3 | .----------. ]} - For type constructor, like list the main children nodes are the argument types. For instance, [(int,float) result] is represented as: {[ .-------------. 0 .-------. | Result.t 5 |-------->| int! 2| .-------------. .-------. | | 1 v .----------. | float! 3 | .----------. ]} Moreover, type abbreviations might be linked to the expanded nodes. If I define: [type 'a pair = 'a * 'a], a type expression [int pair] might correspond to the nodes: {[ .--------. 0 .--------. | pair 6 |------> | int! 2 | .--------. .--------. ┆ ^ ┆ expand | ┆ | .------. 0 + 1 | | * 7 |------>-------. .------. ]} - Universal type binders have two kind of children: bound variables, and the main body. For instance, ['a. 'a -> 'a] is represented as {[ .------. bind .-------. | ∀ 8 |----------> | 𝛼 10 | .------. .------. | ^ | | v | .------. 0 + 1 | | → 9 |------>-------. .------. ]} - [[Subst]] node are children are the type graph guarded by the substitution node, and an eventual link to the parent row variable. - The children of first-class modules are the type expressions that may appear in the right hand side of constraints. For instance, [module M with type t = 'a and type u = 'b] is represented as {[ .----------------------. 0 .-----. | [mod M with t, u] 11 |-------->| 𝛼 12| .----------------------. .----- | | 1 v .------. | 𝛽 13 | .------. ]} - The children of [obj] (resp. [row]) are the methods (resp. constructor) of the object type (resp. polymorphic variant). Each method is then linked to its type. To make them easier to read they are grouped inside graphviz cluster. For instance, [ as 'self] will be represented as: {[ .----------------. | .----------. | | | [obj] 14 |<------<-----<-----. | .----------. | | | ┆ | | | .-------------. | .------. | .-------. | | a public 15 |----->| ∀ 18 |----->| int! 2 | | .-------------. | .------. | .-------. | ┆ | | | .-------------. | .------. | | | m public 16 |-----| ∀ 19 |>--| | .------------. | .------. | ┆ | | ┆ row var | | ┆ | | .-------. | | | '_ 17 | | | .-------. | .-----------------. ]} T  @@@@@@A+'digraphA @@;@@@A@@@@@@)ocaml.doc 6 Digraph with nodes, edges, hyperedges and subgraphes N@@@@@@@@@@@@@A@@@@@@@@"@A+¶msBPUP[@@;@@,A@@@@@PP@+ e Various possible choices on how to represent types, see the {!params} functions for more detail.\\@@@@@@@@@A@@@A@:ᐠ@@@@@@@3@QK@A!@A+'elementC@@;@@WA@@@@@@V C Graph element, see the {!node}, {!edge} and {!hyperedge} function @@@@@@@@@B@@@A@e @@@@@@@3@,PJ@A!@A+*decorationD$.@@;@@A@@@@@@ C Visual decoration on graph elements, see the {!Decoration} module.$//%/w@@@@@@@@@=C@@@A@7@@@@@@@3/../////@,PJ@A!@%types=z~>z@б%titleг&stringJzKz@@ @@@3LKKLLLLL@B<@A@@б@г¶ms[z\z@@ @@@@@б@г栐$listjzkz@В@гe*decorationxzyz@@ @@@.@@@г%Types)type_expr%Typeszz@ zz@@@@@@ H @@@@"@ @@ O' @@@< @@@ Tz:@@гY$unitzz@@ @@@ b@@@@@ e@@@Z@@ h] @@yn@@ kz@@@zz@(  Print a graph to the file [asprintf "%s/%04d-%s-%a.dot" dump_dir session_unique_id title pp_context context ] If the [dump_dir] flag is not set, the local directory is used. See the {!context} type on how and why to setup the context. @@@@@@@E@@"@8ߐ@@@@@@%nodes373<@б%titleг&string3D3J@@ @@@ 3@:@A@@б@гC¶ms3N3T@@ @@@ @@б@г$list3o3s@В@г *decoration3Y3c@@ @@@ .@@@гD'element,3f-3m@@ @@@ =@@@@@ @@ D @@@1 @@@ I>3X/@@г$unitF3wG3{@@ @@@ W@@@@@ Z@@@O@@ ]R @@nc@@ `U3>@@@X33@ H Full version of {!types} that allow to print any kind of graph element ef2@@@@@@@~F@@"@y@@@@@@¶ms|}}}@б+elide_linksгG$bool@@ @@@ 3@:@A@@б6expansion_as_hyperedgeгZ$bool@@ @@@ @@б)short_idsгk$bool@@ @@@ $@@б(colorizeг|$bool@@ @@@ 5@@б1follow_expansionsг$bool@@ @@@ F@@б@г$unit @@ @@@ U@@г.¶ms@@ @@@ b@@@@@ e@@0\)@@@  @@ m@@J B@@@ @@ u@@c[@@@ @@ } !@@|t@@@ @@ )@@!@@@ @@ 1@@ @}}4@  Choice of details for printing type graphes: - if [elide_links] is [true] link nodes are not displayed (default:[true]) - with [expansion_as_hyperedge], memoized constructor expansion are displayed as a hyperedge between the node storing the memoized expansion, the expanded node and the expansion (default:[false]). - with [short_ids], we use an independent counter for node ids, in order to have shorter ids for small digraphs (default:[true]). - with [colorize] nodes are colorized according to their typechecker ids (default:[true]). - with [follow_expansions], we add memoized type constructor expansions to the digraph (default:[true]). ,-@@@@@@@EG@@D@@@@@@@@-update_paramsC D@б+elide_linksг$boolP'Q+@@ @@@ 3RQQRRRRR@:@A@@б6expansion_as_hyperedgeг!$boolc/Id/M@@ @@@ @@б)short_idsг2$booltQ^uQb@@ @@@ $@@б(colorizeгC$boolfrfv@@ @@@ 5@@б1follow_expansionsгT$boolzz@@ @@@ F@@б@г蠐¶ms@@ @@@ U@@г¶ms@@ @@@ b@@@@@ e@@0Ǡ(@@@  @@ lz|@@IϠA@@@ @@ tfh@@bנZ@@@ @@ |QS @@{ߠs@@@ @@ /1(@@@@@ @@ 0@@ @3@O . Update an existing [params] with new values. @@@@@@@ H@@C@_@@@@@@$node  @б@г)type_expr%Types@ @@@@@@ 3@A@A @@гD'element,-@@ @@@ @@@@@ @@@7 @@OI@@ @@$edgeBC@б@г)type_expr%TypesQR@ UV@@@@@@ 3XWWXXXXX@:X(@A @@б@г)type_expr%Typeskl@ op@@@@@@  @@г'element}~@@ @@@ '@@@@@ *@@@0@@ -8 @@@@@J@@@@3A+#dirE  @@;@@&Toward@@  @@L@$From@@  !@@M@@@A@@@@@  @@A@K@@#@@@@@# @@@@@@A@@@3@b5@A@)hyperedge"&"/@б@гN$list"V"Z@В@гI#dir"2"5@@ @@@ 3@*TN@A@@@гޠ*decoration"8"B@@ @@@ @@@гy)type_expr%Types"E"J@ "K "T@@@@@@ ) @@@@1@"@ @@ 28@@@M @@@ 7"1K@@г='element%"^&"e@@ @@@ E@@@@@ H@@@0"" @ ' Edges between more than two elements. =ff>f@@@@@@@VN@@@Q@@@@@@g*DecorationFVW@op@@БA+%colorGef@@;@@%Named@@@@ @@tu@@P@#HSL!h@@I@@@  @@Q@!s@@U@@@ " @@R@!l@@`@@@ % @@S@@@@@T@@@A@@@@@@@@@O@@#==@6@г?&string@@@F3@W;@@@A@@@@@@@@@AF@@@@H@#DD@ @#FFA@@@@Ш@гI%float @@Q@@T@@ @P@#LLR @G@@Ш@гO%float @@W.@@Z@@ #1@V@#SSY@N@@Ш@гV%floatX@@]?Y@@`@@ &B@\@@@Y@@A@U@@3@A@AVY@%green#(@г%color * /@@ @@@ ?3        @Z@A@@@ @@,Z@@ @@$blue06 0:@гà%color(0<)0A@@ @@@ @3*))*****@2@A@@@202 @@J[@@ @@#red=BH>BK@г᠐%colorFBLGBQ@@ @@@ A3HGGHHHHH@2@A@@@PBD @@h\@@ @@&purple[RX\R^@г%colordR_eRd@@ @@@ B3feefffff@2@A@@@nRT @@]@@ @@#hslyekzen@б!hгH%floaterew@@ @@@ C3@#6!@A@@б!sг[%floate}e@@ @@@ D@@б!lгl%floatee@@ @@@ E$@@гR%coloree@@ @@@ F1@@@@ G4e @@3(@@ H8e{ @@J?@@ I<ep@@@eg@@^@@@@CA+%styleH@@;@@&FilledG@@@ J@@@ L@@@@`@&Dotted@@@@ a@$Dash@@@@b@@@A@@@@@@@@@_@@#)) @@г+&option'@г/%color@@73@VL;@@@A@@@@@!@@@@A@@@A 7@@@@9@#55'3@2@@@6@#22-0@/@@@3@@A@/@@3,++,,,,,@@A03@A+%shapeI:;@@;@@'Ellipse@@DE@@]d@&Circle@@MN@@fe@'Diamond@@V W@@of@@@A@@@@@Z@@A@rc@@#a@@@@ @#g@@@@@#m @@@@@@A@@@3lkklllll@S@A@A+(propertyJ{|%@@;@@%Color'@@@ ]@@ (, (<@@h@*Font_color5@@@ ^@@ =A =V@@i@%Style@@@ _@@ W[ Wk@@j@%Label2@@@ `@@@ b@@ lp l@@k@%Shape@@@ c@@  @@l@@@A@@@@@@@@@g@@#OO (. (3@H@гQ%color (7R@@X3@pi;@@@A@@@@@@@@@AX@@@@Z@#VV =C =M@O@гX%color =QY@@_Z@@@@\@#XX W] Wb@Q@гZ%style  Wf[@@a%\@@@@^@#ZZ  lr  lw@N@г\$list  lX@г`&string  l{  l@@h>@@@m?c@@@@e@#aa !  " @Z@гc%shape + d@@jOe@@@@g@@A@c@@3 * ) ) * * * * *@O@Adg@&filled 7 8@б@гݠ%color B C@@ @@@ v3 D C C D D D D D@j@A@@г֠(property Q R@@ @@@ w@@@@@ x@@@ \ @@ tm@@ @@#txt g h@б@г <&string r s@@ @@@ y3 t s s t t t t t@1F@A@@г(property  @@ @@@ z@@@@@ {@@@  @@ n@@ @@$make  @б@г $list  @г1(property  @@ @@@ |3        @;P)@A@@@ @@@ ~ @@г*decoration   @@ @@@ @@@@@ @@@  @@ o@@ @@@oiA@@@@l@e@ A@A@icA@@Z@S@@3        @6U@A3        @3@A    @@V ? {1 Node and decoration types}   @@@@@@@ @@   & {1 Digraph construction and printing}      2@@@@@@3        @[@A@@@@@W@OIA@A@A@@@c@@>=@==@@@=@=@:@A)$make > 4 8 ? 4 <@б@г¶ms I 4 > J 4 D@@ @@@ >@@б@г Ԡ$list X 4 _ Y 4 c@В@гS*decoration f 4 I g 4 S@@ @@@ [@@@г'element u 4 V v 4 ]@@ @@@ j@@@@@ @@ q @@@1 @@@ v  4 H/@@г'digraph  4 g  4 n@@ @@@ @@@@@ @@@O@@ R @@@  4 4@@ q@@@@#add  o s  o v@б@г¶ms  o x  o ~@@ @@@ 3        @@A@@б@г @$list  o   o @В@г*decoration  o   o @@ @@@ @@@г'element  o   o @@ @@@ .@@@@@ @@ 5 @@@1 @@@ :  o /@@б@г l'digraph  o   o @@ @@@ J@@г y'digraph  o   o @@ @@@ W@@@@@ Z@@@'@@ ]# @@@c@@ `f@@@  o o@@ 3r@@@@f,add_subgraph &!! '!!@б@г t¶ms 1!! 2!!@@ @@@ 3 3 2 2 3 3 3 3 3@@A@@б@г /*decoration B!!" C!!,@@ @@@ @@б@г ͠$list Q!!G R!!K@В@г L*decoration _!!1 `!!;@@ @@@ .@@@г 'element n!!> o!!E@@ @@@ =@@@@@ @@ D @@@1 @@@ I !!0/@@б@г 'digraph !!O !!V@@ @@@ Y@@г 'digraph !!Z !!a@@ @@@ f@@@@@ i@@@'@@ l# @@@a@@ od@@@u@@ rx@@@ !!@  I add a subgraph to a digraph, only fresh nodes are added to the subgraph      !@@@@@@@ s@@$@ % ̐@@@@@@+group_nodes !! !!@б@В@г ˠ*decoration !! !!@@ @@@ 3        @<@A@@@г ^'digraph !! !!@@ @@@ @@@@@ @@  @@б@г t'digraph !! !!@@ @@@ '@@г 'digraph !! !!@@ @@@ 4@@@@@ 7@@@(@@ :@ @@@ !!@ ) groups existing nodes inside a subgraph  -!c!c .!c!@@@@@@@ Ft@@@  A@@@@@@Y"ppS D!! E!!@б@г &Format)formatter S!! T!!@  W!! X!!@@@@@@3 Z Y Y Z Z Z Z Z@{A@A @@б@г ؠ'digraph i!! j!!@@ @@@@@г #$unit v!! w!!@@ @@@@@@@@!@@@'@@$/ @@@ !!@@ u@@@@*  ! {1 Debugging helper functions }  "!! "!"#@@@@@@3        @<Z@A  & {2 Generic print debugging function}  $"%"% $"%"P@@@@@@(debug_onT '"t"x '"t"@г D#ref '"t" '"t"@б@г u$unit '"t" '"t"@@ @@@5@@г $bool '"t" '"t"@@ @@@B@@@@@E@@@)@@@J '"t"'@@@ '"t"t*@ P< Conditional graph printing  &"R"R &"R"s@@@@@@@ v@@:@ ` @@@@@@j)debug_offU *"" *""@б@б@г Ġ$unit *"" *""@@ @@@3        @o:@A@@А!a@K@  (*"" )*""@@@ @@@@А!a 1*"" 2*""@@@ @@ 6*""@@@ 9*""@ : [debug_off f] switches off debugging before running [f].  F)"" G)""@@@@@@@ _w@@@  Z@@@@@@9%debugV ]-#&#* ^-#&#/@б@б@г $unit j-#&#2 k-#&#6@@ @@@3 l k k l l l l l@Tk:@A@@г &$unit y-#&#: z-#&#>@@ @@@@@@@@@@г 6$unit -#&#C -#&#G@@ @@@@@@@@" -#&#1 @@@ -#&#& @ ' [debug f] runs [f] when [!debug_on ()] ,"" ,"#%@@@@@@@ x@@@  @@@@@@B  Ð= {2 Node tracking functions } /#I#I /#I#k@@@@@@3        @Tk1@A-register_typeW 3## 3##@б@В@г Ƞ*decoration 3## 3##@@ @@@@@@г c)type_expr%Types 3## 3##@  3## 3#$@@@@@@6 @@@@ @ @@=% @@г $unit3#$3#$ @@ @@@J@@@@@M5@@@3## @ | _ [register_type (lbl,ty)] adds the type [t] to all graph printed until {!forget} is called 1#m#m 2##@@@@@@@8y@@@ 3@@@@@@l1register_subgraphX67$$77$$@б@г ¶msA8$$B8$$@@ @@@3CBBCCCCC@8@A@@б*decorationг A*decorationT8$$U8$$@@ @@@@@б@г ߠ$listc8$$d8$$@г )type_expr%Typesq8$$r8$$@ u8$$v8$$@@@@@@5 @@@ @@@:@@г5$unit8$$8$$@@ @@@G@@@@@J @@H @@@@ @@Q8$$@@@X @@U[@@@7$$@  [register_subgraph params tys] groups together all types reachable from [tys] at this point in printed digraphs, until {!forget} is called 5$ $ 6$W$@@@@@@@z@@&@ @@@@@@t&forgetY;%%%);%%%/@б@гz$unit;%%%2;%%%6@@ @@@3@8@A@@г$unit;%%%:;%%%>@@ @@@@@@@@@@@;%%%% @ Q # Forget all recorded context types :$$:$%$@@@@@@@ {@@@ a@@@@@@1A+'contextZK B&&" B&&)@А!a@3@F[4;@@@A@A@G@B@@@!B&&@ {2 Contextual information} Those functions can be used to modify the filename of the generated digraphs. Use those functions to provide contextual information on a graph emitted during an execution trace..=%@%@/A%&@@@@@@@@@G|@@A2B&&3B&&!@@BA@;$@A A@G@B@@@@@ @@A@ I@@@@@@@3A@@AAAAA@-@A%9@&global[NC&*&.OC&*&4@гK'contextWC&*&=XC&*&D@г+&stringaC&*&6bC&*&<@@ @@@3cbbccccc@P`3@A@@@ @@@ @@@pC&*&*@@}@@@@ #locx{D&E&I|D&E&L@гx'contextD&E&[D&E&b@г(Warnings#loc(WarningsD&E&ND&E&V@ D&E&WD&E&Z@@@@@@/3@9V2@A @@@$ @@@1!@@@D&E&E$@@~@@&@@ +set_contextyE&c&gE&c&r@б@г'contextE&c&wE&c&~@А!a@9L@23@,T%@AE&c&tE&c&v@@@ @@@4 @@б@А!aE&c&E&c&@@г$unitE&c&E&c&@@ @@@5@@@&@@6!@@@@@7$" @@@E&c&c@@@@@@*,with_contextzF&&F&&@б@г'contextF&&F&&@А!a@DL@:3  @Id%@AF&&F&&@@@ @@@< @@б@А!a!F&&"F&&@@б@б@г۠$unit.F&&/F&&@@ @@@="@@А!b@FL@>+=F&&>F&&@@@ @@?0@@А!b4FF&&GF&&@@@ @@@9KF&&@@@B@@A=.@@@;@@B@> @@@TF&&@@l@@@@@F@A@A@ysA@PJA@( @  @  H@ ( @ d 4@ - @  A@  A@ @Fv @@:@]@V@\@<@@zI@)@t@T@@UA@B@@@@@@3@B@A@ H************************************************************************A@@A@L@ H BMMBM@ H OCaml CC@ H DD3@ H Florian Angeletti, projet Cambium, Inria Paris E44E4@ H FF@ H Copyright 2024 Institut National de Recherche en Informatique et GG@ H en Automatique. HHg@ H IhhIh@ H All rights reserved. This file is distributed under the terms of JJ@ H the GNU Lesser General Public License version 2.1, with the KKN@ H special exception on linking described in the file LICENSE. LOOLO@ H MM@ H************************************************************************NN5@ * This module provides function for printing type expressions as digraph using graphviz format. This is mostly aimed at providing a better representation of type expressions during debugging session. 젠 * A type node is printed as {[ .---------------. | lvl | | ID |----> | |---> .---------------. ]} where the description part might be: - a path: [list/8!] - a type variable: ['name], [α], [β], [γ] - [*] for tuples - [→] for arrows type - an universal type variable: [[β]∀], ['name ∀], ... - [[mod X with ...]] for a first class module - [∀] for a universal type binder The more complex encoding for polymorphic variants and object types uses nodes as head of the subgraph representing those types - [[obj...]] for the head of an object subgraph - [[Nil]] for the end of an object subgraph - [[Row...]] for the head of a polymorphic variant subgraph - [[Subst]] for a temporary substitution node Then each nodes is relied by arrows to any of its children types. - Type variables, universal type variables, [Nil], and [Subst] nodes don't have children. - For tuples, the children types are the elements of the tuple. For instance, [int * float] is represented as {[ .------. 0 .-------. | * 1 |-------->| int! 2| .------. .-------. | | 1 v .----------. | float! 3 | .----------. ]} - For arrows, the children types are the type of the argument and the result type. For instance, for [int -> float]: {[ .------. 0 .-------. | → 4 |-------->| int! 2| .------. .-------. | | 1 v .----------. | float! 3 | .----------. ]} - For type constructor, like list the main children nodes are the argument types. For instance, [(int,float) result] is represented as: {[ .-------------. 0 .-------. | Result.t 5 |-------->| int! 2| .-------------. .-------. | | 1 v .----------. | float! 3 | .----------. ]} Moreover, type abbreviations might be linked to the expanded nodes. If I define: [type 'a pair = 'a * 'a], a type expression [int pair] might correspond to the nodes: {[ .--------. 0 .--------. | pair 6 |------> | int! 2 | .--------. .--------. ┆ ^ ┆ expand | ┆ | .------. 0 + 1 | | * 7 |------>-------. .------. ]} - Universal type binders have two kind of children: bound variables, and the main body. For instance, ['a. 'a -> 'a] is represented as {[ .------. bind .-------. | ∀ 8 |----------> | 𝛼 10 | .------. .------. | ^ | | v | .------. 0 + 1 | | → 9 |------>-------. .------. ]} - [[Subst]] node are children are the type graph guarded by the substitution node, and an eventual link to the parent row variable. - The children of first-class modules are the type expressions that may appear in the right hand side of constraints. For instance, [module M with type t = 'a and type u = 'b] is represented as {[ .----------------------. 0 .-----. | [mod M with t, u] 11 |-------->| 𝛼 12| .----------------------. .----- | | 1 v .------. | 𝛽 13 | .------. ]} - The children of [obj] (resp. [row]) are the methods (resp. constructor) of the object type (resp. polymorphic variant). Each method is then linked to its type. To make them easier to read they are grouped inside graphviz cluster. For instance, [ as 'self] will be represented as: {[ .----------------. | .----------. | | | [obj] 14 |<------<-----<-----. | .----------. | | | ┆ | | | .-------------. | .------. | .-------. | | a public 15 |----->| ∀ 18 |----->| int! 2 | | .-------------. | .------. | .-------. | ┆ | | | .-------------. | .------. | | | m public 16 |-----| ∀ 19 |>--| | .------------. | .------. | ┆ | | ┆ row var | | ┆ | | .-------. | | | '_ 17 | | | .-------. | .-----------------. ]} i 7* Digraph with nodes, edges, hyperedges and subgraphes M f* Various possible choices on how to represent types, see the {!params} functions for more detail.' D* Graph element, see the {!node}, {!edge} and {!hyperedge} function  D* Visual decoration on graph elements, see the {!Decoration} module.נ * Print a graph to the file [asprintf "%s/%04d-%s-%a.dot" dump_dir session_unique_id title pp_context context ] If the [dump_dir] flag is not set, the local directory is used. See the {!context} type on how and why to setup the context. 3 I* Full version of {!types} that allow to print any kind of graph element  * Choice of details for printing type graphes: - if [elide_links] is [true] link nodes are not displayed (default:[true]) - with [expansion_as_hyperedge], memoized constructor expansion are displayed as a hyperedge between the node storing the memoized expansion, the expanded node and the expansion (default:[false]). - with [short_ids], we use an independent counter for node ids, in order to have shorter ids for small digraphs (default:[true]). - with [colorize] nodes are colorized according to their typechecker ids (default:[true]). - with [follow_expansions], we add memoized type constructor expansions to the digraph (default:[true]).  ؠ /* Update an existing [params] with new values.   (* Edges between more than two elements.  ͠ * {1 Node and decoration types}  '* {1 Digraph construction and printing} J* add a subgraph to a digraph, only fresh nodes are added to the subgraph [ ** groups existing nodes inside a subgraph 頠 "* {1 Debugging helper functions }  '* {2 Generic print debugging function} s=* Conditional graph printing , ;* [debug_off f] switches off debugging before running [f]. ܠ (* [debug f] runs [f] when [!debug_on ()]>* {2 Node tracking functions }h `* [register_type (lbl,ty)] adds the type [t] to all graph printed until {!forget} is called  * [register_subgraph params tys] groups together all types reachable from [tys] at this point in printed digraphs, until {!forget} is called  $* Forget all recorded context types = * {2 Contextual information} Those functions can be used to modify the filename of the generated digraphs. Use those functions to provide contextual information on a graph emitted during an execution trace.@-./boot/ocamlc)-nostdlib"-I&./boot*-use-prims2runtime/primitives"-g0-strict-sequence*-principal(-absname"-w8+a-4-9-40-41-42-44-45-48+-warn-error"+a*-bin-annot/-strict-formats"-I&typing"-I%utils"-I'parsing"-I&typing"-I(bytecomp"-I,file_formats"-I&lambda"-I*middle_end"-I2middle_end/closure"-I2middle_end/flambda"-I=middle_end/flambda/base_types"-I'asmcomp"-I&driver"-I(toplevel"-I%tools"-I'runtime"-I1otherlibs/dynlink"-I-otherlibs/str"-I4otherlibs/systhreads"-I.otherlibs/unix"-I8otherlibs/runtime_events"-cno =/builds/workspace/precheck/flambda/false/label/ocaml-linux-32 >10/.-,+*)('&%$#"! @@0 "UF-d7.3@@@(Asttypes0>n{T8cئ8CamlinternalFormatBasics0%FU(Q/Tu0CamlinternalLazy0&͂7 Pˆ*Format_doc0]mWϓ:Mݠ0K2%)Š%Ident0">WA+9*X,Identifiable0 {d\FX'`(Location0a7cK_H%9)Longident0s `7mɕc+Outcometree0kX%d5Q/+)Parsetree0T鿁ۘ7Qu$Path0Y2kf֯J._Ϡ)Primitive0²~$xzT෠%Shape0oNՄBH&Stdlib0Lku]8_٠.Stdlib__Buffer08APF< t..Stdlib__Domain0:M;׉<O$Ġ.Stdlib__Either0Vy`u~c à.Stdlib__Format0ܚ#G7m|/Stdlib__Hashtbl0ѱN][/!,Stdlib__Lazy0* -S$.)"0D.Stdlib__Lexing0e<.V +Stdlib__Map0L5xE|O0~,J-+Stdlib__Seq0nwzG&amg+Stdlib__Set0\$;7 +Stdlib__Sys0 -ռ鱦s5/-Stdlib__Uchar056uf4[_.Type_immediacy0A^abOhՠ0^Y~# )Unit_info0ڀh%((Warnings0mJɒkgr